Skip to content

Commit d74b0be

Browse files
committed
refactor: Replace SECP256K1_API_VAR with SECP256K1_API
1 parent 7e93886 commit d74b0be

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

include/secp256k1.h

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ 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 __declspec (dllexport)
143142
# endif
144143
/* The user must define SECP256K1_STATIC when consuming libsecp256k1 as a static
145144
* library. */
@@ -148,17 +147,14 @@ typedef int (*secp256k1_nonce_function)(
148147
* It does not depend on the Libtool's assumption that if a DLL is being built
149148
* (DLL_EXPORT is defined) then that DLL is going to consume any dependent libraries
150149
* as DLLs. See "Windows DLLs" in the Libtool manual. */
151-
# define SECP256K1_API __declspec (dllimport)
152-
# define SECP256K1_API_VAR extern __declspec (dllimport)
150+
# define SECP256K1_API __declspec (dllimport)
153151
# endif
154152
#endif
155153
#ifndef SECP256K1_API
156154
# if defined(__GNUC__) && (__GNUC__ >= 4) && defined(SECP256K1_BUILD)
157-
# define SECP256K1_API __attribute__ ((visibility ("default")))
158-
# define SECP256K1_API_VAR extern __attribute__ ((visibility ("default")))
155+
# define SECP256K1_API __attribute__ ((visibility ("default")))
159156
# else
160157
# define SECP256K1_API
161-
# define SECP256K1_API_VAR extern
162158
# endif
163159
#endif
164160

@@ -230,10 +226,10 @@ typedef int (*secp256k1_nonce_function)(
230226
*
231227
* It is highly recommended to call secp256k1_selftest before using this context.
232228
*/
233-
SECP256K1_API_VAR const secp256k1_context *secp256k1_context_static;
229+
SECP256K1_API extern const secp256k1_context *secp256k1_context_static;
234230

235231
/** Deprecated alias for secp256k1_context_static. */
236-
SECP256K1_API_VAR const secp256k1_context *secp256k1_context_no_precomp
232+
SECP256K1_API extern const secp256k1_context *secp256k1_context_no_precomp
237233
SECP256K1_DEPRECATED("Use secp256k1_context_static instead");
238234

239235
/** Perform basic self tests (to be used in conjunction with secp256k1_context_static)
@@ -630,10 +626,10 @@ SECP256K1_API int secp256k1_ecdsa_signature_normalize(
630626
* If a data pointer is passed, it is assumed to be a pointer to 32 bytes of
631627
* extra entropy.
632628
*/
633-
SECP256K1_API_VAR const secp256k1_nonce_function secp256k1_nonce_function_rfc6979;
629+
SECP256K1_API extern const secp256k1_nonce_function secp256k1_nonce_function_rfc6979;
634630

635631
/** A default safe nonce generation function (currently equal to secp256k1_nonce_function_rfc6979). */
636-
SECP256K1_API_VAR const secp256k1_nonce_function secp256k1_nonce_function_default;
632+
SECP256K1_API extern const secp256k1_nonce_function secp256k1_nonce_function_default;
637633

638634
/** Create an ECDSA signature.
639635
*

include/secp256k1_ecdh.h

Lines changed: 2 additions & 2 deletions
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 extern 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 extern 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

Lines changed: 2 additions & 2 deletions
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 extern 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 extern 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

Lines changed: 1 addition & 1 deletion
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 extern 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)