Fix inline machinery in C99 mode on MacOS X.
authorLudovic Courtès <ludo@gnu.org>
Thu, 10 Apr 2008 21:57:05 +0000 (23:57 +0200)
committerLudovic Courtès <ludo@gnu.org>
Thu, 10 Apr 2008 21:57:05 +0000 (23:57 +0200)
libguile/ChangeLog
libguile/inline.h

index 46c0121f0c5890a4ea661dd2a30c22e8cc58ae0b..b6301442a410aed00c938c3f017c335257f263e6 100644 (file)
@@ -1,3 +1,10 @@
+2008-04-10  Ludovic Courtès  <ludo@gnu.org>
+
+       * inline.h (SCM_C_EXTERN_INLINE): Special-case Apple's GCC
+       4.0-based compiler, which doesn't support GNU inline semantics
+       at all in C99 mode but doesn't define `__GNUC_STDC_INLINE__'.
+       See http://thread.gmane.org/gmane.network.gnutls.general/1135 .
+
 2008-04-10  Andy Wingo  <wingo@pobox.com>
 
        * struct.c (scm_struct_ref, scm_struct_set_x): "Light" structs
index 2b5b2a4dc3288e85090713416d3ce4c355c23af0..34bb84345f2df813e7563e23f76217bfaeffcc42 100644 (file)
 
    With GCC 4.2, `__GNUC_STDC_INLINE__' is never defined (because C99 inline
    semantics are not supported), but a warning is issued in C99 mode if
-   `__gnu_inline__' is not used.  */
+   `__gnu_inline__' is not used.
 
-# ifdef __GNUC__
+   Apple's GCC build >5400 (since Xcode 3.0) doesn't support GNU inline in
+   C99 mode and doesn't define `__GNUC_STDC_INLINE__'.  Fall back to "static
+   inline" in that case.  */
+
+# if (defined __GNUC__) && (!(__APPLE_CC__ > 5400 && __STDC_VERSION__ >= 199901L))
 #  if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2)
 #   define SCM_C_EXTERN_INLINE                                 \
            extern __inline__ __attribute__ ((__gnu_inline__))