From 9509ebd11d4e5efc8a3d00dcf453515c03443f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Mon, 31 Oct 2016 12:05:46 -0400 Subject: [PATCH] build: add missing include for Windows --- include/opendht/infohash.h | 9 ++------- include/opendht/utils.h | 9 ++++++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h index d1df7698..e0964830 100644 --- a/include/opendht/infohash.h +++ b/include/opendht/infohash.h @@ -22,16 +22,11 @@ #include <msgpack.hpp> #ifndef _WIN32 -#include <netinet/in.h> -#include <netdb.h> -#ifdef __ANDROID__ -typedef uint16_t in_port_t; -#endif +#include <sys/socket.h> #else #include <iso646.h> #include <ws2tcpip.h> -typedef uint16_t sa_family_t; -typedef uint16_t in_port_t; +#include <ws2def.h> #endif #include <iostream> diff --git a/include/opendht/utils.h b/include/opendht/utils.h index ae634d9a..ef6de45d 100644 --- a/include/opendht/utils.h +++ b/include/opendht/utils.h @@ -26,9 +26,16 @@ #ifndef _WIN32 #include <sys/socket.h> +#include <netinet/in.h> +#include <netdb.h> +#ifdef __ANDROID__ +typedef uint16_t in_port_t; +#endif #else -#include <ws2def.h> #include <ws2tcpip.h> +#include <ws2def.h> +typedef uint16_t sa_family_t; +typedef uint16_t in_port_t; #endif #include <chrono> -- GitLab