summaryrefslogtreecommitdiffstats
path: root/gl/m4/visibility.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/visibility.m4')
-rw-r--r--gl/m4/visibility.m425
1 files changed, 14 insertions, 11 deletions
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
index 077c476..6cbd7e5 100644
--- a/gl/m4/visibility.m4
+++ b/gl/m4/visibility.m4
@@ -1,5 +1,5 @@
1# visibility.m4 serial 3 (gettext-0.18) 1# visibility.m4 serial 5 (gettext-0.18.2)
2dnl Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc. 2dnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -12,7 +12,7 @@ dnl __attribute__((__visibility__("hidden"))) and
12dnl __attribute__((__visibility__("default"))). 12dnl __attribute__((__visibility__("default"))).
13dnl Does *not* test for __visibility__("protected") - which has tricky 13dnl Does *not* test for __visibility__("protected") - which has tricky
14dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on 14dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
15dnl MacOS X. 15dnl Mac OS X.
16dnl Does *not* test for __visibility__("internal") - which has processor 16dnl Does *not* test for __visibility__("internal") - which has processor
17dnl dependent semantics. 17dnl dependent semantics.
18dnl Does *not* test for #pragma GCC visibility push(hidden) - which is 18dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
@@ -33,7 +33,8 @@ AC_DEFUN([gl_VISIBILITY],
33 AC_CACHE_VAL([gl_cv_cc_vis_werror], [ 33 AC_CACHE_VAL([gl_cv_cc_vis_werror], [
34 gl_save_CFLAGS="$CFLAGS" 34 gl_save_CFLAGS="$CFLAGS"
35 CFLAGS="$CFLAGS -Werror" 35 CFLAGS="$CFLAGS -Werror"
36 AC_TRY_COMPILE([], [], 36 AC_COMPILE_IFELSE(
37 [AC_LANG_PROGRAM([[]], [[]])],
37 [gl_cv_cc_vis_werror=yes], 38 [gl_cv_cc_vis_werror=yes],
38 [gl_cv_cc_vis_werror=no]) 39 [gl_cv_cc_vis_werror=no])
39 CFLAGS="$gl_save_CFLAGS"]) 40 CFLAGS="$gl_save_CFLAGS"])
@@ -51,13 +52,15 @@ AC_DEFUN([gl_VISIBILITY],
51 if test $gl_cv_cc_vis_werror = yes; then 52 if test $gl_cv_cc_vis_werror = yes; then
52 CFLAGS="$CFLAGS -Werror" 53 CFLAGS="$CFLAGS -Werror"
53 fi 54 fi
54 AC_TRY_COMPILE( 55 AC_COMPILE_IFELSE(
55 [extern __attribute__((__visibility__("hidden"))) int hiddenvar; 56 [AC_LANG_PROGRAM(
56 extern __attribute__((__visibility__("default"))) int exportedvar; 57 [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
57 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); 58 extern __attribute__((__visibility__("default"))) int exportedvar;
58 extern __attribute__((__visibility__("default"))) int exportedfunc (void); 59 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
59 void dummyfunc (void) {}], 60 extern __attribute__((__visibility__("default"))) int exportedfunc (void);
60 [], 61 void dummyfunc (void) {}
62 ]],
63 [[]])],
61 [gl_cv_cc_visibility=yes], 64 [gl_cv_cc_visibility=yes],
62 [gl_cv_cc_visibility=no]) 65 [gl_cv_cc_visibility=no])
63 CFLAGS="$gl_save_CFLAGS"]) 66 CFLAGS="$gl_save_CFLAGS"])