diff options
| author | Mark Adler <madler@alumni.caltech.edu> | 2012-03-03 00:20:00 -0800 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2012-03-03 00:20:00 -0800 |
| commit | dab7531eccdb5b22368797ae7958471401d1e427 (patch) | |
| tree | 1cf5916c4f8f0f97b286fc55e9c2b7aa5b724a4c | |
| parent | 2547c6c81fbf751e22ab7dcafdc1d1b50c8562a3 (diff) | |
| download | zlib-dab7531eccdb5b22368797ae7958471401d1e427.tar.gz zlib-dab7531eccdb5b22368797ae7958471401d1e427.tar.bz2 zlib-dab7531eccdb5b22368797ae7958471401d1e427.zip | |
Simplify test and use of gcc hidden attribute.
| -rwxr-xr-x | configure | 10 | ||||
| -rw-r--r-- | gzguts.h | 2 | ||||
| -rw-r--r-- | zutil.h | 2 |
3 files changed, 5 insertions, 9 deletions
| @@ -638,11 +638,7 @@ fi | |||
| 638 | if test "$gcc" -eq 1; then | 638 | if test "$gcc" -eq 1; then |
| 639 | echo >> configure.log | 639 | echo >> configure.log |
| 640 | cat > $test.c <<EOF | 640 | cat > $test.c <<EOF |
| 641 | #if ((__GNUC__-0) * 100 + __GNUC_MINOR__-0 >= 303) | 641 | #define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) |
| 642 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) | ||
| 643 | #else | ||
| 644 | # define ZLIB_INTERNAL | ||
| 645 | #endif | ||
| 646 | int ZLIB_INTERNAL foo; | 642 | int ZLIB_INTERNAL foo; |
| 647 | int main() | 643 | int main() |
| 648 | { | 644 | { |
| @@ -650,10 +646,10 @@ int main() | |||
| 650 | } | 646 | } |
| 651 | EOF | 647 | EOF |
| 652 | if tryboth $CC -c $CFLAGS $test.c; then | 648 | if tryboth $CC -c $CFLAGS $test.c; then |
| 649 | CFLAGS="$CFLAGS -DHAVE_HIDDEN" | ||
| 650 | SFLAGS="$SFLAGS -DHAVE_HIDDEN" | ||
| 653 | echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log | 651 | echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log |
| 654 | else | 652 | else |
| 655 | CFLAGS="$CFLAGS -DNO_VIZ" | ||
| 656 | SFLAGS="$SFLAGS -DNO_VIZ" | ||
| 657 | echo "Checking for attribute(visibility) support... No." | tee -a configure.log | 653 | echo "Checking for attribute(visibility) support... No." | tee -a configure.log |
| 658 | fi | 654 | fi |
| 659 | fi | 655 | fi |
| @@ -12,7 +12,7 @@ | |||
| 12 | # endif | 12 | # endif |
| 13 | #endif | 13 | #endif |
| 14 | 14 | ||
| 15 | #if ((__GNUC__-0) * 100 + __GNUC_MINOR__-0) >= 303 && !defined(NO_VIZ) | 15 | #ifdef HAVE_HIDDEN |
| 16 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) | 16 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) |
| 17 | #else | 17 | #else |
| 18 | # define ZLIB_INTERNAL | 18 | # define ZLIB_INTERNAL |
| @@ -13,7 +13,7 @@ | |||
| 13 | #ifndef ZUTIL_H | 13 | #ifndef ZUTIL_H |
| 14 | #define ZUTIL_H | 14 | #define ZUTIL_H |
| 15 | 15 | ||
| 16 | #if ((__GNUC__-0) * 100 + __GNUC_MINOR__-0) >= 303 && !defined(NO_VIZ) | 16 | #ifdef HAVE_HIDDEN |
| 17 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) | 17 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) |
| 18 | #else | 18 | #else |
| 19 | # define ZLIB_INTERNAL | 19 | # define ZLIB_INTERNAL |
