From af7d3aa263b52ca80b11922cf1af375a3b683d0e Mon Sep 17 00:00:00 2001 From: nijtmans Date: Tue, 22 Jul 2008 20:49:25 +0000 Subject: define DLLEXPORT as __attribute__ ((visibility("default"))) for gcc >= 4.0. This allows extensions to be compiled with -fvisiblity=hidden and still all symbols decorated with EXPORT will be exported. See: (backport from trunk tcl.h 1.256) --- generic/tcl.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index 921a1b1..4c5d535 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tcl.h,v 1.254.2.2 2008/06/30 03:18:57 dgp Exp $ + * RCS: @(#) $Id: tcl.h,v 1.254.2.3 2008/07/22 20:49:25 nijtmans Exp $ */ #ifndef _TCL @@ -172,26 +172,27 @@ extern "C" { #if (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec)))) # define HAVE_DECLSPEC 1 -#endif - -#ifdef STATIC_BUILD -# define DLLIMPORT -# define DLLEXPORT -# if HAVE_DECLSPEC && defined(_DLL) -# define CRTIMPORT __declspec(dllimport) +# ifdef STATIC_BUILD +# define DLLIMPORT +# define DLLEXPORT +# ifdef _DLL +# define CRTIMPORT __declspec(dllimport) +# else +# define CRTIMPORT +# endif # else -# define CRTIMPORT +# define DLLIMPORT __declspec(dllimport) +# define DLLEXPORT __declspec(dllexport) +# define CRTIMPORT __declspec(dllimport) # endif #else -# if HAVE_DECLSPEC -# define DLLIMPORT __declspec(dllimport) -# define DLLEXPORT __declspec(dllexport) -# define CRTIMPORT __declspec(dllimport) +# define DLLIMPORT +# if defined(__GNUC__) && __GNUC__ > 3 +# define DLLEXPORT __attribute__ ((visibility("default"))) # else -# define DLLIMPORT -# define DLLEXPORT -# define CRTIMPORT +# define DLLEXPORT # endif +# define CRTIMPORT #endif /* -- cgit v0.12