diff options
author | unknown <df@pippilotta.erinye.com> | 2008-02-11 18:02:37 +0100 |
---|---|---|
committer | unknown <df@pippilotta.erinye.com> | 2008-02-11 18:02:37 +0100 |
commit | 98964759359592557007e44b10ebc7d799a64790 (patch) | |
tree | edd5d2cb6aa301f84d6240913c53acf55c75526a /extra/resolveip.c | |
parent | 9c5fe5e8d1a2e6b3311b4c0bbf74d73389796647 (diff) | |
download | mariadb-git-98964759359592557007e44b10ebc7d799a64790.tar.gz |
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.
Diffstat (limited to 'extra/resolveip.c')
-rw-r--r-- | extra/resolveip.c | 8 |
1 files changed, 8 insertions, 0 deletions
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"); |