X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=include%2Fansidecl.h;h=23d85bf0e1617bebd508e0dbd3e0bd3748d5614b;hb=3ebb9d0b5b601b6872c9a6cac88a55133efef47b;hp=86b094474825708040abe56ad06f4ff7793f07f8;hpb=5741047ef3d6bd21528067e7ff6b0af43efc5614;p=pf3gnuchains%2Fgcc-fork.git diff --git a/include/ansidecl.h b/include/ansidecl.h index 86b09447482..23d85bf0e16 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -1,6 +1,6 @@ /* ANSI and traditional C compatability macros Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2009 + 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -178,7 +178,7 @@ So instead we use the macro below and test it against specific values. */ /* inline requires special treatment; it's in C99, and GCC >=2.7 supports it too, but it's not in C89. */ #undef inline -#if __STDC_VERSION__ > 199901L || defined(__cplusplus) +#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__)) /* it's a keyword */ #else # if GCC_VERSION >= 2007 @@ -416,6 +416,17 @@ So instead we use the macro below and test it against specific values. */ #define EXPORTED_CONST const #endif +/* Be conservative and only use enum bitfields with C++ or GCC. + FIXME: provide a complete autoconf test for buggy enum bitfields. */ + +#ifdef __cplusplus +#define ENUM_BITFIELD(TYPE) enum TYPE +#elif (GCC_VERSION > 2000) +#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE +#else +#define ENUM_BITFIELD(TYPE) unsigned int +#endif + #ifdef __cplusplus } #endif