xref: /aosp_15_r20/prebuilts/clang-tools/linux-x86/clang-headers/stdbool.h (revision bed243d3d9cd544cfb038bfa7be843dedc6e6bf7)
1*bed243d3SAndroid Build Coastguard Worker /*===---- stdbool.h - Standard header for booleans -------------------------===
2*bed243d3SAndroid Build Coastguard Worker  *
3*bed243d3SAndroid Build Coastguard Worker  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*bed243d3SAndroid Build Coastguard Worker  * See https://llvm.org/LICENSE.txt for license information.
5*bed243d3SAndroid Build Coastguard Worker  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*bed243d3SAndroid Build Coastguard Worker  *
7*bed243d3SAndroid Build Coastguard Worker  *===-----------------------------------------------------------------------===
8*bed243d3SAndroid Build Coastguard Worker  */
9*bed243d3SAndroid Build Coastguard Worker 
10*bed243d3SAndroid Build Coastguard Worker #ifndef __STDBOOL_H
11*bed243d3SAndroid Build Coastguard Worker #define __STDBOOL_H
12*bed243d3SAndroid Build Coastguard Worker 
13*bed243d3SAndroid Build Coastguard Worker #define __bool_true_false_are_defined 1
14*bed243d3SAndroid Build Coastguard Worker 
15*bed243d3SAndroid Build Coastguard Worker #if defined(__STDC_VERSION__) && __STDC_VERSION__ > 201710L
16*bed243d3SAndroid Build Coastguard Worker /* FIXME: We should be issuing a deprecation warning here, but cannot yet due
17*bed243d3SAndroid Build Coastguard Worker  * to system headers which include this header file unconditionally.
18*bed243d3SAndroid Build Coastguard Worker  */
19*bed243d3SAndroid Build Coastguard Worker #elif !defined(__cplusplus)
20*bed243d3SAndroid Build Coastguard Worker #define bool _Bool
21*bed243d3SAndroid Build Coastguard Worker #define true 1
22*bed243d3SAndroid Build Coastguard Worker #define false 0
23*bed243d3SAndroid Build Coastguard Worker #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
24*bed243d3SAndroid Build Coastguard Worker /* Define _Bool as a GNU extension. */
25*bed243d3SAndroid Build Coastguard Worker #define _Bool bool
26*bed243d3SAndroid Build Coastguard Worker #if defined(__cplusplus) && __cplusplus < 201103L
27*bed243d3SAndroid Build Coastguard Worker /* For C++98, define bool, false, true as a GNU extension. */
28*bed243d3SAndroid Build Coastguard Worker #define bool bool
29*bed243d3SAndroid Build Coastguard Worker #define false false
30*bed243d3SAndroid Build Coastguard Worker #define true true
31*bed243d3SAndroid Build Coastguard Worker #endif
32*bed243d3SAndroid Build Coastguard Worker #endif
33*bed243d3SAndroid Build Coastguard Worker 
34*bed243d3SAndroid Build Coastguard Worker #endif /* __STDBOOL_H */
35