From: Antoine Bollengier <44288655+b5i@users.noreply.github.com> Date: Wed, 15 May 2024 20:46:05 +0000 (+0200) Subject: socketpair: fix compilation when USE_UNIX_SOCKETS is not defined X-Git-Tag: curl-8_8_0~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c5ad6d278a68e8bbcabc6f587d95884cd0779da;p=thirdparty%2Fcurl.git socketpair: fix compilation when USE_UNIX_SOCKETS is not defined Closes #13666 --- diff --git a/lib/socketpair.h b/lib/socketpair.h index bd499abbef..09d975477a 100644 --- a/lib/socketpair.h +++ b/lib/socketpair.h @@ -38,7 +38,16 @@ #define wakeup_write swrite #define wakeup_read sread #define wakeup_close sclose -#define wakeup_create(p) Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, p) + +#if defined(USE_UNIX_SOCKETS) && defined(HAVE_SOCKETPAIR) +#define SOCKET_FAMILY AF_UNIX +#elif !defined(HAVE_SOCKETPAIR) +#define SOCKET_FAMILY 0 /* not used */ +#else +#error "unsupported unix domain and socketpair build combo" +#endif + +#define wakeup_create(p) Curl_socketpair(SOCKET_FAMILY, SOCK_STREAM, 0, p) #endif /* HAVE_PIPE */