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.
This commit is contained in:
fanquake 2022-04-12 10:35:15 +01:00
parent 094d9fda5c
commit c79ad935f0
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1
5 changed files with 12 additions and 13 deletions

View File

@ -9,7 +9,7 @@
#include <config/bitcoin-config.h>
#endif
#include <stdint.h>
#include <cstdint>
#if defined(HAVE_BYTESWAP_H)
#include <byteswap.h>

View File

@ -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)
{

View File

@ -11,7 +11,7 @@
#include <compat/byteswap.h>
#include <stdint.h>
#include <cstdint>
#if defined(HAVE_ENDIAN_H)
#include <endian.h>

View File

@ -5,6 +5,7 @@
#include <list>
#include <locale>
#include <stdexcept>
#include <string>
namespace
{

View File

@ -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)
{