mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
Use [[maybe_unused]] instead of YS_ATTRIBUTE(unused).
[[maybe_unused]] is available since C++17, so this commit adds a polyfill YS_MAYBE_UNUSED. Once we require C++17 we can drop it.
This commit is contained in:
parent
118e4caa37
commit
c8c3c7af87
2 changed files with 18 additions and 10 deletions
|
@ -144,6 +144,14 @@ extern Tcl_Obj *Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *p
|
|||
# define YS_ATTRIBUTE(...)
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
# define YS_MAYBE_UNUSED [[maybe_unused]];
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
# define YS_MAYBE_UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
# define YS_MAYBE_UNUSED
|
||||
#endif
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
# define YS_FALLTHROUGH [[fallthrough]];
|
||||
#elif defined(__clang__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue