mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 23:00:42 -07:00
Initial commit for GitHub migration based on spice2x-25-03-03
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user