This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the EGCS project.
standards compliance fix for stdbool.h
- To: gcc-patches@egcs.cygnus.com
- Subject: standards compliance fix for stdbool.h
- From: Zack Weinberg <zack@rabi.columbia.edu>
- Date: Sat, 17 Jul 1999 19:16:09 -0400
In the current draft standard, the actual type provided by stdbool.h is
supposed to be called "_Bool"; bool is #defined to _Bool. This is so people
can #undef it if it conflicts.
zw
1999-07-17 Zack Weinberg <zack@rabi.columbia.edu>
* stdbool.h: Make the typedef name _Bool, with bool a #defined
alias.
Index: ginclude/stdbool.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/ginclude/stdbool.h,v
retrieving revision 1.2
diff -u -r1.2 stdbool.h
--- ginclude/stdbool.h 1998/12/16 21:19:24 1.2
+++ ginclude/stdbool.h 1999/07/17 23:09:39
@@ -2,17 +2,20 @@
#ifndef __STDBOOL_H__
#define __STDBOOL_H__ 1
-/* The type `bool' must promote to `int' or `unsigned int'. The constants
+/* The type `_Bool' must promote to `int' or `unsigned int'. The constants
`true' and `false' must have the value 0 and 1 respectively. */
typedef enum
{
false = 0,
true = 1
- } bool;
+ } _Bool;
/* The names `true' and `false' must also be made available as macros. */
#define false false
#define true true
+
+/* The macro `bool', which may be undefined, expands to _Bool. */
+#define bool _Bool
/* Signal that all the definitions are present. */
#define __bool_true_false_are_defined 1