From b95633121bf32587fb24d22e5f26ddffb51cd7f7 Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 20 Sep 2022 11:21:33 +0100 Subject: [PATCH 1/2] refactor: use over stdio.h We currently use both. Consolidate on the former. --- src/bitcoin-tx.cpp | 2 +- src/httpserver.cpp | 2 +- src/ipc/interfaces.cpp | 2 +- src/qt/utilitydialog.cpp | 2 +- src/streams.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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 #include +#include #include #include -#include static bool fCreateBlank; static std::map 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 #include +#include #include #include #include -#include #include #include 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 #include +#include #include #include #include -#include #include #include #include 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 #include -#include +#include #include #include 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 #include +#include #include #include #include #include -#include #include #include #include From 55aad5f3a957296776cfd8d7a4a251361355b8e8 Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 20 Sep 2022 11:26:01 +0100 Subject: [PATCH 2/2] build: remove stdio.h from header checks We already use a mix of 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. --- build_msvc/bitcoin_config.h.in | 3 --- configure.ac | 2 +- 2 files changed, 1 insertion(+), 4 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 header file. */ #define HAVE_STDINT_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_STDIO_H 1 - /* Define to 1 if you have the 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