Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix building on Win7 #1849

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ 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);
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
Loading