diff --git a/CMakeLists.txt b/CMakeLists.txt index badac4d99..2bf668ab4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,10 +24,15 @@ OPTION(USE_DOUBLE_PRECISION "Use double precision" OFF) OPTION(USE_GRAPHICAL_BENCHMARK "Use Graphical Benchmark" ON) OPTION(BUILD_SHARED_LIBS "Use shared libraries" OFF) -OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" OFF) OPTION(USE_MSVC_INCREMENTAL_LINKING "Use MSVC Incremental Linking" OFF) OPTION(USE_CUSTOM_VECTOR_MATH "Use custom vectormath library" OFF) +#statically linking VC++ isn't supported for WindowsPhone/WindowsStore +IF (CMAKE_SYSTEM_NAME STREQUAL WindowsPhone OR CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" ON) +ELSE () + OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" OFF) +ENDIF (CMAKE_SYSTEM_NAME STREQUAL WindowsPhone OR CMAKE_SYSTEM_NAME STREQUAL WindowsStore) #SET(CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:NO") #SET(CMAKE_EXE_LINKER_FLAGS "/STACK:10000000 /INCREMENTAL:NO") diff --git a/src/LinearMath/btQuickprof.cpp b/src/LinearMath/btQuickprof.cpp index ffc2e9684..b913e1123 100644 --- a/src/LinearMath/btQuickprof.cpp +++ b/src/LinearMath/btQuickprof.cpp @@ -59,7 +59,7 @@ struct btClockData #ifdef BT_USE_WINDOWS_TIMERS LARGE_INTEGER mClockFrequency; - DWORD mStartTick; + LONGLONG mStartTick; LONGLONG mPrevElapsedTime; LARGE_INTEGER mStartTime; #else @@ -105,7 +105,7 @@ void btClock::reset() { #ifdef BT_USE_WINDOWS_TIMERS QueryPerformanceCounter(&m_data->mStartTime); - m_data->mStartTick = GetTickCount(); + m_data->mStartTick = GetTickCount64(); m_data->mPrevElapsedTime = 0; #else #ifdef __CELLOS_LV2__ @@ -134,9 +134,9 @@ unsigned long int btClock::getTimeMilliseconds() unsigned long msecTicks = (unsigned long)(1000 * elapsedTime / m_data->mClockFrequency.QuadPart); // Check for unexpected leaps in the Win32 performance counter. - // (This is caused by unexpected data across the PCI to ISA + // (This is caused by unexpected data across the PCI to ISA // bridge, aka south bridge. See Microsoft KB274323.) - unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick; + unsigned long elapsedTicks = (unsigned long)(GetTickCount64() - m_data->mStartTick); signed long msecOff = (signed long)(msecTicks - elapsedTicks); if (msecOff < -100 || msecOff > 100) { @@ -194,7 +194,7 @@ unsigned long int btClock::getTimeMicroseconds() // Check for unexpected leaps in the Win32 performance counter. // (This is caused by unexpected data across the PCI to ISA // bridge, aka south bridge. See Microsoft KB274323.) - unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick; + unsigned long elapsedTicks = (unsigned long)(GetTickCount64() - m_data->mStartTick); signed long msecOff = (signed long)(msecTicks - elapsedTicks); if (msecOff < -100 || msecOff > 100) { diff --git a/src/LinearMath/btScalar.h b/src/LinearMath/btScalar.h index 5ee65fc39..520c3669f 100644 --- a/src/LinearMath/btScalar.h +++ b/src/LinearMath/btScalar.h @@ -48,6 +48,11 @@ inline int btGetVersion() #define ATTRIBUTE_ALIGNED16(a) a #define ATTRIBUTE_ALIGNED64(a) a #define ATTRIBUTE_ALIGNED128(a) a + #elif (_M_ARM) + #define SIMD_FORCE_INLINE __forceinline + #define ATTRIBUTE_ALIGNED16(a) __declspec() a + #define ATTRIBUTE_ALIGNED64(a) __declspec() a + #define ATTRIBUTE_ALIGNED128(a) __declspec () a #else //#define BT_HAS_ALIGNED_ALLOCATOR #pragma warning(disable : 4324) // disable padding warning @@ -67,6 +72,7 @@ inline int btGetVersion() #define btFsel(a,b,c) __fsel((a),(b),(c)) #else +#if (!defined (_M_ARM) && WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)//Do not turn SSE on for Windows Phone Emulators #if (defined (_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined (BT_USE_DOUBLE_PRECISION)) #if _MSC_VER>1400 #define BT_USE_SIMD_VECTOR3 @@ -88,6 +94,7 @@ inline int btGetVersion() //#define BT_USE_SSE_IN_API #endif //BT_USE_SSE #include +#endif #endif #endif//_XBOX