Fix pthreads on non-MinGW Windows builds

- Use C11 standard `timespec_get` instead of `clock_gettime`
- Remove the unused `thread_sleep` function
This commit is contained in:
David Hrdlička
2021-09-18 18:39:36 +02:00
parent 1baab36dc6
commit 39653e366a
2 changed files with 12 additions and 31 deletions

View File

@@ -104,4 +104,11 @@ if(MSVC_TOOLSET_VERSION GREATER_EQUAL 142 AND ARCH STREQUAL "arm64")
endif()
endif()
# HACK: MinGW does not have `timespec_get`
include(CheckSymbolExists)
check_symbol_exists(timespec_get time.h HAS_TIMESPEC_GET)
if(HAS_TIMESPEC_GET)
add_compile_definitions(HAS_TIMESPEC_GET)
endif()
add_subdirectory(src)