curl/lib
Viktor Szakats e91fcbac7d
macos: undo `availability` macro enabled by Homebrew gcc
Homebrew gcc builds starting with 12.4.0, 13.3.0 and 14.1.0 enabled
the `availability` attribute.

This broke builds because the way the Apple SDK uses attributes (when
available) are incompatible with how gcc accepts them. Causing these
errors:
```
  error: attributes should be specified before the declarator in a function definition
  error: expected ',' or '}' before
```

Upstream commits implementing the `availability` macro:
gcc-12: fd5530b7cb
gcc-13: cb7e4eca68
gcc-14: ff62a10886

The project above is a Darwin gcc compatibility pack, that is applied
to Homebrew gcc builds.

This patch works by redefining the `availability` macro to an invalid
value, making `__has_attribute(availability)` checks fail, stopping
Apple SDK from inserting the incompatible attributes.

It also replaces the previous, local workaround for `lib/macos.c`.

Example with gcc 12.4.0 with macOS SDK 14.0 (Xcode 15.0.1):
```
In file included from <path-to-sdk>/MacOSX14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:54,
                 from <path-to-sdk>/MacOSX14.0.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreCopySpecific.h:30,
                 from /Users/runner/work/curl/curl/lib/macos.c:33,
                 from /Users/runner/work/curl/curl/build/lib/CMakeFiles/libcurl_shared.dir/Unity/unity_0_c.c:244:
<path-to-sdk>/MacOSX14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h:126:1: error: attributes should be specified before the declarator in a function definition
  126 | CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return ((CFOptionFlags)(1UL << (8 + i)));}
      | ^~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/9787982387/job/27025351601?pr=14096#step:7:18

The gcc vs. llvm/clang incompatibility possibly tracked here upstream:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108796
More info:
  https://github.com/llvm/llvm-project/issues/81767
  8433baadec
  https://discourse.llvm.org/t/changing-attribute-ast-printing-location-for-gcc-compatibility/73215
  https://reviews.llvm.org/D159362

Follow-up to db135f8d72 #14119
Ref: https://github.com/curl/curl/pull/14091#issuecomment-2222703468
Fixes #13700
Cherry-picked from #14097
Closes #14155
2024-07-12 00:32:39 +02:00
..
vauth code: language cleanup in comments 2024-07-01 22:58:55 +02:00
vquic code: language cleanup in comments 2024-07-01 22:58:55 +02:00
vssh code: language cleanup in comments 2024-07-01 22:58:55 +02:00
vtls build: sync warning options between autotools, cmake & compilers 2024-07-10 11:30:40 +02:00
.checksrc
.gitattributes
.gitignore build: remove MacOSX-Framework script 2024-04-08 22:46:51 +02:00
CMakeLists.txt cmake: enable SOVERSION for Cygwin and `CMAKE_DLL_NAME_WITH_SOVERSION` 2024-06-13 19:30:39 +02:00
Makefile.am build: untangle `CURLDEBUG` and `DEBUGBUILD` macros 2024-05-28 08:12:00 +02:00
Makefile.inc mbedTLS: implement CURLOPT_SSL_CIPHER_LIST option 2024-04-24 14:30:37 +02:00
Makefile.mk build: prefer `USE_IPV6` macro internally (was: `ENABLE_IPV6`) 2024-04-13 08:33:26 +00:00
Makefile.soname
altsvc.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
altsvc.h lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
amigaos.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
amigaos.h
arpa_telnet.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
asyn-ares.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
asyn-thread.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
asyn.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
base64.c lib: silence `-Wsign-conversion` in base64, strcase, mprintf 2024-04-24 23:29:30 +02:00
bufq.c bufq: writing into a softlimit queue cannot be partial 2024-03-03 17:35:47 +01:00
bufq.h bufq: remove duplicate word in comment 2024-05-08 19:12:03 +02:00
bufref.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
bufref.h
c-hyper.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
c-hyper.h http: expect 100 rework 2024-03-18 12:41:56 +01:00
cf-h1-proxy.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cf-h1-proxy.h
cf-h2-proxy.c multi: fix pollset during RESOLVING phase 2024-07-02 11:17:38 +02:00
cf-h2-proxy.h
cf-haproxy.c connection: shutdown TLS (for FTP) better 2024-06-10 13:08:12 +02:00
cf-haproxy.h
cf-https-connect.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cf-https-connect.h
cf-socket.c cf-socket: remove two "useless" assignments 2024-07-10 14:40:36 +02:00
cf-socket.h socket: support binding to interface *AND* IP 2024-06-04 23:47:54 +02:00
cfilters.c lib: graceful connection shutdown 2024-06-26 08:33:17 +02:00
cfilters.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
config-amigaos.h
config-dos.h
config-mac.h
config-os400.h lib: merge `ENABLE_QUIC` C macro into `USE_HTTP3` 2024-04-13 08:33:27 +00:00
config-plan9.h build: prefer `USE_IPV6` macro internally (was: `ENABLE_IPV6`) 2024-04-13 08:33:26 +00:00
config-riscos.h build: prefer `USE_IPV6` macro internally (was: `ENABLE_IPV6`) 2024-04-13 08:33:26 +00:00
config-win32.h build: prefer `USE_IPV6` macro internally (was: `ENABLE_IPV6`) 2024-04-13 08:33:26 +00:00
config-win32ce.h windows: simplify detecting and using system headers 2023-12-16 13:13:44 +00:00
conncache.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
conncache.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
connect.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
connect.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
content_encoding.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
content_encoding.h
cookie.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cookie.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_addrinfo.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_addrinfo.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_base64.h
curl_config.h.cmake code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_ctype.h
curl_des.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_des.h
curl_endian.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_endian.h
curl_fnmatch.c lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
curl_fnmatch.h
curl_get_line.c lib: convert Curl_get_line to use dynbuf 2024-02-07 09:22:10 +01:00
curl_get_line.h lib: convert Curl_get_line to use dynbuf 2024-02-07 09:22:10 +01:00
curl_gethostname.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_gethostname.h
curl_gssapi.c
curl_gssapi.h
curl_hmac.h
curl_krb5.h
curl_ldap.h
curl_md4.h
curl_md5.h
curl_memory.h
curl_memrchr.c
curl_memrchr.h
curl_multibyte.c curl_multibyte: remove access() function wrapper for Windows 2024-05-07 02:28:10 -04:00
curl_multibyte.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_ntlm_core.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_ntlm_core.h
curl_path.c curl_path: make Curl_get_pathname use dynbuf 2024-05-08 10:10:12 +02:00
curl_path.h curl_path: make Curl_get_pathname use dynbuf 2024-05-08 10:10:12 +02:00
curl_printf.h curl.h: add CURLE_TOO_LARGE 2023-12-18 10:34:22 +01:00
curl_range.c
curl_range.h
curl_rtmp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_rtmp.h curl_version_info: provide librtmp version 2024-04-15 16:48:34 +02:00
curl_sasl.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sasl.h
curl_setup.h macos: undo `availability` macro enabled by Homebrew gcc 2024-07-12 00:32:39 +02:00
curl_setup_once.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sha256.h
curl_sha512_256.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sha512_256.h SHA-512/256: implement hash algorithm 2024-02-20 11:35:56 +01:00
curl_sspi.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
curl_sspi.h
curl_threads.c windows: fix UWP builds, add GHA job 2024-06-05 00:52:24 +02:00
curl_threads.h windows: fix UWP builds, add GHA job 2024-06-05 00:52:24 +02:00
curl_trc.c ftp: add tracing support 2024-05-10 23:39:48 +02:00
curl_trc.h ftp: add tracing support 2024-05-10 23:39:48 +02:00
curlx.h curl: use curl_getenv instead of the curlx_ version 2024-03-30 22:45:47 +01:00
cw-out.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
cw-out.h cw-out: improved error handling 2024-04-16 15:52:10 +02:00
dict.c lib: xfer_setup and non-blocking shutdown 2024-06-11 13:41:03 +02:00
dict.h
dllmain.c dllmain: Call OpenSSL thread cleanup for Windows and Cygwin 2024-04-24 04:04:25 -04:00
doh.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
doh.h build: untangle `UNITTESTS` and `DEBUGBUILD` macros 2024-05-27 21:15:50 +02:00
dynbuf.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
dynbuf.h build: enable missing OpenSSF-recommended warnings, with fixes 2023-12-16 13:12:37 +00:00
dynhds.c build: untangle `UNITTESTS` and `DEBUGBUILD` macros 2024-05-27 21:15:50 +02:00
dynhds.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
easy.c multi: fix pollset during RESOLVING phase 2024-07-02 11:17:38 +02:00
easy_lock.h
easygetopt.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
easyif.h build: untangle `CURLDEBUG` and `DEBUGBUILD` macros 2024-05-28 08:12:00 +02:00
easyoptions.c tcpkeepalive: add CURLOPT_TCP_KEEPCNT and --keepalive-cnt 2024-06-12 09:31:17 +02:00
easyoptions.h
escape.c lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
escape.h
file.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
file.h
fileinfo.c
fileinfo.h
fopen.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
fopen.h
formdata.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
formdata.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ftp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ftp.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ftplistparser.c llist: add Curl_llist_append() 2024-04-11 09:00:51 +02:00
ftplistparser.h
functypes.h
getenv.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
getinfo.c docs: misc language polish 2024-07-01 16:45:17 +02:00
getinfo.h
gopher.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
gopher.h
hash.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hash.h multi: add multi->proto_hash, a key-value store for protocol data 2024-05-26 00:15:01 +02:00
headers.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
headers.h http: move headers collecting to writer 2024-02-26 09:44:15 +01:00
hmac.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostasyn.c Revert "urldata: move async resolver state from easy handle to connectdata" 2023-12-15 12:57:35 +01:00
hostip.c hostip: skip error check for infallible function call 2024-07-10 16:14:06 +02:00
hostip.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostip4.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostip6.c
hostsyn.c
hsts.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hsts.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http1.c lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
http1.h
http2.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http2.h
http_aws_sigv4.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_aws_sigv4.h
http_chunks.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_chunks.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_digest.c
http_digest.h
http_negotiate.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_negotiate.h
http_ntlm.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
http_ntlm.h
http_proxy.c connection: shutdown TLS (for FTP) better 2024-06-10 13:08:12 +02:00
http_proxy.h
idn.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
idn.h idn: add native AppleIDN (icucore) support for macOS/iOS 2024-04-17 00:24:09 +02:00
if2ip.c if2ip: make the buf_size arg a size_t 2024-04-30 14:22:11 +02:00
if2ip.h if2ip: make the buf_size arg a size_t 2024-04-30 14:22:11 +02:00
imap.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
imap.h
inet_ntop.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
inet_ntop.h lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
inet_pton.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
inet_pton.h windows: delete redundant headers 2023-12-18 14:56:57 +00:00
krb5.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ldap.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
libcurl.rc (lib)curl.rc: set debug flag also for `CURLDEBUG` and `UNITTESTS` 2024-05-22 08:38:12 +02:00
libcurl.vers.in
llist.c llist: add Curl_llist_append() 2024-04-11 09:00:51 +02:00
llist.h llist: add Curl_llist_append() 2024-04-11 09:00:51 +02:00
macos.c macos: undo `availability` macro enabled by Homebrew gcc 2024-07-12 00:32:39 +02:00
macos.h
md4.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
md5.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
memdebug.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
memdebug.h lib: tidy up types and casts 2024-06-05 14:02:39 +02:00
mime.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
mime.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
mprintf.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
mqtt.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
mqtt.h mqtt, remove remaining use of data->state.buffer 2024-01-27 12:42:19 +01:00
multi.c multi: pollset assertion only when IP connected 2024-07-05 17:00:58 +02:00
multihandle.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
multiif.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
netrc.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
netrc.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
nonblock.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
nonblock.h
noproxy.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
noproxy.h noproxy: patterns need to be comma separated 2024-06-01 12:25:13 +02:00
openldap.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
optiontable.pl curldown: Fix email address in Copyright 2024-02-28 11:28:10 +01:00
parsedate.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
parsedate.h
pingpong.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
pingpong.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
pop3.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
pop3.h lib: add Curl_xfer_write_resp_hd 2024-04-11 09:29:21 +02:00
progress.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
progress.h getinfo: CURLINFO_QUEUE_TIME_T 2023-12-27 09:28:48 +01:00
psl.c
psl.h
rand.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rand.h
rename.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rename.h
request.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
request.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rtsp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
rtsp.h http: remove "struct HTTP" 2024-06-12 16:04:53 +02:00
select.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
select.h multi: prepare multi_wait() for future shutdown usage 2024-06-10 13:11:05 +02:00
sendf.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
sendf.h transfer: do not use EXPIRE_NOW while blocked 2024-06-13 15:13:43 +02:00
setopt.c vtls: replace addsessionid with set_sessionid 2024-07-09 23:14:58 +02:00
setopt.h setopt: warn on Curl_set*opt() uses not using the return value 2024-05-12 17:27:51 +02:00
setup-os400.h os400: make it compilable again 2024-06-13 11:30:55 +02:00
setup-vms.h docs: misc language polish 2024-07-01 16:45:17 +02:00
setup-win32.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
sha256.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
share.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
share.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
sigpipe.h
slist.c
slist.h
smb.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
smb.h lib: further send/upload handling polish 2024-03-04 08:42:56 +01:00
smtp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
smtp.h lib: further send/upload handling polish 2024-03-04 08:42:56 +01:00
sockaddr.h build: prefer `USE_IPV6` macro internally (was: `ENABLE_IPV6`) 2024-04-13 08:33:26 +00:00
socketpair.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
socketpair.h socketpair: provide `Curl_socketpair` only when `!CURL_DISABLE_SOCKETPAIR` 2024-06-07 10:47:15 +02:00
socks.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
socks.h
socks_gssapi.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
socks_sspi.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
speedcheck.c
speedcheck.h
splay.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
splay.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strcase.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strcase.h
strdup.c
strdup.h
strerror.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strerror.h
strtok.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strtok.h
strtoofft.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
strtoofft.h docs: misc language polish 2024-07-01 16:45:17 +02:00
system_win32.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
system_win32.h system_win32: add missing curl.h include 2024-06-26 10:05:32 +02:00
telnet.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
telnet.h
tftp.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
tftp.h
timediff.c
timediff.h docs: misc language polish 2024-07-01 16:45:17 +02:00
timeval.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
timeval.h
transfer.c transfer: avoid polling socket every transfer loop 2024-07-04 23:02:41 +02:00
transfer.h transfer: do not use EXPIRE_NOW while blocked 2024-06-13 15:13:43 +02:00
url.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
url.h lib: graceful connection shutdown 2024-06-26 08:33:17 +02:00
urlapi-int.h build: untangle `UNITTESTS` and `DEBUGBUILD` macros 2024-05-27 21:15:50 +02:00
urlapi.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
urldata.h vtls: replace addsessionid with set_sessionid 2024-07-09 23:14:58 +02:00
version.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
version_win32.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
version_win32.h
warnless.c
warnless.h warnless: delete orphan declarations 2024-05-14 16:37:11 +02:00
ws.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
ws.h docs: misc language polish 2024-07-01 16:45:17 +02:00