summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMake/CurlTests.c16
-rw-r--r--CMakeLists.txt6
-rw-r--r--lib/curl_config.h.cmake3
3 files changed, 25 insertions, 0 deletions
diff --git a/CMake/CurlTests.c b/CMake/CurlTests.c
index ab244ac39..9388c835b 100644
--- a/CMake/CurlTests.c
+++ b/CMake/CurlTests.c
@@ -549,3 +549,19 @@ main() {
return 0;
}
#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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4d7605364..8ecf34ce0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1026,6 +1026,12 @@ if(HAVE_INET_NTOA_R_DECL_REENTRANT)
set(NEED_REENTRANT 1)
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
if(NOT HAVE_IN_ADDR_T)
diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake
index ab0094be5..83cf07ba6 100644
--- a/lib/curl_config.h.cmake
+++ b/lib/curl_config.h.cmake
@@ -127,6 +127,9 @@
/* Define to 1 if bool is an available type. */
#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. */
#cmakedefine HAVE_CLOCK_GETTIME_MONOTONIC 1