Skip to content

Commit

Permalink
curl.test.patch test improve patch with auto-detection 2
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Nov 7, 2024
1 parent 66cc851 commit ffaece6
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions curl.test.patch
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ index e8be5d0ccd9104..804cdebc648032 100644
that started advertising the `availability` attribute, which then gets used
by Apple SDK, but, in a way incompatible with gcc, resulting in misc errors
inside SDK headers, e.g.:
@@ -51,12 +51,19 @@
@@ -51,14 +51,23 @@
definition
error: expected ',' or '}' before
Followed by missing declarations.
Expand All @@ -194,14 +194,18 @@ index e8be5d0ccd9104..804cdebc648032 100644
+ fail.
+ Fixed upstream in 14.2.0_1. Disable the workaround if the fix is detected.
+ */
+#if defined(__APPLE__) && \
+ !defined(__clang__) && \
+ !defined(CURL_NO_APPLE_AVAILABILITY_WORKAROUND) && \
+ defined(__GNUC__) && \
+ defined(__has_attribute) && \
+ (defined(CURL_APPLE_AVAILABILITY_WORKAROUND) || \
+ !defined(__has_feature) || \
+ !__has_feature(attribute_availability))
+#if defined(__APPLE__) && \
+ !defined(__clang__) && \
+ defined(__GNUC__) && \
+ defined(__has_attribute) && \
+ !defined(CURL_NO_APPLE_AVAILABILITY_WORKAROUND)
+/* Separate #if to make it compile with some non-Apple gcc compilers */
+#if defined(CURL_APPLE_AVAILABILITY_WORKAROUND) || \
+ !defined(__has_feature) || \
+ !__has_feature(attribute_availability)
#define availability curl_pp_attribute_disabled
#endif
+#endif

#if defined(__APPLE__)
#include <sys/types.h>

0 comments on commit ffaece6

Please sign in to comment.