1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-02 10:21:46 -05:00

hostip: fix broken macOS/CMake/GCC builds

Follow-up to 31f631a142d855f06

Fixes #7128
Closes #7129
This commit is contained in:
Radek Zajic 2021-05-25 22:19:05 +02:00 committed by Daniel Stenberg
parent 54e5c24565
commit 1a5e41d97c
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 5 additions and 3 deletions

View File

@ -69,7 +69,7 @@
#include "memdebug.h"
#if defined(ENABLE_IPV6) && defined(CURL_OSX_CALL_COPYPROXIES)
#include <SystemConfiguration/SystemConfiguration.h>
#include <SystemConfiguration/SCDynamicStoreCopySpecific.h>
#endif
#if defined(CURLRES_SYNCH) && \

View File

@ -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))) {