File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,25 @@ typedef int (*secp256k1_nonce_function)(
121121#endif
122122
123123/* Symbol visibility. */
124+ #if !defined(SECP256K1_API ) && defined(SECP256K1_NO_API_VISIBILITY_ATTRIBUTES )
125+ /* The user has requested that we don't specify visibility attributes in
126+ * the public API.
127+ *
128+ * Since all our non-API declarations use the static qualifier, this means
129+ * that the user can use -fvisibility=<value> to set the visibility of the
130+ * API symbols. For instance, -fvisibility=hidden can be useful *even for
131+ * the API symbols*, e.g., when building a static library which is linked
132+ * into a shared library, and the latter should not re-export the
133+ * libsecp256k1 API.
134+ *
135+ * While visibility is a concept that applies only to shared libraries,
136+ * setting visibility will still make a difference when building a static
137+ * library: the visibility settings will be stored in the static library,
138+ * solely for the potential case that the static library will be linked into
139+ * a shared library. In that case, the stored visibility settings will
140+ * resurface and be honored for the shared library. */
141+ # define SECP256K1_API extern
142+ #endif
124143#if !defined(SECP256K1_API )
125144# if defined(SECP256K1_BUILD )
126145 /* On Windows, assume a shared library only if explicitly requested.
You can’t perform that action at this time.
0 commit comments