From d0b341cf0fd59a3eb8809d4e6515857b30b28647 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 12 Feb 2016 23:31:55 +1100 Subject: [PATCH] update for mingw's default _WIN32_WINNT mingw defaults with _WIN32_WINNT as 0x0502 which doesn't define inet_pton(), so add a conditional check --- tests/test_security_null.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_security_null.cpp b/tests/test_security_null.cpp index e95a7c9d..f0ce6b55 100644 --- a/tests/test_security_null.cpp +++ b/tests/test_security_null.cpp @@ -158,7 +158,11 @@ int main (void) ip4addr.sin_family = AF_INET; ip4addr.sin_port = htons(9003); - inet_pton(AF_INET, "127.0.0.1", &ip4addr.sin_addr); +#if (ZMQ_HAVE_WINDOWS and _WIN32_WINNT < 0x0600) + ip4addr.sin_addr.s_addr = inet_addr ("127.0.0.1"); +#else + inet_pton(AF_INET, "127.0.0.1", &ip4addr.sin_addr); +#endif s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); rc = connect (s, (struct sockaddr*) &ip4addr, sizeof ip4addr);