stdbool.h 883 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* $OpenBSD: stdbool.h,v 1.5 2010/07/24 22:17:03 guenther Exp $ */
  2. /*
  3. * Written by Marc Espie, September 25, 1999
  4. * Public domain.
  5. */
  6. #ifndef _STDBOOL_H_
  7. #define _STDBOOL_H_
  8. #ifndef __cplusplus
  9. #ifndef __GNUC__
  10. /* Support for _C99: type _Bool is already built-in. */
  11. /* `_Bool' type must promote to `int' or `unsigned int'. */
  12. typedef enum {
  13. false = 0,
  14. true = 1
  15. } _Bool;
  16. /* And those constants must also be available as macros. */
  17. # define false false
  18. # define true true
  19. #else /* __GNUC__ */
  20. # define false 0
  21. # define true 1
  22. #endif
  23. /* User visible type `bool' is provided as a macro which may be redefined */
  24. #define bool _Bool
  25. #else /* __cplusplus */
  26. # define _Bool bool
  27. # define bool bool
  28. # define false false
  29. # define true true
  30. #endif
  31. /* Inform that everything is fine */
  32. #define __bool_true_false_are_defined 1
  33. #endif /* _STDBOOL_H_ */