Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame] | 1 | //===-- lldb-private-defines.h ----------------------------------*- C++ -*-===// |
| 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 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 9 | #ifndef LLDB_LLDB_PRIVATE_DEFINES_H |
| 10 | #define LLDB_LLDB_PRIVATE_DEFINES_H |
Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame] | 11 | |
| 12 | #if defined(__cplusplus) |
| 13 | |
| 14 | // Include Compiler.h here so we don't define LLVM_FALLTHROUGH and then |
| 15 | // Compiler.h later tries to redefine it. |
| 16 | #include "llvm/Support/Compiler.h" |
| 17 | |
| 18 | #ifndef LLVM_FALLTHROUGH |
| 19 | |
| 20 | #ifndef __has_cpp_attribute |
| 21 | #define __has_cpp_attribute(x) 0 |
| 22 | #endif |
| 23 | |
| 24 | /// \macro LLVM_FALLTHROUGH |
| 25 | /// Marks an empty statement preceding a deliberate switch fallthrough. |
| 26 | #if __has_cpp_attribute(clang::fallthrough) |
| 27 | #define LLVM_FALLTHROUGH [[clang::fallthrough]] |
| 28 | #else |
| 29 | #define LLVM_FALLTHROUGH |
| 30 | #endif |
| 31 | |
| 32 | #endif // ifndef LLVM_FALLTHROUGH |
| 33 | |
| 34 | #endif // #if defined(__cplusplus) |
| 35 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 36 | #endif // LLDB_LLDB_PRIVATE_DEFINES_H |