X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fcompat.h;h=66a1fd88fe4532d7563e3dad9390fe1661478098;hb=04f8402c636b06a3b3ed3c109b86a5cacf7b5318;hp=40b17ba9c9f711285f71123696875c5248ec8786;hpb=51f30f56bff7e6ab410e1d353acb2a3f23c7cfc7;p=srvx.git diff --git a/src/compat.h b/src/compat.h index 40b17ba..66a1fd8 100644 --- a/src/compat.h +++ b/src/compat.h @@ -57,6 +57,10 @@ char *alloca(); #include #endif +#ifdef HAVE_STDINT_H +#include +#endif + #ifdef HAVE_NETDB_H #include #endif @@ -75,6 +79,11 @@ char *alloca(); #include #endif +/* Cygwin (for example) doesn't define LINE_MAX, although mingw does. */ +#if !defined(LINE_MAX) +# define LINE_MAX 2048 +#endif + #ifdef HAVE_VA_COPY #define VA_COPY(DEST, SRC) va_copy(DEST, SRC) #elif HAVE___VA_COPY @@ -130,17 +139,19 @@ struct addrinfo { #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 #ifndef HAVE_GAI_STRERROR const char *gai_strerror(int errcode); #endif +#ifndef HAVE_GETNAMEINFO +#define NI_NUMERICHOST 1 +int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags); +#endif + #ifndef EINPROGRESS # ifdef WSAEINPROGRESS # define EINPROGRESS WSAEINPROGRESS