File tree Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ std = ["rand/std"]
33
33
recovery = []
34
34
endomorphism = []
35
35
lowmemory = []
36
+ dont_replace_c_symbols = []
36
37
37
38
[dev-dependencies ]
38
39
rand = " 0.6"
Original file line number Diff line number Diff line change @@ -52,14 +52,15 @@ fn main() {
52
52
. define ( "USE_NUM_NONE" , Some ( "1" ) )
53
53
. define ( "USE_FIELD_INV_BUILTIN" , Some ( "1" ) )
54
54
. define ( "USE_SCALAR_INV_BUILTIN" , Some ( "1" ) )
55
- . define ( "ENABLE_MODULE_ECDH" , Some ( "1" ) )
56
- . define ( "USE_EXTERNAL_DEFAULT_CALLBACKS" , Some ( "1" ) ) ;
55
+ . define ( "ENABLE_MODULE_ECDH" , Some ( "1" ) ) ;
57
56
58
57
if cfg ! ( feature = "lowmemory" ) {
59
58
base_config. define ( "ECMULT_WINDOW_SIZE" , Some ( "4" ) ) ; // A low-enough value to consume neglible memory
60
59
} else {
61
60
base_config. define ( "ECMULT_WINDOW_SIZE" , Some ( "15" ) ) ; // This is the default in the configure file (`auto`)
62
61
}
62
+ #[ cfg( not( feature = "dont_replace_c_symbols" ) ) ]
63
+ base_config. define ( "USE_EXTERNAL_DEFAULT_CALLBACKS" , Some ( "1" ) ) ;
63
64
#[ cfg( feature = "endomorphism" ) ]
64
65
base_config. define ( "USE_ENDOMORPHISM" , Some ( "1" ) ) ;
65
66
#[ cfg( feature = "recovery" ) ]
Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ extern "C" {
256
256
}
257
257
258
258
259
- #[ cfg( feature = "std" ) ]
259
+ #[ cfg( all ( feature = "std" , not ( feature = "dont_replace_c_symbols" ) ) ) ]
260
260
#[ no_mangle]
261
261
/// A reimplementation of the C function `secp256k1_context_create` in rust.
262
262
///
@@ -281,7 +281,7 @@ pub unsafe extern "C" fn secp256k1_context_create(flags: c_uint) -> *mut Context
281
281
secp256k1_context_preallocated_create ( ptr as * mut c_void , flags)
282
282
}
283
283
284
- #[ cfg( feature = "std" ) ]
284
+ #[ cfg( all ( feature = "std" , not ( feature = "dont_replace_c_symbols" ) ) ) ]
285
285
#[ no_mangle]
286
286
/// A reimplementation of the C function `secp256k1_context_destroy` in rust.
287
287
///
@@ -300,6 +300,7 @@ pub unsafe extern "C" fn secp256k1_context_destroy(ctx: *mut Context) {
300
300
}
301
301
302
302
303
+ #[ cfg( not( feature = "dont_replace_c_symbols" ) ) ]
303
304
#[ no_mangle]
304
305
/// **This function is an override for the C function, this is the an edited version of the original description:**
305
306
///
@@ -326,6 +327,7 @@ pub unsafe extern "C" fn secp256k1_default_illegal_callback_fn(message: *const c
326
327
panic ! ( "[libsecp256k1] illegal argument. {}" , msg) ;
327
328
}
328
329
330
+ #[ cfg( not( feature = "dont_replace_c_symbols" ) ) ]
329
331
#[ no_mangle]
330
332
/// **This function is an override for the C function, this is the an edited version of the original description:**
331
333
///
Original file line number Diff line number Diff line change @@ -717,6 +717,7 @@ mod tests {
717
717
718
718
719
719
#[ test]
720
+ #[ cfg( not( feature = "dont_replace_c_symbols" ) ) ]
720
721
fn test_manual_create_destroy ( ) {
721
722
let ctx_full = unsafe { ffi:: secp256k1_context_create ( AllPreallocated :: FLAGS ) } ;
722
723
let ctx_sign = unsafe { ffi:: secp256k1_context_create ( SignOnlyPreallocated :: FLAGS ) } ;
You can’t perform that action at this time.
0 commit comments