Skip to content

Commit 6077065

Browse files
include: Avoid visibility("default") on Windows
Fixes #1421.
1 parent 1988855 commit 6077065

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/secp256k1.h

+8
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ typedef int (*secp256k1_nonce_function)(
147147
* 1. If using Libtool, it defines DLL_EXPORT automatically.
148148
* 2. In other cases, SECP256K1_DLL_EXPORT must be defined. */
149149
# define SECP256K1_API extern __declspec (dllexport)
150+
# else
151+
/* Building libsecp256k1 as a static library on Windows.
152+
* No declspec is needed. One may be tempted to set
153+
* __attribute__ ((visibility("default"))), but this may trigger warnings on
154+
* GCC when compiling with -flto, despite the GCC manual (Section "Common
155+
* Function Attributes") claiming that default visibility is supported
156+
* everywhere, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116478 . */
157+
# define SECP256K1_API extern
150158
# endif
151159
/* The user must define SECP256K1_STATIC when consuming libsecp256k1 as a static
152160
* library on Windows. */

0 commit comments

Comments
 (0)