]> granicus.if.org Git - python/commitdiff
Issue #16745: Hide symbols in _decimal.so.
authorStefan Krah <skrah@bytereef.org>
Sat, 22 Dec 2012 13:18:35 +0000 (14:18 +0100)
committerStefan Krah <skrah@bytereef.org>
Sat, 22 Dec 2012 13:18:35 +0000 (14:18 +0100)
12 files changed:
Modules/_decimal/libmpdec/basearith.h
Modules/_decimal/libmpdec/constants.h
Modules/_decimal/libmpdec/convolute.h
Modules/_decimal/libmpdec/crt.h
Modules/_decimal/libmpdec/difradix2.h
Modules/_decimal/libmpdec/fnt.h
Modules/_decimal/libmpdec/fourstep.h
Modules/_decimal/libmpdec/memory.h
Modules/_decimal/libmpdec/mpdecimal.h
Modules/_decimal/libmpdec/numbertheory.h
Modules/_decimal/libmpdec/sixstep.h
Modules/_decimal/libmpdec/transpose.h

index 5004b2c0382fded94fbb7112954ab342f9b69839..114cef3860364607f8442f407b69e14d27920a72 100644 (file)
 #include "typearith.h"
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 mpd_uint_t _mpd_baseadd(mpd_uint_t *w, const mpd_uint_t *u, const mpd_uint_t *v,
                         mpd_size_t m, mpd_size_t n);
 void _mpd_baseaddto(mpd_uint_t *w, const mpd_uint_t *u, mpd_size_t n);
@@ -209,6 +213,9 @@ _mpd_isallnine(const mpd_uint_t *data, mpd_ssize_t len)
 }
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif /* BASEARITH_H */
 
 
index 2d63d7e3c82798a6cd9d523a28d4d436d9eb961d..13df9202123d4ef8ae69261731b3c35e247f86b1 100644 (file)
 #include "mpdecimal.h"
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 /* choice of optimized functions */
 #if defined(CONFIG_64)
 /* x64 */
@@ -77,6 +81,9 @@ extern const mpd_uint_t LH_P1P2;
 extern const mpd_uint_t UH_P1P2;
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif /* CONSTANTS_H */
 
 
index 2f8d6d831b6f377a20972155816bf67dd98b72af..c35ed461d3b5fabeaee8bfc184ffe0d06c538653 100644 (file)
 #include "mpdecimal.h"
 #include <stdio.h>
 
-#define SIX_STEP_THRESHOLD 4096
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
+#define SIX_STEP_THRESHOLD 4096
 
 int fnt_convolute(mpd_uint_t *c1, mpd_uint_t *c2, mpd_size_t n, int modnum);
 int fnt_autoconvolute(mpd_uint_t *c1, mpd_size_t n, int modnum);
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif
index 0e03e5d07710d4379871910a8d8a9a729489cfe7..8909232231abe395f8c6ac3c3d3caf2711e7e742 100644 (file)
 #include <stdio.h>
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t nmemb);
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif
index 759442a2bcf7580ffa6067389b5dcb5dbdca4eda..81aa598543fd41666654af7bceda67d1ae53dbe8 100644 (file)
 #include "numbertheory.h"
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 void fnt_dif2(mpd_uint_t a[], mpd_size_t n, struct fnt_params *tparams);
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif
index 2d701b6c8aae98ff8d40ae8055c06bfa5e0f0997..1f302cccbfa12eda258d78dc24dd6b12df6c6c9b 100644 (file)
 #include <stdio.h>
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 int std_fnt(mpd_uint_t a[], mpd_size_t n, int modnum);
 int std_inv_fnt(mpd_uint_t a[], mpd_size_t n, int modnum);
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif
 
index 61d9d6a71a8dd30058f53e5e2a5297789b07c3c5..593f27d489f416895eb8772c23592e9d1ce5841d 100644 (file)
 #include <stdio.h>
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 int four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
 int inv_four_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif
index b3a4a56e9687a6239fcc1e6c062fd7bf65b7b11e..7e73c13059330d97fd9c82ff5724ed4543d1fc5c 100644 (file)
 #include "mpdecimal.h"
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status);
 int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status);
 int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status);
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif
 
 
index d131c71441f633b664bc447c641d70408969ec72..f5affdbc5e8796f89409621273e8d18e5c687235 100644 (file)
@@ -67,10 +67,24 @@ extern "C" {
   #else
     #define UNUSED
   #endif
+  #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(__INTEL_COMPILER)
+    #define MPD_PRAGMA(x) _Pragma(x)
+    #define MPD_HIDE_SYMBOLS_START "GCC visibility push(hidden)"
+    #define MPD_HIDE_SYMBOLS_END "GCC visibility pop"
+  #else
+    #define MPD_PRAGMA(x)
+    #define MPD_HIDE_SYMBOLS_START
+    #define MPD_HIDE_SYMBOLS_END
+  #endif
   #define EXTINLINE
 #endif
 
 
+/* This header file is internal for the purpose of building _decimal.so.
+ * All symbols should have local scope in the DSO. */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 #if !defined(LEGACY_COMPILER)
   #if !defined(UINT64_MAX)
     /* The following #error is just a warning. If the compiler indeed does
@@ -789,6 +803,9 @@ int mpd_resize(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx);
 int mpd_resize_zero(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx);
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #ifdef __cplusplus
 } /* END extern "C" */
 #endif
index f54d11dc3824c38b22e5ed18e399d010312c4a52..10922546198921aadcb31f1ca507c20bade7b149 100644 (file)
 #include "mpdecimal.h"
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 /* transform parameters */
 struct fnt_params {
     int modnum;
@@ -66,6 +70,9 @@ std_setmodulus(int modnum, mpd_uint_t *umod)
 #endif
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif
 
 
index 4d251df0595dbbb3a218da44f9e21ca5cd03cafb..0467007061b82af255a91fae18315bd4d9401c0c 100644 (file)
 #include <stdio.h>
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 int six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
 int inv_six_step_fnt(mpd_uint_t *a, mpd_size_t n, int modnum);
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif
index dd0aec6600740f0f00e3188517ecc08ca6db5eb6..7e349ee08df12c7106ec75bee7076e38ff2bc3d3 100644 (file)
 #include <stdio.h>
 
 
+/* Internal header file: all symbols have local scope in the DSO */
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_START)
+
+
 enum {FORWARD_CYCLE, BACKWARD_CYCLE};
 
 
@@ -52,4 +56,7 @@ static inline void pointerswap(mpd_uint_t **a, mpd_uint_t **b)
 }
 
 
+MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */
+
+
 #endif