Skip to content

Commit 84d60fd

Browse files
committed
Add ENUM with array define
1 parent 4f3431d commit 84d60fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/defs.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@
1515
#endif
1616

1717
// clang-format off
18-
#define SMART_STRINGIFY_CASE(ENUM_CODE) case ENUM_CODE: return # ENUM_CODE
18+
#define ENUM_STR_CASE(ENUM_CODE) case ENUM_CODE: return #ENUM_CODE
1919
// clang-format on
20+
21+
#define ENUM(name, atype, ...) \
22+
enum name { __VA_ARGS__ }; \
23+
static constexpr atype All_##name##_usize[] = { __VA_ARGS__ };

0 commit comments

Comments
 (0)