diff --git a/include/secp256k1.h b/include/secp256k1.h index cfbdd528c2..b0a03043bf 100644 --- a/include/secp256k1.h +++ b/include/secp256k1.h @@ -147,6 +147,14 @@ typedef int (*secp256k1_nonce_function)( * 1. If using Libtool, it defines DLL_EXPORT automatically. * 2. In other cases, SECP256K1_DLL_EXPORT must be defined. */ # define SECP256K1_API extern __declspec (dllexport) +# else + /* Building libsecp256k1 as a static library on Windows. + * No declspec is needed. One may be tempted to set + * __attribute__ ((visibility("default"))), but this may trigger warnings on + * GCC when compiling with -flto, despite the GCC manual (Section "Common + * Function Attributes") claiming that default visibility is supported + * everywhere, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116478. */ +# define SECP256K1_API extern # endif /* The user must define SECP256K1_STATIC when consuming libsecp256k1 as a static * library on Windows. */