From 3f15a98f8d95a3c277078e6a7191cdc95da5f065 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 7 Jan 2008 03:08:37 +0000 Subject: [PATCH] Cope with gcc 4.3 changed 'extern inline' semantics. (#315437, patch by MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2008-01-06 Matthias Clasen * glib/gutils.h: Cope with gcc 4.3 changed 'extern inline' semantics. (#315437, patch by Loïc Minier) svn path=/trunk/; revision=6254 --- ChangeLog | 5 +++++ glib/gutils.h | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0a9e6be..72bb241 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-01-06 Matthias Clasen + * glib/gutils.h: Cope with gcc 4.3 changed 'extern inline' + semantics. (#315437, patch by Loïc Minier) + +2008-01-06 Matthias Clasen + * glib/gspawn.c (fdwalk): Don't set open_max to RLIM_INFINITY. (#495589, Tommi Komulainen) diff --git a/glib/gutils.h b/glib/gutils.h index 382aaca..b3af632 100644 --- a/glib/gutils.h +++ b/glib/gutils.h @@ -69,6 +69,18 @@ G_BEGIN_DECLS # endif /* va_list is a pointer */ #endif /* !G_VA_COPY */ +/* need this utility macro, but it's not always present in system headers + * copy it from linux features.h for those who need it + */ +#ifndef __GNUC_PREREQ +#if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#else +# define __GNUC_PREREQ(maj, min) 0 +#endif +#endif + /* inlining hassle. for compilers that don't allow the `inline' keyword, * mostly because of strict ANSI C compliance or dumbness, we try to fall * back to either `__inline__' or `__inline'. @@ -97,7 +109,12 @@ G_BEGIN_DECLS # define G_INLINE_FUNC # undef G_CAN_INLINE #elif defined (__GNUC__) -# define G_INLINE_FUNC extern inline +# if __GNUC_PREREQ (4,2) && defined (__STDC_VERSION__) \ + && __STDC_VERSION__ >= 199901L +# define G_INLINE_FUNC extern __inline __attribute__ ((__gnu_inline__)) +# else +# define G_INLINE_FUNC extern __inline +# endif #elif defined (G_CAN_INLINE) # define G_INLINE_FUNC static inline #else /* can't inline */ -- 2.7.4