mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 16:07:04 -06:00
amend to #222: prevent merge errors by unexpected growing of properties enum in compilers supporting constexpr/static_assert, checking its length at compile time:
ARRAY_SIZE(g_NameToPropID) must be always equal NCoderPropID::kEndOfProp
This commit is contained in:
@@ -331,6 +331,11 @@ static const CNameToPropID g_NameToPropID[] =
|
||||
{ VT_UI4, "ldmhevery" }
|
||||
};
|
||||
|
||||
#if defined(static_assert) || (__STDC_VERSION >= 201112L) || (_MSC_VER >= 1900)
|
||||
static_assert(ARRAY_SIZE(g_NameToPropID) == NCoderPropID::kEndOfProp,
|
||||
"g_NameToPropID doesn't match NCoderPropID enum");
|
||||
#endif
|
||||
|
||||
static int FindPropIdExact(const UString &name)
|
||||
{
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(g_NameToPropID); i++)
|
||||
|
||||
Reference in New Issue
Block a user