From 3156c8e9cf52d1dbeb9fa545a0d32a77e3d45a8c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 10 Aug 2004 18:52:30 +0000 Subject: [PATCH] Remove G_GNUC_INTERNAL from here. Check whether the visibility attribute 2004-08-10 Matthias Clasen * 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. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-12 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ configure.in | 31 +++++++++++++++++++++++++++++++ glib/gmacros.h | 11 ----------- 7 files changed, 66 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index da9f671..5fdb078 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-08-10 Matthias Clasen + + * 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 * glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index da9f671..5fdb078 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +2004-08-10 Matthias Clasen + + * 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 * glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index da9f671..5fdb078 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +2004-08-10 Matthias Clasen + + * 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 * glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index da9f671..5fdb078 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +2004-08-10 Matthias Clasen + + * 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 * glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index da9f671..5fdb078 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +2004-08-10 Matthias Clasen + + * 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 * glib/gmacros.h (G_GNUC_INTERNAL): Define empty if gcc is too old. diff --git a/configure.in b/configure.in index 52ad5de..7ec93d0 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/glib/gmacros.h b/glib/gmacros.h index 11832b2..d205053 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -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))) -- 2.7.4