Skip to content

Commit

Permalink
Merge #86: fix: WASM
Browse files Browse the repository at this point in the history
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
  • Loading branch information
apoelstra committed Oct 18, 2024
2 parents af1d134 + 454a9aa commit 0a3e73c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
20 changes: 0 additions & 20 deletions secp256k1-zkp-sys/depend/secp256k1/src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@
#define DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x
#define DEBUG_CONFIG_DEF(x) DEBUG_CONFIG_MSG(#x "=" STR(x))

/* Debug helper for printing arrays of unsigned char. */
#define PRINT_BUF(buf, len) do { \
printf("%s[%lu] = ", #buf, (unsigned long)len); \
print_buf_plain(buf, len); \
} while(0)

static void print_buf_plain(const unsigned char *buf, size_t len) {
size_t i;
printf("{");
for (i = 0; i < len; i++) {
if (i % 8 == 0) {
printf("\n ");
} else {
printf(" ");
}
printf("0x%02X,", buf[i]);
}
printf("\n}\n");
}

# if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
# if SECP256K1_GNUC_PREREQ(2,7)
# define SECP256K1_INLINE __inline__
Expand Down
31 changes: 29 additions & 2 deletions secp256k1-zkp-sys/depend/util.h.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
diff --git a/secp256k1-zkp-sys/depend/secp256k1/src/util.h b/secp256k1-zkp-sys/depend/secp256k1/src/util.h
index 10ea516..4066d2a 100644
index 10ea516..2c53866 100644
--- a/secp256k1-zkp-sys/depend/secp256k1/src/util.h
+++ b/secp256k1-zkp-sys/depend/secp256k1/src/util.h
@@ -153,14 +153,6 @@ static const secp256k1_callback default_error_callback = {
@@ -19,26 +19,6 @@
#define DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x
#define DEBUG_CONFIG_DEF(x) DEBUG_CONFIG_MSG(#x "=" STR(x))

-/* Debug helper for printing arrays of unsigned char. */
-#define PRINT_BUF(buf, len) do { \
- printf("%s[%lu] = ", #buf, (unsigned long)len); \
- print_buf_plain(buf, len); \
-} while(0)
-
-static void print_buf_plain(const unsigned char *buf, size_t len) {
- size_t i;
- printf("{");
- for (i = 0; i < len; i++) {
- if (i % 8 == 0) {
- printf("\n ");
- } else {
- printf(" ");
- }
- printf("0x%02X,", buf[i]);
- }
- printf("\n}\n");
-}
-
# if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
# if SECP256K1_GNUC_PREREQ(2,7)
# define SECP256K1_INLINE __inline__
@@ -153,14 +133,6 @@ static const secp256k1_callback default_error_callback = {
#define VERIFY_CHECK(cond)
#endif

Expand Down

0 comments on commit 0a3e73c

Please sign in to comment.