Use the GCC 4 visibility extension to mark everything in xcbint.h hidden.
[free-sw/xcb/libxcb] / acinclude.m4
1 dnl Detection and configuration of the visibility feature of gcc
2 dnl Vincent Torri 2006-02-11
3 dnl
4 dnl GCC_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
5 dnl Check the visibility feature of gcc
6 dnl
7 AC_DEFUN([GCC_CHECK_VISIBILITY],
8    [AC_MSG_CHECKING([whether ${CC} supports visibility feature])
9     save_CFLAGS=${CFLAGS}
10     CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
11     AC_COMPILE_IFELSE(
12        [AC_LANG_PROGRAM(
13           [[
14 #pragma GCC visibility push(hidden)
15 extern void f(int);
16 #pragma GCC visibility pop
17           ]],
18           [[]]
19         )],
20        [AC_DEFINE(
21            GCC_HAS_VISIBILITY,
22            [],
23            [Defined if GCC supports the vilibility feature])
24         m4_if([$1], [], [:], [$1])
25         AC_MSG_RESULT(yes)],
26        [m4_if([$2], [], [:], [$2])
27         AC_MSG_RESULT(no)])
28     CFLAGS=${save_CFLAGS}
29    ])