swig/Lib
Vadim Zeitlin 727a65c0e8 Fix using exception in modules importing other modules
Ensure that we have only a single SWIG_CException_Raise() function
across all modules instead of having per-module functions and, worse,
per-module PendingException variables, which resulted in compile-time
errors and couldn't work anyhow because function checking for the
current exception didn't necessarily use the same "global" variable
where it was stored. More formally, old version resulted in ODR
violations and undefined behaviour.

The way we avoid it now is rather ugly and consists in excluding
SWIG_CException from wrapping using the hack in the source code which
postpones wrapping this class until the very end and checks if we had
encountered any %import directives and simply doesn't wrap it if we did.

The same code is used to define the special SWIG_CException_DEFINED
preprocessor symbol which is then used in the generated code to prevent
the SWIG_CException class declaration from being compiled as part of the
wrapper too (because this still happens due to %inline being used for
its definition, and there doesn't seem to be any better way to avoid
this).

This is definitely not pretty, but at least adding "throw(char*)" to a
couple of functions in mod_[ab].i test suite files works now instead of
failing (even without linking and running) as before. This commit
doesn't modify the test suite to avoid possible problems with the other
languages, however.
2021-11-27 00:19:05 +01:00
..
c Fix using exception in modules importing other modules 2021-11-27 00:19:05 +01:00
cffi Fix wrapping of references/pointers and qualifiers to member pointers 2017-03-16 21:04:38 +00:00
csharp Fix more "allows to" and other typos 2021-04-21 15:54:46 +12:00
d D: Replace deprecated imports (package std.c). Fixes #1593 2020-05-30 16:28:48 +01:00
go swig -go: don't use crosscall2 for panicking 2021-09-15 17:56:01 -07:00
guile Member function pointer typemap tweaks 2021-04-26 22:32:52 +01:00
java Fix Java %interface family of macros 2021-04-27 23:37:18 +01:00
javascript Merge branch 'v8-context-aware-race-free-preparation' 2021-03-11 22:48:38 +00:00
lua Member function pointer typemap tweaks 2021-04-26 22:32:52 +01:00
mzscheme Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
ocaml [OCaml] Fix compilation errors with OCaml 4.09.0 2019-12-29 22:41:43 -07:00
octave 0.0 float warning fix 2020-10-10 15:02:26 +01:00
perl5 Avoid gcc 11 misleading indentation warning in generated code 2021-10-03 17:18:58 +02:00
php Replace remaining PHP errors with PHP exceptions 2021-05-26 09:39:43 +12:00
python Further leak fixes 2021-05-18 13:07:48 +01:00
r fixed some missing semicolons. Each one caused a compile error in generated code 2020-03-25 11:01:12 -07:00
ruby Fix more "allows to" and other typos 2021-04-21 15:54:46 +12:00
scilab Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
std Revert "Use std/std_vector.i instead of a poor copy in c/std_vector.i" 2021-10-07 22:03:47 +02:00
tcl Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
typemaps Member function pointer typemap tweaks 2021-04-26 22:32:52 +01:00
xml
allkw.swg Disable Chicken target language 2019-02-05 18:42:12 +00:00
attribute.i Fix %arg in Lib/attribute.i 2013-05-25 00:37:57 +01:00
carrays.i Initialise all newly created arrays in arrays.i library. 2015-07-30 20:41:15 +01:00
cdata.i Merge branch 'master' into C 2021-10-04 16:03:36 +02:00
cmalloc.i Revert rev 11918 "merge revisions 11872:11876 from trunk to gsoc2008-maciekd branch - license changes" 2012-05-06 00:49:56 +00:00
constraints.i Revert rev 11918 "merge revisions 11872:11876 from trunk to gsoc2008-maciekd branch - license changes" 2012-05-06 00:49:56 +00:00
cpointer.i Revert rev 11918 "merge revisions 11872:11876 from trunk to gsoc2008-maciekd branch - license changes" 2012-05-06 00:49:56 +00:00
cstring.i Revert rev 11918 "merge revisions 11872:11876 from trunk to gsoc2008-maciekd branch - license changes" 2012-05-06 00:49:56 +00:00
cwstring.i Revert rev 11918 "merge revisions 11872:11876 from trunk to gsoc2008-maciekd branch - license changes" 2012-05-06 00:49:56 +00:00
director_common.swg Create director_common.swg for language-indep code 2015-03-12 19:51:11 +13:00
exception.i Replace remaining PHP errors with PHP exceptions 2021-05-26 09:39:43 +12:00
intrusive_ptr.i Fix bug with macro invocation with empty first arg 2017-10-08 09:02:28 +13:00
inttypes.i Remove duplicate declarations of strtoimax and strtoumax in inttypes.i 2014-04-08 23:47:22 +01:00
linkruntime.c
math.i Conditionalise math.i for PHP 2021-03-17 09:43:15 +13:00
pointer.i Update link to point to 3.0 docs 2015-01-08 11:16:48 +13:00
runtime.swg
shared_ptr.i Fix bug with macro invocation with empty first arg 2017-10-08 09:02:28 +13:00
std_except.i [OCaml] Some exception improvements 2019-02-07 16:25:10 -07:00
stdint.i Revert rev 11918 "merge revisions 11872:11876 from trunk to gsoc2008-maciekd branch - license changes" 2012-05-06 00:49:56 +00:00
stl.i Revert rev 11918 "merge revisions 11872:11876 from trunk to gsoc2008-maciekd branch - license changes" 2012-05-06 00:49:56 +00:00
swig.swg Add unignore for rvalue ref-qualifiers 2017-08-30 18:17:04 +01:00
swigarch.i Typo fix in error messages from swigarch.i 2015-02-04 23:07:18 +00:00
swigerrors.swg Remove trailing spaces in the generated code. 2013-09-13 10:02:39 +02:00
swigfragments.swg Fix Visual Studio 2015 and later compilation errors due to snprintf macro definition. 2019-04-19 11:33:02 +01:00
swiginit.swg Lib/javascript/v8: use context-aware initialization. 2021-03-02 15:31:28 +01:00
swiglabels.swg swiglabels.swg: added check if __GNUC__ is defined 2016-02-13 13:49:07 +01:00
swigrun.i Revert rev 11918 "merge revisions 11872:11876 from trunk to gsoc2008-maciekd branch - license changes" 2012-05-06 00:49:56 +00:00
swigrun.swg swigrun.swg: fix typo 2021-04-21 15:49:15 +12:00
swigwarnings.swg Rework std::initializer_list handling to warn about usage in any method, not just constructors. A typemap is used to issue the warning and can be overridden with user defined behaviour. 2013-02-04 20:03:22 +00:00
wchar.i Revert rev 11918 "merge revisions 11872:11876 from trunk to gsoc2008-maciekd branch - license changes" 2012-05-06 00:49:56 +00:00
windows.i Add missing VOID definition to windows.i 2019-01-07 18:46:14 +00:00