[BACK]Return to stdbool.h CVS log [TXT][DIR] Up to [local] / src / include

Annotation of src/include/stdbool.h, Revision 1.7

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