Skip to content

Commit 66cc851

Browse files
committed
curl.test.patch test improve patch with auto-detection
1 parent 471b7d1 commit 66cc851

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

curl.test.patch

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -170,32 +170,38 @@ index e8be5d0ccd9104..804cdebc648032 100644
170170
#ifdef HAS_ALPN
171171
--- a/lib/curl_setup.h
172172
+++ b/lib/curl_setup.h
173-
@@ -43,7 +43,10 @@
173+
@@ -43,7 +43,7 @@
174174
#include <_mingw.h>
175175
#endif
176176

177177
-/* Workaround for Homebrew gcc 12.4.0, 13.3.0, 14.1.0 and newer (as of 14.1.0)
178-
+/* Workaround for Homebrew gcc 12.4.0, 13.3.0, 14.1.0, 14.2.0.
179-
+ Fixed it 14.2.0_1. We also omit the workaround for 14.2.0 because there
180-
+ is now way to tall 14.2.0_1 and 14.2.0 apart, and the workaround breaks
181-
+ the fixed 14.2.0_1 version.
178+
+/* Workaround for Homebrew gcc 12.4.0, 13.3.0, 14.1.0, 14.2.0 (initial build)
182179
that started advertising the `availability` attribute, which then gets used
183180
by Apple SDK, but, in a way incompatible with gcc, resulting in misc errors
184181
inside SDK headers, e.g.:
185-
@@ -53,9 +56,13 @@
182+
@@ -51,12 +51,19 @@
183+
definition
184+
error: expected ',' or '}' before
186185
Followed by missing declarations.
187-
Fix it by overriding the built-in feature-check macro used by the headers
188-
to enable the problematic attributes. This makes the feature check fail. */
186+
- Fix it by overriding the built-in feature-check macro used by the headers
187+
- to enable the problematic attributes. This makes the feature check fail. */
189188
-#if defined(__APPLE__) && \
190189
- !defined(__clang__) && \
191190
- defined(__GNUC__) && __GNUC__ >= 12 && \
192-
+#if defined(__APPLE__) && \
193-
+ !defined(__clang__) && \
194-
+ defined(__GNUC__) && \
195-
+ (__GNUC__ == 12 || \
196-
+ __GNUC__ == 13 || \
197-
+ (__GNUC__ == 14 && \
198-
+ defined(__GNUC_MINOR__) && (__GNUC_MINOR__ <= 1))) && \
199-
defined(__has_attribute)
191+
- defined(__has_attribute)
192+
+ Work it around by overriding the built-in feature-check macro used by the
193+
+ 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.
196+
+ */
197+
+#if defined(__APPLE__) && \
198+
+ !defined(__clang__) && \
199+
+ !defined(CURL_NO_APPLE_AVAILABILITY_WORKAROUND) && \
200+
+ defined(__GNUC__) && \
201+
+ defined(__has_attribute) && \
202+
+ (defined(CURL_APPLE_AVAILABILITY_WORKAROUND) || \
203+
+ !defined(__has_feature) || \
204+
+ !__has_feature(attribute_availability))
200205
#define availability curl_pp_attribute_disabled
201206
#endif
207+

0 commit comments

Comments
 (0)