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