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
This commit is contained in:
Orgad Shaneh 2024-05-10 13:13:32 +03:00 committed by Viktor Szakats
parent 3a564fecab
commit 7ca0a3791b
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -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;
;