diff mbox

Ping: [PATCH] non-GNU C++ compilers

Message ID alpine.DEB.2.02.1110212044230.6478@laptop-mg.saclay.inria.fr
State New
Headers show

Commit Message

Marc Glisse Oct. 21, 2011, 6:47 p.m. UTC
Hello,

anyone willing to commit this?


On Sat, 24 Sep 2011, Marc Glisse wrote:

> On Sat, 17 Sep 2011, Joseph S. Myers wrote:
>
>> These are OK (with ChangeLog entries properly omitting the "include/",
>> since they go in include/ChangeLog) in the absence of libiberty maintainer
>> objections within 72 hours.
>
> Thanks. Is someone willing to commit them now they have been accepted? I am 
> attaching them as a single patch and copying the changelog entries here for 
> convenience (I wrote the date of Monday because it looks like a day where 
> someone might have time to commit...).
>
> include/ChangeLog:
>
> 2011-09-26  Ulrich Drepper  <drepper@gmail.com>
>
> 	* obstack.h [!GNUC] (obstack_free): Avoid cast to int.
>
> 2011-09-26  Marc Glisse  <marc.glisse@inria.fr>
>
> 	* ansidecl.h (ENUM_BITFIELD): Always use enum in C++

Comments

DJ Delorie Oct. 22, 2011, 1:35 a.m. UTC | #1
Committed.  Thanks!
diff mbox

Patch

Index: include/ansidecl.h
===================================================================
--- include/ansidecl.h	(revision 179146)
+++ include/ansidecl.h	(working copy)
@@ -416,10 +416,12 @@ 
 #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
Index: include/obstack.h
===================================================================
--- include/obstack.h	(revision 179146)
+++ include/obstack.h	(working copy)
@@ -532,9 +532,9 @@ 
 # 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__ */