summaryrefslogtreecommitdiffstats
path: root/lib/timeval.c
diff options
context:
space:
mode:
authorCurl Upstream <curl-library@cool.haxx.se>2021-05-26 06:18:11 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-27 19:11:35 (GMT)
commit18b2a8d7604f3aced9c93220806851f96e231f36 (patch)
tree5a79eb90691de68ebfb91ac85d7e8faea3190a4d /lib/timeval.c
parent076b3219f58ca16afa52fe095019a05537ade0f3 (diff)
downloadCMake-18b2a8d7604f3aced9c93220806851f96e231f36.zip
CMake-18b2a8d7604f3aced9c93220806851f96e231f36.tar.gz
CMake-18b2a8d7604f3aced9c93220806851f96e231f36.tar.bz2
curl 2021-05-26 (6b951a69)
Code extracted from: https://github.com/curl/curl.git at commit 6b951a6928811507d493303b2878e848c077b471 (curl-7_77_0).
Diffstat (limited to 'lib/timeval.c')
-rw-r--r--lib/timeval.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/timeval.c b/lib/timeval.c
index 8523dad..ca98fe5 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -78,14 +78,16 @@ struct curltime Curl_now(void)
** code compiles but fails during run-time if clock_gettime() is
** called on unsupported OS version.
*/
-#if defined(__APPLE__) && (HAVE_BUILTIN_AVAILABLE == 1)
+#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \
+ (HAVE_BUILTIN_AVAILABLE == 1)
bool have_clock_gettime = FALSE;
if(__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *))
have_clock_gettime = TRUE;
#endif
if(
-#if defined(__APPLE__) && (HAVE_BUILTIN_AVAILABLE == 1)
+#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \
+ (HAVE_BUILTIN_AVAILABLE == 1)
have_clock_gettime &&
#endif
(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow))) {