Skip to content

Commit 926dd3e

Browse files
Merge #1295: abi: Use dllexport for mingw builds
bc7c8db abi: Use dllexport for mingw builds (Cory Fields) Pull request description: Addresses the first part of #1181. See the discussion there for more context and history. After this, all that remains is a (platform-independent) exports checker for c-i. Or perhaps a linker script or .def file could be tricked into testing as a side-effect. This should fix mingw exports, specifically hiding the following: `secp256k1_pre_g_128` `secp256k1_pre_g` `secp256k1_ecmult_gen_prec_table` This changes our visibility macros to look more like [gcc's recommendation](https://gcc.gnu.org/wiki/Visibility#How_to_use_the_new_C.2B-.2B-_visibility_support). Edit: Note that we could further complicate this by supporting `__attribute__ ((dllexport))` as well, though I didn't bother as I'm not sure what compiler combo would accept that but not the bare dllexport syntax. Edit2: As the title implies, this affects this ABI and could affect downstream libs/apps in unintended ways (though it's hard to imagine any real downside). Though because it's win32 only, I'm imagining very little real-world impact at all. ACKs for top commit: hebasto: re-ACK bc7c8db, only a comment has been adjusted since my recent [review](#1295 (review)), real-or-random: utACK bc7c8db Tree-SHA512: 378e15556da49494f551bdf4f7b41304db9d03a435f21fcc947c9520aa43e3c655cfe216fba57a5179a871c975c806460eef7c33b105f2726e1de0937ff2444e
2 parents 1083683 + bc7c8db commit 926dd3e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/secp256k1.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ typedef int (*secp256k1_nonce_function)(
133133
# define SECP256K1_NO_BUILD
134134
#endif
135135

136-
/* Symbol visibility. See libtool manual, section "Windows DLLs". */
137-
#if defined(_WIN32) && !defined(__GNUC__)
136+
/* Symbol visibility. See https://gcc.gnu.org/wiki/Visibility */
137+
/* DLL_EXPORT is defined internally for shared builds */
138+
#if defined(_WIN32)
138139
# ifdef SECP256K1_BUILD
139140
# ifdef DLL_EXPORT
140141
# define SECP256K1_API __declspec (dllexport)

0 commit comments

Comments
 (0)