summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac3
-rw-r--r--include/cord.h4
-rw-r--r--include/gc_config_macros.h4
-rw-r--r--include/private/gc_priv.h4
4 files changed, 8 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 414edc7d..a72787a4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -562,7 +562,8 @@ if test "${enable_shared}" = yes; then
[ac_cv_fvisibility_hidden=no])
CFLAGS="$old_CFLAGS"
AS_IF([test "$ac_cv_fvisibility_hidden" = yes],
- [CFLAGS="-DGC_VISIBILITY_HIDDEN_SET -fvisibility=hidden $CFLAGS"])
+ [CFLAGS="-DGC_VISIBILITY_HIDDEN_SET -fvisibility=hidden $CFLAGS"],
+ [CFLAGS="-DGC_NO_VISIBILITY $CFLAGS"])
AC_MSG_RESULT($ac_cv_fvisibility_hidden)
fi
fi
diff --git a/include/cord.h b/include/cord.h
index d3d555b6..f414a916 100644
--- a/include/cord.h
+++ b/include/cord.h
@@ -66,8 +66,8 @@
# elif defined(_MSC_VER) || defined(__DMC__) || defined(__BORLANDC__) \
|| defined(__CYGWIN__) || defined(__WATCOMC__)
# define CORD_API extern __declspec(dllexport)
-# elif defined(__GNUC__) && (__GNUC__ >= 4 \
- || defined(GC_VISIBILITY_HIDDEN_SET))
+# elif defined(__GNUC__) && !defined(GC_NO_VISIBILITY) \
+ && (__GNUC__ >= 4 || defined(GC_VISIBILITY_HIDDEN_SET))
/* Only matters if used in conjunction with -fvisibility=hidden option. */
# define CORD_API extern __attribute__((__visibility__("default")))
# endif
diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h
index b5898cb4..e9671294 100644
--- a/include/gc_config_macros.h
+++ b/include/gc_config_macros.h
@@ -202,8 +202,8 @@
# elif defined(__GNUC__)
/* Only matters if used in conjunction with -fvisibility=hidden option. */
-# if defined(GC_BUILD) && (__GNUC__ >= 4 \
- || defined(GC_VISIBILITY_HIDDEN_SET))
+# if defined(GC_BUILD) && !defined(GC_NO_VISIBILITY) \
+ && (__GNUC__ >= 4 || defined(GC_VISIBILITY_HIDDEN_SET))
# define GC_API extern __attribute__((__visibility__("default")))
# endif
# endif
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h
index ed9fc566..2102d627 100644
--- a/include/private/gc_priv.h
+++ b/include/private/gc_priv.h
@@ -109,7 +109,7 @@ typedef char * ptr_t; /* A generic pointer to which we can add */
/* located in the "extra" folder). */
# if defined(GC_DLL) && defined(__GNUC__) && !defined(MSWIN32) \
&& !defined(MSWINCE) && !defined(CYGWIN32)
-# if __GNUC__ >= 4
+# if (__GNUC__ >= 4) && !defined(GC_NO_VISIBILITY)
/* See the corresponding GC_API definition. */
# define GC_INNER __attribute__((__visibility__("hidden")))
# else
@@ -165,7 +165,7 @@ typedef char * ptr_t; /* A generic pointer to which we can add */
#ifndef GC_API_OSCALL
/* This is used to identify GC routines called by name from OS. */
# if defined(__GNUC__)
-# if __GNUC__ >= 4
+# if (__GNUC__ >= 4) && !defined(GC_NO_VISIBILITY)
/* Same as GC_API if GC_DLL. */
# define GC_API_OSCALL extern __attribute__((__visibility__("default")))
# else