@@ -137,6 +137,7 @@ secp256k1_context* secp256k1_context_preallocated_create(void* prealloc, unsigne
137137 return ret ;
138138}
139139
140+ #if SECP256K1_HAVE_STDLIB_H
140141secp256k1_context * secp256k1_context_create (unsigned int flags ) {
141142 size_t const prealloc_size = secp256k1_context_preallocated_size (flags );
142143 secp256k1_context * ctx = (secp256k1_context * )checked_malloc (& default_error_callback , prealloc_size );
@@ -147,6 +148,7 @@ secp256k1_context* secp256k1_context_create(unsigned int flags) {
147148
148149 return ctx ;
149150}
151+ #endif
150152
151153secp256k1_context * secp256k1_context_preallocated_clone (const secp256k1_context * ctx , void * prealloc ) {
152154 secp256k1_context * ret ;
@@ -159,6 +161,7 @@ secp256k1_context* secp256k1_context_preallocated_clone(const secp256k1_context*
159161 return ret ;
160162}
161163
164+ #if SECP256K1_HAVE_STDLIB_H
162165secp256k1_context * secp256k1_context_clone (const secp256k1_context * ctx ) {
163166 secp256k1_context * ret ;
164167 size_t prealloc_size ;
@@ -171,6 +174,7 @@ secp256k1_context* secp256k1_context_clone(const secp256k1_context* ctx) {
171174 ret = secp256k1_context_preallocated_clone (ctx , ret );
172175 return ret ;
173176}
177+ #endif
174178
175179void secp256k1_context_preallocated_destroy (secp256k1_context * ctx ) {
176180 ARG_CHECK_VOID (ctx == NULL || secp256k1_context_is_proper (ctx ));
@@ -183,6 +187,7 @@ void secp256k1_context_preallocated_destroy(secp256k1_context* ctx) {
183187 secp256k1_ecmult_gen_context_clear (& ctx -> ecmult_gen_ctx );
184188}
185189
190+ #if SECP256K1_HAVE_STDLIB_H
186191void secp256k1_context_destroy (secp256k1_context * ctx ) {
187192 ARG_CHECK_VOID (ctx == NULL || secp256k1_context_is_proper (ctx ));
188193
@@ -194,6 +199,7 @@ void secp256k1_context_destroy(secp256k1_context* ctx) {
194199 secp256k1_context_preallocated_destroy (ctx );
195200 free (ctx );
196201}
202+ #endif
197203
198204void secp256k1_context_set_illegal_callback (secp256k1_context * ctx , void (* fun )(const char * message , void * data ), const void * data ) {
199205 /* We compare pointers instead of checking secp256k1_context_is_proper() here
@@ -219,6 +225,7 @@ void secp256k1_context_set_error_callback(secp256k1_context* ctx, void (*fun)(co
219225 ctx -> error_callback .data = data ;
220226}
221227
228+ #if SECP256K1_HAVE_STDLIB_H
222229secp256k1_scratch_space * secp256k1_scratch_space_create (const secp256k1_context * ctx , size_t max_size ) {
223230 VERIFY_CHECK (ctx != NULL );
224231 return secp256k1_scratch_create (& ctx -> error_callback , max_size );
@@ -228,6 +235,7 @@ void secp256k1_scratch_space_destroy(const secp256k1_context *ctx, secp256k1_scr
228235 VERIFY_CHECK (ctx != NULL );
229236 secp256k1_scratch_destroy (& ctx -> error_callback , scratch );
230237}
238+ #endif
231239
232240/* Mark memory as no-longer-secret for the purpose of analysing constant-time behaviour
233241 * of the software.
0 commit comments