@@ -179,7 +179,7 @@ index e8be5d0ccd9104..804cdebc648032 100644
179179 that started advertising the `availability` attribute, which then gets used
180180 by Apple SDK, but, in a way incompatible with gcc, resulting in misc errors
181181 inside SDK headers, e.g.:
182- @@ -51,14 +51,23 @@
182+ @@ -51,13 +51,17 @@
183183 definition
184184 error: expected ',' or '}' before
185185 Followed by missing declarations.
@@ -188,24 +188,18 @@ index e8be5d0ccd9104..804cdebc648032 100644
188188- #if defined(__APPLE__) && \
189189- !defined(__clang__) && \
190190- defined(__GNUC__) && __GNUC__ >= 12 && \
191- - defined(__has_attribute)
192191+ Work it around by overriding the built-in feature-check macro used by the
193192+ headers to enable the problematic attributes. This makes the feature check
194- + fail.
195- + Fixed upstream in 14.2.0_1. Disable the workaround if the fix is detected.
193+ + fail. Fixed in 14.2.0_1. Disable the workaround if the fix is detected.
196194+ */
197- + #if defined(__APPLE__) && \
198- + !defined(__clang__) && \
199- + defined(__GNUC__) && \
200- + defined(__has_attribute) && \
201- + !defined(CURL_NO_APPLE_AVAILABILITY_WORKAROUND)
202- + /* Separate #if to make it compile with some non-Apple gcc compilers */
203- + #if defined(CURL_APPLE_AVAILABILITY_WORKAROUND) || \
204- + !defined(__has_feature) || \
205- + !__has_feature(attribute_availability)
206- #define availability curl_pp_attribute_disabled
195+ + #if defined(__APPLE__) && !defined(__clang__) && defined(__GNUC__) && \
196+ defined(__has_attribute)
197+ - #define availability curl_pp_attribute_disabled
198+ + # if !defined(__has_feature)
199+ + # define availability curl_pp_attribute_disabled
200+ + # elif !__has_feature(attribute_availability)
201+ + # define availability curl_pp_attribute_disabled
202+ + # endif
207203 #endif
208- + #endif
209204
210205 #if defined(__APPLE__)
211- #include <sys/types.h>
0 commit comments