]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
defaults.h (BOOL_TYPE_SIZE): Move default here from cp/decl.c.
authorJason Merrill <jason@redhat.com>
Fri, 3 May 2002 12:07:13 +0000 (08:07 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 3 May 2002 12:07:13 +0000 (08:07 -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: r53087

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 6ba526678081a24973aba767e9b5aab49ed20981..ceaa81a13c7f5dbefbe69c50c8da544cc35488f2 100644 (file)
@@ -1,5 +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.
+
        * dwarf2out.c (gen_type_die): Don't recurse if TYPE_NAME doesn't
        actually declare this type.
 
index 59ef4d4e8a9d52d930ce3c6bae84d1e3f208d821..262825720c4cbe5280b5582b65452993ebb4c70e 100644 (file)
@@ -3079,8 +3079,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 4df5a6fb14f78d47b3e83fd72a32eb063d28278a..3565ab3a54866842a34c848cfe71afd5c7f6bef8 100644 (file)
@@ -1190,11 +1190,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 8084ade5d5bca7a71f134bce63bb97eb986ba6ac..d5fe01ca1cbb3475262e6747ee19bd9f510c370b 100644 (file)
@@ -270,9 +270,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 02c5307a65093bd3606acfa37191991ebb6eec42..2844ad38d6dbba13dd2deb9c65774d1d2617e3a3 100644 (file)
@@ -1,5 +1,7 @@
 2002-05-03  Jason Merrill  <jason@redhat.com>
 
+       * decl.c (BOOL_TYPE_SIZE): Move default to defaults.h.
+
        * decl.c (grokdeclarator): Revert last change.
 
 2002-05-02  Mark Mitchell  <mark@codesourcery.com>
index 35a9315ad182731af42104c2fdefa087235f2d09..99e69fadd7c738ddd58adceaae64d53e85ab0250 100644 (file)
@@ -51,11 +51,6 @@ Boston, MA 02111-1307, USA.  */
 
 extern const struct attribute_spec *lang_attribute_table;
 
-#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 3071f1f35cd92001c1fff175b9de314a19ffaa56..8e1e1ec6f13461d59b5a80447c0147c7c28e2536 100644 (file)
@@ -285,6 +285,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