From 1f262ca2dbe00ba761e9b91994e93fee65d6efc1 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 15 Jul 2015 21:12:04 +0200 Subject: Fix build for Windows/MingW64 ... --- LibOVRKernel/Src/Tracing/Tracing.h | 2 +- LibOVRKernel/Src/Util/Util_SystemInfo.cpp | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'LibOVRKernel') diff --git a/LibOVRKernel/Src/Tracing/Tracing.h b/LibOVRKernel/Src/Tracing/Tracing.h index c14dc4a..1591a2c 100644 --- a/LibOVRKernel/Src/Tracing/Tracing.h +++ b/LibOVRKernel/Src/Tracing/Tracing.h @@ -32,7 +32,7 @@ limitations under the License. // ***** OVR_ENABLE_ETW_TRACING definition (XXX default to on for windows builds?) // -#ifdef OVR_OS_WIN32 +#if defined(OVR_OS_WIN32) && defined(OVR_CC_MSVC) #define OVR_ENABLE_ETW_TRACING #endif diff --git a/LibOVRKernel/Src/Util/Util_SystemInfo.cpp b/LibOVRKernel/Src/Util/Util_SystemInfo.cpp index 5ebdf65..06fd4c7 100644 --- a/LibOVRKernel/Src/Util/Util_SystemInfo.cpp +++ b/LibOVRKernel/Src/Util/Util_SystemInfo.cpp @@ -34,6 +34,11 @@ limitations under the License. #include #endif +#if defined(OVR_OS_WIN32) && !defined(OVR_CC_MSVC) +// mingw64 .. for __cpuid(..) +#include +#endif /* defined(OVR_OS_WIN32) && !defined(OVR_CC_MSVC) */ + /* // Disabled, can't link RiftConfigUtil #ifdef OVR_OS_WIN32 @@ -149,7 +154,6 @@ const char * GetProcessInfo() } #ifdef OVR_OS_WIN32 - String OSVersionAsString() { return GetSystemFileVersionString("\\kernel32.dll"); @@ -257,12 +261,22 @@ String GetProcessorInfo() char brand[0x40] = {}; int cpui[4] = { -1 }; +#if defined(OVR_CC_MSVC) __cpuidex(cpui, 0x80000002, 0); +#else + // mingw64 .. + __cpuid(cpui, 0x80000002); +#endif //unsigned int blocks = cpui[0]; for (int i = 0; i <= 2; ++i) { +#if defined(OVR_CC_MSVC) __cpuidex(cpui, 0x80000002 + i, 0); +#else + // mingw64 .. + __cpuid(cpui, 0x80000002 + i); +#endif *reinterpret_cast(brand + i * 16) = cpui[0]; *reinterpret_cast(brand + 4 + i * 16) = cpui[1]; *reinterpret_cast(brand + 8 + i * 16) = cpui[2]; -- cgit v1.2.3