summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sipgen/gencode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sipgen/gencode.c b/sipgen/gencode.c
index 6c848a4..0a9bc41 100644
--- a/sipgen/gencode.c
+++ b/sipgen/gencode.c
@@ -2324,12 +2324,18 @@ static void generateModInitStart(moduleDef *mod, int gen_c, FILE *fp)
"#define SIP_MODULE_RETURN(r) return\n"
"#endif\n"
"\n"
+"#if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)\n"
+"#pragma GCC visibility push(default)\n"
+"#endif\n"
"#if defined(SIP_STATIC_MODULE)\n"
"%sSIP_MODULE_TYPE SIP_MODULE_ENTRY()\n"
"#else\n"
"PyMODINIT_FUNC SIP_MODULE_ENTRY()\n"
"#endif\n"
"{\n"
+"#if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)\n"
+"#pragma GCC visibility pop\n"
+"#endif\n"
, mod->name
, mod->name
, (gen_c ? "" : "extern \"C\" "));