From a6f9e71c98867bf07038f285983e2a6c40c78997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 16 Mar 2009 09:40:33 +0000 Subject: [PATCH] This should fix ticket #3481 again. It keeps the same semantics as before when the header is used for compiling with -std=c99 or -std=gnu99 and GCC4, which has a reverted meaning of "extern inline" (now standard compliant). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29558 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/libio.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/headers/posix/libio.h b/headers/posix/libio.h index 83caf1d45e..c64631ad8b 100644 --- a/headers/posix/libio.h +++ b/headers/posix/libio.h @@ -217,7 +217,19 @@ extern void _IO_free_backup_area(_IO_FILE *); #ifdef __cplusplus # define __INLINE inline #else -# define __INLINE extern __inline +/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 + inline semantics. */ +//#if __GNUC_PREREQ(4, 3) // <- Gives parse error. Don't know why. +# if 4 < __GNUC__ || (4 == __GNUC__ && 3 <= __GNUC_MINOR__) +# ifdef __STDC__VERSION__ +# if __STDC__VERSION__ + 0 > 199900 +# define __INLINE __attribute__((__extern_inline__)) __inline +# endif +# endif +# endif +# ifndef __INLINE +# define __INLINE extern __inline +# endif #endif __INLINE int