Skip to content

Commit

Permalink
include: Avoid visibility("default") on Windows
Browse files Browse the repository at this point in the history
Fixes #1421.
  • Loading branch information
real-or-random committed Aug 24, 2024
1 parent 1988855 commit 5eb211a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/secp256k1.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 5eb211a

Please sign in to comment.