X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/d76ed9a966ee3d955c8ef00ecc02e643c2005e2e..8dc0685213ead3f8896c83cadc130143ccc4d181:/src/compat.h 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 */