diff --git a/src/options.c b/src/options.c
index 6cae7ee..2844c0c 100644
--- a/src/options.c
+++ b/src/options.c
@@ -10,6 +10,11 @@
#include "options.h"
#include "inet.h"
+/* not available on older Windows SDK and mingw */
+#ifndef IPV6_V6ONLY
+#define IPV6_V6ONLY 27
+#endif
+
/*=========================================================================*\
* Internal functions prototypes
\*=========================================================================*/
diff --git a/src/tcp.c b/src/tcp.c
index 94148c5..fdd85f4 100644
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -13,6 +13,11 @@
#include "options.h"
#include "tcp.h"
+/* not available on older Windows SDK and mingw */
+#ifndef IPV6_V6ONLY
+#define IPV6_V6ONLY 27
+#endif
+
/*=========================================================================*\
* Internal function prototypes
\*=========================================================================*/
diff --git a/src/udp.c b/src/udp.c
index 0241cc5..6630744 100644
--- a/src/udp.c
+++ b/src/udp.c
@@ -13,6 +13,11 @@
#include "options.h"
#include "udp.h"
+/* not available on older Windows SDK and mingw */
+#ifndef IPV6_V6ONLY
+#define IPV6_V6ONLY 27
+#endif
+
/* min and max macros */
#ifndef MIN
#define MIN(x, y) ((x) < (y) ? x : y)
However, inet.c and tcp.c still rely on some *nix specific functions:
CMakeFiles/socket_core.dir/objects.a(inet.c.obj):inet.c:(.text+0x2c5): undefined reference to `_socket_gaistrerror'
CMakeFiles/socket_core.dir/objects.a(inet.c.obj):inet.c:(.text+0x5ad): undefined reference to `_inet_ntop'
CMakeFiles/socket_core.dir/objects.a(inet.c.obj):inet.c:(.text+0x690): undefined reference to `_inet_ntop'
CMakeFiles/socket_core.dir/objects.a(inet.c.obj):inet.c:(.text+0x7b4): undefined reference to `_inet_ntop'
CMakeFiles/socket_core.dir/objects.a(inet.c.obj):inet.c:(.text+0x897): undefined reference to `_inet_ntop'
CMakeFiles/socket_core.dir/objects.a(inet.c.obj):inet.c:(.text+0xb5b): undefined reference to `_socket_gaistrerror'
CMakeFiles/socket_core.dir/objects.a(inet.c.obj):inet.c:(.text+0xc79): undefined reference to `_socket_gaistrerror'
CMakeFiles/socket_core.dir/objects.a(tcp.c.obj):tcp.c:(.text+0xb62): undefined reference to `_socket_gaistrerror'
The text was updated successfully, but these errors were encountered:
I was looking at this briefly a few weeks back (building with Visual Studio, which I quickly abandoned) -- wsocket.c needs to define socket_gaistrerror as a thin wrapper around wstrerror. See MSDN docs on getaddrinfo's return value
In the latest "unstable" branch, IPV6_V6ONL is not always defined (e.g. when I cross compiled mingw from Linux). A workaround is seen in:
http://svn.apache.org/repos/asf/apr/apr/trunk/network_io/win32/sockopt.c
So, I did
However, inet.c and tcp.c still rely on some *nix specific functions:
The text was updated successfully, but these errors were encountered: