]> sourceware.org Git - newlib-cygwin.git/commitdiff
* obstack.h [!GNUC] (obstack_free): Avoid cast to int.
authorDJ Delorie <dj@redhat.com>
Sat, 22 Oct 2011 01:35:29 +0000 (01:35 +0000)
committerDJ Delorie <dj@redhat.com>
Sat, 22 Oct 2011 01:35:29 +0000 (01:35 +0000)
* ansidecl.h (ENUM_BITFIELD): Always use enum in C++

include/ChangeLog
include/ansidecl.h
include/obstack.h

index b5d2d72d2512681b94b58e3455b4e6e7c33044ff..716b43b66a84e6c3fa1ca9fbe0a995d4a394ecd7 100644 (file)
@@ -1,3 +1,11 @@
+2011-10-21  Ulrich Drepper  <drepper@gmail.com>
+
+       * obstack.h [!GNUC] (obstack_free): Avoid cast to int.
+
+2011-10-21  Marc Glisse  <marc.glisse@inria.fr>
+
+       * ansidecl.h (ENUM_BITFIELD): Always use enum in C++
+
 2011-10-19  Alan Modra  <amodra@gmail.com>
 
        PR ld/13254
index c39ce2f5d709ed3c5dc92f01bb0a5e5f7e996617..23d85bf0e1617bebd508e0dbd3e0bd3748d5614b 100644 (file)
@@ -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
index 4aec3a484e2c371c864e0c78317d4d63340e365c..23487ba4f4ae912f3d94608d852f561e2b183153 100644 (file)
@@ -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__ */
 
This page took 0.038384 seconds and 5 git commands to generate.