From 05bd56f8c5296bf52c72e0e956403a3c6bd5e242 Mon Sep 17 00:00:00 2001 From: Markus Tavenrath Date: Thu, 30 Nov 2017 15:18:58 +0100 Subject: [PATCH] Fix issue #147. Do not assert on negative result codes when throwing an exception. There're cases where vendors are non-standard conform and return positive return codes and it's also possible that new success codes could be introduced which require special handling. For the latter case it's legit to throw an exception which a positive result code. (#156) --- VulkanHppGenerator.cpp | 1 - vulkan/vulkan.hpp | 1 - 2 files changed, 2 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index d222ccb..edd26e0 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -3899,7 +3899,6 @@ void writeThrowExceptions( std::ostream & os, EnumData const& enumData) os << R"( VULKAN_HPP_INLINE void throwResultException( Result result, char const * message ) { - assert ( static_cast(result) < 0 ); switch ( result ) { )"; diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 68a3474..84c2777 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -819,7 +819,6 @@ namespace VULKAN_HPP_NAMESPACE VULKAN_HPP_INLINE void throwResultException( Result result, char const * message ) { - assert ( static_cast(result) < 0 ); switch ( result ) { case Result::eErrorOutOfHostMemory: throw OutOfHostMemoryError ( message );