summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qelapsedtimer_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qelapsedtimer_win.cpp')
-rw-r--r--src/corelib/tools/qelapsedtimer_win.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/tools/qelapsedtimer_win.cpp b/src/corelib/tools/qelapsedtimer_win.cpp
index 0a3d2524c0..25c63c42e2 100644
--- a/src/corelib/tools/qelapsedtimer_win.cpp
+++ b/src/corelib/tools/qelapsedtimer_win.cpp
@@ -43,7 +43,11 @@
#include <qt_windows.h>
typedef ULONGLONG (WINAPI *PtrGetTickCount64)(void);
-static PtrGetTickCount64 ptrGetTickCount64 = 0;
+#if defined(Q_OS_WINRT)
+ static const PtrGetTickCount64 ptrGetTickCount64 = &GetTickCount64;
+#else
+ static PtrGetTickCount64 ptrGetTickCount64 = 0;
+#endif
QT_BEGIN_NAMESPACE
@@ -56,6 +60,7 @@ static void resolveLibs()
if (done)
return;
+#ifndef Q_OS_WINRT
// try to get GetTickCount64 from the system
HMODULE kernel32 = GetModuleHandleW(L"kernel32");
if (!kernel32)
@@ -67,6 +72,7 @@ static void resolveLibs()
#else
ptrGetTickCount64 = (PtrGetTickCount64)GetProcAddress(kernel32, "GetTickCount64");
#endif
+#endif // !Q_OS_WINRT
// Retrieve the number of high-resolution performance counter ticks per second
LARGE_INTEGER frequency;