]> git.cworth.org Git - apitrace/blobdiff - common/os_win32.cpp
Make os::getTime() inline and make time frequency OS-dependent variable.
[apitrace] / common / os_win32.cpp
index a0203544ee6b1298683c9e5c2b2e0b088c7aeb65..199ae5a7e4a656be9b41c24d8c53090acabe0360 100644 (file)
@@ -213,16 +213,7 @@ log(const char *format, ...)
 #endif
 }
 
-long long
-getTime(void)
-{
-    static LARGE_INTEGER frequency;
-    LARGE_INTEGER counter;
-    if (!frequency.QuadPart)
-        QueryPerformanceFrequency(&frequency);
-    QueryPerformanceCounter(&counter);
-    return counter.QuadPart*1000000LL/frequency.QuadPart;
-}
+long long timeFrequency = 0LL;
 
 void
 abort(void)
@@ -235,6 +226,10 @@ abort(void)
 }
 
 
+#ifndef DBG_PRINTEXCEPTION_C
+#define DBG_PRINTEXCEPTION_C 0x40010006
+#endif
+
 static PVOID prevExceptionFilter = NULL;
 static void (*gCallback)(void) = NULL;
 
@@ -262,9 +257,11 @@ unhandledExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo)
 
     // Clear direction flag
 #ifdef _MSC_VER
+#ifndef _WIN64
     __asm {
         cld
     };
+#endif
 #else
     asm("cld");
 #endif