Skip to content

Commit d185a6f

Browse files
committed
Conditionally depend on stdio.h
The header `stdio.h` is only needed to get access to `fprintf` used 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 Fix: #1095
1 parent a43e982 commit d185a6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/util.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313

1414
#include <stdlib.h>
1515
#include <stdint.h>
16-
#include <stdio.h>
1716
#include <limits.h>
1817

18+
#ifndef USE_EXTERNAL_DEFAULT_CALLBACKS
19+
#include <stdio.h> /* for fprintf */
20+
#endif
21+
1922
#define STR_(x) #x
2023
#define STR(x) STR_(x)
2124
#define DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x

0 commit comments

Comments
 (0)