Skip to content

Commit

Permalink
fix building on Win7 (#1849)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin authored Aug 19, 2024
1 parent 8a8a47c commit a41654b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/i_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a41654b

Please sign in to comment.