Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of #735 to secp256k1-sys 0.10 #736

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -1,4 +1,4 @@
# This file is automatically @generated by Cargo.

Check warning on line 1 in Cargo-recent.lock

View workflow job for this annotation

GitHub Actions / Test - beta toolchain

Dependencies could be updated

Check warning on line 1 in Cargo-recent.lock

View workflow job for this annotation

GitHub Actions / Test - 1.56.1 toolchain

Dependencies could be updated
# It is not intended for manual editing.
version = 3

Expand Down Expand Up @@ -194,7 +194,7 @@

[[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
Loading