From: Mark Adler Date: Sat, 3 Mar 2012 08:20:00 +0000 (-0800) Subject: Simplify test and use of gcc hidden attribute. X-Git-Tag: v1.2.7~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dab7531eccdb5b22368797ae7958471401d1e427;p=thirdparty%2Fzlib-ng.git Simplify test and use of gcc hidden attribute. --- diff --git a/configure b/configure index eb103c87d..6b7224b42 100755 --- a/configure +++ b/configure @@ -638,11 +638,7 @@ fi if test "$gcc" -eq 1; then echo >> configure.log cat > $test.c <= 303) -# define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) -#else -# define ZLIB_INTERNAL -#endif +#define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) int ZLIB_INTERNAL foo; int main() { @@ -650,10 +646,10 @@ int main() } EOF if tryboth $CC -c $CFLAGS $test.c; then + CFLAGS="$CFLAGS -DHAVE_HIDDEN" + SFLAGS="$SFLAGS -DHAVE_HIDDEN" echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log else - CFLAGS="$CFLAGS -DNO_VIZ" - SFLAGS="$SFLAGS -DNO_VIZ" echo "Checking for attribute(visibility) support... No." | tee -a configure.log fi fi diff --git a/gzguts.h b/gzguts.h index 2ef95f3e2..0ccc9a678 100644 --- a/gzguts.h +++ b/gzguts.h @@ -12,7 +12,7 @@ # endif #endif -#if ((__GNUC__-0) * 100 + __GNUC_MINOR__-0) >= 303 && !defined(NO_VIZ) +#ifdef HAVE_HIDDEN # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) #else # define ZLIB_INTERNAL diff --git a/zutil.h b/zutil.h index 7be5f5549..4e3dcc6ae 100644 --- a/zutil.h +++ b/zutil.h @@ -13,7 +13,7 @@ #ifndef ZUTIL_H #define ZUTIL_H -#if ((__GNUC__-0) * 100 + __GNUC_MINOR__-0) >= 303 && !defined(NO_VIZ) +#ifdef HAVE_HIDDEN # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) #else # define ZLIB_INTERNAL