Skip to content

Commit 3e6078c

Browse files
committed
refactor: Replace SECP256K1_API_VAR with SECP256K1_API
1 parent 27b5d95 commit 3e6078c

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

include/secp256k1.h

+8-12
Original file line numberDiff line numberDiff line change
@@ -138,24 +138,20 @@ typedef int (*secp256k1_nonce_function)(
138138
#if defined(_WIN32)
139139
# ifdef SECP256K1_BUILD
140140
# ifdef DLL_EXPORT
141-
# define SECP256K1_API __declspec (dllexport)
142-
# define SECP256K1_API_VAR extern __declspec (dllexport)
141+
# define SECP256K1_API extern __declspec (dllexport)
143142
# endif
144143
/* The user must define SECP256K1_STATIC when consuming libsecp256k1 as a static
145144
* library on Windows. */
146145
# elif !defined(SECP256K1_STATIC)
147146
/* Consuming libsecp256k1 as a DLL. */
148-
# define SECP256K1_API __declspec (dllimport)
149-
# define SECP256K1_API_VAR extern __declspec (dllimport)
147+
# define SECP256K1_API extern __declspec (dllimport)
150148
# endif
151149
#endif
152150
#ifndef SECP256K1_API
153151
# if defined(__GNUC__) && (__GNUC__ >= 4) && defined(SECP256K1_BUILD)
154-
# define SECP256K1_API __attribute__ ((visibility ("default")))
155-
# define SECP256K1_API_VAR extern __attribute__ ((visibility ("default")))
152+
# define SECP256K1_API extern __attribute__ ((visibility ("default")))
156153
# else
157-
# define SECP256K1_API
158-
# define SECP256K1_API_VAR extern
154+
# define SECP256K1_API extern
159155
# endif
160156
#endif
161157

@@ -227,10 +223,10 @@ typedef int (*secp256k1_nonce_function)(
227223
*
228224
* It is highly recommended to call secp256k1_selftest before using this context.
229225
*/
230-
SECP256K1_API_VAR const secp256k1_context *secp256k1_context_static;
226+
SECP256K1_API const secp256k1_context *secp256k1_context_static;
231227

232228
/** Deprecated alias for secp256k1_context_static. */
233-
SECP256K1_API_VAR const secp256k1_context *secp256k1_context_no_precomp
229+
SECP256K1_API const secp256k1_context *secp256k1_context_no_precomp
234230
SECP256K1_DEPRECATED("Use secp256k1_context_static instead");
235231

236232
/** Perform basic self tests (to be used in conjunction with secp256k1_context_static)
@@ -627,10 +623,10 @@ SECP256K1_API int secp256k1_ecdsa_signature_normalize(
627623
* If a data pointer is passed, it is assumed to be a pointer to 32 bytes of
628624
* extra entropy.
629625
*/
630-
SECP256K1_API_VAR const secp256k1_nonce_function secp256k1_nonce_function_rfc6979;
626+
SECP256K1_API const secp256k1_nonce_function secp256k1_nonce_function_rfc6979;
631627

632628
/** A default safe nonce generation function (currently equal to secp256k1_nonce_function_rfc6979). */
633-
SECP256K1_API_VAR const secp256k1_nonce_function secp256k1_nonce_function_default;
629+
SECP256K1_API const secp256k1_nonce_function secp256k1_nonce_function_default;
634630

635631
/** Create an ECDSA signature.
636632
*

include/secp256k1_ecdh.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ typedef int (*secp256k1_ecdh_hash_function)(
2727

2828
/** An implementation of SHA256 hash function that applies to compressed public key.
2929
* Populates the output parameter with 32 bytes. */
30-
SECP256K1_API_VAR const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_sha256;
30+
SECP256K1_API const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_sha256;
3131

3232
/** A default ECDH hash function (currently equal to secp256k1_ecdh_hash_function_sha256).
3333
* Populates the output parameter with 32 bytes. */
34-
SECP256K1_API_VAR const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_default;
34+
SECP256K1_API const secp256k1_ecdh_hash_function secp256k1_ecdh_hash_function_default;
3535

3636
/** Compute an EC Diffie-Hellman secret in constant time
3737
*

include/secp256k1_ellswift.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ typedef int (*secp256k1_ellswift_xdh_hash_function)(
7272
/** An implementation of an secp256k1_ellswift_xdh_hash_function which uses
7373
* SHA256(prefix64 || ell_a64 || ell_b64 || x32), where prefix64 is the 64-byte
7474
* array pointed to by data. */
75-
SECP256K1_API_VAR const secp256k1_ellswift_xdh_hash_function secp256k1_ellswift_xdh_hash_function_prefix;
75+
SECP256K1_API const secp256k1_ellswift_xdh_hash_function secp256k1_ellswift_xdh_hash_function_prefix;
7676

7777
/** An implementation of an secp256k1_ellswift_xdh_hash_function compatible with
7878
* BIP324. It returns H_tag(ell_a64 || ell_b64 || x32), where H_tag is the
7979
* BIP340 tagged hash function with tag "bip324_ellswift_xonly_ecdh". Equivalent
8080
* to secp256k1_ellswift_xdh_hash_function_prefix with prefix64 set to
8181
* SHA256("bip324_ellswift_xonly_ecdh")||SHA256("bip324_ellswift_xonly_ecdh").
8282
* The data argument is ignored. */
83-
SECP256K1_API_VAR const secp256k1_ellswift_xdh_hash_function secp256k1_ellswift_xdh_hash_function_bip324;
83+
SECP256K1_API const secp256k1_ellswift_xdh_hash_function secp256k1_ellswift_xdh_hash_function_bip324;
8484

8585
/** Construct a 64-byte ElligatorSwift encoding of a given pubkey.
8686
*

include/secp256k1_schnorrsig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ typedef int (*secp256k1_nonce_function_hardened)(
6161
* Therefore, to create BIP-340 compliant signatures, algo must be set to
6262
* "BIP0340/nonce" and algolen to 13.
6363
*/
64-
SECP256K1_API_VAR const secp256k1_nonce_function_hardened secp256k1_nonce_function_bip340;
64+
SECP256K1_API const secp256k1_nonce_function_hardened secp256k1_nonce_function_bip340;
6565

6666
/** Data structure that contains additional arguments for schnorrsig_sign_custom.
6767
*

0 commit comments

Comments
 (0)