Skip to content

Commit

Permalink
Merge #736: Backport of #735 to secp256k1-sys 0.10
Browse files Browse the repository at this point in the history
21f67d5 secp256k1-sys: release 0.10.1 (Andrew Poelstra)
1f9f77b secp256k1-sys: update util.h patch to delete more stdio code (Andrew Poelstra)

Pull request description:

  This backports #735. I am PR'ing to the secp256k1-0.29.x branch because this will work and because it feels like unnecessary complication to try to create a secp256k1-sys-0.10.x branch, which might be "more correct" but would make our git tree harder to understand and maintain.

  As in #735, this just deletes some dead code from secp256k1-sys/depend/secp256k1.

ACKs for top commit:
  Kixunil:
    ACK 21f67d5

Tree-SHA512: 1b88cf2458250d1454696aabc7c85d76337033ac056deb9416f1487eefb504d01c627849b477f68438cf520242cbdef9de89aadb9dbe9f79c94244ce6c8348bf
  • Loading branch information
apoelstra committed Sep 11, 2024
2 parents 1a1fc57 + 21f67d5 commit ba04d92
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ dependencies = [

[[package]]
name = "secp256k1-sys"
version = "0.10.0"
version = "0.10.1"
dependencies = [
"cc",
"libc",
Expand Down
2 changes: 1 addition & 1 deletion Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ dependencies = [

[[package]]
name = "secp256k1-sys"
version = "0.10.0"
version = "0.10.1"
dependencies = [
"cc",
"libc",
Expand Down
4 changes: 4 additions & 0 deletions secp256k1-sys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.10.1 - 2024-09-10

* Minor build changes to eliminate references to stdio.h [#736](https://github.com/rust-bitcoin/rust-secp256k1/pull/736)

# 0.10.0 - 2024-03-28

* Bump MSRV to Rust `v1.56.1` [#693](https://github.com/rust-bitcoin/rust-secp256k1/pull/693)
Expand Down
2 changes: 1 addition & 1 deletion secp256k1-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "secp256k1-sys"
version = "0.10.0"
version = "0.10.1"
authors = [ "Dawid Ciężarkiewicz <[email protected]>",
"Andrew Poelstra <[email protected]>",
"Steven Roose <[email protected]>" ]
Expand Down
21 changes: 0 additions & 21 deletions secp256k1-sys/depend/secp256k1/src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,13 @@

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

#define STR_(x) #x
#define STR(x) STR_(x)
#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
25 changes: 24 additions & 1 deletion secp256k1-sys/depend/util.h.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
148,152c148,150
14d13
< #include <stdio.h>
22,41d20
< /* 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");
< }
<
148,152c127,129
< void *ret = malloc(size);
< if (ret == NULL) {
< secp256k1_callback_call(cb, "Out of memory");
Expand Down

0 comments on commit ba04d92

Please sign in to comment.