diff options
author | fanquake <fanquake@gmail.com> | 2022-09-22 14:40:37 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-09-22 14:45:13 +0100 |
commit | 590d20644458d136c74e1cb0eccbc535ac5edf41 (patch) | |
tree | 9e47e43e0436bf1e67148ae1476b4867adf8a878 | |
parent | 2b2c970627f7b343dd07428bd73a146f175e3af9 (diff) | |
parent | 55aad5f3a957296776cfd8d7a4a251361355b8e8 (diff) |
Merge bitcoin/bitcoin#26150: build: remove stdio.h from header checks
55aad5f3a957296776cfd8d7a4a251361355b8e8 build: remove stdio.h from header checks (fanquake)
b95633121bf32587fb24d22e5f26ddffb51cd7f7 refactor: use <cstdio> over stdio.h (fanquake)
Pull request description:
We already use a mix of `<cstdio>` and `stdio.h` unconditionally throughout
the codebase.
Us checking this header also duplicates work already done by autotools.
Currently `stdio.h` is checked for 3 times during a ./configure run, after
this change, at least it's only twice.
ACKs for top commit:
TheCharlatan:
ACK 55aad5f3a957296776cfd8d7a4a251361355b8e8
kristapsk:
ACK 55aad5f3a957296776cfd8d7a4a251361355b8e8
Tree-SHA512: a83cc724528ab92aacfa53048b12fcccec3962637ca7fad30f6c610365edeb0e951f74e37832ad7d3f79ca9b8d7203cb10165c89d0e4b63eeda7a970dab82dfb
-rw-r--r-- | build_msvc/bitcoin_config.h.in | 3 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/bitcoin-tx.cpp | 2 | ||||
-rw-r--r-- | src/httpserver.cpp | 2 | ||||
-rw-r--r-- | src/ipc/interfaces.cpp | 2 | ||||
-rw-r--r-- | src/qt/utilitydialog.cpp | 2 | ||||
-rw-r--r-- | src/streams.h | 2 |
7 files changed, 6 insertions, 9 deletions
diff --git a/build_msvc/bitcoin_config.h.in b/build_msvc/bitcoin_config.h.in index dad44e6228..6cdaf4b2b1 100644 --- a/build_msvc/bitcoin_config.h.in +++ b/build_msvc/bitcoin_config.h.in @@ -146,9 +146,6 @@ /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 -/* Define to 1 if you have the <stdio.h> header file. */ -#define HAVE_STDIO_H 1 - /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 diff --git a/configure.ac b/configure.ac index 3791385a66..5b1ce4ed7e 100644 --- a/configure.ac +++ b/configure.ac @@ -1010,7 +1010,7 @@ if test "$TARGET_OS" = "darwin"; then AX_CHECK_LINK_FLAG([-Wl,-bind_at_load], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-bind_at_load"], [], [$LDFLAG_WERROR]) fi -AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h sys/types.h sys/stat.h sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h]) +AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdlib.h unistd.h sys/types.h sys/stat.h sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h]) AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],, [#include <sys/types.h> diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index d49dc72abf..010cac5920 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -27,9 +27,9 @@ #include <util/system.h> #include <util/translation.h> +#include <cstdio> #include <functional> #include <memory> -#include <stdio.h> static bool fCreateBlank; static std::map<std::string,UniValue> registers; diff --git a/src/httpserver.cpp b/src/httpserver.cpp index e68436cc2c..19caefe400 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -21,10 +21,10 @@ #include <util/threadnames.h> #include <util/translation.h> +#include <cstdio> #include <deque> #include <memory> #include <optional> -#include <stdio.h> #include <stdlib.h> #include <string> diff --git a/src/ipc/interfaces.cpp b/src/ipc/interfaces.cpp index 580590fde9..f4115db982 100644 --- a/src/ipc/interfaces.cpp +++ b/src/ipc/interfaces.cpp @@ -12,10 +12,10 @@ #include <tinyformat.h> #include <util/system.h> +#include <cstdio> #include <functional> #include <memory> #include <stdexcept> -#include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 4894cac905..331487b51d 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -17,7 +17,7 @@ #include <util/system.h> #include <util/strencodings.h> -#include <stdio.h> +#include <cstdio> #include <QCloseEvent> #include <QLabel> diff --git a/src/streams.h b/src/streams.h index f14d347380..24778ab331 100644 --- a/src/streams.h +++ b/src/streams.h @@ -13,11 +13,11 @@ #include <algorithm> #include <assert.h> +#include <cstdio> #include <ios> #include <limits> #include <optional> #include <stdint.h> -#include <stdio.h> #include <string.h> #include <string> #include <utility> |