better check for clock_gettime_nsec_np() -- cf. bug #5467.

This commit is contained in:
Ozkan Sezer
2021-01-25 04:11:40 +03:00
parent d327bbfbfd
commit aa4a6b0b88
5 changed files with 91 additions and 4 deletions

View File

@@ -873,7 +873,18 @@ if(LIBC)
else()
set(HAVE_ALLOCA_H 1)
set(HAVE_ALLOCA 1)
check_symbol_exists(clock_gettime_nsec_np "time.h" HAVE_CLOCK_GETTIME_NSEC_NP)
if(IOS OR TVOS) # assuming iOS / TVOS >= 10.0
set(HAVE_CLOCK_GETTIME_NSEC_NP 1)
else()
CHECK_C_SOURCE_COMPILES("
#include <AvailabilityMacros.h>
#include <time.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
#error Need 10.12 or newer target
#endif
int main(int argc, char **argv) { return !clock_gettime_nsec_np(CLOCK_MONOTONIC); }
" HAVE_CLOCK_GETTIME_NSEC_NP)
endif()
endif()
check_struct_has_member("struct sigaction" "sa_sigaction" "signal.h" HAVE_SA_SIGACTION)