diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-26 22:41:40 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-12 13:02:05 -0600 |
commit | 5255dbd5196f0125b51d969c46e46ac5765db7ed (patch) | |
tree | 8af92c558c12c231ff3ea2bec991c77d947e6ffe /libmisc | |
parent | cd5e55ebb7d5a51c0a8bd62137ab75a0f6ff1356 (diff) |
libmisc: macro.h: Add LM_PARTIAL_SWITCH, use it
Diffstat (limited to 'libmisc')
-rw-r--r-- | libmisc/include/libmisc/macro.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libmisc/include/libmisc/macro.h b/libmisc/include/libmisc/macro.h index ae204ae..9ac29b9 100644 --- a/libmisc/include/libmisc/macro.h +++ b/libmisc/include/libmisc/macro.h @@ -11,6 +11,12 @@ #define LM_FORCE_SEMICOLON static_assert(1, "force semicolon") +#define LM_PARTIAL_SWITCH(VAL) \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wswitch-enum\"") \ + switch (VAL) \ + _Pragma("GCC diagnostic pop") \ + /* for function definitions */ #define LM_UNUSED(argname) |