@@ -137,6 +137,7 @@ secp256k1_context* secp256k1_context_preallocated_create(void* prealloc, unsigne
137
137
return ret ;
138
138
}
139
139
140
+ #if SECP256K1_HAVE_STDLIB_H
140
141
secp256k1_context * secp256k1_context_create (unsigned int flags ) {
141
142
size_t const prealloc_size = secp256k1_context_preallocated_size (flags );
142
143
secp256k1_context * ctx = (secp256k1_context * )checked_malloc (& default_error_callback , prealloc_size );
@@ -147,6 +148,7 @@ secp256k1_context* secp256k1_context_create(unsigned int flags) {
147
148
148
149
return ctx ;
149
150
}
151
+ #endif
150
152
151
153
secp256k1_context * secp256k1_context_preallocated_clone (const secp256k1_context * ctx , void * prealloc ) {
152
154
secp256k1_context * ret ;
@@ -159,6 +161,7 @@ secp256k1_context* secp256k1_context_preallocated_clone(const secp256k1_context*
159
161
return ret ;
160
162
}
161
163
164
+ #if SECP256K1_HAVE_STDLIB_H
162
165
secp256k1_context * secp256k1_context_clone (const secp256k1_context * ctx ) {
163
166
secp256k1_context * ret ;
164
167
size_t prealloc_size ;
@@ -171,6 +174,7 @@ secp256k1_context* secp256k1_context_clone(const secp256k1_context* ctx) {
171
174
ret = secp256k1_context_preallocated_clone (ctx , ret );
172
175
return ret ;
173
176
}
177
+ #endif
174
178
175
179
void secp256k1_context_preallocated_destroy (secp256k1_context * ctx ) {
176
180
ARG_CHECK_VOID (ctx == NULL || secp256k1_context_is_proper (ctx ));
@@ -183,6 +187,7 @@ void secp256k1_context_preallocated_destroy(secp256k1_context* ctx) {
183
187
secp256k1_ecmult_gen_context_clear (& ctx -> ecmult_gen_ctx );
184
188
}
185
189
190
+ #if SECP256K1_HAVE_STDLIB_H
186
191
void secp256k1_context_destroy (secp256k1_context * ctx ) {
187
192
ARG_CHECK_VOID (ctx == NULL || secp256k1_context_is_proper (ctx ));
188
193
@@ -194,6 +199,7 @@ void secp256k1_context_destroy(secp256k1_context* ctx) {
194
199
secp256k1_context_preallocated_destroy (ctx );
195
200
free (ctx );
196
201
}
202
+ #endif
197
203
198
204
void secp256k1_context_set_illegal_callback (secp256k1_context * ctx , void (* fun )(const char * message , void * data ), const void * data ) {
199
205
/* 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
219
225
ctx -> error_callback .data = data ;
220
226
}
221
227
228
+ #if SECP256K1_HAVE_STDLIB_H
222
229
secp256k1_scratch_space * secp256k1_scratch_space_create (const secp256k1_context * ctx , size_t max_size ) {
223
230
VERIFY_CHECK (ctx != NULL );
224
231
return secp256k1_scratch_create (& ctx -> error_callback , max_size );
@@ -228,6 +235,7 @@ void secp256k1_scratch_space_destroy(const secp256k1_context *ctx, secp256k1_scr
228
235
VERIFY_CHECK (ctx != NULL );
229
236
secp256k1_scratch_destroy (& ctx -> error_callback , scratch );
230
237
}
238
+ #endif
231
239
232
240
/* Mark memory as no-longer-secret for the purpose of analysing constant-time behaviour
233
241
* of the software.
0 commit comments