secp256k1-sys: patch out checked_malloc
This commit is contained in:
parent
942a0e5e2c
commit
7a0c60edcd
|
@ -145,11 +145,9 @@ static const rustsecp256k1_v0_9_0_callback default_error_callback = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static SECP256K1_INLINE void *checked_malloc(const rustsecp256k1_v0_9_0_callback* cb, size_t size) {
|
static SECP256K1_INLINE void *checked_malloc(const rustsecp256k1_v0_9_0_callback* cb, size_t size) {
|
||||||
void *ret = malloc(size);
|
(void) cb;
|
||||||
if (ret == NULL) {
|
(void) size;
|
||||||
rustsecp256k1_v0_9_0_callback_call(cb, "Out of memory");
|
return NULL;
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__BIGGEST_ALIGNMENT__)
|
#if defined(__BIGGEST_ALIGNMENT__)
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
148,152c148,150
|
||||||
|
< void *ret = malloc(size);
|
||||||
|
< if (ret == NULL) {
|
||||||
|
< secp256k1_callback_call(cb, "Out of memory");
|
||||||
|
< }
|
||||||
|
< return ret;
|
||||||
|
---
|
||||||
|
> (void) cb;
|
||||||
|
> (void) size;
|
||||||
|
> return NULL;
|
|
@ -97,6 +97,7 @@ echo "$SOURCE_REV" >> ./secp256k1-HEAD-revision.txt
|
||||||
patch "$DIR/include/secp256k1.h" "./secp256k1.h.patch"
|
patch "$DIR/include/secp256k1.h" "./secp256k1.h.patch"
|
||||||
patch "$DIR/src/secp256k1.c" "./secp256k1.c.patch"
|
patch "$DIR/src/secp256k1.c" "./secp256k1.c.patch"
|
||||||
patch "$DIR/src/scratch_impl.h" "./scratch_impl.h.patch"
|
patch "$DIR/src/scratch_impl.h" "./scratch_impl.h.patch"
|
||||||
|
patch "$DIR/src/util.h" "./util.h.patch"
|
||||||
|
|
||||||
# Fix a linking error while cross-compiling to windowns with mingw
|
# Fix a linking error while cross-compiling to windowns with mingw
|
||||||
patch "$DIR/contrib/lax_der_parsing.c" "./lax_der_parsing.c.patch"
|
patch "$DIR/contrib/lax_der_parsing.c" "./lax_der_parsing.c.patch"
|
||||||
|
|
Loading…
Reference in New Issue