From cea40215bbb60de68a28574baaf1d6743585cb29 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 1 Mar 2006 07:14:57 +0000 Subject: [PATCH] add visibility attribute for GCC, now you can compile using -fvisibility=hidden git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8918 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/swiglabels.swg | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Lib/swiglabels.swg b/Lib/swiglabels.swg index 74b3b12d9..f185c5b98 100644 --- a/Lib/swiglabels.swg +++ b/Lib/swiglabels.swg @@ -50,6 +50,12 @@ # endif #endif +#if (__GNUC__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + /* internal SWIG method */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED @@ -69,7 +75,11 @@ # define SWIGEXPORT __declspec(dllexport) # endif # else -# define SWIGEXPORT +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif # endif #endif