]> granicus.if.org Git - gc/commitdiff
Fix 'visibility attribute not supported' GCC warning (IBM AIX)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 2 Sep 2015 08:52:30 +0000 (11:52 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 29 Jan 2016 13:03:34 +0000 (16:03 +0300)
* configure.ac (enable_shared): Add -D GC_NO_VISIBILITY to CFLAGS if
not ac_cv_fvisibility_hidden.
* include/cord.h (CORD_API): Do not use visibility attribute if
GC_NO_VISIBILITY.
* include/gc_config_macros.h (GC_API): Likewise.
* include/private/gc_priv.h (GC_INNER, GC_API_OSCALL): Likewise.

configure.ac
include/cord.h
include/gc_config_macros.h
include/private/gc_priv.h

index ec0ca23aabf1f02238c5a4a8ada136cf71181341..6b74071c8dad887a768e451714c6039bc98e242d 100644 (file)
@@ -561,7 +561,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
index d3d555b6b970c72acab5d87366db22c04eb385c0..f414a916fa84fb18b5eb33cd95e93358ffc6b79d 100644 (file)
@@ -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
index 9285ddb798c5e517c233ffda46e2f297caeec6ec..f6db93a4858c7eeb1196d5b206cb5e099839c6da 100644 (file)
 
 # 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
index 40295f563983b7f6ce91d52de5617abef9230e65..dd2bf7479ba69bd77531d79dd46e5b9b267f0c49 100644 (file)
@@ -104,7 +104,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
@@ -160,7 +160,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