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 827bd7a017f303843802599037f51fe37fd09957..512da23466f42c1d8b4d2c00e42d21fa1a3459eb 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 0898613ed9a2b12324fae9e74dc142b44266af84..ae4cebb9d0c7db9d33a254eccfa655fc93d22f7b 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 794b3c90579ff2767c6f2ffe026c60e79b4a6687..bf5aadad99fe3b4b7435cd27a0132138fbafd103 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 22fee8450d042271210dfb6270dfa1153945a122..6ef9613030a1294d374b4d5918238573eca95185 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 31efaac0cacfc8425c59e2aeba2a44dad8b075d5..81c24e76814b8ed09a0f9462ebfe3eda4bf9c3b4 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 20b8ccf606a79af6d868f15843c06a88c08f6fa0..4e0100ea30060381bc94c90fa602a7cab89e9f71 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 f354336d3c3bdf7be9bd53885b64c4e2910cf1d4..c854cb707d81f79a8d961db78aaaa099de6545b9 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 1597d52a97cd429f76e2aa33e249d8e79781ed35..702800ad7ab4f18d7b9094b17c4cc613767883f7 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