Skip to content

Commit 4d25990

Browse files
build: Add #ifdefs for requesting import as DLL vs static explicitly
1 parent 85aecf4 commit 4d25990

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/secp256k1.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ typedef int (*secp256k1_nonce_function)(
141141
# define SECP256K1_API __declspec (dllexport)
142142
# define SECP256K1_API_VAR extern __declspec (dllexport)
143143
# endif
144+
# elif defined(SECP256K1_IMPORT_AS_STATICLIB) && defined(SECP256K1_IMPORT_AS_DLL)
145+
# error "At most one of SECP256K1_IMPORT_AS_STATICLIB and SECP256K1_IMPORT_AS_DLL must be defined."
146+
# elif defined(SECP256K1_IMPORT_AS_STATICLIB)
147+
# define SECP256K1_API
148+
# define SECP256K1_API_VAR extern
149+
# elif defined(SECP256K1_IMPORT_AS_DLL)
150+
# define SECP256K1_API __declspec (dllimport)
151+
# define SECP256K1_API_VAR extern __declspec (dllimport)
144152
# elif defined _MSC_VER
145153
# define SECP256K1_API
146154
# define SECP256K1_API_VAR extern __declspec (dllimport)

0 commit comments

Comments
 (0)