diff --git a/tests/test_security_curve.cpp b/tests/test_security_curve.cpp index 854f4f94..b8c7b2b0 100644 --- a/tests/test_security_curve.cpp +++ b/tests/test_security_curve.cpp @@ -235,7 +235,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 (_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)); diff --git a/tests/test_security_null.cpp b/tests/test_security_null.cpp index 25ab74f4..d3b212a1 100644 --- a/tests/test_security_null.cpp +++ b/tests/test_security_null.cpp @@ -148,7 +148,11 @@ int main (void) ip4addr.sin_family = AF_INET; ip4addr.sin_port = htons(9003); +#if (_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); diff --git a/tests/test_security_plain.cpp b/tests/test_security_plain.cpp index 909dc290..8bae0932 100644 --- a/tests/test_security_plain.cpp +++ b/tests/test_security_plain.cpp @@ -154,7 +154,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 (_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));