Skip to content

Commit 0a3e73c

Browse files
committed
Merge #86: fix: WASM
454a9aa fix: Wasm doesn't build (Christian Lewe) Pull request description: Port of rust-bitcoin/rust-secp256k1#735 Let's see if this passes CI. I can run `cargo build --target wasm32-unknown-unknown` after my commit. Generating the `.patch` files was kind of hard. Is there an easy way? ACKs for top commit: apoelstra: ACK 454a9aa; successfully ran local tests; thanks!! Tree-SHA512: 84c41aed6ba8a592938e1888fccf0abcc09fc71a052c6616cb6e63f89474f8cf99e65058e07c2c992298cabd5e2fa6d5e7a3a9b3fc1fb14bb13800f8b1c01b00
2 parents af1d134 + 454a9aa commit 0a3e73c

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

secp256k1-zkp-sys/depend/secp256k1/src/util.h

-20
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,6 @@
1919
#define DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x
2020
#define DEBUG_CONFIG_DEF(x) DEBUG_CONFIG_MSG(#x "=" STR(x))
2121

22-
/* Debug helper for printing arrays of unsigned char. */
23-
#define PRINT_BUF(buf, len) do { \
24-
printf("%s[%lu] = ", #buf, (unsigned long)len); \
25-
print_buf_plain(buf, len); \
26-
} while(0)
27-
28-
static void print_buf_plain(const unsigned char *buf, size_t len) {
29-
size_t i;
30-
printf("{");
31-
for (i = 0; i < len; i++) {
32-
if (i % 8 == 0) {
33-
printf("\n ");
34-
} else {
35-
printf(" ");
36-
}
37-
printf("0x%02X,", buf[i]);
38-
}
39-
printf("\n}\n");
40-
}
41-
4222
# if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
4323
# if SECP256K1_GNUC_PREREQ(2,7)
4424
# define SECP256K1_INLINE __inline__

secp256k1-zkp-sys/depend/util.h.patch

+29-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
11
diff --git a/secp256k1-zkp-sys/depend/secp256k1/src/util.h b/secp256k1-zkp-sys/depend/secp256k1/src/util.h
2-
index 10ea516..4066d2a 100644
2+
index 10ea516..2c53866 100644
33
--- a/secp256k1-zkp-sys/depend/secp256k1/src/util.h
44
+++ b/secp256k1-zkp-sys/depend/secp256k1/src/util.h
5-
@@ -153,14 +153,6 @@ static const secp256k1_callback default_error_callback = {
5+
@@ -19,26 +19,6 @@
6+
#define DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x
7+
#define DEBUG_CONFIG_DEF(x) DEBUG_CONFIG_MSG(#x "=" STR(x))
8+
9+
-/* Debug helper for printing arrays of unsigned char. */
10+
-#define PRINT_BUF(buf, len) do { \
11+
- printf("%s[%lu] = ", #buf, (unsigned long)len); \
12+
- print_buf_plain(buf, len); \
13+
-} while(0)
14+
-
15+
-static void print_buf_plain(const unsigned char *buf, size_t len) {
16+
- size_t i;
17+
- printf("{");
18+
- for (i = 0; i < len; i++) {
19+
- if (i % 8 == 0) {
20+
- printf("\n ");
21+
- } else {
22+
- printf(" ");
23+
- }
24+
- printf("0x%02X,", buf[i]);
25+
- }
26+
- printf("\n}\n");
27+
-}
28+
-
29+
# if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
30+
# if SECP256K1_GNUC_PREREQ(2,7)
31+
# define SECP256K1_INLINE __inline__
32+
@@ -153,14 +133,6 @@ static const secp256k1_callback default_error_callback = {
633
#define VERIFY_CHECK(cond)
734
#endif
835

0 commit comments

Comments
 (0)