Merge pull request #1119 from asuessenbach/enum

Extend enum type search in readEnums.
This commit is contained in:
Andreas Süßenbach 2021-11-02 21:49:29 +01:00 committed by GitHub
commit fa98c57db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12143,6 +12143,13 @@ void VulkanHppGenerator::readEnums( tinyxml2::XMLElement const * element )
// get the EnumData entry in enum map
std::map<std::string, EnumData>::iterator enumIt = m_enums.find( name );
if ( enumIt == m_enums.end() )
{
enumIt = std::find_if( m_enums.begin(),
m_enums.end(),
[&name]( std::pair<std::string, EnumData> const & enumData )
{ return enumData.second.alias == name; } );
}
check( enumIt != m_enums.end(), line, "enum <" + name + "> is not listed as enum in the types section" );
check( enumIt->second.values.empty(), line, "enum <" + name + "> already holds values" );