Reorganize C++ exceptions; ref #3470

There are 3 levels of C++ exception handling:
* default - no C++ exception (use setjmp/longjmp)
* enable_cxx_exception (use C++ exceptions with C ABI)
* enable_cxx_abi (use C++ ABI including exceptions)
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-03-02 10:58:26 +09:00
parent fdd92750fe
commit 0bcf9e28fc
8 changed files with 55 additions and 32 deletions
+4 -2
View File
@@ -7,8 +7,10 @@
#ifndef MRB_THROW_H
#define MRB_THROW_H
#if defined(MRB_ENABLE_CXX_EXCEPTION) && !defined(__cplusplus)
#error Trying to use C++ exception handling in C code
#if defined(MRB_ENABLE_CXX_ABI)
# if !defined(__cplusplus)
# error Trying to use C++ exception handling in C code
# endif
#endif
#if defined(MRB_ENABLE_CXX_EXCEPTION) && defined(__cplusplus)