Remove G_GNUC_INTERNAL from here. Check whether the visibility attribute

2004-08-10  Matthias Clasen  <mclasen@redhat.com>

	* glib/gmacros.h: Remove G_GNUC_INTERNAL from here.
	* configure.in: Check whether the visibility attribute
	works and define G_HAVE_GNUC_VISIBILITY and
	G_GNUC_INTERNAL in glibconfig.h correspondingly.
This commit is contained in:
Matthias Clasen 2004-08-10 18:52:30 +00:00 committed by Matthias Clasen
parent e02c68bef0
commit 3156c8e9cf
7 changed files with 66 additions and 11 deletions

View File

@ -1,3 +1,10 @@
2004-08-10 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Remove G_GNUC_INTERNAL from here.
* configure.in: Check whether the visibility attribute
works and define G_HAVE_GNUC_VISIBILITY and
G_GNUC_INTERNAL in glibconfig.h correspondingly.
Mon Aug 9 17:37:56 2004 Matthias Clasen <maclas@gmx.de>
* glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old.

View File

@ -1,3 +1,10 @@
2004-08-10 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Remove G_GNUC_INTERNAL from here.
* configure.in: Check whether the visibility attribute
works and define G_HAVE_GNUC_VISIBILITY and
G_GNUC_INTERNAL in glibconfig.h correspondingly.
Mon Aug 9 17:37:56 2004 Matthias Clasen <maclas@gmx.de>
* glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old.

View File

@ -1,3 +1,10 @@
2004-08-10 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Remove G_GNUC_INTERNAL from here.
* configure.in: Check whether the visibility attribute
works and define G_HAVE_GNUC_VISIBILITY and
G_GNUC_INTERNAL in glibconfig.h correspondingly.
Mon Aug 9 17:37:56 2004 Matthias Clasen <maclas@gmx.de>
* glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old.

View File

@ -1,3 +1,10 @@
2004-08-10 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Remove G_GNUC_INTERNAL from here.
* configure.in: Check whether the visibility attribute
works and define G_HAVE_GNUC_VISIBILITY and
G_GNUC_INTERNAL in glibconfig.h correspondingly.
Mon Aug 9 17:37:56 2004 Matthias Clasen <maclas@gmx.de>
* glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old.

View File

@ -1,3 +1,10 @@
2004-08-10 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h: Remove G_GNUC_INTERNAL from here.
* configure.in: Check whether the visibility attribute
works and define G_HAVE_GNUC_VISIBILITY and
G_GNUC_INTERNAL in glibconfig.h correspondingly.
Mon Aug 9 17:37:56 2004 Matthias Clasen <maclas@gmx.de>
* glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old.

View File

@ -667,6 +667,23 @@ call_a(2,3);
],g_have_gnuc_varargs=yes,g_have_gnuc_varargs=no)
AC_MSG_RESULT($g_have_gnuc_varargs)
# check for GNUC visibility support
AC_MSG_CHECKING(for GNUC visibility attribute)
GLIB_CHECK_COMPILE_WARNINGS([
void
__attribute__ ((visibility ("hidden")))
f (void)
{
}
int main (int argc, char **argv)
{
f();
return 0;
}
],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no)
AC_MSG_RESULT($g_have_gnuc_visibility)
# check for bytesex stuff
AC_C_BIGENDIAN
@ -2206,6 +2223,18 @@ _______EOF
fi
if test x$g_have_gnuc_visibility = xyes ; then
cat >>$outfile <<_______EOF
#define G_HAVE_GNUC_VISIBILITY 1
#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
_______EOF
else
cat >>$outfile <<_______EOF
#define G_GNUC_INTERNAL
_______EOF
fi
echo >>$outfile
if test x$g_mutex_has_default = xyes; then
cat >>$outfile <<_______EOF
@ -2522,6 +2551,8 @@ g_have_gnuc_varargs=$g_have_gnuc_varargs
g_have_iso_c_varargs=$g_have_iso_c_varargs
g_have_iso_cxx_varargs=$g_have_iso_cxx_varargs
g_have_gnuc_visibility=$g_have_gnuc_visibility
case xyes in
x$ac_cv_c_bigendian)
g_byte_order=G_BIG_ENDIAN

View File

@ -54,17 +54,6 @@
#define G_GNUC_PURE
#endif
/*
* Provide G_GNUC_INTERNAL that is used for marking library
* functions as being used internally to the lib only, to not
* create inefficient PLT entries.
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
#else
#define G_GNUC_INTERNAL
#endif
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))