File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,14 @@ typedef int (*secp256k1_nonce_function)(
133133# define SECP256K1_NO_BUILD
134134#endif
135135
136- /* Symbol visibility. See https://gcc.gnu.org/wiki/Visibility */
136+ /* Symbol visibility. */
137137#if defined(_WIN32 )
138+ /* GCC for Windows (e.g., MinGW) accepts the __declspec syntax
139+ * for MSVC compatibility. A __declspec declaration implies (but is not
140+ * exactly equivalent to) __attribute__ ((visibility("default"))), and so we
141+ * actually want __declspec even on GCC, see "Microsoft Windows Function
142+ * Attributes" in the GCC manual and the recommendations in
143+ * https://gcc.gnu.org/wiki/Visibility. */
138144# if defined(SECP256K1_BUILD )
139145# if defined(DLL_EXPORT ) || defined(SECP256K1_DLL_EXPORT )
140146 /* Building libsecp256k1 as a DLL.
@@ -151,8 +157,10 @@ typedef int (*secp256k1_nonce_function)(
151157#endif
152158#ifndef SECP256K1_API
153159# if defined(__GNUC__ ) && (__GNUC__ >= 4 ) && defined(SECP256K1_BUILD )
160+ /* Building libsecp256k1 on non-Windows using GCC or compatible. */
154161# define SECP256K1_API extern __attribute__ ((visibility ("default")))
155162# else
163+ /* All cases not captured above. */
156164# define SECP256K1_API extern
157165# endif
158166#endif
You can’t perform that action at this time.
0 commit comments