diff --git a/src/corelib/tools/qelapsedtimer_win.cpp b/src/corelib/tools/qelapsedtimer_win.cpp index 0a3d2524c04..25c63c42e20 100644 --- a/src/corelib/tools/qelapsedtimer_win.cpp +++ b/src/corelib/tools/qelapsedtimer_win.cpp @@ -43,7 +43,11 @@ #include 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;