mirror of https://github.com/moparisthebest/curl
cmake: test and set missed defines during configuration
Added configuration checks for HAVE_BUILTIN_AVAILABLE and HAVE_CLOCK_GETTIME_MONOTONIC. Closes #3097
This commit is contained in:
parent
8a42b769a7
commit
667b5721c7
|
@ -549,3 +549,19 @@ main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_CLOCK_GETTIME_MONOTONIC
|
||||||
|
#include <time.h>
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
struct timespec ts = {0, 0};
|
||||||
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_BUILTIN_AVAILABLE
|
||||||
|
int
|
||||||
|
main() {
|
||||||
|
if(__builtin_available(macOS 10.12, *)) {}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -1026,6 +1026,12 @@ if(HAVE_INET_NTOA_R_DECL_REENTRANT)
|
||||||
set(NEED_REENTRANT 1)
|
set(NEED_REENTRANT 1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Check clock_gettime(CLOCK_MONOTONIC, x) support
|
||||||
|
curl_internal_test(HAVE_CLOCK_GETTIME_MONOTONIC)
|
||||||
|
|
||||||
|
# Check compiler support of __builtin_available()
|
||||||
|
curl_internal_test(HAVE_BUILTIN_AVAILABLE)
|
||||||
|
|
||||||
# Some other minor tests
|
# Some other minor tests
|
||||||
|
|
||||||
if(NOT HAVE_IN_ADDR_T)
|
if(NOT HAVE_IN_ADDR_T)
|
||||||
|
|
|
@ -127,6 +127,9 @@
|
||||||
/* Define to 1 if bool is an available type. */
|
/* Define to 1 if bool is an available type. */
|
||||||
#cmakedefine HAVE_BOOL_T 1
|
#cmakedefine HAVE_BOOL_T 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the __builtin_available function. */
|
||||||
|
#cmakedefine HAVE_BUILTIN_AVAILABLE 1
|
||||||
|
|
||||||
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
|
/* Define to 1 if you have the clock_gettime function and monotonic timer. */
|
||||||
#cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC 1
|
#cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue