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

This commit is contained in:
Martin Griffin 2024-10-11 18:50:26 +01:00 committed by GitHub
parent 6d24d8a78f
commit fcc067e515
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -524,6 +524,17 @@ bool AsmFile::ParseEnum()
long enumCounter = 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
{
m_pos = fallbackPosition - 4;