mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
Add YS_FALLTHROUGH macro to mark case fall-through
C++17 introduced [[fallthrough]], GCC and clang had their own vendored attributes before that. MSVC doesn't seem to have such a warning at all.
This commit is contained in:
parent
a299e606f8
commit
695150b037
5 changed files with 23 additions and 6 deletions
|
@ -155,6 +155,16 @@ extern Tcl_Obj *Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *p
|
|||
# define YS_NORETURN
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
# define YS_FALLTHROUGH [[fallthrough]];
|
||||
#elif defined(__GNUC__)
|
||||
# define YS_FALLTHROUGH [[gnu::fallthrough]];
|
||||
#elif defined(__clang__)
|
||||
# define YS_FALLTHROUGH [[clang::fallthrough]];
|
||||
#else
|
||||
# define YS_FALLTHROUGH
|
||||
#endif
|
||||
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
|
||||
// Note: All headers included in hashlib.h must be included
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue