From f34bb0176c1b86fbc22ae07a106722938fd3ae35 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Wed, 3 Feb 2010 02:20:09 +0000 Subject: [PATCH] minor compile fixes for __CELLOS_LV2_ --- src/LinearMath/btHashMap.h | 13 +++++++++---- src/LinearMath/btSerializer.h | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/LinearMath/btHashMap.h b/src/LinearMath/btHashMap.h index 68eab4112..add7a7b02 100644 --- a/src/LinearMath/btHashMap.h +++ b/src/LinearMath/btHashMap.h @@ -90,7 +90,13 @@ public: class btHashPtr { - void* m_pointer; + + union + { + void* m_pointer; + int m_hashValues[2]; + }; + public: btHashPtr(void* ptr) @@ -112,9 +118,8 @@ public: SIMD_FORCE_INLINE unsigned int getHash()const { const bool VOID_IS_8 = ((sizeof(void*)==8)); - int* intPtr = (int*)&m_pointer; - - int key = VOID_IS_8? intPtr[0]+intPtr[1] : intPtr[0]; + + int key = VOID_IS_8? m_hashValues[0]+m_hashValues[1] : m_hashValues[0]; // Thomas Wang's hash key += ~(key << 15); key ^= (key >> 10); key += (key << 3); key ^= (key >> 6); key += ~(key << 11); key ^= (key >> 16); diff --git a/src/LinearMath/btSerializer.h b/src/LinearMath/btSerializer.h index 59159fc22..7a706a473 100644 --- a/src/LinearMath/btSerializer.h +++ b/src/LinearMath/btSerializer.h @@ -19,7 +19,10 @@ subject to the following restrictions: #include "btScalar.h" // has definitions like SIMD_FORCE_INLINE #include "btStackAlloc.h" #include "btHashMap.h" + +#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__) #include +#endif #include