From ac0b8eec3402e2baf6da9a8fd5fa030133d7ea27 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Sat, 12 Mar 2016 09:40:16 +0000 Subject: [PATCH] libunwind-gcc-4.8.5 git-svn-id: svn://kolibrios.org@6326 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/sdk/sources/gcc_eh/ansidecl.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/contrib/sdk/sources/gcc_eh/ansidecl.h b/contrib/sdk/sources/gcc_eh/ansidecl.h index 8b76647426..40f4a5fea4 100644 --- a/contrib/sdk/sources/gcc_eh/ansidecl.h +++ b/contrib/sdk/sources/gcc_eh/ansidecl.h @@ -279,8 +279,15 @@ So instead we use the macro below and test it against specific values. */ # endif #endif +/* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend + couldn't parse attributes placed after the identifier name, and now + the entire compiler is built with C++. */ #ifndef ATTRIBUTE_UNUSED -#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#if GCC_VERSION >= 3004 +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#else +#define ATTRIBUTE_UNUSED +#endif #endif /* ATTRIBUTE_UNUSED */ /* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the @@ -416,6 +423,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