From a197c58935d926fc43b036414c7e9ee5c1bffdd9 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Wed, 11 Sep 2013 00:01:48 +0000 Subject: [PATCH] Add #ifdef BT_NO_SIMD_OPERATOR_OVERLOADS before including Bullet headers, to avoid clashes with XNAMath.h Fixes Issue 710 error C2084: function 'XMVECTOR operator +(FXMVECTOR,FXMVECTOR)' already has a body error C2084: function 'XMVECTOR operator -(FXMVECTOR,FXMVECTOR)' already has a body error C2084: function 'XMVECTOR operator *(FXMVECTOR,FXMVECTOR)' already has a body --- src/LinearMath/btScalar.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/LinearMath/btScalar.h b/src/LinearMath/btScalar.h index aaa1d6de6..2399c5d3b 100644 --- a/src/LinearMath/btScalar.h +++ b/src/LinearMath/btScalar.h @@ -284,6 +284,8 @@ static int btInfinityMask = 0x7F800000; #define BT_INFINITY (*(float*)&btInfinityMask) #endif +//use this, in case there are clashes (such as xnamath.h) +#ifndef BT_NO_SIMD_OPERATOR_OVERLOADS inline __m128 operator + (const __m128 A, const __m128 B) { return _mm_add_ps(A, B); @@ -298,6 +300,7 @@ inline __m128 operator * (const __m128 A, const __m128 B) { return _mm_mul_ps(A, B); } +#endif //BT_NO_SIMD_OPERATOR_OVERLOADS #define btCastfTo128i(a) (_mm_castps_si128(a)) #define btCastfTo128d(a) (_mm_castps_pd(a))