mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-18 01:13:55 +00:00
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
This commit is contained in:
parent
41cc603d11
commit
d0b341cf0f
@ -158,7 +158,11 @@ int main (void)
|
|||||||
|
|
||||||
ip4addr.sin_family = AF_INET;
|
ip4addr.sin_family = AF_INET;
|
||||||
ip4addr.sin_port = htons(9003);
|
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);
|
s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
rc = connect (s, (struct sockaddr*) &ip4addr, sizeof ip4addr);
|
rc = connect (s, (struct sockaddr*) &ip4addr, sizeof ip4addr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user