Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sudo-project
GitHub Repository: sudo-project/sudo
Path: blob/main/include/compat/stdbool.h
1532 views
1
/* $OpenBSD: stdbool.h,v 1.5 2010/07/24 22:17:03 guenther Exp $ */
2
3
/*
4
* Written by Marc Espie, September 25, 1999
5
* Public domain.
6
*/
7
8
#ifndef COMPAT_STDBOOL_H
9
#define COMPAT_STDBOOL_H
10
11
#ifndef __cplusplus
12
13
#if (defined(HAVE__BOOL) && HAVE__BOOL > 0) || defined(lint)
14
/* Support for _C99: type _Bool is already built-in. */
15
#define false 0
16
#define true 1
17
18
#else
19
/* `_Bool' type must promote to `int' or `unsigned int'. */
20
typedef enum {
21
false = 0,
22
true = 1
23
} _Bool;
24
25
/* And those constants must also be available as macros. */
26
#define false false
27
#define true true
28
29
#endif
30
31
/* User visible type `bool' is provided as a macro which may be redefined */
32
#define bool _Bool
33
34
#else /* __cplusplus */
35
#define _Bool bool
36
#define bool bool
37
#define false false
38
#define true true
39
#endif /* __cplusplus */
40
41
/* Inform that everything is fine */
42
#define __bool_true_false_are_defined 1
43
44
#endif /* COMPAT_STDBOOL_H */
45
46