mirror of
https://github.com/KhronosGroup/Vulkan-Hpp
synced 2024-11-14 16:21:06 +00:00
28 lines
1016 B
C++
28 lines
1016 B
C++
VULKAN_HPP_INLINE void resultCheck( Result result, char const * message )
|
|
{
|
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
|
ignore( result ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
|
|
ignore( message );
|
|
VULKAN_HPP_ASSERT_ON_RESULT( result == Result::eSuccess );
|
|
#else
|
|
if ( result != Result::eSuccess )
|
|
{
|
|
throwResultException( result, message );
|
|
}
|
|
#endif
|
|
}
|
|
|
|
VULKAN_HPP_INLINE void resultCheck( Result result, char const * message, std::initializer_list<Result> successCodes )
|
|
{
|
|
#ifdef VULKAN_HPP_NO_EXCEPTIONS
|
|
ignore( result ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
|
|
ignore( message );
|
|
ignore( successCodes ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
|
|
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
|
|
#else
|
|
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
|
|
{
|
|
throwResultException( result, message );
|
|
}
|
|
#endif
|
|
} |