From 3b46f5c49740e2a3e8aa5619300f20bcecfcbc6c Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Wed, 30 Jun 2021 11:14:15 +0200 Subject: [PATCH] Add support of attribute "protect" for enum values, second part --- VulkanHppGenerator.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 8372cbd..92d68f8 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -1249,7 +1249,16 @@ void VulkanHppGenerator::appendEnumToString( std::string & for ( auto const & value : enumData.second.values ) { std::string enter, leave; - std::tie( enter, leave ) = generateProtection( value.extension ); + if ( !value.extension.empty() ) + { + assert( value.protect.empty() ); + 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 ) { str += previousLeave + enter;