Skip to content

Commit 1309c03

Browse files
committed
Fix some compile problems on weird/old compilers.
The visibility attribute is a GCC 4+ feature. GCC 2.95 also warns about the unsigned/signed comparision.
1 parent 2309c7d commit 1309c03

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/secp256k1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ typedef int (*secp256k1_nonce_function)(
134134
# else
135135
# define SECP256K1_API
136136
# endif
137-
# elif defined(__GNUC__) && defined(SECP256K1_BUILD)
137+
# elif defined(__GNUC__) && (__GNUC__ >= 4) && defined(SECP256K1_BUILD)
138138
# define SECP256K1_API __attribute__ ((visibility ("default")))
139139
# else
140140
# define SECP256K1_API

src/secp256k1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ int secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *o
291291

292292
VERIFY_CHECK(ctx != NULL);
293293
ARG_CHECK(outputlen != NULL);
294-
ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33 : 65));
294+
ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33u : 65u));
295295
len = *outputlen;
296296
*outputlen = 0;
297297
ARG_CHECK(output != NULL);

0 commit comments

Comments
 (0)