From 41cc603d11588f76ba244ae77e8ed500833ad844 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 12 Feb 2016 23:31:24 +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_curve.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_security_curve.cpp b/tests/test_security_curve.cpp index 6c075978..d9db69ad 100644 --- a/tests/test_security_curve.cpp +++ b/tests/test_security_curve.cpp @@ -245,7 +245,11 @@ int main (void) ip4addr.sin_family = AF_INET; ip4addr.sin_port = htons (9998); - 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));