diff --git a/lib/includes/ngtcp2/ngtcp2.h b/lib/includes/ngtcp2/ngtcp2.h index abef3855bebd6a1f473f717612a06c2675b3fbde..3373adb9f91a52c1d0907a68d338da5b81e3d8f9 100644 --- a/lib/includes/ngtcp2/ngtcp2.h +++ b/lib/includes/ngtcp2/ngtcp2.h @@ -46,10 +46,15 @@ extern "C" { # include <inttypes.h> #endif /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */ #include <sys/types.h> -#include <sys/socket.h> #include <stdarg.h> #include <stddef.h> +#ifdef WIN32 +# include <winsock2.h> +#else +# include <sys/socket.h> +#endif + #include <ngtcp2/version.h> #ifdef NGTCP2_STATICLIB diff --git a/lib/ngtcp2_addr.c b/lib/ngtcp2_addr.c index cf7a4f317b6d5394cf28efcf488f20a533615be7..cfc91c41e2c38e84279f63ee44982700fcb64d0f 100644 --- a/lib/ngtcp2_addr.c +++ b/lib/ngtcp2_addr.c @@ -26,7 +26,18 @@ #include <string.h> #include <assert.h> -#include <netinet/ip.h> + +#ifdef WIN32 +# include <winsock2.h> +# include <ws2tcpip.h> +#else +# include <sys/types.h> +# include <sys/socket.h> +# include <netinet/in.h> +# include <netinet/ip.h> +# include <netinet/tcp.h> +# include <arpa/inet.h> +#endif ngtcp2_addr *ngtcp2_addr_init(ngtcp2_addr *dest, const struct sockaddr *addr, size_t addrlen, void *user_data) {