summaryrefslogtreecommitdiffstats
path: root/generic/tcl.h
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-04-24 21:11:57 (GMT)
committernijtmans <nijtmans>2008-04-24 21:11:57 (GMT)
commit9cd73daf723396e0a13996ec11b0b8781888af28 (patch)
treec7dfd0245365db8346fd99da35be15f4c9b330f7 /generic/tcl.h
parent140933e5aa1698253bb1afadc0add0e4e068bfc9 (diff)
downloadtcl-9cd73daf723396e0a13996ec11b0b8781888af28.zip
tcl-9cd73daf723396e0a13996ec11b0b8781888af28.tar.gz
tcl-9cd73daf723396e0a13996ec11b0b8781888af28.tar.bz2
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. See: <http://gcc.gnu.org/wiki/Visibility>
Diffstat (limited to 'generic/tcl.h')
-rw-r--r--generic/tcl.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 1d4b94b..10ef922 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.255 2008/04/01 16:23:39 dgp Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.256 2008/04/24 21:11:57 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
/*