From 98964759359592557007e44b10ebc7d799a64790 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 11 Feb 2008 18:02:37 +0100 Subject: Make this build on Windows. extra/resolveip.c: Regrettably, Windows does not have inet_aton. We still don't want to use inet_addr on all platforms, because it is inaccurate and deprecated on many. --- extra/resolveip.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extra/resolveip.c b/extra/resolveip.c index 0cc89d6e22e..aedc2cc3418 100644 --- a/extra/resolveip.c +++ b/extra/resolveip.c @@ -118,13 +118,21 @@ int main(int argc, char **argv) while (argc--) { +#ifndef WIN32 struct in_addr addr; +#endif ip = *argv++; /* Not compatible with IPv6! Probably should use getnameinfo(). */ +#ifdef WIN32 + taddr = inet_addr(ip); + if(taddr != INADDR_NONE) + { +#else if (inet_aton(ip, &addr) != 0) { taddr= addr.s_addr; +#endif if (taddr == htonl(INADDR_BROADCAST)) { puts("Broadcast"); -- cgit v1.2.1