util: use 64 bit timer on Windows#5054
util: use 64 bit timer on Windows#5054ethomson merged 3 commits intolibgit2:masterfrom tniessen:util-use-64-bit-timer
Conversation
|
I am not sure why one of the MinGW builds fails. This API was introduced more than 10 years ago and only requires |
|
I'm not either, that's pretty surprising. But IIRC mingw often makes use of its own headers, so it may simply be something that we need to declare explicitly on that platform. |
|
I am not sure what the default |
|
@ethomson Any ideas or updates on this? |
|
No, sorry, I'm not very familiar with mingw. |
git__timer was originally implemented using a 32 bit timer since Windows XP did not support GetTickCount64. Windows XP was discontinued five years ago, so it should be safe to use the new API. As a benefit, we do not need to care about overflows for the next 585 million years.
|
Took me a while to set up MinGW locally and figure this out. The problem is that This should be good to go now. |
| @@ -1,3 +1,8 @@ | |||
| # Ensure that MinGW provides the correct header files. | |||
| IF (WIN32 AND NOT CYGWIN) | |||
| ADD_DEFINITIONS(-DWIN32 -D_WIN32_WINNT=0x0600) | |||
There was a problem hiding this comment.
Can we just move this into the top-level CMakeLists.txt?
There was a problem hiding this comment.
There was a problem hiding this comment.
I moved it out of the ELSE block for MSVC (not sure if it makes a difference on MSVC). As before, _WIN32_WINNT is not set on Cygwin, I believe Cygwin doesn't provide Windows header files anyway.
|
Thanks for all the work on this @tniessen! 😀 |
git__timerwas originally implemented using a 32 bit timer since Windows XP did not supportGetTickCount64. Windows XP was discontinued five years ago, so it should be safe to use the new API.As a benefit, we do not need to care about overflows for the next 585 million years.