diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-01-05 16:45:06 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-01-05 16:45:06 +0000 |
commit | 9da7457367ccfa42c21af5e5f5fefe4e1188e141 (patch) | |
tree | 177b437c55473d004e020aa96e3a66f1930108f2 | |
parent | 81caa1a620a04ade56293de4219b011db4d0f9a0 (diff) |
sync with glibc to get the extern inline directive
-rw-r--r-- | include/sys/cdefs.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index 8daac15ef..e2920510a 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1992-2001, 2002, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1992-2001, 2002, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -130,8 +131,18 @@ /* Fortify support. */ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) -#define __warndecl(name, msg) extern void name (void) +#if __GNUC_PREREQ (4,3) +# define __warndecl(name, msg) \ + extern void name (void) __attribute__((__warning__ (msg))) +# define __warnattr(msg) __attribute__((__warning__ (msg))) +# define __errordecl(name, msg) \ + extern void name (void) __attribute__((__error__ (msg))) +#else +# define __warndecl(name, msg) extern void name (void) +# define __warnattr(msg) +# define __errordecl(name, msg) extern void name (void) +#endif /* Support for flexible arrays. */ #if __GNUC_PREREQ (2,97) @@ -286,6 +297,31 @@ # define __always_inline __inline #endif +/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 + inline semantics, unless -fgnu89-inline is used. */ +#if !defined __cplusplus || __GNUC_PREREQ (4,3) +# if defined __GNUC_STDC_INLINE__ || defined __cplusplus +# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) +# if __GNUC_PREREQ (4,3) +# define __extern_always_inline \ + extern __always_inline __attribute__ ((__gnu_inline__, __artificial__)) +# else +# define __extern_always_inline \ + extern __always_inline __attribute__ ((__gnu_inline__)) +# endif +# else +# define __extern_inline extern __inline +# define __extern_always_inline extern __always_inline +# endif +#endif + +/* GCC 4.3 and above allow passing all anonymous arguments of an + __extern_always_inline function to some other vararg function. */ +#if __GNUC_PREREQ (4,3) +# define __va_arg_pack() __builtin_va_arg_pack () +# define __va_arg_pack_len() __builtin_va_arg_pack_len () +#endif + /* It is possible to compile containing GCC extensions even if GCC is run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before |