diff --git a/curl.test.patch b/curl.test.patch index bf0b12413..6e5d03289 100644 --- a/curl.test.patch +++ b/curl.test.patch @@ -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,14 +51,23 @@ +@@ -51,13 +51,17 @@ definition error: expected ',' or '}' before Followed by missing declarations. @@ -188,24 +188,18 @@ index e8be5d0ccd9104..804cdebc648032 100644 -#if defined(__APPLE__) && \ - !defined(__clang__) && \ - defined(__GNUC__) && __GNUC__ >= 12 && \ -- defined(__has_attribute) + Work it around by overriding the built-in feature-check macro used by the + headers to enable the problematic attributes. This makes the feature check -+ fail. -+ Fixed upstream in 14.2.0_1. Disable the workaround if the fix is detected. ++ fail. Fixed in 14.2.0_1. Disable the workaround if the fix is detected. + */ -+#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 ++#if defined(__APPLE__) && !defined(__clang__) && defined(__GNUC__) && \ + defined(__has_attribute) +-#define availability curl_pp_attribute_disabled ++# if !defined(__has_feature) ++# define availability curl_pp_attribute_disabled ++# elif !__has_feature(attribute_availability) ++# define availability curl_pp_attribute_disabled ++# endif #endif -+#endif #if defined(__APPLE__) - #include