| 1 | /* clang-format off */ |
| 2 | /* clang-format gets confused by the #define bool line, and gives crazy indenting */ |
| 3 | #ifndef AWS_COMMON_STDBOOL_H |
| 4 | #define AWS_COMMON_STDBOOL_H |
| 5 | |
| 6 | /* |
| 7 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 8 | * |
| 9 | * Licensed under the Apache License, Version 2.0 (the "License"). |
| 10 | * You may not use this file except in compliance with the License. |
| 11 | * A copy of the License is located at |
| 12 | * |
| 13 | * http://aws.amazon.com/apache2.0 |
| 14 | * |
| 15 | * or in the "license" file accompanying this file. This file is distributed |
| 16 | * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 17 | * express or implied. See the License for the specific language governing |
| 18 | * permissions and limitations under the License. |
| 19 | */ |
| 20 | |
| 21 | #ifndef NO_STDBOOL |
| 22 | # include <stdbool.h> /* NOLINT(fuchsia-restrict-system-includes) */ |
| 23 | #else |
| 24 | # ifndef __cplusplus |
| 25 | # define bool _Bool |
| 26 | # define true 1 |
| 27 | # define false 0 |
| 28 | # elif defined(__GNUC__) && !defined(__STRICT_ANSI__) |
| 29 | # define _Bool bool |
| 30 | # if __cplusplus < 201103L |
| 31 | /* For C++98, define bool, false, true as a GNU extension. */ |
| 32 | # define bool bool |
| 33 | # define false false |
| 34 | # define true true |
| 35 | # endif /* __cplusplus < 201103L */ |
| 36 | # endif /* __cplusplus */ |
| 37 | #endif /* NO_STDBOOL */ |
| 38 | |
| 39 | #endif /* AWS_COMMON_STDBOOL_H */ |
| 40 | /* clang-format on */ |
| 41 | |