]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: test and set missed defines during configuration
authordmitrykos <dmitrykos@neutroncode.com>
Thu, 4 Oct 2018 18:31:23 +0000 (21:31 +0300)
committerSergei Nikulov <sergey.nikulov@gmail.com>
Fri, 5 Oct 2018 10:10:41 +0000 (13:10 +0300)
Added configuration checks for HAVE_BUILTIN_AVAILABLE and HAVE_CLOCK_GETTIME_MONOTONIC.

Closes #3097

CMake/CurlTests.c
CMakeLists.txt
lib/curl_config.h.cmake

index ab244ac39380f78e5c8c9daea6d6eace43b40524..9388c835bfed5696fbe8439eab623c0f78cbfeec 100644 (file)
@@ -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
index 4d760536459a920fbe8ed6f8bdb3870a39f0b7db..8ecf34ce058ea2342c42e9a5987e316c9ac1c6ff 100644 (file)
@@ -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)
index ab0094be5dd23f6d339bf074b4314d4be96a4f52..83cf07ba60af3e2a59bc72d050c47c6f98e7a5a2 100644 (file)
 /* 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