Browse Source

Vk: hello, MinGW, why are you so special again?!

pull/504/head
Vladimír Vondruš 5 years ago
parent
commit
18817ed58a
  1. 5
      src/Magnum/Vk/Assert.h

5
src/Magnum/Vk/Assert.h

@ -108,6 +108,9 @@ including the @ref Magnum/Vk/Assert.h header.
return Magnum::Vk::Result(call); \ return Magnum::Vk::Result(call); \
}() }()
#elif defined(CORRADE_STANDARD_ASSERT) #elif defined(CORRADE_STANDARD_ASSERT)
/* MinGW GCC 8 for some reason needs the `return Magnum::Vk::Result();` at the
end, otherwise it complains about non-void function exiting with no return.
All other compilers understand the abort() as a noreturn function. */
#define MAGNUM_VK_INTERNAL_ASSERT_SUCCESS_OR(call, ...) \ #define MAGNUM_VK_INTERNAL_ASSERT_SUCCESS_OR(call, ...) \
[&]() { \ [&]() { \
const Magnum::Vk::Result _CORRADE_HELPER_PASTE(magnumVkResult, __LINE__) = Magnum::Vk::Result(call); \ const Magnum::Vk::Result _CORRADE_HELPER_PASTE(magnumVkResult, __LINE__) = Magnum::Vk::Result(call); \
@ -116,6 +119,7 @@ including the @ref Magnum/Vk/Assert.h header.
return _CORRADE_HELPER_PASTE(magnumVkResult, __LINE__); \ return _CORRADE_HELPER_PASTE(magnumVkResult, __LINE__); \
} \ } \
assert(false); \ assert(false); \
return Magnum::Vk::Result(); \
}() }()
#else #else
#define MAGNUM_VK_INTERNAL_ASSERT_SUCCESS_OR(call, ...) \ #define MAGNUM_VK_INTERNAL_ASSERT_SUCCESS_OR(call, ...) \
@ -127,6 +131,7 @@ including the @ref Magnum/Vk/Assert.h header.
} \ } \
Corrade::Utility::Error{Corrade::Utility::Error::defaultOutput()} << "Call " #call " failed with" << _CORRADE_HELPER_PASTE(magnumVkResult, __LINE__) << "at " __FILE__ ":" CORRADE_LINE_STRING; \ Corrade::Utility::Error{Corrade::Utility::Error::defaultOutput()} << "Call " #call " failed with" << _CORRADE_HELPER_PASTE(magnumVkResult, __LINE__) << "at " __FILE__ ":" CORRADE_LINE_STRING; \
std::abort(); \ std::abort(); \
return Magnum::Vk::Result(); \
}() }()
#endif #endif
#endif #endif

Loading…
Cancel
Save