glib r6271 - in branches/glib-2-14: . glib



Author: matthiasc
Date: Tue Jan  8 01:10:57 2008
New Revision: 6271
URL: http://svn.gnome.org/viewvc/glib?rev=6271&view=rev

Log:
2008-01-06  Matthias Clasen  <mclasen redhat com>

        * glib/gutils.h: Cope with gcc 4.3 changed 'extern inline'
        semantics.  (#315437, patch by LoÃc Minier)



Modified:
   branches/glib-2-14/ChangeLog
   branches/glib-2-14/glib/gutils.h

Modified: branches/glib-2-14/glib/gutils.h
==============================================================================
--- branches/glib-2-14/glib/gutils.h	(original)
+++ branches/glib-2-14/glib/gutils.h	Tue Jan  8 01:10:57 2008
@@ -69,6 +69,18 @@
 #  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 @@
 #  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 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]