diff --git a/src/include/microhttpd2_portability.h b/src/include/microhttpd2_portability.h index a6036891..b05d8fed 100644 --- a/src/include/microhttpd2_portability.h +++ b/src/include/microhttpd2_portability.h @@ -1,29 +1,37 @@ MHD_C_DECLRATIONS_START_HERE_ /* *INDENT-OFF* */ -/* If generic headers don't work on your platform, include headers - which define 'va_list', 'size_t', 'uint_fast16_t', 'uint_fat32_t', - 'uint_fast64_t', 'struct sockaddr', and "#define MHD_PLATFORM_H" - before including "microhttpd.h". Then the following "standard" - includes won't be used (which might be a good idea, especially - on platforms where they do not exist). +/* If generic headers don't work on your platform, include headers which define + 'va_list', 'size_t', 'uint_fast16_t', 'uint_fast32_t', 'uint_fast64_t', + 'struct sockaddr', and then "#define MHD_HAVE_SYS_HEADERS_INCLUDED" before + including "microhttpd2.h". + When 'MHD_HAVE_SYS_HEADERS_INCLUDED' is defined the following "standard" + includes won't be used (which might be a good idea, especially on platforms + where they do not exist). */ -#ifndef MHD_PLATFORM_H -#include -#include -#include -#if defined(_WIN32) && ! defined(__CYGWIN__) -#include -#else -#include -#include -#include -#endif -#endif - -#if defined(__CYGWIN__) && ! defined(_SYS_TYPES_FD_SET) -/* Do not define __USE_W32_SOCKETS under Cygwin! */ -#error Cygwin with winsock fd_set is not supported +#ifndef MHD_HAVE_SYS_HEADERS_INCLUDED +# include +# ifndef MHD_SYS_BASE_TYPES_H + /* Headers for uint_fastXX_t, size_t */ +# include +# include +# include +# endif +# ifndef MHD_SYS_SOCKET_TYPES_H + /* Headers for 'struct sockaddr' */ +# if !defined(_WIN32) || defined(__CYGWIN__) +# include +# else + /* Prevent conflict of and */ +# if !defined(_WINSOCK2API_) && !defined(_WINSOCKAPI_) +# ifndef WIN32_LEAN_AND_MEAN + /* Do not use unneeded parts of W32 headers. */ +# define WIN32_LEAN_AND_MEAN 1 +# endif /* !WIN32_LEAN_AND_MEAN */ +# include +# endif +# endif +# endif #endif #ifndef __cplusplus