X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fcompat.h;h=232af42ed6373465fb33a96062c751061a6a9051;hb=fd209bd5cc9ffc7989c461a2f2a2011790668d32;hp=85712597e36b1a4bcf20360f1ddc5facbc16ff2e;hpb=7aea2bdc026e2ba25140b74b26c17b18810b951c;p=srvx.git diff --git a/src/compat.h b/src/compat.h index 8571259..232af42 100644 --- a/src/compat.h +++ b/src/compat.h @@ -53,6 +53,14 @@ char *alloca(); #include #endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +#ifdef HAVE_NETDB_H +#include +#endif + #ifdef HAVE_UNISTD_H #include #endif @@ -87,4 +95,30 @@ extern char * strdup(char const * str); extern char const * strerror(int errornum); #endif +#ifndef HAVE_STRUCT_ADDRINFO + +struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + size_t ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; + +#define AI_PASSIVE 1 +#define AI_CANONNAME 2 + +#endif /* !defined(HAVE_STRUCT_ADDRINFO) */ + +#ifndef HAVE_GETADDRINFO + +int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res); +int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags); +void freeaddrinfo(struct addrinfo *res); + +#endif + #endif /* COMPAT_H */