stdbool.h 732 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * stdbool.h
  3. *
  4. * Created on: 17.10.2012
  5. * Author: muehlbrandt
  6. */
  7. #ifndef _STDBOOL_H
  8. #define _STDBOOL_H
  9. /* C99 Boolean types for compilers without C99 support */
  10. /* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */
  11. #if !defined(__cplusplus)
  12. #if !defined(__GNUC__)
  13. /* _Bool builtin type is included in GCC */
  14. /* ISO C Standard: 5.2.5 An object declared as
  15. type _Bool is large enough to store
  16. the values 0 and 1. */
  17. /* We choose 8 bit to match C++ */
  18. /* It must also promote to integer */
  19. typedef int8_t _Bool;
  20. #endif
  21. /* ISO C Standard: 7.16 Boolean type */
  22. #define bool _Bool
  23. #define true 1
  24. #define false 0
  25. #define __bool_true_false_are_defined 1
  26. #endif
  27. #endif