3
0
Fork 0
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:
whitequark 2020-06-19 15:45:52 +00:00
parent 118e4caa37
commit c8c3c7af87
2 changed files with 18 additions and 10 deletions

View file

@ -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__)