From 1503c806bd9c2db6873bc3c5acec9997fd233d72 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Tue, 22 Oct 2013 23:08:43 +0000 Subject: [PATCH] fix Mac OSX build when using GNU++11 C++ language standard, make this the default in premake under OSX for easier testing --- build/premake4.lua | 1 + src/LinearMath/btVector3.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/premake4.lua b/build/premake4.lua index c7c114df2..b80656452 100644 --- a/build/premake4.lua +++ b/build/premake4.lua @@ -94,6 +94,7 @@ solution "0BulletSolution" xcodebuildsettings { 'ARCHS = "$(ARCHS_STANDARD_32_BIT) $(ARCHS_STANDARD_64_BIT)"', + 'CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"', 'VALID_ARCHS = "x86_64 i386"', } end diff --git a/src/LinearMath/btVector3.cpp b/src/LinearMath/btVector3.cpp index eadcedce7..9389a25ca 100644 --- a/src/LinearMath/btVector3.cpp +++ b/src/LinearMath/btVector3.cpp @@ -51,7 +51,7 @@ long _maxdot_large( const float *vv, const float *vec, unsigned long count, floa long _maxdot_large( const float *vv, const float *vec, unsigned long count, float *dotResult ) { const float4 *vertices = (const float4*) vv; - static const unsigned char indexTable[16] = {-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; + static const unsigned char indexTable[16] = {(unsigned char)-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; float4 dotMax = btAssign128( -BT_INFINITY, -BT_INFINITY, -BT_INFINITY, -BT_INFINITY ); float4 vvec = _mm_loadu_ps( vec ); float4 vHi = btCastiTo128f(_mm_shuffle_epi32( btCastfTo128i( vvec), 0xaa )); /// zzzz @@ -436,7 +436,7 @@ long _mindot_large( const float *vv, const float *vec, unsigned long count, floa long _mindot_large( const float *vv, const float *vec, unsigned long count, float *dotResult ) { const float4 *vertices = (const float4*) vv; - static const unsigned char indexTable[16] = {-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; + static const unsigned char indexTable[16] = {(unsigned char)-1, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 }; float4 dotmin = btAssign128( BT_INFINITY, BT_INFINITY, BT_INFINITY, BT_INFINITY ); float4 vvec = _mm_loadu_ps( vec ); float4 vHi = btCastiTo128f(_mm_shuffle_epi32( btCastfTo128i( vvec), 0xaa )); /// zzzz