From 1a1f834adeb243c5938604eb826c65d1f0efede0 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 28 Feb 2017 23:27:13 +0900 Subject: Compile C files by C compiler when C++ files mixed. ref #3267 #3470 By this commit, mruby do not use C++ ABI mode unless you specify explicitly. It compiles C files by C compilers, with C++ exception enabled when it sees C++ files in your configured mrbgems. I haven't tried visualcpp, so please submit an issue if you see any problem with C++ gems on Windows. --- doc/guides/compile.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/guides/compile.md b/doc/guides/compile.md index d07b4f65f..9ca61c6fd 100644 --- a/doc/guides/compile.md +++ b/doc/guides/compile.md @@ -242,9 +242,19 @@ conf.enable_bintest ### C++ ABI mruby can use C++ exception to raise exception internally. -It is called C++ ABI mode. By using C++ exception it can release C++ stack object correctly. -Whenever you mix C++ code C++ ABI mode would be enabled automatically. + +There are two levels of C++ exception handling. The one is +C++ exception enabled (but still C files are compiled by C +compiler), and the other is C++ ABI mode where all files are +compiled by C++ compiler. + +When you mix C++ code, C++ exception would be enabled automatically. +If you need to enable C++ exception explicitly add the following: +```ruby +conf.enable_cxx_exception +``` + If you need to enable C++ ABI mode explicitly add the following: ```ruby conf.enable_cxx_abi @@ -252,8 +262,10 @@ conf.enable_cxx_abi #### C++ exception disabling. + If you need to force C++ exception disable -(For example using a compiler option to disable C++ exception) +(For example using a compiler option to disable C++ exception), +but still want to use C++ ABI mode, add following: ```ruby conf.disable_cxx_exception -- cgit v1.2.3