Skip to content

Commit

Permalink
Conditionally depend on stdio.h
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tcharding committed Nov 4, 2022
1 parent a43e982 commit 6dfbbb4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@

#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <limits.h>

#ifndef USE_EXTERNAL_DEFAULT_CALLBACKS
#include <stdio.h>
#endif

#define STR_(x) #x
#define STR(x) STR_(x)
#define DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x
Expand Down

0 comments on commit 6dfbbb4

Please sign in to comment.