aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVRKernel/Src/Util/Util_SystemInfo.cpp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-07-15 21:12:04 +0200
committerSven Gothel <[email protected]>2015-07-15 21:12:04 +0200
commit1f262ca2dbe00ba761e9b91994e93fee65d6efc1 (patch)
tree55c5b013ac5dd5e1edee5cc1ed09739a914de3e0 /LibOVRKernel/Src/Util/Util_SystemInfo.cpp
parenta352ecb7e63304034ac93332cf0c4d9183df867e (diff)
Fix build for Windows/MingW64 ...
Diffstat (limited to 'LibOVRKernel/Src/Util/Util_SystemInfo.cpp')
-rw-r--r--LibOVRKernel/Src/Util/Util_SystemInfo.cpp16
1 files changed, 15 insertions, 1 deletions
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 <sys/utsname.h>
#endif
+#if defined(OVR_OS_WIN32) && !defined(OVR_CC_MSVC)
+// mingw64 .. for __cpuid(..)
+#include <intrin.h>
+#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<int*>(brand + i * 16) = cpui[0];
*reinterpret_cast<int*>(brand + 4 + i * 16) = cpui[1];
*reinterpret_cast<int*>(brand + 8 + i * 16) = cpui[2];