1 | // Copyright 2018 the V8 project authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | #ifndef V8_BASE_V8_FALLTHROUGH_H_ |
6 | #define V8_BASE_V8_FALLTHROUGH_H_ |
7 | |
8 | // When clang suggests inserting [[clang::fallthrough]], it first checks if |
9 | // it knows of a macro expanding to it, and if so suggests inserting the |
10 | // macro. This means that this macro must be used only in code internal |
11 | // to v8, so that v8's user code doesn't end up getting suggestions |
12 | // for V8_FALLTHROUGH instead of the user-specific fallthrough macro. |
13 | // So do not include this header in any of v8's public headers -- only |
14 | // use it in src/, not in include/. |
15 | #if defined(__clang__) |
16 | #define V8_FALLTHROUGH [[clang::fallthrough]] // NOLINT(whitespace/braces) |
17 | #else |
18 | #define V8_FALLTHROUGH |
19 | #endif |
20 | |
21 | #endif // V8_BASE_V8_FALLTHROUGH_H_ |
22 | |