lib: introduce CURL_ACCEPT()

To avoid overriding the system symbol `accept`, which is a macro on some
systems (AIX), and thus can't be called via the `(function)` PP trick.

It's also problematic to reset such macro to its original value.

Follow-up to 3bb5e58c10 #17827
Reported-by: Andrew Kirillov
Fixes #18500
Closes #18501
Closes #18502
This commit is contained in:
Viktor Szakats 2025-09-09 10:00:13 +02:00
parent f8ff233cdf
commit 9863599d69
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
7 changed files with 10 additions and 9 deletions

View file

@ -371,7 +371,7 @@ curl_socket_t curl_dbg_accept(curl_socket_t s, void *saddr, void *saddrlen,
struct sockaddr *addr = (struct sockaddr *)saddr;
curl_socklen_t *addrlen = (curl_socklen_t *)saddrlen;
curl_socket_t sockfd = (accept)(s, addr, addrlen);
curl_socket_t sockfd = accept(s, addr, addrlen);
if(source && (sockfd != CURL_SOCKET_BAD))
curl_dbg_log("FD %s:%d accept() = %" FMT_SOCKET_T "\n",