From 6dfbbb44c94c0d316deffc07c0b19813b911d5a0 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 3 Nov 2022 10:41:10 +1100 Subject: [PATCH] Conditionally depend on stdio.h The header `stdio.h` is only needed in code ifdef guarded by `USE_EXTERNAL_DEFAULT_CALLBACKS`, we can therefore guard the include statement in the same manner. The reason for doing this as that wasm builds in downstream user code have to patch in an empty `stdio.h` file in order to build because of this unconditional include. ref: https://github.com/rust-bitcoin/rust-secp256k1/blob/master/secp256k1-sys/depend/secp256k1.c.patch This patch does the first part of #1095 --- src/util.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util.h b/src/util.h index 0921e34f16..44bae3e17c 100644 --- a/src/util.h +++ b/src/util.h @@ -13,9 +13,12 @@ #include #include -#include #include +#ifndef USE_EXTERNAL_DEFAULT_CALLBACKS +#include +#endif + #define STR_(x) #x #define STR(x) STR_(x) #define DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x