File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,12 @@ typedef int (*secp256k1_nonce_function)(
134134#endif
135135
136136/* Symbol visibility. See https://gcc.gnu.org/wiki/Visibility */
137- /* DLL_EXPORT is defined internally for shared builds */
138137#if defined(_WIN32 )
139- # ifdef SECP256K1_BUILD
140- # ifdef DLL_EXPORT
138+ # if defined(SECP256K1_BUILD )
139+ # if defined(DLL_EXPORT ) || defined(SECP256K1_DLL_EXPORT )
140+ /* Building libsecp256k1 as a DLL.
141+ * 1. If using Libtool, it defines DLL_EXPORT automatically.
142+ * 2. In other cases, SECP256K1_DLL_EXPORT must be defined. */
141143# define SECP256K1_API extern __declspec (dllexport)
142144# endif
143145 /* The user must define SECP256K1_STATIC when consuming libsecp256k1 as a static
Original file line number Diff line number Diff line change @@ -20,10 +20,9 @@ if(SECP256K1_ASM STREQUAL "arm32")
2020 target_link_libraries (secp256k1_asm INTERFACE secp256k1_asm_arm)
2121endif ()
2222
23- # Define our export symbol only for Win32 and only for shared libs.
24- # This matches libtool's usage of DLL_EXPORT
2523if (WIN32 )
26- set_target_properties (secp256k1 PROPERTIES DEFINE_SYMBOL "DLL_EXPORT" )
24+ # Define our export symbol only for shared libs.
25+ set_target_properties (secp256k1 PROPERTIES DEFINE_SYMBOL SECP256K1_DLL_EXPORT)
2726 target_compile_definitions (secp256k1 INTERFACE $<$<NOT :$<BOOL :${BUILD_SHARED_LIBS} >>:SECP256K1_STATIC>)
2827endif ()
2928
You can’t perform that action at this time.
0 commit comments