From 467c34644861a5267601255650e27c7aadab31dc Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 22 Oct 2020 18:21:47 +0300 Subject: [PATCH 1/3] net: Drop unneeded Windows headers in compat.h No interface from the mswsock.h header is used. According to https://docs.microsoft.com/en-us/windows/win32/winsock/creating-a-basic-winsock-application "The Winsock2.h header file internally includes core elements from the Windows.h header file, so there is not usually an #include line for the Windows.h header file in Winsock applications." --- src/compat.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/compat.h b/src/compat.h index 0be02cae03..5fa6589792 100644 --- a/src/compat.h +++ b/src/compat.h @@ -18,11 +18,7 @@ #undef FD_SETSIZE // prevent redefinition compiler warning #endif #define FD_SETSIZE 1024 // max number of fds in fd_set - -#include // Must be included before mswsock.h and windows.h - -#include -#include +#include #include #include #else From f796f0057bc7dad8e7065831b07f432fc0fb9f08 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 22 Oct 2020 18:41:39 +0300 Subject: [PATCH 2/3] net: Drop unneeded headers when compat.h included --- src/httpserver.cpp | 7 ------- src/net.h | 5 ----- 2 files changed, 12 deletions(-) diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 1e5ea2de83..0a8e58ab67 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -33,13 +33,6 @@ #include -#ifdef EVENT__HAVE_NETINET_IN_H -#include -#ifdef _XOPEN_SOURCE_EXTENDED -#include -#endif -#endif - /** Maximum size of http request (request line + headers) */ static const size_t MAX_HEADERS_SIZE = 8192; diff --git a/src/net.h b/src/net.h index 2652d82ea0..caa2ef6526 100644 --- a/src/net.h +++ b/src/net.h @@ -33,11 +33,6 @@ #include #include -#ifndef WIN32 -#include -#endif - - class CScheduler; class CNode; class BanMan; From cadb77a6ab8a3e6f56062cfaec4dd8168c71b39d Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 22 Oct 2020 19:37:17 +0300 Subject: [PATCH 3/3] net: Add compat.h header for htonl function --- src/torcontrol.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp index 8ebe3d750d..9d91f42b1b 100644 --- a/src/torcontrol.cpp +++ b/src/torcontrol.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include