summaryrefslogtreecommitdiff
path: root/include/libc/stdbool.h
blob: d3f951bdfb4afb0d645910b6c8236d3ef7c1116e (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
#ifndef LIBC_STDBOOL_H
#define LIBC_STDBOOL_H

#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined 1
#endif

#ifndef __cplusplus

#if (__STDC_VERSION__ >= 199901L) && !defined(PERMUTER)
#define bool  _Bool
#define false 0
#define true  1
#elif CC_CHECK
// A way to enforce bools to not be treated the same as s32 by the host compiler
// This has to be an ifdef because an enum-return-type doesn't match on `return (thing1) && (thing2);` patterns
typedef enum bool {
    false,
    true
} bool;
#else
typedef int bool;

#define false   0
#define true    1
#endif

#endif /* __cplusplus */

#endif /* STDBOOL */