<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
Hi, I'm looking to use the inet_pton function within
modules\services_discovery\microdns.c<br>
<br>
Unfortunately it looks to be defined twice when I cross compile
for Windows:<br>
<br>
1. in libmicrodns (compat/inet.c) - will only be declared if
defined (_WIN32) && !defined(HAVE_INET_NTOP)<br>
2. in libws2_32.a (I think from including winsock2.h?)<br>
<br>
/opt/gcc-x86_64-w64-mingw32/x86_64-w64-mingw32/lib/libws2_32.a(dywbs00169.o):(.text+0x0):
multiple definition of `inet_pton'<br>
/win64/vlc/contrib/x86_64-w64-mingw32/lib/libmicrodns.a(inet.o):/win64/libmicrodns/build/../compat/inet.c:60:
first defined here<br>
<br>
I've commented out the contents of the compat/inet.c file and
successfully VLC with the modified libmicrodns.<br>
<br>
Is it ok to add a patch to contrib\src\microdns (see example
below), or is there a better way? Is it because it's linking
libmicrodns before<i> </i>libws2_32 rather than after?<br>
</p>
<p>Thanks,</p>
<p>Roland</p>
<p><br>
From e364a3201b30e88236dd62c892e9cb24e9c36fb2 Mon Sep 17 00:00:00
2001<br>
From: Roland Bewick <a class="moz-txt-link-rfc2396E" href="mailto:roland.bewick@gmail.com"><roland.bewick@gmail.com></a><br>
Date: Thu, 18 Jul 2019 11:55:59 +0700<br>
Subject: [PATCH] remove unneeded inet compatibility<br>
<br>
---<br>
compat/inet.c | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/compat/inet.c b/compat/inet.c<br>
index 2983e4d..9c2dfb8 100644<br>
--- a/compat/inet.c<br>
+++ b/compat/inet.c<br>
@@ -27,7 +27,7 @@<br>
#include "compat.h"<br>
#include "utils.h"<br>
<br>
-#if defined (_WIN32) && !defined(HAVE_INET_NTOP)<br>
+/*#if defined (_WIN32) && !defined(HAVE_INET_NTOP)<br>
const char *<br>
inet_ntop(int af, const void *src, char *dst, socklen_t size)<br>
{<br>
@@ -67,4 +67,4 @@ int inet_pton (int af, const char *src, void
*dst)<br>
errno = EAFNOSUPPORT;<br>
return -1;<br>
}<br>
-#endif // _WIN32 && !inet_ntop<br>
+#endif // _WIN32 && !inet_ntop */<br>
-- <br>
2.17.1</p>
</body>
</html>