Browse Source

Abort instead of exit from MAGNUM_ASSERT_*_SUPPORTED() macros.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
c38407c0bb
  1. 12
      src/Context.h

12
src/Context.h

@ -378,8 +378,8 @@ class MAGNUM_EXPORT Context {
Useful for initial checks on availability of required features. Useful for initial checks on availability of required features.
By default, if assertion fails, an message is printed to error output and the By default, if assertion fails, an message is printed to error output and the
application exits with value `-3`. If `CORRADE_NO_ASSERT` is defined, this application aborts. If `CORRADE_NO_ASSERT` is defined, this macro does nothing.
macro does nothing. Example usage: Example usage:
@code @code
MAGNUM_ASSERT_VERSION_SUPPORTED(Version::GL330); MAGNUM_ASSERT_VERSION_SUPPORTED(Version::GL330);
@endcode @endcode
@ -395,7 +395,7 @@ MAGNUM_ASSERT_VERSION_SUPPORTED(Version::GL330);
do { \ do { \
if(!Magnum::Context::current()->isVersionSupported(version)) { \ if(!Magnum::Context::current()->isVersionSupported(version)) { \
Corrade::Utility::Error() << "Magnum: required version" << version << "is not supported"; \ Corrade::Utility::Error() << "Magnum: required version" << version << "is not supported"; \
std::exit(-3); \ std::abort(); \
} \ } \
} while(0) } while(0)
#endif #endif
@ -408,8 +408,8 @@ MAGNUM_ASSERT_VERSION_SUPPORTED(Version::GL330);
Useful for initial checks on availability of required features. Useful for initial checks on availability of required features.
By default, if assertion fails, an message is printed to error output and the By default, if assertion fails, an message is printed to error output and the
application exits with value `-3`. If `CORRADE_NO_ASSERT` is defined, this application aborts. If `CORRADE_NO_ASSERT` is defined, this macro does nothing.
macro does nothing. Example usage: Example usage:
@code @code
MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::geometry_shader4); MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::geometry_shader4);
@endcode @endcode
@ -425,7 +425,7 @@ MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::geometry_shader4);
do { \ do { \
if(!Magnum::Context::current()->isExtensionSupported<extension>()) { \ if(!Magnum::Context::current()->isExtensionSupported<extension>()) { \
Corrade::Utility::Error() << "Magnum: required extension" << extension::string() << "is not supported"; \ Corrade::Utility::Error() << "Magnum: required extension" << extension::string() << "is not supported"; \
std::exit(-3); \ std::abort(); \
} \ } \
} while(0) } while(0)
#endif #endif

Loading…
Cancel
Save