1 //===-- lldb-private-defines.h ----------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_lldb_private_defines_h_
10 #define liblldb_lldb_private_defines_h_
12 #if defined(__cplusplus)
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"
18 #ifndef LLVM_FALLTHROUGH
20 #ifndef __has_cpp_attribute
21 #define __has_cpp_attribute(x) 0
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]]
29 #define LLVM_FALLTHROUGH
32 #endif // ifndef LLVM_FALLTHROUGH
34 #endif // #if defined(__cplusplus)
36 #endif // liblldb_lldb_private_defines_h_