summaryrefslogtreecommitdiff
path: root/src/port/stdbool.h
blob: 9c011e4d6134812ae9e2e2e8d372b54dacb223e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __STDBOOL_H
#define __STDBOOL_H

#include "sys.h"

/* C99 Boolean types for compilers without C99 support, see
 * http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */

/* don't define bool in C++, it exists already! */
#ifndef __cplusplus

#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#else

#if !defined HAVE_ENUM_BOOL
typedef enum {
	_Bool_must_promote_to_int = -1,
	false = 0,
	true = 1
} _Bool;
#endif /* !defined HAVE_ENUM_BOOL */

#define bool _Bool

#define true 1
#define false 0

#define __bool_true_false_are_defined 1

#endif /* ifdef HAVE_STDBOOL_H */

#endif /* ifndef __cplusplus */

#endif /* ifndef STDBOOL_H */