diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h index ac54a7b7b10740e3ce9b484c35655d45f49fb3a5..5bd0ae8f527dd866c8a570046d5317be1a14dc58 100644 --- a/include/opendht/infohash.h +++ b/include/opendht/infohash.h @@ -21,6 +21,18 @@ #include <msgpack.hpp> +#ifndef _WIN32 +#include <netinet/in.h> +#include <netdb.h> +#ifdef __ANDROID__ +typedef uint16_t in_port_t; +#endif +#else +#include <ws2tcpip.h> +typedef uint16_t sa_family_t; +typedef uint16_t in_port_t; +#endif + #include <iostream> #include <iomanip> #include <array> @@ -197,12 +209,7 @@ public: }; -static constexpr InfoHash zeroes {}; -static constexpr InfoHash ones = {std::array<uint8_t, HASH_LEN>{{ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF -}}}; +static constexpr const InfoHash zeroes {}; struct NodeExport { InfoHash id; diff --git a/include/opendht/node.h b/include/opendht/node.h index 63ee310adabb4d8a3053ed61138d8828c9a0a21b..cd2813bcec062fbc6359962f710494f4eb51856c 100644 --- a/include/opendht/node.h +++ b/include/opendht/node.h @@ -24,8 +24,6 @@ #include "utils.h" #include "infohash.h" -#include <arpa/inet.h> - #include <list> namespace dht { diff --git a/include/opendht/value.h b/include/opendht/value.h index 23dbd7e43b61c9fecd605be91900ed2652e8c372..e652ce5402f93dbbd54b5bbb6115be0b57a516a4 100644 --- a/include/opendht/value.h +++ b/include/opendht/value.h @@ -26,18 +26,6 @@ #include <msgpack.hpp> -#ifndef _WIN32 -#include <netinet/in.h> -#include <netdb.h> -#ifdef __ANDROID__ -typedef uint16_t in_port_t; -#endif -#else -#include <ws2tcpip.h> -typedef uint16_t sa_family_t; -typedef uint16_t in_port_t; -#endif - #include <string> #include <sstream> #include <bitset>