summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal/libmpdec/mpdecimal.h
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_decimal/libmpdec/mpdecimal.h')
-rw-r--r--Modules/_decimal/libmpdec/mpdecimal.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h
index d131c71..f5affdb 100644
--- a/Modules/_decimal/libmpdec/mpdecimal.h
+++ b/Modules/_decimal/libmpdec/mpdecimal.h
@@ -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