use _Static_assert to ensure DP_DoomState_Strings matches DP_Doomstate enum
This commit is contained in:
parent
01742f13d7
commit
7dbcf4bbb5
2 changed files with 5 additions and 2 deletions
|
@ -101,4 +101,7 @@ const char *const DP_DoomState_Strings[DP_DS_COUNT] =
|
|||
"DoomState_Ready",
|
||||
"DoomState_Running",
|
||||
"DoomState_Quit",
|
||||
};
|
||||
};
|
||||
|
||||
_Static_assert(sizeof(DP_DoomState_Strings) / sizeof(DP_DoomState_Strings[0]) == DP_DS_COUNT,
|
||||
"DP_DoomState enum and strings do not match up");
|
|
@ -46,7 +46,7 @@ typedef enum DP_DoomState
|
|||
DP_DS_COUNT,
|
||||
} DP_DoomState;
|
||||
|
||||
extern const char *const DP_DoomState_Strings[DP_DS_COUNT];
|
||||
extern const char *const DP_DoomState_Strings[];
|
||||
|
||||
static inline const char *doomstate_str(DP_DoomState ds)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue