Let us start here, from square one. No, from Zero!

This commit is contained in:
smpn2
2022-09-30 22:45:51 +09:00
parent 14215af0d1
commit b7a60638a4
1005 changed files with 303069 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include "external/fmt/include/fmt/format.h"
#define ENUM_VARIANT(value) case (value): return #value
#define FLAGS_START(VAR) \
if ((VAR) == 0) { \
return "0x0"; \
} \
\
bool first = true; \
std::string result
#define FLAG(VAR, value) \
do { \
if ((VAR) & (value)) { \
if (!first) { \
result += " | "; \
} \
first = false; \
result += (#value); \
} \
} while (0)
#define FLAGS_END(VAR) \
if (result.empty()) { \
result = fmt::format("0x{:08x}", (VAR)); \
} \
\
return result