From bdea9e5fe8cb19d89015d8a6543ecab4b9e76a01 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Sat, 22 Oct 2011 01:35:29 +0000 Subject: [PATCH] * obstack.h [!GNUC] (obstack_free): Avoid cast to int. * ansidecl.h (ENUM_BITFIELD): Always use enum in C++ --- include/ChangeLog | 8 ++++++++ include/ansidecl.h | 6 ++++-- include/obstack.h | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/ChangeLog b/include/ChangeLog index b5d2d72d2..716b43b66 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,11 @@ +2011-10-21 Ulrich Drepper + + * obstack.h [!GNUC] (obstack_free): Avoid cast to int. + +2011-10-21 Marc Glisse + + * ansidecl.h (ENUM_BITFIELD): Always use enum in C++ + 2011-10-19 Alan Modra PR ld/13254 diff --git a/include/ansidecl.h b/include/ansidecl.h index c39ce2f5d..23d85bf0e 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -416,10 +416,12 @@ 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 GCC. +/* Be conservative and only use enum bitfields with C++ or GCC. FIXME: provide a complete autoconf test for buggy enum bitfields. */ -#if (GCC_VERSION > 2000) +#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 diff --git a/include/obstack.h b/include/obstack.h index 4aec3a484..23487ba4f 100644 --- a/include/obstack.h +++ b/include/obstack.h @@ -532,9 +532,9 @@ __extension__ \ # define obstack_free(h,obj) \ ( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ - ? (int) ((h)->next_free = (h)->object_base \ - = (h)->temp + (char *) (h)->chunk) \ - : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0))) + ? (((h)->next_free = (h)->object_base \ + = (h)->temp + (char *) (h)->chunk), 0) \ + : ((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0))) #endif /* not __GNUC__ or not __STDC__ */