Skip to content
Snippets Groups Projects
Commit 46e28f8d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

When building for Windows Vista+, use GetTickCount64() through-out

At one point while migrating off the Windows XP compatible WinSDK and toolset,
I was getting nice deprecation warnings in this file about uses of
GetTickCount() and the 49 day roll-over isuse. I stopped getting those
deprecation warnings (not sure when/why), but I'm still doing the right thing
here/now and using the newer Win32 API function when it's available (always,
for the versions of Windows we're building Synchronet and friends for).
parent 85945505
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,11 @@
#elif defined(_WIN32)
#include <windows.h>
#include <lm.h> /* NetWkstaGetInfo() */
#if WINVER >= 0x0600 // _WIN32_WINNT_VISTA
#define GetTickCount() GetTickCount64()
#endif
#else
#endif
#include "genwrap.h" /* Verify prototypes */
......@@ -1052,7 +1057,7 @@ long double xp_timer(void)
#endif
}
else {
ret = GetTickCount();
ret = (long double)GetTickCount();
ret /= 1000;
}
#else
......@@ -1160,11 +1165,7 @@ int64_t xp_fast_timer64(void)
else
ret = -1;
#elif defined(_WIN32)
#if WINVER < 0x0600
ret = GetTickCount() / 1000;
#else
ret = GetTickCount64() / 1000;
#endif
#else
#error no high-resolution time for this platform
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment