fix building on Win7 (#1849)

This commit is contained in:
Roman Fomin 2024-08-19 15:01:06 +07:00 committed by GitHub
parent 8a8a47c29e
commit a41654b4f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 1 deletions

View File

@ -57,6 +57,17 @@ check_library_exists(m pow "" HAVE_LIBM)
check_include_file("dirent.h" HAVE_DIRENT_H)
check_symbol_exists(strcasecmp "strings.h" HAVE_DECL_STRCASECMP)
check_symbol_exists(strncasecmp "strings.h" HAVE_DECL_STRNCASECMP)
check_c_source_compiles("
#include <windows.h>
int main()
{
CreateWaitableTimerEx(NULL, NULL, CREATE_WAITABLE_TIMER_HIGH_RESOLUTION,
TIMER_ALL_ACCESS);
return 0;
}
"
HAVE_HIGH_RES_TIMER
)
check_c_source_compiles("
#include <immintrin.h>
int main()

View File

@ -6,6 +6,7 @@
#cmakedefine HAVE_DIRENT_H
#cmakedefine01 HAVE_DECL_STRCASECMP
#cmakedefine01 HAVE_DECL_STRNCASECMP
#cmakedefine HAVE_HIGH_RES_TIMER
#cmakedefine HAVE__DIV64
#cmakedefine HAVE_ALSA
#cmakedefine HAVE_FLUIDSYNTH

View File

@ -148,11 +148,13 @@ void I_InitTimer(void)
#ifdef _WIN32
// Create an unnamed waitable timer.
hTimer = NULL;
#ifdef HAVE_HIGH_RES_TIMER
hTimer = CreateWaitableTimerEx(NULL, NULL,
CREATE_WAITABLE_TIMER_MANUAL_RESET
| CREATE_WAITABLE_TIMER_HIGH_RESOLUTION,
TIMER_ALL_ACCESS);
#endif
if (hTimer == NULL)
{
hTimer = CreateWaitableTimer(NULL, TRUE, NULL);