aboutsummaryrefslogtreecommitdiff
path: root/src/compat
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-04-12 10:35:15 +0100
committerfanquake <fanquake@gmail.com>2022-04-20 13:51:33 +0100
commitc79ad935f0412bac3e19a6b925efdb390eb00bd9 (patch)
tree87414427d7dd8749f8a14fce01eb3501f0a96c54 /src/compat
parent094d9fda5ccee7d78a2e3d8b1eec17b8b6a33466 (diff)
downloadbitcoin-c79ad935f0412bac3e19a6b925efdb390eb00bd9.tar.xz
refactor: fix includes in src/compat
Add missing includes. Swap C headers for their C++ counterparts. Remove pointless / unmaintainable include comments. This is even more the case when we are actually using IWYU, as if anyone wants to see the comments they can just get IWYU to generate them.
Diffstat (limited to 'src/compat')
-rw-r--r--src/compat/byteswap.h2
-rw-r--r--src/compat/cpuid.h2
-rw-r--r--src/compat/endian.h2
-rw-r--r--src/compat/glibcxx_sanity.cpp1
-rw-r--r--src/compat/stdin.cpp18
5 files changed, 12 insertions, 13 deletions
diff --git a/src/compat/byteswap.h b/src/compat/byteswap.h
index 27ef1a18df..2f4232fa5c 100644
--- a/src/compat/byteswap.h
+++ b/src/compat/byteswap.h
@@ -9,7 +9,7 @@
#include <config/bitcoin-config.h>
#endif
-#include <stdint.h>
+#include <cstdint>
#if defined(HAVE_BYTESWAP_H)
#include <byteswap.h>
diff --git a/src/compat/cpuid.h b/src/compat/cpuid.h
index 0877ad47d3..e78c1ce6d1 100644
--- a/src/compat/cpuid.h
+++ b/src/compat/cpuid.h
@@ -10,6 +10,8 @@
#include <cpuid.h>
+#include <cstdint>
+
// We can't use cpuid.h's __get_cpuid as it does not support subleafs.
void static inline GetCPUID(uint32_t leaf, uint32_t subleaf, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d)
{
diff --git a/src/compat/endian.h b/src/compat/endian.h
index c5cf7a46cc..bdd8b84c1b 100644
--- a/src/compat/endian.h
+++ b/src/compat/endian.h
@@ -11,7 +11,7 @@
#include <compat/byteswap.h>
-#include <stdint.h>
+#include <cstdint>
#if defined(HAVE_ENDIAN_H)
#include <endian.h>
diff --git a/src/compat/glibcxx_sanity.cpp b/src/compat/glibcxx_sanity.cpp
index e6e6208e40..f2ceeeeb9c 100644
--- a/src/compat/glibcxx_sanity.cpp
+++ b/src/compat/glibcxx_sanity.cpp
@@ -5,6 +5,7 @@
#include <list>
#include <locale>
#include <stdexcept>
+#include <string>
namespace
{
diff --git a/src/compat/stdin.cpp b/src/compat/stdin.cpp
index 0fc4e0fcf2..61d66e39f2 100644
--- a/src/compat/stdin.cpp
+++ b/src/compat/stdin.cpp
@@ -2,23 +2,19 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#if defined(HAVE_CONFIG_H)
-#include <config/bitcoin-config.h>
-#endif
+#include <compat/stdin.h>
-#include <cstdio> // for fileno(), stdin
+#include <cstdio>
#ifdef WIN32
-#include <windows.h> // for SetStdinEcho()
-#include <io.h> // for isatty()
+#include <windows.h>
+#include <io.h>
#else
-#include <termios.h> // for SetStdinEcho()
-#include <unistd.h> // for SetStdinEcho(), isatty()
-#include <poll.h> // for StdinReady()
+#include <termios.h>
+#include <unistd.h>
+#include <poll.h>
#endif
-#include <compat/stdin.h>
-
// https://stackoverflow.com/questions/1413445/reading-a-password-from-stdcin
void SetStdinEcho(bool enable)
{