swig/Source
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
..
CParse Fix -Wchar-subscripts warning 2021-04-26 22:32:52 +01:00
DOH Fix few unused variable warnings 2021-03-07 11:20:31 +00:00
Doxygen Don't use invalid iterators in Doxygen command parsing code 2021-02-22 21:15:03 +01:00
Include Merge branch 'master' into C 2021-10-04 16:03:36 +02:00
Modules Fix using exception in modules importing other modules 2021-11-27 00:19:05 +01:00
Preprocessor Allow customizing type mangling in SWIG preprocessor 2021-11-10 00:53:39 +01:00
Swig Use SWIG-specific suffix for non-overloaded %extend functions too 2021-11-10 00:53:39 +01:00
Makefile.am Merge branch 'master' into C 2019-07-24 20:26:50 +02:00
README Remove details of long-removed directories 2021-05-16 08:42:39 +12:00

SWIG Source directory

 Source/DOH          -  A core set of basic datatypes including
                        strings, lists, hashes, and files.  Used
                        extensively by the rest of SWIG.

 Source/Swig         -  Swig core. Type-system, utility functions.

 Source/Preprocessor -  SWIG C Preprocessor

 Source/CParse       -  SWIG C Parser (still messy)

 Source/Modules      -  Language modules.

 Source/Include      -  Include files.