diff options
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 */ |