summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@digia.com>2013-09-05 10:22:01 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-15 22:41:48 +0200
commitcfc7cc39f971779729b83a2e4d39a4cb48ff20a3 (patch)
tree81cfd99a745d18cf7e78e1eb7ef62394f05182b5 /src
parent1985f818e7c543393660c50dccfb078d9f3c4501 (diff)
qelapsedtimer for WinRT
Change-Id: Ic31fa667bdc746776d8e29564ea8a1ba6e7384f3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-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;