]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
macOS: fix taget detection
authorStefan Eissing <stefan@eissing.org>
Mon, 10 Jul 2023 07:39:19 +0000 (09:39 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 10 Jul 2023 22:14:40 +0000 (00:14 +0200)
- TARGET_OS_OSX is not always defined on macOS
- this leads to missing symbol Curl_macos_init()
- TargetConditionals.h seems to define these only when
  dynamic targets are enabled (somewhere?)
- this PR fixes that on my macOS 13.4.1
- I have no clue why CI builds worked without it

Follow-up to c7308592fb8ba213fc2c1
Closes #11417

lib/curl_setup.h
lib/macos.c
lib/macos.h

index 38cf6ffc126201bbe726eeaaaa9a0e8ff102afe6..727d123e5aa5b18075bc8cb7423b7f09418e26de 100644 (file)
 #if defined(__APPLE__) && !defined(USE_ARES)
 #include <TargetConditionals.h>
 #define USE_RESOLVE_ON_IPS 1
-#  if defined(TARGET_OS_OSX) && TARGET_OS_OSX
+#  if !defined(TARGET_OS_OSX) || TARGET_OS_OSX
 #    define CURL_OSX_CALL_COPYPROXIES 1
 #  endif
 #endif
index abebb95a5a2b3a26ed0c20aafdef21baefcc06fe..5fe4e0bf774251f957708492ee9f519dc21a9d97 100644 (file)
@@ -26,7 +26,7 @@
 
 #if defined(__APPLE__)
 
-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
+#if !defined(TARGET_OS_OSX) || TARGET_OS_OSX
 
 #include <curl/curl.h>
 
index 4e7e608249626b23bdb887939e0eec7f2fe25ef3..3388acd9feb2944601f81c6b2460c25bf53e760d 100644 (file)
@@ -25,7 +25,7 @@
  ***************************************************************************/
 #include "curl_setup.h"
 
-#if defined(__APPLE__) && defined(TARGET_OS_OSX) && TARGET_OS_OSX
+#if defined(__APPLE__) && (!defined(TARGET_OS_OSX) || TARGET_OS_OSX)
 
 CURLcode Curl_macos_init(void);