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