]> git.saurik.com Git - wxWidgets.git/commitdiff
check for HAVE_VISIBILITY first when setting WXIMPORT/WXEXPORT; only set it on platfo...
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 13 Aug 2007 18:36:14 +0000 (18:36 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 13 Aug 2007 18:36:14 +0000 (18:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/aclocal/visibility.m4
configure
include/wx/dlimpexp.h

index 0f02567b9c8c4b61bc3143a969364312af937840..9ee33576dcceb16774aa9576e7928e1f672b0329 100644 (file)
@@ -43,7 +43,12 @@ AC_DEFUN([WX_VISIBILITY],
          #if defined(__GNUC__) && __GNUC__ < 4
          error this gcc is too old;
          #endif
-          
+
+         /* visibility only makes sense for ELF shared libs: */
+         #if !defined(__ELF__) && !defined(__APPLE__)
+         error this platform has no visibility;
+         #endif
+
          extern __attribute__((__visibility__("hidden"))) int hiddenvar;
          extern __attribute__((__visibility__("default"))) int exportedvar;
          extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
index 398c9f0e1e825d8a64248223e9c669b0a54ca637..d76b42fa5ad58de8fc0b418d4aedcfd189418d02 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Id: configure.in 47919 2007-08-07 01:38:18Z VZ .
+# From configure.in Id: configure.in 47942 2007-08-07 22:29:07Z VZ .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0.
 #
@@ -36143,6 +36143,11 @@ cat >>conftest.$ac_ext <<_ACEOF
          error this gcc is too old;
          #endif
 
+         /* visibility only makes sense for ELF shared libs: */
+         #if !defined(__ELF__) && !defined(__APPLE__)
+         error this platform has no visibility;
+         #endif
+
          extern __attribute__((__visibility__("hidden"))) int hiddenvar;
          extern __attribute__((__visibility__("default"))) int exportedvar;
          extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
index 9160ad84c766baed19ad8393c84538120294a067..3df4f4e603b851f0ec17604a255eb413ccc928ff 100644 (file)
 #ifndef _WX_DLIMPEXP_H_
 #define _WX_DLIMPEXP_H_
 
-#if defined(__WINDOWS__)
+#if defined(HAVE_VISIBILITY)
+#    define WXEXPORT __attribute__ ((visibility("default")))
+#    define WXIMPORT __attribute__ ((visibility("default")))
+#elif defined(__WINDOWS__)
     /*
        __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
        as VC++ and gcc
@@ -51,9 +54,6 @@
 #elif defined(__CYGWIN__)
 #    define WXEXPORT __declspec(dllexport)
 #    define WXIMPORT __declspec(dllimport)
-#elif defined(HAVE_VISIBILITY)
-#    define WXEXPORT __attribute__ ((visibility("default")))
-#    define WXIMPORT __attribute__ ((visibility("default")))
 #endif
 
 /* for other platforms/compilers we don't anything */