uriparser / uriparser

:hocho: Strictly RFC 3986 compliant URI parsing and handling library written in C89; moved from SourceForge to GitHub

Home Page:https://uriparser.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conflicting declaration of inet_ntop with mingw-w64-9.0

manisandro opened this issue · comments

On Fedora we moved to mingw-w64-9.0, and uriparser fails to compile with a conflicting declaration of inet_ntop [1]. I'd suggest just dropping the extra declaration:

diff -rupN uriparser-0.9.5/tool/uriparse.c uriparser-0.9.5-new/tool/uriparse.c
--- uriparser-0.9.5/tool/uriparse.c     2021-03-18 17:35:29.000000000 +0100
+++ uriparser-0.9.5-new/tool/uriparse.c 2021-07-23 10:48:26.655075428 +0200
@@ -43,10 +43,6 @@
#ifdef _WIN32
# include <winsock2.h>
# include <ws2tcpip.h>
-# ifdef __MINGW32__
-WINSOCK_API_LINKAGE const char WSAAPI inet_ntop(
-               int af, const void *src, char *dst, socklen_t size);
-# endif
#else
# include <sys/socket.h>
# include <arpa/inet.h>

[1] https://kojipkgs.fedoraproject.org//work/tasks/2526/72422526/build.log

Hi @manisandro ,

I'm unsure which versions of MinGW we'll break with dropping the line and if that's okay. A version guard could help mitigate, so I guess in all cases more research first would help estimate potential consequences. I should probably add MinGW coverage to the CI in here first, in any case.

PS: related commits are:

PS: @manisandro thanks for taking this upstream! 🙏

@manisandro should be fixed by f04d0ee, the new GCC 9 MinGW CI likes it.