File tree 4 files changed +18
-3
lines changed
4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ noinst_HEADERS += src/assumptions.h
47
47
noinst_HEADERS += src/checkmem.h
48
48
noinst_HEADERS += src/testutil.h
49
49
noinst_HEADERS += src/util.h
50
+ noinst_HEADERS += src/util_defs.h
50
51
noinst_HEADERS += src/int128.h
51
52
noinst_HEADERS += src/int128_impl.h
52
53
noinst_HEADERS += src/int128_native.h
Original file line number Diff line number Diff line change @@ -26,9 +26,10 @@ extern "C" {
26
26
static secp256k1_ge_storage secp256k1_pre_g [ECMULT_TABLE_SIZE (WINDOW_G )];
27
27
static secp256k1_ge_storage secp256k1_pre_g_128 [ECMULT_TABLE_SIZE (WINDOW_G )];
28
28
#else /* !defined(EXHAUSTIVE_TEST_ORDER) */
29
+ #include "util_defs.h"
29
30
# define WINDOW_G ECMULT_WINDOW_SIZE
30
- extern const secp256k1_ge_storage secp256k1_pre_g [ECMULT_TABLE_SIZE (WINDOW_G )];
31
- extern const secp256k1_ge_storage secp256k1_pre_g_128 [ECMULT_TABLE_SIZE (WINDOW_G )];
31
+ SECP256K1_LOCAL_VAR const secp256k1_ge_storage secp256k1_pre_g [ECMULT_TABLE_SIZE (WINDOW_G )];
32
+ SECP256K1_LOCAL_VAR const secp256k1_ge_storage secp256k1_pre_g_128 [ECMULT_TABLE_SIZE (WINDOW_G )];
32
33
#endif /* defined(EXHAUSTIVE_TEST_ORDER) */
33
34
34
35
#ifdef __cplusplus
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ extern "C" {
16
16
#ifdef EXHAUSTIVE_TEST_ORDER
17
17
static secp256k1_ge_storage secp256k1_ecmult_gen_prec_table [COMB_BLOCKS ][COMB_POINTS ];
18
18
#else
19
- extern const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table [COMB_BLOCKS ][COMB_POINTS ];
19
+ #include "util_defs.h"
20
+ SECP256K1_LOCAL_VAR const secp256k1_ge_storage secp256k1_ecmult_gen_prec_table [COMB_BLOCKS ][COMB_POINTS ];
20
21
#endif /* defined(EXHAUSTIVE_TEST_ORDER) */
21
22
22
23
#ifdef __cplusplus
Original file line number Diff line number Diff line change
1
+ #ifndef SECP256K1_UTIL_DEFS_H
2
+ #define SECP256K1_UTIL_DEFS_H
3
+
4
+ /* Global variable visibility */
5
+ /* See: https://github.com/bitcoin-core/secp256k1/issues/1181 */
6
+ #if !defined(_WIN32 ) && defined(__GNUC__ ) && (__GNUC__ >= 4 )
7
+ # define SECP256K1_LOCAL_VAR extern __attribute__ ((visibility ("hidden")))
8
+ #else
9
+ # define SECP256K1_LOCAL_VAR extern
10
+ #endif
11
+
12
+ #endif /* SECP256K1_UTIL_DEFS_H */
You can’t perform that action at this time.
0 commit comments