[preproc] support C23 enum underlying type syntax (#2043)

This commit is contained in:
Martin Griffin authored and GitHub committed 2024-10-11 13:50:26 -04:00
1 parent 6d24d8a78f
commit fcc067e515
1 file changed
+11
+11
View File
@@ -524,6 +524,17 @@ bool AsmFile::ParseEnum()
long enumCounter = 0; long enumCounter = 0;
long symbolCount = 0; long symbolCount = 0;
if (m_buffer[m_pos] == ':') // : <type>
{
m_pos++;
std::string underlyingType;
do {
currentHeaderLine += SkipWhitespaceAndEol();
underlyingType = ReadIdentifier();
} while (!underlyingType.empty());
currentHeaderLine += SkipWhitespaceAndEol();
}
if (m_buffer[m_pos] != '{') // assume assembly macro, otherwise assume enum and report errors accordingly if (m_buffer[m_pos] != '{') // assume assembly macro, otherwise assume enum and report errors accordingly
{ {
m_pos = fallbackPosition - 4; m_pos = fallbackPosition - 4;