Made the lib work with -fno-exceptions (at least for now).
This commit is contained in:
@@ -4,19 +4,21 @@
|
||||
#if !defined(MIJIN_INTERNAL_EXCEPTION_HPP_INCLUDED)
|
||||
#define MIJIN_INTERNAL_EXCEPTION_HPP_INCLUDED 1
|
||||
|
||||
#if !defined(MIJIN_WITH_EXCEPTIONS)
|
||||
#define MIJIN_WITH_EXCEPTIONS 0
|
||||
#if !defined(MIJIN_ENABLE_EXCEPTIONS)
|
||||
# define MIJIN_ENABLE_EXCEPTIONS (__cpp_exceptions)
|
||||
#endif
|
||||
|
||||
#define MIJIN_CATCH_EXCEPTIONS (__cpp_exceptions)
|
||||
|
||||
#if !defined(MIJIN_THROWING_ASSERTS)
|
||||
#define MIJIN_THROWING_ASSERTS 0
|
||||
# define MIJIN_THROWING_ASSERTS 0
|
||||
#endif
|
||||
|
||||
#if MIJIN_THROWING_ASSERTS && !defined(MIJIN_TEST_NO_NOEXCEPT)
|
||||
#define MIJIN_TEST_NO_NOEXCEPT
|
||||
#endif
|
||||
|
||||
#if MIJIN_WITH_EXCEPTIONS
|
||||
#if 0 // TODO: what? MIJIN_WITH_EXCEPTIONS
|
||||
#error "Maybe someday"
|
||||
#else
|
||||
#if defined(MIJIN_TEST_NO_NOEXCEPT) // only use for testing
|
||||
@@ -30,4 +32,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if MIJIN_CATCH_EXCEPTIONS
|
||||
# define MIJIN_TRY try
|
||||
# define MIJIN_CATCH catch
|
||||
#else
|
||||
# define MIJIN_TRY
|
||||
# define MIJIN_CATCH(...) if constexpr(false)
|
||||
#endif
|
||||
|
||||
#endif // !defined(MIJIN_INTERNAL_EXCEPTION_HPP_INCLUDED)
|
||||
|
||||
Reference in New Issue
Block a user