1 /* $MirOS: src/include/stdbool.h,v 1.3 2009/10/16 17:35:55 tg Exp $ */ 2 /* $OpenBSD: stdbool.h,v 1.3 2004/10/02 12:55:31 espie Exp $ */ 3 4 /* 5 * Written by Marc Espie, September 25, 1999 6 * Public domain. 7 */ 8 9 #ifndef _STDBOOL_H_ 10 #define _STDBOOL_H_ 11 12 #ifndef __cplusplus 13 14 #if (defined(__GNUC__) && __GNUC__ >= 3) || defined(__PCC__) || \ 15 defined(__NWCC__) 16 /* Support for _C99: type _Bool is already built-in. */ 17 #define false 0 18 #define true 1 19 20 #else 21 /* `_Bool' type must promote to `int' or `unsigned int'. */ 22 typedef enum { 23 false = 0, 24 true = 1 25 } _Bool; 26 27 /* And those constants must also be available as macros. */ 28 #define false false 29 #define true true 30 31 #endif 32 33 /* User visible type `bool' is provided as a macro which may be redefined */ 34 #define bool _Bool 35 36 #else /* __cplusplus */ 37 #define _Bool bool 38 #define bool bool 39 #define false false 40 #define true true 41 #endif /* __cplusplus */ 42 43 /* Inform that everything is fine */ 44 #define __bool_true_false_are_defined 1 45 46 #endif /* _STDBOOL_H_ */ 47