aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-12-03 14:52:23 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-12-03 14:54:07 +0100
commita0489f3472f3799dc1ece32a59556fd239c4c14b (patch)
tree022dc28fe76cbdc49f9f0143fa31920a1272f1e8 /src
parent3fa6a9fc8c9096cc207b11f52e63aa01550dce26 (diff)
parentcadb77a6ab8a3e6f56062cfaec4dd8168c71b39d (diff)
Merge #20221: net: compat.h related cleanup
cadb77a6ab8a3e6f56062cfaec4dd8168c71b39d net: Add compat.h header for htonl function (Hennadii Stepanov) f796f0057bc7dad8e7065831b07f432fc0fb9f08 net: Drop unneeded headers when compat.h included (Hennadii Stepanov) 467c34644861a5267601255650e27c7aadab31dc net: Drop unneeded Windows headers in compat.h (Hennadii Stepanov) Pull request description: It is the `compat.h` header's job to provide platform-agnostic interfaces for internet operations. No need in `#include <arpa/inet.h>` scattered around. ACKs for top commit: practicalswift: re-ACK cadb77a6ab8a3e6f56062cfaec4dd8168c71b39d: patch looks even better laanwj: Code review ACK cadb77a6ab8a3e6f56062cfaec4dd8168c71b39d Tree-SHA512: 625ff90b2806310ab856a6ca1ddb6d9a85aa70f342b323e8525a711dd12219a1ecec8373ec1dca5a0653ffb11f9b421753887b25615d991ba3132c1cca6a3c6e
Diffstat (limited to 'src')
-rw-r--r--src/compat.h6
-rw-r--r--src/httpserver.cpp7
-rw-r--r--src/net.h5
-rw-r--r--src/torcontrol.cpp1
4 files changed, 2 insertions, 17 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 <winsock2.h> // Must be included before mswsock.h and windows.h
-
-#include <mswsock.h>
-#include <windows.h>
+#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdint.h>
#else
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 <support/events.h>
-#ifdef EVENT__HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#ifdef _XOPEN_SOURCE_EXTENDED
-#include <arpa/inet.h>
-#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 fe7b72c920..21ee5e7808 100644
--- a/src/net.h
+++ b/src/net.h
@@ -33,11 +33,6 @@
#include <memory>
#include <condition_variable>
-#ifndef WIN32
-#include <arpa/inet.h>
-#endif
-
-
class CScheduler;
class CNode;
class BanMan;
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 <chainparams.h>
#include <chainparamsbase.h>
+#include <compat.h>
#include <crypto/hmac_sha256.h>
#include <net.h>
#include <netaddress.h>