Skip to content

Commit ec13810

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#26159: build: Remove stdlib.h from header checks
553ff45 build: remove stdlib.h from header checks (fanquake) a63d4cb refactor: use <cstdlib> over stdlib.h (fanquake) Pull request description: We already use a mix of `<cstlib>` and `stdlib.h` unconditionally throughout the codebase. Us checking this header also duplicates work already done by autotools. Currently stdlib.h is checked for 3 times during a ./configure run, after this change, at least it's only twice. Similar to #26150. ACKs for top commit: kristapsk: ACK 553ff45 TheCharlatan: ACK 553ff45 Tree-SHA512: 0a43d39d3df180a1614dbd3a1ee1531b0969ffe4a0c09dfe9d2f3f0ec16196b5fd7523309f6722936a8c8b20908508724e1903e939dd81c3b4538d85d0f42953
2 parents 0cfbb17 + 553ff45 commit ec13810

23 files changed

+24
-25
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ if test "$TARGET_OS" = "darwin"; then
10101010
AX_CHECK_LINK_FLAG([-Wl,-bind_at_load], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-bind_at_load"], [], [$LDFLAG_WERROR])
10111011
fi
10121012

1013-
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])
1013+
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.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])
10141014

10151015
AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],,
10161016
[#include <sys/types.h>

src/consensus/consensus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef BITCOIN_CONSENSUS_CONSENSUS_H
77
#define BITCOIN_CONSENSUS_CONSENSUS_H
88

9-
#include <stdlib.h>
9+
#include <cstdlib>
1010
#include <stdint.h>
1111

1212
/** The maximum allowed size for a serialized block, in bytes (only for buffer size limits) */

src/crypto/chacha20.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#ifndef BITCOIN_CRYPTO_CHACHA20_H
66
#define BITCOIN_CRYPTO_CHACHA20_H
77

8+
#include <cstdlib>
89
#include <stdint.h>
9-
#include <stdlib.h>
1010

1111
/** A class for ChaCha20 256-bit stream cipher developed by Daniel J. Bernstein
1212
https://cr.yp.to/chacha/chacha-20080128.pdf */

src/crypto/hkdf_sha256_32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#include <crypto/hmac_sha256.h>
99

10+
#include <cstdlib>
1011
#include <stdint.h>
11-
#include <stdlib.h>
1212

1313
/** A rfc5869 HKDF implementation with HMAC_SHA256 and fixed key output length of 32 bytes (L=32) */
1414
class CHKDF_HMAC_SHA256_L32

src/crypto/hmac_sha256.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#include <crypto/sha256.h>
99

10+
#include <cstdlib>
1011
#include <stdint.h>
11-
#include <stdlib.h>
1212

1313
/** A hasher class for HMAC-SHA-256. */
1414
class CHMAC_SHA256

src/crypto/hmac_sha512.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#include <crypto/sha512.h>
99

10+
#include <cstdlib>
1011
#include <stdint.h>
11-
#include <stdlib.h>
1212

1313
/** A hasher class for HMAC-SHA-512. */
1414
class CHMAC_SHA512

src/crypto/poly1305.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#ifndef BITCOIN_CRYPTO_POLY1305_H
66
#define BITCOIN_CRYPTO_POLY1305_H
77

8+
#include <cstdlib>
89
#include <stdint.h>
9-
#include <stdlib.h>
1010

1111
#define POLY1305_KEYLEN 32
1212
#define POLY1305_TAGLEN 16

src/crypto/ripemd160.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#ifndef BITCOIN_CRYPTO_RIPEMD160_H
66
#define BITCOIN_CRYPTO_RIPEMD160_H
77

8+
#include <cstdlib>
89
#include <stdint.h>
9-
#include <stdlib.h>
1010

1111
/** A hasher class for RIPEMD-160. */
1212
class CRIPEMD160

src/crypto/sha1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#ifndef BITCOIN_CRYPTO_SHA1_H
66
#define BITCOIN_CRYPTO_SHA1_H
77

8+
#include <cstdlib>
89
#include <stdint.h>
9-
#include <stdlib.h>
1010

1111
/** A hasher class for SHA1. */
1212
class CSHA1

src/crypto/sha256.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#ifndef BITCOIN_CRYPTO_SHA256_H
66
#define BITCOIN_CRYPTO_SHA256_H
77

8+
#include <cstdlib>
89
#include <stdint.h>
9-
#include <stdlib.h>
1010
#include <string>
1111

1212
/** A hasher class for SHA-256. */

0 commit comments

Comments
 (0)