DavidKimYongRak / box2d

Automatically exported from code.google.com/p/box2d
0 stars 0 forks source link

missing #include <string.h> #322

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There are a few files missing the definition of memcpy and memset.

Box2D\Box2D\Collision\Shapes\b2ChainShape.cpp
Box2D\Box2D\Collision\b2DynamicTree.cpp
Box2D\Box2D\Common\b2BlockAllocator.cpp

So far, the error only shows up when building for Android.

Easy fix, just add #include <string.h>.

Original issue reported on code.google.com by isaacbu...@gmail.com on 5 Nov 2013 at 4:09

GoogleCodeExporter commented 9 years ago
That's because it is including <memory.h> instead of <string.h>. Some (many) 
compilers treat these two headers as synonyms, but <memory.h> is non standard, 
so in some environments it may even not exist.

The easiest solution is to replace any occurrence of <memory.h> with <string.h>.

Original comment by rodrigor...@gmail.com on 7 Dec 2013 at 9:34

GoogleCodeExporter commented 9 years ago
Would <cstring> not be more standard?

Original comment by Jonno.5000 on 15 Dec 2013 at 12:01

GoogleCodeExporter commented 9 years ago
Yes, it seems that <cstring> is more standard for C++.  Here's a patch for this.

Original comment by stalb...@gmail.com on 15 Mar 2014 at 3:58

Attachments:

GoogleCodeExporter commented 9 years ago
Revision: 302
Message:
Fix for issue 322.
----
Modified : /trunk/Box2D/Box2D/Collision/Shapes/b2ChainShape.cpp
Modified : /trunk/Box2D/Box2D/Collision/b2DynamicTree.cpp
Modified : /trunk/Box2D/Box2D/Common/b2BlockAllocator.cpp

Original comment by erinca...@gmail.com on 4 Apr 2014 at 4:26

GoogleCodeExporter commented 9 years ago
Issue 325 has been merged into this issue.

Original comment by erinca...@gmail.com on 4 Apr 2014 at 5:30