diff options
author | Andrew Chow <github@achow101.com> | 2023-11-28 16:42:53 -0500 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-11-28 16:51:28 -0500 |
commit | 16b5b4b674414c41f34b0d37e15a16521fb08013 (patch) | |
tree | 526f814b5f2e20a84275f7e7bb4ac90439a1e13c /src/common | |
parent | 75462b39d2e35ce2ee585453f905445349103e30 (diff) | |
parent | fa1a38470697796a1a67397a815c8f8256f59224 (diff) | |
download | bitcoin-16b5b4b674414c41f34b0d37e15a16521fb08013.tar.xz |
Merge bitcoin/bitcoin#28579: refactor: Remove redundant checks in compat/assumptions.h
fa1a38470697796a1a67397a815c8f8256f59224 Move compat.h include from system.h to system.cpp (MarcoFalke)
88887531b704f3943fdb33abbdd5378ecfeee14f Move compat/assumptions.h include to one place that actually needs it (MarcoFalke)
77774110f4dd591a71441851813d59c03c9e3c78 Remove __cplusplus from compat/assumptions.h (MarcoFalke)
faa3d4f1d8ecff444be53215d72e32d71d9ce138 Remove duplicate NDEBUG check from compat/assumptions.h (MarcoFalke)
Pull request description:
Generally, compile-time checks should be close to the code that use them. Especially, since `compat/assumptions.h` is only included in one place, where iwyu suggests to remove it.
Fix all issues:
* The `NDEBUG` check is used in `util/check`, so it is redundant in `compat/assumptions.h`.
* The `__cplusplus` check is redundant with `doc/dependencies.md` (see commit message).
* Add missing `// IWYU pragma: keep` to avoid removing the include by accident.
ACKs for top commit:
achow101:
ACK fa1a38470697796a1a67397a815c8f8256f59224
TheCharlatan:
re-ACK fa1a38470697796a1a67397a815c8f8256f59224
theuni:
ACK fa1a38470697796a1a67397a815c8f8256f59224
Tree-SHA512: f8b6db84be5d8844a2267345c0b1405fcbc39b8b5eeaa24db5b8412a74145fe44cf188b6b0c39cc2b062690ed37ca5b4662473484afe28dbec6469e79961389b
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/system.cpp | 3 | ||||
-rw-r--r-- | src/common/system.h | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/common/system.cpp b/src/common/system.cpp index 1d1c5fa56a..ba42c6df50 100644 --- a/src/common/system.cpp +++ b/src/common/system.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2022 The Bitcoin Core developers +// Copyright (c) 2009-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -12,6 +12,7 @@ #ifndef WIN32 #include <sys/stat.h> #else +#include <compat/compat.h> #include <codecvt> #endif diff --git a/src/common/system.h b/src/common/system.h index 40206aaa01..e8018f9b10 100644 --- a/src/common/system.h +++ b/src/common/system.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2022 The Bitcoin Core developers +// Copyright (c) 2009-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -10,11 +10,7 @@ #include <config/bitcoin-config.h> #endif -#include <compat/assumptions.h> -#include <compat/compat.h> - -#include <set> -#include <stdint.h> +#include <cstdint> #include <string> // Application startup time (used for uptime calculation) |