diff --git a/src/secp256k1.c b/src/secp256k1.c index 47aa6d44fd..37c33d5968 100644 --- a/src/secp256k1.c +++ b/src/secp256k1.c @@ -35,28 +35,28 @@ #ifndef USE_EXTERNAL_DEFAULT_CALLBACKS #include #include -static void default_illegal_callback_fn(const char* str, void* data) { +static void secp256k1_default_illegal_callback_fn(const char* str, void* data) { (void)data; fprintf(stderr, "[libsecp256k1] illegal argument: %s\n", str); abort(); } -static void default_error_callback_fn(const char* str, void* data) { +static void secp256k1_default_error_callback_fn(const char* str, void* data) { (void)data; fprintf(stderr, "[libsecp256k1] internal consistency check failed: %s\n", str); abort(); } #else -void default_illegal_callback_fn(const char* str, void* data); -void default_error_callback_fn(const char* str, void* data); +void secp256k1_default_illegal_callback_fn(const char* str, void* data); +void secp256k1_default_error_callback_fn(const char* str, void* data); #endif static const secp256k1_callback default_illegal_callback = { - default_illegal_callback_fn, + secp256k1_default_illegal_callback_fn, NULL }; static const secp256k1_callback default_error_callback = { - default_error_callback_fn, + secp256k1_default_error_callback_fn, NULL }; @@ -70,8 +70,8 @@ struct secp256k1_context_struct { static const secp256k1_context secp256k1_context_no_precomp_ = { { 0 }, { 0 }, - { default_illegal_callback_fn, 0 }, - { default_error_callback_fn, 0 } + { secp256k1_default_illegal_callback_fn, 0 }, + { secp256k1_default_error_callback_fn, 0 } }; const secp256k1_context *secp256k1_context_no_precomp = &secp256k1_context_no_precomp_; @@ -122,7 +122,7 @@ void secp256k1_context_destroy(secp256k1_context* ctx) { void secp256k1_context_set_illegal_callback(secp256k1_context* ctx, void (*fun)(const char* message, void* data), const void* data) { ARG_CHECK_NO_RETURN(ctx != secp256k1_context_no_precomp); if (fun == NULL) { - fun = default_illegal_callback_fn; + fun = secp256k1_default_illegal_callback_fn; } ctx->illegal_callback.fn = fun; ctx->illegal_callback.data = data; @@ -131,7 +131,7 @@ void secp256k1_context_set_illegal_callback(secp256k1_context* ctx, void (*fun)( void secp256k1_context_set_error_callback(secp256k1_context* ctx, void (*fun)(const char* message, void* data), const void* data) { ARG_CHECK_NO_RETURN(ctx != secp256k1_context_no_precomp); if (fun == NULL) { - fun = default_error_callback_fn; + fun = secp256k1_default_error_callback_fn; } ctx->error_callback.fn = fun; ctx->error_callback.data = data;