Merge pull request #1060 from asuessenbach/alias

Downgrade attribute "extends" of enum alias elements from required to optional.
This commit is contained in:
Andreas Süßenbach 2021-09-06 11:01:58 +02:00 committed by GitHub
commit 4c8d98c81a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14010,7 +14010,7 @@ void VulkanHppGenerator::readRequireEnumAlias( tinyxml2::XMLElement const *
std::map<std::string, std::string> const & attributes ) std::map<std::string, std::string> const & attributes )
{ {
int line = element->GetLineNum(); int line = element->GetLineNum();
checkAttributes( line, attributes, { { "alias", {} }, { "extends", {} }, { "name", {} } }, { { "comment", {} } } ); checkAttributes( line, attributes, { { "alias", {} }, { "name", {} } }, { { "comment", {} }, { "extends", {} } } );
checkElements( line, getChildElements( element ), {} ); checkElements( line, getChildElements( element ), {} );
std::string alias, bitpos, name, extends, extnumber, offset, value; std::string alias, bitpos, name, extends, extnumber, offset, value;
@ -14030,11 +14030,14 @@ void VulkanHppGenerator::readRequireEnumAlias( tinyxml2::XMLElement const *
} }
} }
if ( !extends.empty() )
{
auto enumIt = m_enums.find( extends ); auto enumIt = m_enums.find( extends );
check( enumIt != m_enums.end(), line, "feature extends unknown enum <" + extends + ">" ); check( enumIt != m_enums.end(), line, "feature extends unknown enum <" + extends + ">" );
// add this enum name to the list of aliases // add this enum name to the list of aliases
enumIt->second.addEnumAlias( line, name, alias ); enumIt->second.addEnumAlias( line, name, alias );
}
} }
void VulkanHppGenerator::readRequires( tinyxml2::XMLElement const * element, void VulkanHppGenerator::readRequires( tinyxml2::XMLElement const * element,