defaults.h (BOOL_TYPE_SIZE): Move default here from cp/decl.c.
authorJason Merrill <jason@redhat.com>
Fri, 3 May 2002 12:09:35 +0000 (08:09 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 3 May 2002 12:09:35 +0000 (08:09 -0400)
        * defaults.h (BOOL_TYPE_SIZE): Move default here from cp/decl.c.
        * c-decl.c (c_init_decl_processing): Use it.
        * config/rs6000/darwin.h (BOOL_TYPE_SIZE): Define to INT_TYPE_SIZE.
        * config/i960/i960.h (BOOL_TYPE_SIZE): Don't define.
        * config/mcore/mcore.h (BOOL_TYPE_SIZE): Don't define.

From-SVN: r53089

gcc/ChangeLog
gcc/c-decl.c
gcc/config/i960/i960.h
gcc/config/mcore/mcore.h
gcc/config/rs6000/darwin.h
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/defaults.h

index 827bd7a..512da23 100644 (file)
@@ -1,3 +1,11 @@
+2002-05-02  Jason Merrill  <jason@redhat.com>
+
+       * defaults.h (BOOL_TYPE_SIZE): Move default here from cp/decl.c.
+       * c-decl.c (c_init_decl_processing): Use it.
+       * config/rs6000/darwin.h (BOOL_TYPE_SIZE): Define to INT_TYPE_SIZE.
+       * config/i960/i960.h (BOOL_TYPE_SIZE): Don't define.
+       * config/mcore/mcore.h (BOOL_TYPE_SIZE): Don't define.
+
 2002-05-03  Kazu Hirata  <kazu@cs.umass.edu>
 
        * regrename.c: Fix formatting.
index 0898613..ae4cebb 100644 (file)
@@ -2913,8 +2913,7 @@ c_init_decl_processing ()
   boolean_true_node = integer_one_node;
   boolean_false_node = integer_zero_node;
 
-  /* With GCC, C99's _Bool is always of size 1.  */
-  c_bool_type_node = make_unsigned_type (CHAR_TYPE_SIZE);
+  c_bool_type_node = make_unsigned_type (BOOL_TYPE_SIZE);
   TREE_SET_CODE (c_bool_type_node, BOOLEAN_TYPE);
   TYPE_MAX_VALUE (c_bool_type_node) = build_int_2 (1, 0);
   TREE_TYPE (TYPE_MAX_VALUE (c_bool_type_node)) = c_bool_type_node;
index 794b3c9..bf5aada 100644 (file)
@@ -1174,11 +1174,6 @@ struct cum_args { int ca_nregparms; int ca_nstackparms; };
 
 #define SLOW_BYTE_ACCESS 1
 
-/* Force sizeof(bool) == 1 to maintain binary compatibility; otherwise, the
-   change in SLOW_BYTE_ACCESS would have changed it to 4.  */
-
-#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
-
 /* We assume that the store-condition-codes instructions store 0 for false
    and some other value for true.  This is the value stored for true.  */
 
index 22fee84..6ef9613 100644 (file)
@@ -254,9 +254,6 @@ extern const char * mcore_stack_increment_string;
    words.  */
 #define LONG_LONG_TYPE_SIZE 64
 
-/* the size of the boolean type -- in C++; */
-#define        BOOL_TYPE_SIZE  8
-
 /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
 #define PARM_BOUNDARY          32
 
index 31efaac..81c24e7 100644 (file)
@@ -233,3 +233,7 @@ Boston, MA 02111-1307, USA.  */
    space/speed.  */
 #undef MAX_LONG_TYPE_SIZE
 #define MAX_LONG_TYPE_SIZE 32
+
+/* For binary compatibility with 2.95; Darwin C APIs use bool from
+   stdbool.h, which was an int-sized enum in 2.95.  */
+#define BOOL_TYPE_SIZE INT_TYPE_SIZE
index 20b8ccf..4e0100e 100644 (file)
@@ -1,3 +1,7 @@
+2002-05-03  Jason Merrill  <jason@redhat.com>
+
+       * decl.c (BOOL_TYPE_SIZE): Move default to defaults.h.
+
 2002-04-30  Mark Mitchell  <mark@codesourcery.com>
 
        ABI change, returning simple classes from functions.
index f354336..c854cb7 100644 (file)
@@ -49,11 +49,6 @@ Boston, MA 02111-1307, USA.  */
 #include "c-pragma.h"
 #include "diagnostic.h"
 
-#ifndef BOOL_TYPE_SIZE
-/* `bool' has size and alignment `1', on all platforms.  */
-#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
-#endif
-
 static tree grokparms                          PARAMS ((tree));
 static const char *redeclaration_error_message PARAMS ((tree, tree));
 
index 1597d52..702800a 100644 (file)
@@ -293,6 +293,11 @@ do {                                                               \
 #define CHAR_TYPE_SIZE BITS_PER_UNIT
 #endif
 
+#ifndef BOOL_TYPE_SIZE
+/* `bool' has size and alignment `1', on almost all platforms.  */
+#define BOOL_TYPE_SIZE CHAR_TYPE_SIZE
+#endif
+
 #ifndef SHORT_TYPE_SIZE
 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
 #endif