From: Orgad Shaneh Date: Fri, 10 May 2024 10:13:32 +0000 (+0300) Subject: cmake: fix `HAVE_IOCTLSOCKET_FIONBIO` test with gcc 14 X-Git-Tag: curl-8_8_0~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ca0a3791b15d67c924b563beccc9844ddc2a6b1;p=thirdparty%2Fcurl.git cmake: fix `HAVE_IOCTLSOCKET_FIONBIO` test with gcc 14 The function signature has had u_long flags since ever. This is how it is defined in the documentation, and implemented in MinGW. The code that uses ioctlsocket in nonblock.c also has unsigned long. Error: CurlTests.c:275:41: error: passing argument 3 of 'ioctlsocket' from incompatible pointer type [-Wincompatible-pointer-types] 275 | if(0 != ioctlsocket(0, FIONBIO, &flags)) | ^~~~~~ | | | int * In file included from CurlTests.c:266: /opt/mxe/usr/i686-w64-mingw32.static/include/winsock2.h:1007:76: note: expected 'u_long *' {aka 'long unsigned int *'} but argument is of type 'int *' 1007 | WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,__LONG32 cmd,u_long *argp); | ~~~~~~~~^~~~ Closes #13578 --- diff --git a/CMake/CurlTests.c b/CMake/CurlTests.c index 83d743d34e..483b9a218b 100644 --- a/CMake/CurlTests.c +++ b/CMake/CurlTests.c @@ -228,7 +228,7 @@ int main(void) #endif int main(void) { - int flags = 0; + unsigned long flags = 0; if(0 != ioctlsocket(0, FIONBIO, &flags)) return 1; ;