Merge pull request #1007 from asuessenbach/protect

Add support of attribute "protect" for enum values, second part
This commit is contained in:
Andreas Süßenbach 2021-06-30 12:17:56 +02:00 committed by GitHub
commit 6217c48a88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1249,7 +1249,16 @@ void VulkanHppGenerator::appendEnumToString( std::string &
for ( auto const & value : enumData.second.values ) for ( auto const & value : enumData.second.values )
{ {
std::string enter, leave; std::string enter, leave;
if ( !value.extension.empty() )
{
assert( value.protect.empty() );
std::tie( enter, leave ) = generateProtection( value.extension ); std::tie( enter, leave ) = generateProtection( value.extension );
}
else if ( !value.protect.empty() )
{
enter = "#if defined( " + value.protect + " )\n";
leave = "#endif /*" + value.protect + "*/\n";
}
if ( previousEnter != enter ) if ( previousEnter != enter )
{ {
str += previousLeave + enter; str += previousLeave + enter;