Closes https://github.com/assimp/assimp/issues/940: use standard offsetof
instead of an own version.pull/941/head
parent
7c63208515
commit
070fb3363f
|
@ -50,6 +50,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "BlenderBMesh.h"
|
||||
#include "BlenderTessellator.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
static const unsigned int BLEND_TESS_MAGIC = 0x83ed9ac3;
|
||||
|
||||
#if ASSIMP_BLEND_WITH_GLU_TESSELLATE
|
||||
|
@ -373,13 +375,13 @@ void BlenderTessellatorP2T::ReferencePoints( std::vector< Blender::PointP2T >& p
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Yes this is filthy... but we have no choice
|
||||
#define OffsetOf( Class, Member ) ( static_cast< unsigned int >( \
|
||||
/*#define OffsetOf( Class, Member ) ( static_cast< unsigned int >( \
|
||||
reinterpret_cast<uint8_t*>(&( reinterpret_cast< Class* >( NULL )->*( &Class::Member ) )) - \
|
||||
static_cast<uint8_t*>(NULL) ) )
|
||||
|
||||
*/
|
||||
inline PointP2T& BlenderTessellatorP2T::GetActualPointStructure( p2t::Point& point ) const
|
||||
{
|
||||
unsigned int pointOffset = OffsetOf( PointP2T, point2D );
|
||||
unsigned int pointOffset = offsetof( PointP2T, point2D );
|
||||
PointP2T& pointStruct = *reinterpret_cast< PointP2T* >( reinterpret_cast< char* >( &point ) - pointOffset );
|
||||
if ( pointStruct.magic != static_cast<int>( BLEND_TESS_MAGIC ) )
|
||||
{
|
||||
|
|
Binary file not shown.
|
@ -43,18 +43,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <assimp/scene.h>
|
||||
#include <LimitBoneWeightsProcess.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace Assimp;
|
||||
|
||||
class LimitBoneWeightsTest : public ::testing::Test {
|
||||
public:
|
||||
|
||||
virtual void SetUp();
|
||||
virtual void TearDown();
|
||||
|
||||
protected:
|
||||
|
||||
LimitBoneWeightsProcess* piProcess;
|
||||
aiMesh* pcMesh;
|
||||
};
|
||||
|
|
|
@ -43,19 +43,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <assimp/scene.h>
|
||||
#include <MaterialSystem.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace Assimp;
|
||||
using namespace ::std;
|
||||
using namespace ::Assimp;
|
||||
|
||||
class MaterialSystemTest : public ::testing::Test
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void SetUp() { this->pcMat = new aiMaterial(); }
|
||||
virtual void TearDown() { delete this->pcMat; }
|
||||
|
||||
protected:
|
||||
|
||||
aiMaterial* pcMat;
|
||||
};
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "UnitTestPCH.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace Assimp;
|
||||
using namespace ::Assimp;
|
||||
|
||||
class utMatrix3x3Test : public ::testing::Test {
|
||||
|
||||
|
|
Loading…
Reference in New Issue