#112 Fix mingw build failure
Merged 3 months ago by zfridric. Opened 3 months ago by zfridric.
rpms/ zfridric/gnutls zfridric_f40  into  f40

@@ -0,0 +1,12 @@ 

+ diff --color -ruNp a/lib/system/sockets.c b/lib/system/sockets.c

+ --- a/lib/system/sockets.c	2024-01-16 03:36:04.000000000 +0100

+ +++ b/lib/system/sockets.c	2024-02-22 16:20:48.900495575 +0100

+ @@ -208,7 +208,7 @@ int gnutls_system_recv_timeout(gnutls_tr

+  	} while (ret == -1 && errno == EINTR);

+  #else

+  	fd_set rfds;

+ -	struct timeval _tv, *tv = NULL;

+ +	TIMEVAL _tv, *tv = NULL;

+  

+  	FD_ZERO(&rfds);

+  	FD_SET(fd, &rfds);

file modified
+1
@@ -19,6 +19,7 @@ 

  # follow https://gitlab.com/gnutls/gnutls/-/issues/1443

  Patch: gnutls-3.7.8-ktls_skip_tls12_chachapoly_test.patch

  Patch: gnutls-3.8.3-kernel_version_check.patch

+ Patch: gnutls-3.8.3-fix-mingw-build.patch

  

  %bcond_without bootstrap

  %bcond_without dane

Fixes the following error:

../../lib/system/sockets.c: In function 'gnutls_system_recv_timeout':
../../lib/system/sockets.c:222:49: error: passing argument 5 of 'select' from incompatible pointer type [-Wincompatible-pointer-types]
222 | ret = select(fd + 1, &rfds, NULL, NULL, tv);
| ^~
| |
| struct rpl_timeval
In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/ws2tcpip.h:17,
from ../../lib/gnutls_int.h:52,
from ../../lib/system.h:27,
from ../../lib/system/sockets.c:25:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:1031:116: note: expected 'const TIMEVAL
' {aka 'const struct timeval '} but argument is of type 'struct rpl_timeval '
1031 | WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set readfds,fd_set writefds,fd_set exceptfds,const TIMEVAL timeout);
| ~^

Signed-off-by: Zoltan Fridrich zfridric@redhat.com

Pull-Request has been merged by zfridric

3 months ago