VectorNav C Library
bool.h
1 #ifndef VNBOOL_H_INCLUDED
2 #define VNBOOL_H_INCLUDED
3 
6 #include "vn/util/compiler.h"
7 #include "vn/int.h"
8 
9 #if !defined(__cplusplus)
10 
11  #if VN_HAVE_STDBOOL_H
12  #include <stdbool.h>
13  #else
14  #if !defined(__GNUC__)
15  /* _Bool builtin type is included in GCC. */
16  /* ISO C Standard: 5.2.5 An object declared as type _Bool is large
17  * enough to store the values 0 and 1. */
18  typedef int8_t _Bool;
19  #endif
20 
21  /* ISO C Standard: 7.16 Boolean type */
22 
23  #if defined(__STDC__) && defined(__GNUC__)
24  /* Avoid warning "ISO C90/89 does not support boolean types" */
25  #define bool int8_t
26  #else
27  #define bool _Bool
28  #endif
29 
30  #define true 1
31  #define false 0
32  #define __bool_true_false_are_defined 1
33  #endif
34 
35 #endif
36 
37 #endif