diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2009-03-29 17:39:12 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2009-03-29 17:39:12 +0200 |
commit | a285896c04fb2a205f270a4ae55a62b003adb87e (patch) | |
tree | 7ba5212644451d5e9809853c12554ba772c4f556 /include | |
parent | 93d9ab3932e86b0491e295ccd6f3842bc5ebd542 (diff) | |
download | wolfbones-a285896c04fb2a205f270a4ae55a62b003adb87e.tar.gz wolfbones-a285896c04fb2a205f270a4ae55a62b003adb87e.tar.bz2 |
cleaned up Cygwin getaddrinfo and started Win32 getaddrinfo
Diffstat (limited to 'include')
-rw-r--r-- | include/wolf/port/netdb.h | 19 | ||||
-rw-r--r-- | include/wolf/port/sys.h | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/include/wolf/port/netdb.h b/include/wolf/port/netdb.h index 1751c2d..87efd3c 100644 --- a/include/wolf/port/netdb.h +++ b/include/wolf/port/netdb.h @@ -49,7 +49,14 @@ #include <netinet/in.h> #endif +#ifndef _WIN32 #include <arpa/inet.h> +#endif + +/* no inet_ntop on Windows */ +#ifdef _WIN32 +#include "port/inet_ntop.h" +#endif /* for getaddrinfo, freeaddrinfo, struct getaddrinfo */ @@ -74,14 +81,24 @@ #include <sys/types.h> #include <sys/socket.h> #endif - + +/* for all modern Unix systems */ +#ifndef _WIN32 #include <netdb.h> /* for getaddrinfo, freeadrinfo, struct getaddrinfo */ +#endif +/* for newlib on Cygwin we need a stub */ #ifdef CYGWIN #include "port/getaddrinfo.h" /* stub implementation on Cygwin */ #endif +/* exists on Windows in slightly different form */ +#ifdef _WIN32 +#include <Winsock2.h> /* all kind of prerequisites */ +#include <WS2tcpip.h> /* for getaddrinfo */ +#endif + /** @} */ /* @addtogroup wolf_port */ #endif /* ifndef WOLF_NETDB_H */ diff --git a/include/wolf/port/sys.h b/include/wolf/port/sys.h index fcb82c3..79250b7 100644 --- a/include/wolf/port/sys.h +++ b/include/wolf/port/sys.h @@ -227,6 +227,7 @@ #define _XOPEN_SOURCE 600 #define HAVE_ENUM_BOOL #define HAVE_SYSLOG_H +#define HAVE_INET_NTOP #else #error unknown platform #endif /* OS_MINOR_VERSION == 0 */ @@ -238,6 +239,7 @@ #if defined _WIN32 #define HAVE_ITOA #define HAVE_EVENTLOG +#define HAVE_GETADDRINFO #endif /* defined _WIN32 */ /* Microsoft Windows compiler */ |