swig/Source/Modules
Vadim Zeitlin 3d6880aad1 Start removing proxy layer, just use the wrapped functions directly
The proxy layer, and all the extra complexity associated with it, seemed to be
only necessary in order to try to allow using the same name for the wrapped
global functions as were used for them in the original C or C++ code being
wrapped. However this could simply never work in all cases, notably it didn't
work at all when using ELF shared libraries under Unix as the functions with
the same name defined in the main program were interposed and replaced the
functions defined in the shared library, meaning that the proxy function foo()
called wrapper function _wrap_foo() which called back into proxy function
foo() itself again, resulting in guaranteed stack overflow. The only possible
way to fix this would be to use "protected" ELF visibility for the original
functions, but this is not always possible (e.g. if the sources of the
original library are not available) and not simple even when it is and,
besides, protected visibility has its own problems -- notably by making it
impossible to hook the library functions when you actually want to do it.
Besides, proxy-based approach simply couldn't work at all when using static
linking as it resulted in two copies of the function with the same name

Most importantly, however, the main task of this module is to wrap C++
classes, not C functions, and renaming them in the wrapper is not necessary at
all in this case as there is no conflict with the original names in this case.
So simply drop the idea of generating a separate proxy header and generate a
header declaring the functions declared in the wrapper instead and, also, do
not give them "_wrap_" prefix whenever possible, i.e. only do it for the
global functions.

This simplifies SWIG code itself and makes it simpler to use its output as
it's not necessary to link both with the wrapper (dynamically) and with the
proxy (statically) and it's not enough to link with the wrapper only and it
can be done in any way (i.e. either statically or dynamically).

As a side effect of this change, Swig_name_proxy() is not necessary any more
and was removed, eliminating the only difference with the master branch in any
source file other than c.cxx itself.
2016-04-14 02:44:45 +02:00
..
allegrocl.cxx Fix assertion for some languages when wrapping a C++11 enum class that is private in a class. 2016-03-31 20:27:36 +01:00
allocate.cxx Re-organization of the interface feature common code 2016-03-03 08:55:20 +00:00
browser.cxx Add lambda functions to the symbol tables and add ability to suppress lambda warnings. 2013-02-04 20:05:34 +00:00
c.cxx Start removing proxy layer, just use the wrapped functions directly 2016-04-14 02:44:45 +02:00
cffi.cxx Fix assertion for some languages when wrapping a C++11 enum class that is private in a class. 2016-03-31 20:27:36 +01:00
chicken.cxx Prevent redefinition warnings when compiling with SWIG<module> defined 2015-12-22 14:33:21 +02:00
clisp.cxx Fix assertion for some languages when wrapping a C++11 enum class that is private in a class. 2016-03-31 20:27:36 +01:00
contract.cxx Cosmetics/code beautification of nested class support 2013-11-29 07:29:58 +00:00
csharp.cxx Merge branch 'char-escaping' 2016-03-12 23:27:51 +00:00
d.cxx Merge branch 'char-escaping' 2016-03-12 23:27:51 +00:00
directors.cxx Add support for thread_local when specified with other legitimate storage class specifiers - extern and static 2013-02-08 06:36:39 +00:00
emit.cxx Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
go.cxx Fix assertion for some languages when wrapping a C++11 enum class that is private in a class. 2016-03-31 20:27:36 +01:00
guile.cxx Prevent redefinition warnings when compiling with SWIG<module> defined 2015-12-22 14:33:21 +02:00
interface.cxx Interface feature fix for typedef types 2016-03-07 21:42:27 +00:00
java.cxx Merge branch 'char-escaping' 2016-03-12 23:27:51 +00:00
javascript.cxx Cosmetic corrections - Mac OS X 2015-08-02 20:14:20 +01:00
lang.cxx Fix assertion for some languages when wrapping a C++11 enum class that is private in a class. 2016-03-31 20:27:36 +01:00
lua.cxx Fix assertion for some languages when wrapping a C++11 enum class that is private in a class. 2016-03-31 20:27:36 +01:00
main.cxx Warning fixes for 64bit visual c++ on Windows 2015-07-03 20:59:24 +01:00
modula3.cxx Multiple inheritance warning wording tweak 2016-03-06 10:45:39 +00:00
module.cxx Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
mzscheme.cxx Prevent redefinition warnings when compiling with SWIG<module> defined 2015-12-22 14:33:21 +02:00
nested.cxx Fix segmentation fault when top==NULL 2015-02-26 14:57:19 +13:00
ocaml.cxx Fix assertion for some languages when wrapping a C++11 enum class that is private in a class. 2016-03-31 20:27:36 +01:00
octave.cxx Prevent redefinition warnings when compiling with SWIG<module> defined 2015-12-22 14:33:21 +02:00
overload.cxx Clearer warning message for badly constructed typecheck typemaps 2015-04-14 07:34:40 +01:00
perl5.cxx Prevent redefinition warnings when compiling with SWIG<module> defined 2015-12-22 14:33:21 +02:00
php.cxx Merge branch 'char-escaping' 2016-03-12 23:27:51 +00:00
pike.cxx Prevent redefinition warnings when compiling with SWIG<module> defined 2015-12-22 14:33:21 +02:00
python.cxx Merge branch 'ahnolds-py_gettar' 2016-04-02 18:06:03 +01:00
r.cxx Fix assertion for some languages when wrapping a C++11 enum class that is private in a class. 2016-03-31 20:27:36 +01:00
README File move 2002-12-03 20:33:35 +00:00
ruby.cxx Multiple inheritance warning wording tweak 2016-03-06 10:45:39 +00:00
s-exp.cxx Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
scilab.cxx scilab: fix builder for scilab 6.0 (empty matrix error) 2016-03-02 05:14:44 -05:00
swigmain.cxx Merge branch 'master' into C 2016-04-08 17:29:16 +02:00
swigmod.h Add checks for interface name symbol clashes 2016-03-03 22:48:35 +00:00
tcl8.cxx Prevent redefinition warnings when compiling with SWIG<module> defined 2015-12-22 14:33:21 +02:00
typepass.cxx %shared_ptr support improvements for classes in an inheritance chain 2015-10-01 22:36:01 +01:00
uffi.cxx Eliminate needless casting away const from string constants 2014-04-30 12:00:23 +12:00
utils.cxx Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
xml.cxx Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00

06/25/2002

This directory contains all of the SWIG language modules.  Many of these
modules contain code that dates back to SWIG1.0.  The module API has changed
a lot in the development releases so this is fairly messy.  We're working on
cleaning it up, but you'll have to bear with us until it's done.

-- Dave