summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-07-22 20:49:25 (GMT)
committernijtmans <nijtmans>2008-07-22 20:49:25 (GMT)
commitaf7d3aa263b52ca80b11922cf1af375a3b683d0e (patch)
tree5ed5be8601d3b8741aed648d227d378f7a5da85a
parentd1725d3e767a10fefd1ad97b98faffcbea03e862 (diff)
downloadtcl-af7d3aa263b52ca80b11922cf1af375a3b683d0e.zip
tcl-af7d3aa263b52ca80b11922cf1af375a3b683d0e.tar.gz
tcl-af7d3aa263b52ca80b11922cf1af375a3b683d0e.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 will be exported. See: <http://gcc.gnu.org/wiki/Visibility> (backport from trunk tcl.h 1.256)
-rw-r--r--generic/tcl.h33
1 files 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
/*