swig/Lib/c
Vadim Zeitlin 10d25c7327 Drop longjmp-based exception handling approach
Using longjmp was incompatible with using C++ objects in the code using the
wrappers, and using this C API from C++ to avoid ABI incompatibilities between
different C++ compilers is one of the main reasons for using this module.

Also, this required using a separate SwigObj instead of just using the real
object pointer which inevitably resulted in memory leaks whenever a non owned
object was returned from anywhere, e.g. from a member accessor or any method
returning pointer or reference.

Abandon the attempts to recreate C++ exceptions in C and just use a very
simple approach allowing to pass an error message out of band after any
function call in a global variable. An alternative could be to add a special
"out" error parameter to each and every function, but this risked being too
verbose, especially for the functions which don't really throw, and the calls
to SWIG_PendingException_get() won't need to be made explicitly when using a
C++ wrapper around the generated C API in the future.

This simplifies both the module and the generated code, in particular we don't
need any runtime code at all any more and there is no need for an extra level
of indirection for every object.

It also makes a couple more tests pass.
2016-09-15 01:27:40 +02:00
..
c.swg Drop longjmp-based exception handling approach 2016-09-15 01:27:40 +02:00
cexcept.swg Drop longjmp-based exception handling approach 2016-09-15 01:27:40 +02:00
cheader.swg No real changes, just rename "proxy_header" to "cheader" 2016-04-21 15:18:22 +02:00
clabels.swg Remove unused SWIGPROTECT 2016-04-13 18:10:35 +02:00
std_common.i Many major improvements. Almost all testsuite compiles now. 2009-04-15 23:30:16 +00:00
std_except.i Many major improvements. Almost all testsuite compiles now. 2009-04-15 23:30:16 +00:00
std_map.i Many major improvements. Almost all testsuite compiles now. 2009-04-15 23:30:16 +00:00
std_pair.i Many major improvements. Almost all testsuite compiles now. 2009-04-15 23:30:16 +00:00
std_string.i Get rid of separate cmodtype typemap 2016-04-21 18:58:32 +02:00
std_vector.i Remove template specific typemaps. Leftover from the change to C# like template handling. 2012-08-13 16:22:30 +00:00
stl.i Many major improvements. Almost all testsuite compiles now. 2009-04-15 23:30:16 +00:00
typemaps.i Many major improvements. Almost all testsuite compiles now. 2009-04-15 23:30:16 +00:00