mirror of https://github.com/swig/swig
Revert rev 10606 "Merged revisions 10498-10499,10503-10504,10506,10508,10511,10515-10516,10518-10519,10527,10530-10531,10536-10537,10539-10552,10558-10568,10574-10580,10582,10584,10588-10589,10594 via svnmerge from "
This reverts commit 379b9bcdf44dcd87c5eca7eb9a773aea793e7caf. From: William S Fulton <wsf@fultondesigns.co.uk> git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@13034 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d6b81eb831
commit
1acc0167d1
10
ANNOUNCE
10
ANNOUNCE
|
@ -1,10 +1,10 @@
|
|||
*** ANNOUNCE: SWIG 1.3.36 (24 June 2008) ***
|
||||
*** ANNOUNCE: SWIG 1.3.35 (7 April 2008) ***
|
||||
|
||||
http://www.swig.org
|
||||
|
||||
|
||||
We're pleased to announce SWIG-1.3.36, the latest installment in the
|
||||
SWIG development effort. SWIG-1.3.36 includes a number of bug fixes
|
||||
We're pleased to announce SWIG-1.3.35, the latest installment in the
|
||||
SWIG development effort. SWIG-1.3.35 includes a number of bug fixes
|
||||
and large number of enhancements throughout.
|
||||
|
||||
What is SWIG?
|
||||
|
@ -24,11 +24,11 @@ Availability:
|
|||
-------------
|
||||
The release is available for download on Sourceforge at
|
||||
|
||||
http://prdownloads.sourceforge.net/swig/swig-1.3.36.tar.gz
|
||||
http://prdownloads.sourceforge.net/swig/swig-1.3.35.tar.gz
|
||||
|
||||
A Windows version is also available at
|
||||
|
||||
http://prdownloads.sourceforge.net/swig/swigwin-1.3.36.zip
|
||||
http://prdownloads.sourceforge.net/swig/swigwin-1.3.35.zip
|
||||
|
||||
Release numbers
|
||||
---------------
|
||||
|
|
159
CHANGES
159
CHANGES
|
@ -2,162 +2,6 @@ SWIG (Simplified Wrapper and Interface Generator)
|
|||
|
||||
See CHANGES.current for current version.
|
||||
|
||||
Version 1.3.36 (24 June 2008)
|
||||
=============================
|
||||
|
||||
06/24/2008: wsfulton
|
||||
Remove deprecated -c commandline option (runtime library generation).
|
||||
|
||||
06/24/2008: olly
|
||||
[PHP] Fix assertion failure when handling %typemap(in,numinputs=0)
|
||||
(testcase ignore_parameter).
|
||||
|
||||
06/24/2008: olly
|
||||
[PHP] Fix segfault when wrapping a non-class function marked with
|
||||
%newobject (testcase char_strings).
|
||||
|
||||
06/22/2008: wsfulton
|
||||
[Java] Add a way to use AttachCurrentThreadAsDaemon instead of AttachCurrentThread
|
||||
in director code. Define the SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON macro, see
|
||||
Lib/java/director.swg.
|
||||
|
||||
06/21/2008: wsfulton
|
||||
[Ruby] Fix crashing in the STL wrappers (reject! and delete_if methods)
|
||||
|
||||
06/19/2008: wsfulton
|
||||
[Java, C#] C# and Java keywords will be renamed instead of just issuing a warning
|
||||
and then generating uncompileable code. Warning 314 gives the new name when a
|
||||
keyword is found.
|
||||
|
||||
06/19/2008: wsfulton
|
||||
[R] Keyword handling added. R Keywords will be renamed as necessary.
|
||||
Warning 314 gives the new name when a keyword is found.
|
||||
|
||||
06/17/2008: mgossage
|
||||
[Lua] Added missing support for bool& and bool*. Added runtest for li_typemaps testcase.
|
||||
(Bug #1938142)
|
||||
|
||||
06/07/2008: bhy
|
||||
Added test case keyword_rename, then made the keyword renaming works properly
|
||||
by fixing Swig_name_make() for a incomplete condition checking.
|
||||
|
||||
06/02/2008: wsfulton
|
||||
[Java, C#] Fix enum wrappers when using -noproxy.
|
||||
|
||||
05/30/2008: bhy
|
||||
Added std::wstring into Lib/typemaps/primtypes.swg, since it is also a primitive
|
||||
type in SWIG - fixed SF #1976978.
|
||||
|
||||
05/29/2008: wsfulton
|
||||
[Java, C#] Fix variable wrappers when using -noproxy.
|
||||
|
||||
05/29/2008: bhy
|
||||
[Python] Fixed a typo of %#ifdef in Lib/python/pycontainer.swg, which is related
|
||||
to -extranative SWIG option - SF #1971977.
|
||||
|
||||
05/20/2008: wsfulton
|
||||
New partialcheck makefile targets for partial testing of the test-suite. These
|
||||
just invoke SWIG, ie no compilation and no runtime testing. It can be faster
|
||||
when developing by just doing a directory diff of the files SWIG generates
|
||||
against those from a previous run. Example usage from the top level directory:
|
||||
|
||||
make partialcheck-test-suite
|
||||
make partialcheck-java-test-suite
|
||||
|
||||
This change also encompasses more flexibility in running the test-suite, eg
|
||||
it is possible to prefix the command line which runs any target language test
|
||||
with a tool. See the RUNTOOL, COMPILETOOL and SWIGTOOL targets in the common.mk
|
||||
file and makefiles in the test-suite directory. For example it is possible to
|
||||
run the runtime tests through valgrind using:
|
||||
|
||||
make check RUNTOOL="valgrind --leak-check=full"
|
||||
|
||||
or invoke SWIG under valgrind using:
|
||||
|
||||
make check SWIGTOOL="valgrind --tool=memcheck"
|
||||
|
||||
05/19/2008: drjoe
|
||||
[R] Fixed define that was breaking pre-2.7. Checked in
|
||||
patch from Soren Sonnenburg that creates strings in
|
||||
version independent way
|
||||
|
||||
05/15/2008: wsfulton
|
||||
[Java] Fix variable name clash in directors - SF #1963316 reported by Tristan.
|
||||
|
||||
05/14/2008: wsfulton
|
||||
Add an optimisation for functions that return objects by value, reducing
|
||||
the number of copies of the object that are made. Implemented using an
|
||||
optional attribute in the "out" typemap called "optimal". Details in
|
||||
Typemaps.html.
|
||||
|
||||
05/11/2008: olly
|
||||
[PHP] Check for %feature("notabstract") when generating PHP5 class
|
||||
wrapper.
|
||||
|
||||
05/11/2008: wsfulton
|
||||
Fix SF #1943608 - $self substitution in %contract, patch submitted by
|
||||
Toon Verstraelen.
|
||||
|
||||
05/09/2008: olly
|
||||
[PHP] Fix char * typemaps to work when applied to signed char * and
|
||||
unsigned char * (uncovered by testcase apply_strings).
|
||||
|
||||
05/09/2008: wsfulton
|
||||
Fix wrapping of char * member variables when using allprotected mode.
|
||||
Bug reported by Warren Wang.
|
||||
|
||||
05/09/2008: olly
|
||||
[PHP] Fix bad PHP code generated when wrapping an enum in a
|
||||
namespace (uncovered by testcase arrays_scope).
|
||||
|
||||
05/09/2008: olly
|
||||
[PHP] SWIG now runs the PHP testsuite using PHP5, not PHP4. PHP4
|
||||
is essentially obsolete now, so we care much more about solid PHP5
|
||||
support.
|
||||
|
||||
05/07/2008: wsfulton
|
||||
STL fixes when using %import rather than %include and the Solaris Workshop
|
||||
compiler and the Roguewave STL.
|
||||
|
||||
05/07/2008: wsfulton
|
||||
Fix wrapping of overloaded protected methods when using allprotected mode.
|
||||
Bug reported by Warren Wang.
|
||||
|
||||
05/03/2008: wsfulton
|
||||
Commit patch #1956607 to add -MT support from Richard Boulton.
|
||||
This patch mirrors the gcc -MT option which allows one to change the default
|
||||
Makefile target being generated when generating makefiles with the -M family
|
||||
of options. For example:
|
||||
|
||||
$ swig -java -MM -MT overiddenname -c++ example.i
|
||||
overiddenname: \
|
||||
example.i \
|
||||
example.h
|
||||
|
||||
04/30/2008: mgossage
|
||||
[Lua] Removed generation of _wrap_delete_XXXXX (wrappered destructor)
|
||||
which was unused and causing warning with g++ -Wall.
|
||||
Removed other unused warning in typemaps.i and other places.
|
||||
Added Examples/lua/embed3, and run tests a few test cases.
|
||||
|
||||
04/24/2008: olly
|
||||
[Python] Fix generated code for IBM's C++ compiler on AIX (patch
|
||||
from Goeran Uddeborg in SF#1928048).
|
||||
|
||||
04/24/2008: olly
|
||||
Rename BSIZE in Examples/test-suite/arrays_scope.i to BBSIZE to
|
||||
avoid a clash with BSIZE defined by headers on AIX with Perl
|
||||
(reported in SF#1928048).
|
||||
|
||||
04/20/2008: wsfulton
|
||||
Add the ability to wrap all protected members when using directors.
|
||||
Previously only the virtual methods were available to the target language.
|
||||
Now all protected members, (static and non-static variables, non-virtual methods
|
||||
and static methods) are wrapped when using the allprotected mode. The allprotected
|
||||
mode is turned on in the module declaration:
|
||||
|
||||
%module(directors="1", allprotected="1") modulename
|
||||
|
||||
Version 1.3.35 (7 April 2008)
|
||||
=============================
|
||||
|
||||
|
@ -12279,8 +12123,7 @@ Version 1.3.14 (August 12, 2002)
|
|||
with helper functions even if they aren't used. To fix this,
|
||||
a new fragment directive is available. For example:
|
||||
|
||||
(corrected typo in line below - 06/26/2008)
|
||||
%fragment("type_header","header") %{
|
||||
%fragment("type_helper","header") %{
|
||||
void some_helper_function() {
|
||||
...
|
||||
}
|
||||
|
|
103
CHANGES.current
103
CHANGES.current
|
@ -1,3 +1,106 @@
|
|||
Version 1.3.36 (in progress)
|
||||
=============================
|
||||
|
||||
05/20/2008: wsfulton
|
||||
New partialcheck makefile targets for partial testing of the test-suite. These
|
||||
just invoke SWIG, ie no compilation and no runtime testing. It can be faster
|
||||
when developing by just doing a directory diff of the files SWIG generates
|
||||
against those from a previous run. Example usage from the top level directory:
|
||||
|
||||
make partialcheck-test-suite
|
||||
make partialcheck-java-test-suite
|
||||
|
||||
This change also encompasses more flexibility in running the test-suite, eg
|
||||
it is possible to prefix the command line which runs any target language test
|
||||
with a tool. See the RUNTOOL, COMPILETOOL and SWIGTOOL targets in the common.mk
|
||||
file and makefiles in the test-suite directory. For example it is possible to
|
||||
run the runtime tests through valgrind using:
|
||||
|
||||
make check RUNTOOL="valgrind --leak-check=full"
|
||||
|
||||
or invoke SWIG under valgrind using:
|
||||
|
||||
make check SWIGTOOL="valgrind --tool=memcheck"
|
||||
|
||||
05/19/2008: drjoe
|
||||
[R] Fixed define that was breaking pre-2.7. Checked in
|
||||
patch from Soren Sonnenburg that creates strings in
|
||||
version independent way
|
||||
|
||||
05/15/2008: wsfulton
|
||||
[Java] Fix variable name clash in directors - SF #1963316 reported by Tristan.
|
||||
|
||||
05/14/2008: wsfulton
|
||||
Add an optimisation for functions that return objects by value, reducing
|
||||
the number of copies of the object that are made. Implemented using an
|
||||
optional attribute in the "out" typemap called "optimal". Details in
|
||||
Typemaps.html.
|
||||
|
||||
05/11/2008: olly
|
||||
[PHP] Check for %feature("notabstract") when generating PHP5 class
|
||||
wrapper.
|
||||
|
||||
05/11/2008: wsfulton
|
||||
Fix SF #1943608 - $self substitution in %contract, patch submitted by
|
||||
Toon Verstraelen.
|
||||
|
||||
05/09/2008: olly
|
||||
[PHP] Fix char * typemaps to work when applied to signed char * and
|
||||
unsigned char * (uncovered by testcase apply_strings).
|
||||
|
||||
05/09/2008: wsfulton
|
||||
Fix wrapping of char * member variables when using allprotected mode.
|
||||
Bug reported by Warren Wang.
|
||||
|
||||
05/09/2008: olly
|
||||
[PHP] Fix bad PHP code generated when wrapping an enum in a
|
||||
namespace (uncovered by testcase arrays_scope).
|
||||
|
||||
05/09/2008: olly
|
||||
[PHP] SWIG now runs the PHP testsuite using PHP5, not PHP4. PHP4
|
||||
is essentially obsolete now, so we care much more about solid PHP5
|
||||
support.
|
||||
|
||||
05/07/2008: wsfulton
|
||||
STL fixes when using %import rather than %include and the Solaris Workshop
|
||||
compiler and the Roguewave STL.
|
||||
|
||||
05/07/2008: wsfulton
|
||||
Fix wrapping of overloaded protected methods when using allprotected mode.
|
||||
Bug reported by Warren Wang.
|
||||
|
||||
05/03/2008: wsfulton
|
||||
Commit patch #1956607 to add -MT support from Richard Boulton.
|
||||
This patch mirrors the gcc -MT option which allows one to change the default
|
||||
Makefile target being generated when generating makefiles with the -M family
|
||||
of options. For example:
|
||||
|
||||
$ swig -java -MM -MT overiddenname -c++ example.i
|
||||
overiddenname: \
|
||||
example.i \
|
||||
example.h
|
||||
|
||||
04/30/2008: mgossage
|
||||
[Lua] Removed generation of _wrap_delete_XXXXX (wrappered destructor)
|
||||
which was unused and causing warning with g++ -Wall.
|
||||
Removed other unused warning in typemaps.i and other places.
|
||||
Added Examples/lua/embed3, and run tests a few test cases.
|
||||
|
||||
04/24/2008: olly
|
||||
[Python] Fix generated code for IBM's C++ compiler on AIX (patch
|
||||
from Goeran Uddeborg in SF#1928048).
|
||||
|
||||
04/24/2008: olly
|
||||
Rename BSIZE in Examples/test-suite/arrays_scope.i to BBSIZE to
|
||||
avoid a clash with BSIZE defined by headers on AIX with Perl
|
||||
(reported in SF#1928048).
|
||||
|
||||
04/20/2008: wsfulton
|
||||
Add the ability to wrap all protected members when using directors.
|
||||
Previously only the virtual methods were available to the target language.
|
||||
Now all protected members, (static and non-static variables, non-virtual methods
|
||||
and static methods) are wrapped when using the allprotected mode. The allprotected
|
||||
mode is turned on in the module declaration:
|
||||
|
||||
%module(directors="1", allprotected="1") modulename
|
||||
|
||||
|
|
|
@ -380,7 +380,7 @@
|
|||
</ul>
|
||||
<li><a href="Typemaps.html#Typemaps_nn43">Typemaps for multiple languages</a>
|
||||
<li><a href="Typemaps.html#Typemaps_optimal">Optimal code generation when returning by value</a>
|
||||
<li><a href="Typemaps.html#Typemaps_multi_argument_typemaps">Multi-argument typemaps</a>
|
||||
<li><a href="Typemaps.html#Typemaps_nn42">Multi-argument typemaps</a>
|
||||
<li><a href="Typemaps.html#runtime_type_checker">The run-time type checker</a>
|
||||
<ul>
|
||||
<li><a href="Typemaps.html#Typemaps_nn45">Implementation</a>
|
||||
|
@ -768,7 +768,6 @@
|
|||
<li><a href="Java.html#java_directors_classes">Director classes</a>
|
||||
<li><a href="Java.html#java_directors_overhead">Overhead and code bloat</a>
|
||||
<li><a href="Java.html#java_directors_example">Simple directors example</a>
|
||||
<li><a href="Java.html#java_directors_threading">Director threading issues</a>
|
||||
</ul>
|
||||
<li><a href="Java.html#java_allprotected">Accessing protected members</a>
|
||||
<li><a href="Java.html#common_customization">Common customization features</a>
|
||||
|
|
|
@ -85,7 +85,6 @@
|
|||
<li><a href="#java_directors_classes">Director classes</a>
|
||||
<li><a href="#java_directors_overhead">Overhead and code bloat</a>
|
||||
<li><a href="#java_directors_example">Simple directors example</a>
|
||||
<li><a href="#java_directors_threading">Director threading issues</a>
|
||||
</ul>
|
||||
<li><a href="#java_allprotected">Accessing protected members</a>
|
||||
<li><a href="#common_customization">Common customization features</a>
|
||||
|
@ -3451,26 +3450,6 @@ DirectorDerived::upcall_method() invoked.
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="java_directors_threading"></a>20.5.5 Director threading issues</H3>
|
||||
|
||||
|
||||
<p>
|
||||
Depending on your operating system and version of Java and how you are using threads, you might find the JVM hangs on exit.
|
||||
There are a couple of solutions to try out. The preferred solution requires jdk-1.4 and later and uses <tt>AttachCurrentThreadAsDaemon</tt> instead of <tt>AttachCurrentThread</tt> whenever a call into the JVM is required. This can be enabled by defining the SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON macro when compiling the C++ wrapper code. For older JVMs define SWIG_JAVA_NO_DETACH_CURRENT_THREAD instead, to avoid the <tt>DetachCurrentThread</tt> call but this will result in a memory leak instead. For further details inspect the source code in the java/director.swg library file.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Macros can be defined on the commandline when compiling your C++ code, or alternatively added to the C++ wrapper file as shown below:
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
<pre>
|
||||
%insert("runtime") %{
|
||||
#define SWIG_JAVA_NO_DETACH_CURRENT_THREAD
|
||||
%}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<H2><a name="java_allprotected"></a>20.6 Accessing protected members</H2>
|
||||
|
||||
|
||||
|
|
|
@ -1153,9 +1153,8 @@ public:
|
|||
|
||||
|
||||
<p>
|
||||
This is great for reducing the size of the wrappers, but the caveat is it does not work for the statically typed languages,
|
||||
such as C# and Java,
|
||||
which don't have optional arguments in the language,
|
||||
This is great for reducing the size of the wrappers, but the caveat is it does not work for the strongly typed languages
|
||||
which don't have optional arguments in the language, such as C# and Java.
|
||||
Another restriction of this feature is that it cannot handle default arguments that are not public.
|
||||
The following example illustrates this:
|
||||
</p>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Sections"></a>SWIG-1.3 Development Documentation</H1>
|
||||
|
||||
Last update : SWIG-1.3.37 (in progress)
|
||||
Last update : SWIG-1.3.36 (in progress)
|
||||
|
||||
<H2>Sections</H2>
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
</ul>
|
||||
<li><a href="#Typemaps_nn43">Typemaps for multiple languages</a>
|
||||
<li><a href="#Typemaps_optimal">Optimal code generation when returning by value</a>
|
||||
<li><a href="#Typemaps_multi_argument_typemaps">Multi-argument typemaps</a>
|
||||
<li><a href="#Typemaps_nn42">Multi-argument typemaps</a>
|
||||
<li><a href="#runtime_type_checker">The run-time type checker</a>
|
||||
<ul>
|
||||
<li><a href="#Typemaps_nn45">Implementation</a>
|
||||
|
@ -702,7 +702,7 @@ variables (parms). The purpose of these variables will be explained shortly.
|
|||
</p>
|
||||
|
||||
<p><em>code</em> specifies the code used in the typemap.
|
||||
Usually this is C/C++ code, but in the statically typed target languages, such as Java and C#, this can contain target language code for certain typemaps.
|
||||
Usually this is C/C++ code, but in the strongly typed target languages, such as Java and C#, this can contain target language code for certain typemaps.
|
||||
It can take any one of the following forms:
|
||||
</p>
|
||||
|
||||
|
@ -1933,7 +1933,7 @@ to implement customized conversions.
|
|||
|
||||
<p>
|
||||
In addition, the "in" typemap allows the number of converted arguments to be
|
||||
specified. The <tt>numinputs</tt> attributes facilitates this. For example:
|
||||
specified. For example:
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
|
@ -1946,12 +1946,7 @@ specified. The <tt>numinputs</tt> attributes facilitates this. For example:
|
|||
</div>
|
||||
|
||||
<p>
|
||||
At this time, only zero or one arguments may be converted.
|
||||
When <tt>numinputs</tt> is set to 0, the argument is effectively ignored and cannot be supplied from the target language.
|
||||
The argument is still required when making the C/C++ call and the above typemap
|
||||
shows the value used is instead obtained from a locally declared variable called <tt>temp</tt>.
|
||||
Usually <tt>numinputs</tt> is not specified, whereupon the default value is 1, that is, there is a one to one mapping of the number of arguments when used from the target language to the C/C++ call.
|
||||
<a href="#Typemaps_multi_argument_typemaps">Multi-argument typemaps</a> provide a similar concept where the number of arguments mapped from the target language to C/C++ can be changed for more tha multiple adjacent C/C++ arguments.
|
||||
At this time, only zero or one arguments may be converted.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
@ -2816,7 +2811,7 @@ optimal attribute usage in the out typemap at example.i:7.
|
|||
However, it doesn't always get it right, for example when <tt>$1</tt> is within some commented out code.
|
||||
</p>
|
||||
|
||||
<H2><a name="Typemaps_multi_argument_typemaps"></a>10.9 Multi-argument typemaps</H2>
|
||||
<H2><a name="Typemaps_nn42"></a>10.9 Multi-argument typemaps</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
@ -373,7 +373,7 @@ example.i(4): Syntax error in input.
|
|||
<li>117. Deprecated <tt>%new</tt> directive.
|
||||
<li>118. Deprecated <tt>%typemap(except)</tt>.
|
||||
<li>119. Deprecated <tt>%typemap(ignore)</tt>.
|
||||
<li>120. Deprecated command line option (-runtime, -noruntime).
|
||||
<li>120. Deprecated command line option (-c).
|
||||
<li>121. Deprecated <tt>%name</tt> directive.
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -40,9 +40,8 @@ LIBCRYPT = @LIBCRYPT@
|
|||
SYSLIBS = $(LIBM) $(LIBC) $(LIBCRYPT)
|
||||
LIBPREFIX =
|
||||
|
||||
# RUNTOOL is for use with runtime tools, eg set it to valgrind
|
||||
# RUNTOOL is for use as with runtime tools, eg set it to valgrind
|
||||
RUNTOOL =
|
||||
# COMPILETOOL is a way to run the compiler under another tool, or more commonly just to stop the compiler executing
|
||||
COMPILETOOL=
|
||||
|
||||
# X11 options
|
||||
|
@ -95,6 +94,8 @@ TK_OPTS = -ltk -ltcl @LIBS@
|
|||
|
||||
# Extra Tcl specific dynamic linking options
|
||||
TCL_DLNK = @TCLDYNAMICLINKING@
|
||||
TCL_LDSHARED = @TCL_LDSHARED@
|
||||
TCL_CXXSHARED = @TCL_CXXSHARED@
|
||||
TCL_SO = @TCL_SO@
|
||||
|
||||
# -----------------------------------------------------------
|
||||
|
@ -134,7 +135,7 @@ wish_cpp: $(SRCS)
|
|||
tcl: $(SRCS)
|
||||
$(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
|
||||
$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE)
|
||||
$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
|
||||
$(TCL_LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# Build a Tcl7.5 dynamic loadable module for C++
|
||||
|
@ -143,7 +144,7 @@ tcl: $(SRCS)
|
|||
tcl_cpp: $(SRCS)
|
||||
$(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
|
||||
$(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE)
|
||||
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
|
||||
$(TCL_CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# Cleaning the Tcl examples
|
||||
|
@ -879,11 +880,11 @@ chicken_static_cpp: $(CXXSRCS) $(CHICKSRCS)
|
|||
|
||||
chicken:
|
||||
$(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACE)
|
||||
$(COMPILETOOL) $(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ISRCS) -o $(TARGET)$(SO)
|
||||
$(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ISRCS) -o $(TARGET)$(SO)
|
||||
|
||||
chicken_cpp:
|
||||
$(SWIG) -c++ -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACE)
|
||||
$(COMPILETOOL) $(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ICXXSRCS) $(CXXSRCS) -o $(TARGET)$(SO)
|
||||
$(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ICXXSRCS) $(CXXSRCS) -o $(TARGET)$(SO)
|
||||
|
||||
chicken_externalhdr:
|
||||
$(SWIG) -chicken -external-runtime $(TARGET)
|
||||
|
@ -1077,11 +1078,11 @@ RRSRC = $(INTERFACE:.i=.R)
|
|||
|
||||
r: $(SRCS)
|
||||
$(SWIG) -r $(SWIGOPT) $(INTERFACE)
|
||||
+( PKG_LIBS="$(SRCS)" PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(ISRCS) )
|
||||
+( PKG_LIBS="$(SRCS)" PKG_CPPFLAGS="$(INCLUDES)" $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(ISRCS) )
|
||||
|
||||
r_cpp: $(CXXSRCS)
|
||||
$(SWIG) -c++ -r $(SWIGOPT) -o $(RCXXSRCS) $(INTERFACE)
|
||||
+( PKG_LIBS="$(CXXSRCS)" PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) )
|
||||
+( PKG_LIBS="$(CXXSRCS)" PKG_CPPFLAGS="$(INCLUDES)" $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) )
|
||||
|
||||
r_clean:
|
||||
rm -f *_wrap* *~ .~*
|
||||
|
|
|
@ -20,7 +20,7 @@ extern int gcd(int x, int y);
|
|||
SCM *v;
|
||||
if (!(SCM_NIMP($input) && SCM_VECTORP($input))) {
|
||||
SWIG_exception(SWIG_ValueError, "Expecting a vector");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
$1 = SCM_LENGTH($input);
|
||||
if ($1 == 0) {
|
||||
|
@ -32,7 +32,7 @@ extern int gcd(int x, int y);
|
|||
if (!(SCM_NIMP(v[i]) && SCM_STRINGP(v[i]))) {
|
||||
free($2);
|
||||
SWIG_exception(SWIG_ValueError, "Vector items must be strings");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
$2[i] = SCM_CHARS(v[i]);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,6 @@
|
|||
|
||||
%module example;
|
||||
|
||||
%{
|
||||
void divide_l(int a, int b, int *quotient_p, int *remainder_p);
|
||||
void divide_v(int a, int b, int *quotient_p, int *remainder_p);
|
||||
void divide_mv(int a, int b, int *quotient_p, int *remainder_p);
|
||||
%}
|
||||
|
||||
/* Multiple values as lists. By default, if more than one value is to
|
||||
be returned, a list of the values is created and returned; to switch
|
||||
back to this behavior, use: */
|
||||
|
|
|
@ -16,7 +16,7 @@ void sort_int(int* arr, int len)
|
|||
// ditto doubles
|
||||
int compare_double(const void * a, const void * b)
|
||||
{
|
||||
return (int)( *(double*)a - *(double*)b );
|
||||
return ( *(double*)a - *(double*)b );
|
||||
}
|
||||
|
||||
void sort_double(double* arr, int len)
|
||||
|
|
|
@ -11,17 +11,6 @@ We will be using the luaL_dostring()/lua_dostring() function to call into lua
|
|||
|
||||
*/
|
||||
|
||||
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
||||
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
# define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
|
||||
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
|
||||
# define _SCL_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -119,7 +108,7 @@ int call_va (lua_State *L,const char *func, const char *sig, ...) {
|
|||
endwhile:
|
||||
|
||||
/* do the call */
|
||||
nres = (int)strlen(sig); /* number of expected results */
|
||||
nres = strlen(sig); /* number of expected results */
|
||||
if (lua_pcall(L, narg, nres, 0) != 0) /* do the call */
|
||||
{
|
||||
printf("error running function `%s': %s\n",func, lua_tostring(L, -1));
|
||||
|
|
|
@ -5,17 +5,6 @@ passing C++ objects to this function.
|
|||
|
||||
*/
|
||||
|
||||
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
||||
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
# define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
|
||||
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
|
||||
# define _SCL_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -81,6 +70,9 @@ int call_onEvent(lua_State *L, Event e) {
|
|||
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int ok;
|
||||
int res;
|
||||
char str[80];
|
||||
printf("[C++] Welcome to the simple embedded Lua example v3\n");
|
||||
printf("[C++] We are in C++\n");
|
||||
printf("[C++] opening a Lua state & loading the libraries\n");
|
||||
|
|
|
@ -54,14 +54,14 @@ void ShapeOwner::add(Shape* ptr) // this method takes ownership of the object
|
|||
|
||||
Shape* ShapeOwner::get(int idx) // this pointer is still owned by the class (assessor)
|
||||
{
|
||||
if (idx < 0 || idx >= static_cast<int>(shapes.size()))
|
||||
if (idx<0 || idx>=shapes.size())
|
||||
return NULL;
|
||||
return shapes[idx];
|
||||
}
|
||||
|
||||
Shape* ShapeOwner::remove(int idx) // this method returns memory which must be deleted
|
||||
{
|
||||
if (idx < 0 || idx >= static_cast<int>(shapes.size()))
|
||||
if (idx<0 || idx>=shapes.size())
|
||||
return NULL;
|
||||
Shape* ptr=shapes[idx];
|
||||
shapes.erase(shapes.begin()+idx);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
class Base {
|
||||
public:
|
||||
Base() { };
|
||||
virtual ~Base() { };
|
||||
~Base() { };
|
||||
virtual void A() {
|
||||
printf("I'm Base::A\n");
|
||||
}
|
||||
|
|
|
@ -7,25 +7,26 @@ using namespace std;
|
|||
class Bar
|
||||
{
|
||||
public:
|
||||
virtual void bar () {
|
||||
cout << "bar" << endl;
|
||||
}
|
||||
virtual ~Bar() {}
|
||||
virtual void bar ()
|
||||
{
|
||||
cout << "bar" << endl;
|
||||
}
|
||||
};
|
||||
|
||||
class Foo
|
||||
{
|
||||
public:
|
||||
virtual void foo () {
|
||||
cout << "foo" << endl;
|
||||
}
|
||||
virtual ~Foo() {}
|
||||
virtual void foo ()
|
||||
{
|
||||
cout << "foo" << endl;
|
||||
}
|
||||
};
|
||||
|
||||
class Foo_Bar : public Foo, public Bar
|
||||
{
|
||||
public:
|
||||
virtual void fooBar () {
|
||||
cout << "foobar" << endl;
|
||||
}
|
||||
virtual void fooBar ()
|
||||
{
|
||||
cout << "foobar" << endl;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -123,7 +123,7 @@ SOURCE=.\example.i
|
|||
InputPath=.\example.i
|
||||
InputName=example
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
@ -138,7 +138,7 @@ InputName=example
|
|||
InputPath=.\example.i
|
||||
InputName=example
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
|
|
@ -23,7 +23,7 @@ Zoo::~Zoo()
|
|||
IterType iter = this->animals.begin();
|
||||
IterType end = this->animals.end();
|
||||
|
||||
for(; iter != end; ++iter)
|
||||
for(iter; iter != end; ++iter)
|
||||
{
|
||||
Animal* animal = *iter;
|
||||
delete animal;
|
||||
|
|
|
@ -123,7 +123,7 @@ SOURCE=.\example.i
|
|||
InputPath=.\example.i
|
||||
InputName=example
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
@ -138,7 +138,7 @@ InputName=example
|
|||
InputPath=.\example.i
|
||||
InputName=example
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
|
|
@ -115,7 +115,7 @@ SOURCE=.\bar.i
|
|||
InputPath=.\bar.i
|
||||
InputName=bar
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
@ -130,7 +130,7 @@ InputName=bar
|
|||
InputPath=.\bar.i
|
||||
InputName=bar
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
|
|
@ -115,7 +115,7 @@ SOURCE=.\base.i
|
|||
InputPath=.\base.i
|
||||
InputName=base
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
@ -130,7 +130,7 @@ InputName=base
|
|||
InputPath=.\base.i
|
||||
InputName=base
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
|
|
@ -115,7 +115,7 @@ SOURCE=.\foo.i
|
|||
InputPath=.\foo.i
|
||||
InputName=foo
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
@ -130,7 +130,7 @@ InputName=foo
|
|||
InputPath=.\foo.i
|
||||
InputName=foo
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
|
|
@ -115,7 +115,7 @@ SOURCE=.\spam.i
|
|||
InputPath=.\spam.i
|
||||
InputName=spam
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
@ -130,7 +130,7 @@ InputName=spam
|
|||
InputPath=.\spam.i
|
||||
InputName=spam
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
|
|
@ -123,7 +123,7 @@ SOURCE=.\example.i
|
|||
InputPath=.\example.i
|
||||
InputName=example
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
@ -138,7 +138,7 @@ InputName=example
|
|||
InputPath=.\example.i
|
||||
InputName=example
|
||||
|
||||
"$(InputName)_wrap.cxx" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
echo In order to function correctly, please ensure the following environment variables are correctly set:
|
||||
echo RUBY_INCLUDE: %RUBY_INCLUDE%
|
||||
echo RUBY_LIB: %RUBY_LIB%
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
class Base {
|
||||
public:
|
||||
Base() { };
|
||||
virtual ~Base() { };
|
||||
~Base() { };
|
||||
virtual void A() {
|
||||
printf("I'm Base::A\n");
|
||||
}
|
||||
|
|
|
@ -31,7 +31,5 @@
|
|||
const char memberconstchar;
|
||||
|
||||
virtual ~DirectorTest() {}
|
||||
private:
|
||||
DirectorTest& operator=(const DirectorTest &);
|
||||
};
|
||||
%}
|
||||
|
|
|
@ -57,8 +57,6 @@ struct BoolStructure {
|
|||
m_rbool(m_bool2),
|
||||
m_const_pbool(m_pbool),
|
||||
m_const_rbool(m_rbool) {}
|
||||
private:
|
||||
BoolStructure& operator=(const BoolStructure &);
|
||||
};
|
||||
%}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ below.
|
|||
%warnfilter(SWIGWARN_TYPEMAP_CHARLEAK_MSG) global_const_char; // Setting a const char * variable may leak memory.
|
||||
|
||||
%{
|
||||
#define OTHERLAND_MSG "Little message from the safe world."
|
||||
#define OTHERLAND_MSG "Little message from the the safe world."
|
||||
#define CPLUSPLUS_MSG "A message from the deep dark world of C++, where anything is possible."
|
||||
static char *global_str = NULL;
|
||||
const int UINT_DIGITS = 10; // max unsigned int is 4294967295
|
||||
|
|
|
@ -40,7 +40,7 @@ SWIGOPT += -nounit
|
|||
$(setup)
|
||||
+$(swig_and_compile_c)
|
||||
$(run_testcase)
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then ( \
|
||||
+if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(PROXYSUFFIX) ]; then ( \
|
||||
$(MAKE) $*.cproxy; ) \
|
||||
fi;
|
||||
|
||||
|
@ -54,7 +54,7 @@ SWIGOPT += -nounit
|
|||
|
||||
%.externaltest:
|
||||
$(setup)
|
||||
+$(swig_and_compile_external)
|
||||
$(swig_and_compile_external)
|
||||
$(run_testcase)
|
||||
|
||||
# Runs the testcase. A testcase is only run if
|
||||
|
@ -69,21 +69,21 @@ run_testcase = \
|
|||
%.cppproxy: SWIGOPT += -proxy
|
||||
%.cppproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)
|
||||
%.cppproxy:
|
||||
echo "$(ACTION)ing testcase $* (with run test) under chicken with -proxy"
|
||||
+$(swig_and_compile_cpp)
|
||||
echo "Checking testcase $* (with run test) under chicken with -proxy"
|
||||
$(swig_and_compile_cpp)
|
||||
$(run_testcase)
|
||||
|
||||
%.cproxy: SWIGOPT += -proxy
|
||||
%.cproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)
|
||||
%.cproxy:
|
||||
echo "$(ACTION)ing testcase $* (with run test) under chicken with -proxy"
|
||||
echo "Checking testcase $* (with run test) under chicken with -proxy"
|
||||
+$(swig_and_compile_c)
|
||||
$(run_testcase)
|
||||
|
||||
%.multiproxy: SWIGOPT += -proxy -noclosuses
|
||||
%.multiproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)
|
||||
%.multiproxy:
|
||||
echo "$(ACTION)ing testcase $* (with run test) under chicken with -proxy"
|
||||
echo "Checking testcase $* (with run test) under chicken with -proxy"
|
||||
+$(swig_and_compile_multi_cpp)
|
||||
$(run_testcase)
|
||||
|
||||
|
|
|
@ -203,7 +203,6 @@ CPP_TEST_CASES += \
|
|||
inherit_target_language \
|
||||
inherit_void_arg \
|
||||
inline_initializer \
|
||||
keyword_rename \
|
||||
kind \
|
||||
langobj \
|
||||
li_attribute \
|
||||
|
@ -424,7 +423,6 @@ C_TEST_CASES += \
|
|||
immutable \
|
||||
inctest \
|
||||
integers \
|
||||
keyword_rename \
|
||||
lextype \
|
||||
li_carrays \
|
||||
li_cdata \
|
||||
|
|
|
@ -46,8 +46,6 @@ public:
|
|||
int* array_member1[ARRAY_SIZE];
|
||||
ParametersTest* array_member2[ARRAY_SIZE];
|
||||
MemberVariablesTest() : member3(NULL), member4(NULL) {}
|
||||
private:
|
||||
MemberVariablesTest& operator=(const MemberVariablesTest&);
|
||||
};
|
||||
void foo(const int *const i) {}
|
||||
|
||||
|
@ -71,8 +69,6 @@ public:
|
|||
void ret6(int*& a) {}
|
||||
int*& ret7() {return GlobalIntPtr;}
|
||||
ReturnValuesTest() : int3(NULL) {}
|
||||
private:
|
||||
ReturnValuesTest& operator=(const ReturnValuesTest&);
|
||||
};
|
||||
|
||||
const int* globalRet1() {return &GlobalInt;}
|
||||
|
@ -104,8 +100,6 @@ int* const globalRet2() {return &GlobalInt;}
|
|||
A* ap;
|
||||
const A* cap;
|
||||
Acptr acptr;
|
||||
private:
|
||||
B& operator=(const B&);
|
||||
};
|
||||
|
||||
const B* bar(const B* b) {
|
||||
|
|
|
@ -55,8 +55,6 @@ class Bar {
|
|||
Foo *testFoo(int a, Foo *f) {
|
||||
return new Foo(2 * a + (f ? f->num : 0) + fval.num);
|
||||
}
|
||||
private:
|
||||
Bar& operator=(const Bar&);
|
||||
};
|
||||
|
||||
%}
|
||||
|
|
|
@ -51,9 +51,9 @@ intermediary_classname.customtest:
|
|||
# Makes a directory for the testcase if it does not exist
|
||||
setup = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
|
||||
echo "Checking testcase $* (with run test) under $(LANGUAGE)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
|
||||
echo "Checking testcase $* under $(LANGUAGE)" ; \
|
||||
fi; \
|
||||
if [ ! -d $* ]; then \
|
||||
mkdir $*; \
|
||||
|
|
|
@ -5,7 +5,7 @@ using char_stringsNamespace;
|
|||
public class char_strings_runme {
|
||||
|
||||
private static string CPLUSPLUS_MSG = "A message from the deep dark world of C++, where anything is possible.";
|
||||
private static string OTHERLAND_MSG = "Little message from the safe world.";
|
||||
private static string OTHERLAND_MSG = "Little message from the the safe world.";
|
||||
|
||||
public static void Main() {
|
||||
|
||||
|
|
|
@ -81,8 +81,6 @@ struct SpeedClass {
|
|||
const colour myColour2;
|
||||
speedtd1 mySpeedtd1;
|
||||
SpeedClass() : myColour2(red), mySpeedtd1(slow) { }
|
||||
private:
|
||||
SpeedClass& operator=(const SpeedClass&);
|
||||
};
|
||||
|
||||
int speedTest0(int s) { return s; }
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
virtual ~Node() {}
|
||||
};
|
||||
|
||||
class NodeSwitch : public Node {
|
||||
class Switch : public Node {
|
||||
public :
|
||||
virtual int addChild( Node *child ) { return 2; } // This was hidden with -fvirtual
|
||||
virtual int addChild( Node *child, bool value ) { return 3; }
|
||||
virtual ~NodeSwitch() {}
|
||||
virtual ~Switch() {}
|
||||
};
|
||||
%}
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ run_testcase = \
|
|||
|
||||
setup = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE) (with SCM API)" ; \
|
||||
echo "Checking testcase $* (with run test) under $(LANGUAGE) (with SCM API)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing testcase $* under $(LANGUAGE) (with SCM API)" ; \
|
||||
echo "Checking testcase $* under $(LANGUAGE) (with SCM API)" ; \
|
||||
fi;
|
||||
|
||||
swig_and_compile_multi_cpp = \
|
||||
|
@ -43,9 +43,9 @@ swig_and_compile_multi_cpp = \
|
|||
# Same as setup and run_testcase, but without the SCRIPTPREFIX (so the runme comes from the guilescm directory)
|
||||
local_setup = \
|
||||
if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE) (with SCM API)" ; \
|
||||
echo "Checking testcase $* (with run test) under $(LANGUAGE) (with SCM API)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing testcase $* under $(LANGUAGE) (with SCM API)" ; \
|
||||
echo "Checking testcase $* under $(LANGUAGE) (with SCM API)" ; \
|
||||
fi;
|
||||
|
||||
local_run_testcase = \
|
||||
|
|
|
@ -57,9 +57,9 @@ SWIGOPT += -package $*
|
|||
# Makes a directory for the testcase if it does not exist
|
||||
setup = \
|
||||
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
|
||||
echo "Checking testcase $* (with run test) under $(LANGUAGE)" ; \
|
||||
else \
|
||||
echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
|
||||
echo "Checking testcase $* under $(LANGUAGE)" ; \
|
||||
fi; \
|
||||
if [ ! -d $* ]; then \
|
||||
mkdir $*; \
|
||||
|
|
|
@ -12,7 +12,7 @@ public class char_strings_runme {
|
|||
}
|
||||
|
||||
private static String CPLUSPLUS_MSG = "A message from the deep dark world of C++, where anything is possible.";
|
||||
private static String OTHERLAND_MSG = "Little message from the safe world.";
|
||||
private static String OTHERLAND_MSG = "Little message from the the safe world.";
|
||||
|
||||
public static void main(String argv[]) {
|
||||
|
||||
|
|
|
@ -119,8 +119,6 @@ public:
|
|||
void const_member_method(const ConstWithout *p) const {}
|
||||
const ConstWithout * const_var;
|
||||
const ConstWithout * const var_const;
|
||||
private:
|
||||
ConstWithout& operator=(const ConstWithout &);
|
||||
};
|
||||
const ConstWithout * global_constwithout = 0;
|
||||
void global_method_constwithout(const ConstWithout *p) {}
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Test reserved keyword renaming
|
||||
*/
|
||||
|
||||
%module keyword_rename
|
||||
|
||||
#pragma SWIG nowarn=SWIGWARN_PARSE_KEYWORD
|
||||
|
||||
%inline %{
|
||||
|
||||
#define KW(x, y) int x (int y) { return y; }
|
||||
|
||||
/* Python keywords */
|
||||
KW(in, except)
|
||||
KW(except, in)
|
||||
KW(pass, in)
|
||||
|
||||
/* Perl keywords */
|
||||
KW(tie, die)
|
||||
KW(use, next)
|
||||
|
||||
/* Java keywords */
|
||||
KW(implements, native)
|
||||
KW(synchronized, final)
|
||||
|
||||
/* C# Keywords */
|
||||
KW(string, out)
|
||||
struct sealed {int i;};
|
||||
|
||||
%}
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ public:
|
|||
%}
|
||||
|
||||
%inline %{
|
||||
std::string stdstring_empty() {
|
||||
std::string empty() {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
require("import") -- the import fn
|
||||
import("li_typemaps") -- import code
|
||||
|
||||
-- catch "undefined" global variables
|
||||
setmetatable(getfenv(),{__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
|
||||
|
||||
-- Check double INPUT typemaps
|
||||
assert(li_typemaps.in_double(22.22) == 22.22)
|
||||
assert(li_typemaps.inr_double(22.22) == 22.22)
|
||||
|
||||
-- Check double OUTPUT typemaps
|
||||
assert(li_typemaps.out_double(22.22) == 22.22)
|
||||
assert(li_typemaps.outr_double(22.22) == 22.22)
|
||||
|
||||
-- Check double INOUT typemaps
|
||||
assert(li_typemaps.inout_double(22.22) == 22.22)
|
||||
assert(li_typemaps.inoutr_double(22.22) == 22.22)
|
||||
|
||||
-- check long long
|
||||
assert(li_typemaps.in_ulonglong(20)==20)
|
||||
assert(li_typemaps.inr_ulonglong(20)==20)
|
||||
assert(li_typemaps.out_ulonglong(20)==20)
|
||||
assert(li_typemaps.outr_ulonglong(20)==20)
|
||||
assert(li_typemaps.inout_ulonglong(20)==20)
|
||||
assert(li_typemaps.inoutr_ulonglong(20)==20)
|
||||
|
||||
-- check bools
|
||||
assert(li_typemaps.in_bool(true)==true)
|
||||
assert(li_typemaps.inr_bool(false)==false)
|
||||
assert(li_typemaps.out_bool(true)==true)
|
||||
assert(li_typemaps.outr_bool(false)==false)
|
||||
assert(li_typemaps.inout_bool(true)==true)
|
||||
assert(li_typemaps.inoutr_bool(false)==false)
|
||||
|
||||
-- the others
|
||||
a,b=li_typemaps.inoutr_int2(1,2)
|
||||
assert(a==1 and b==2)
|
||||
|
||||
f,i=li_typemaps.out_foo(10)
|
||||
assert(f.a==10 and i==20)
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
%module(ruby_minherit="1") minherit
|
||||
|
||||
#if defined(SWIGPYTHON) || defined(SWIGRUBY) || defined(SWIGOCAML) || defined(SWIGOCTAVE) || defined(SWIGPERL)
|
||||
#if defined(SWIGPYTHON) || defined(SWIGRUBY) || defined(SWIGOCAML) || defined(SWIGOCTAVE)
|
||||
|
||||
%inline %{
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
fvirtual
|
||||
|
||||
sw = NodeSwitch();
|
||||
sw = Switch();
|
||||
n = Node();
|
||||
i = sw.addChild(n);
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ if (s != "hellohello")
|
|||
endif
|
||||
|
||||
|
||||
if (li_std_string.stdstring_empty() != "")
|
||||
if (li_std_string.empty() != "")
|
||||
error
|
||||
endif
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ SKIP: {
|
|||
is($gen1->testl("9234567890121111113"), "9234567890121111114", "ulonglong big number");
|
||||
|
||||
|
||||
is(li_std_string::stdstring_empty(), "", "stdstring_empty");
|
||||
is(li_std_string::empty(), "", "empty");
|
||||
|
||||
is(li_std_string::c_empty(), "", "c_empty");
|
||||
|
||||
|
@ -110,4 +110,4 @@ is(li_std_string::get_null(li_std_string::c_null()), undef, "c_empty");
|
|||
|
||||
is(li_std_string::get_null(li_std_string::c_empty()), "non-null", "c_empty");
|
||||
|
||||
is(li_std_string::get_null(li_std_string::stdstring_empty()), "non-null", "stdstring_empty");
|
||||
is(li_std_string::get_null(li_std_string::empty()), "non-null", "c_empty");
|
||||
|
|
|
@ -7,7 +7,7 @@ use strict;
|
|||
|
||||
my $command = shift @ARGV;
|
||||
|
||||
my $output = `$^X $command 2>&1`;
|
||||
my $output = `perl $command 2>&1`;
|
||||
|
||||
die "SWIG Perl test failed: \n\n$output\n"
|
||||
if $?;
|
||||
|
|
|
@ -42,17 +42,17 @@ missingtests: missingcpptests missingctests
|
|||
%.cpptest:
|
||||
$(setup)
|
||||
+$(swig_and_compile_cpp)
|
||||
+$(run_testcase)
|
||||
$(run_testcase)
|
||||
|
||||
%.ctest:
|
||||
$(setup)
|
||||
+$(swig_and_compile_c)
|
||||
+$(run_testcase)
|
||||
$(run_testcase)
|
||||
|
||||
%.multicpptest:
|
||||
$(setup)
|
||||
+$(swig_and_compile_multi_cpp)
|
||||
+$(run_testcase)
|
||||
$(run_testcase)
|
||||
|
||||
# Runs the testcase. A testcase is only run if
|
||||
# a file is found which has _runme.php4 appended after the testcase name.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from fvirtual import *
|
||||
|
||||
sw = NodeSwitch()
|
||||
sw = Switch()
|
||||
n = Node()
|
||||
i = sw.addChild(n);
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
import keyword_rename
|
||||
keyword_rename._in(1)
|
||||
keyword_rename._except(1)
|
|
@ -121,7 +121,7 @@ if s != "hellohello":
|
|||
raise RuntimeError
|
||||
|
||||
|
||||
if li_std_string.stdstring_empty() != "":
|
||||
if li_std_string.empty() != "":
|
||||
raise RuntimeError
|
||||
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ run_testcase = \
|
|||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" \
|
||||
$(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ;) \
|
||||
else \
|
||||
($(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$*$(WRAPSUFFIX);) \
|
||||
($(RUNR) $(srcdir)/$(SCRIPTPREFIX)$*$(WRAPSUFFIX);) \
|
||||
fi;
|
||||
|
||||
run_multitestcase = \
|
||||
|
@ -51,7 +51,7 @@ run_multitestcase = \
|
|||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" \
|
||||
$(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX) ;) \
|
||||
else \
|
||||
($(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX);) \
|
||||
($(RUNR) $(srcdir)/$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX);) \
|
||||
fi; \
|
||||
done
|
||||
# Clean
|
||||
|
|
|
@ -124,7 +124,7 @@ if (s != "hellohello")
|
|||
end
|
||||
|
||||
|
||||
if (stdstring_empty() != "")
|
||||
if (empty() != "")
|
||||
raise RuntimeError
|
||||
end
|
||||
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
%module samename
|
||||
|
||||
#if !(defined(SWIGCSHARP) || defined(SWIGJAVA))
|
||||
class samename {
|
||||
public:
|
||||
void do_something() {
|
||||
// ...
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
%{
|
||||
%inline {
|
||||
|
||||
class samename {
|
||||
public:
|
||||
|
@ -18,5 +9,5 @@ class samename {
|
|||
}
|
||||
};
|
||||
|
||||
%}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
static const Polarization polarization = UnaryPolarization;
|
||||
};
|
||||
template <Polarization P>
|
||||
struct Interface_
|
||||
struct Interface
|
||||
{
|
||||
};
|
||||
|
||||
|
@ -26,16 +26,16 @@
|
|||
};
|
||||
%}
|
||||
|
||||
%template(Interface_UP) Interface_<UnaryPolarization>;
|
||||
%template(Interface_UP) Interface<UnaryPolarization>;
|
||||
%template(Module_1) Module<1>;
|
||||
|
||||
%inline %{
|
||||
struct ExtInterface1 :
|
||||
Interface_<UnaryPolarization> // works
|
||||
Interface<UnaryPolarization> // works
|
||||
{
|
||||
};
|
||||
struct ExtInterface2 :
|
||||
Interface_<interface_traits::polarization> // doesn't work
|
||||
Interface<interface_traits::polarization> // doesn't work
|
||||
{
|
||||
};
|
||||
struct ExtModule1 :
|
||||
|
|
|
@ -16,7 +16,7 @@ public:
|
|||
|
||||
|
||||
template <typename T>
|
||||
class ArrayIterator_
|
||||
class ArrayIterator
|
||||
{
|
||||
public:
|
||||
typedef test_Array::intT intT;
|
||||
|
@ -38,8 +38,8 @@ class ArrayPrimitiveT
|
|||
public:
|
||||
typedef T ValueT;
|
||||
typedef T valueT;
|
||||
typedef ArrayIterator_<T> Iterator;
|
||||
typedef ArrayIterator_<const T> ConstIterator;
|
||||
typedef ArrayIterator<T> Iterator;
|
||||
typedef ArrayIterator<const T> ConstIterator;
|
||||
typedef ArrayReverseIterator<T> ReverseIterator;
|
||||
typedef ArrayReverseIterator<const T> ConstReverseIterator;
|
||||
};
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Foo {
|
|||
%typemap(javaout) Str1 * = char *;
|
||||
#endif
|
||||
%typemap(in) Str1 * = char *;
|
||||
#if !(defined(SWIGCSHARP) || defined(SWIGLUA) || defined(SWIGPHP))
|
||||
#if !(defined(SWIGCSHARP) || defined(SWIGLUA))
|
||||
%typemap(freearg) Str1 * = char *;
|
||||
#endif
|
||||
%typemap(typecheck) Str1 * = char *;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
/* Warnings for certain CHICKEN keywords. From Section 7.1.1 of
|
||||
Revised^5 Report on the Algorithmic Language Scheme */
|
||||
#define CHICKENKW(x) %namewarn("314: '" #x "' is a R^5RS syntatic keyword") #x
|
||||
#define CHICKENKW(x) %namewarn("314:" #x " is a R^5RS syntatic keyword") #x
|
||||
|
||||
CHICKENKW(else);
|
||||
CHICKENKW(=>);
|
||||
|
|
|
@ -73,7 +73,7 @@ static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = {
|
|||
|
||||
static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) {
|
||||
SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback;
|
||||
if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) {
|
||||
if (code >=0 && (size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) {
|
||||
callback = SWIG_csharp_exceptions[code].callback;
|
||||
}
|
||||
callback(msg);
|
||||
|
@ -81,7 +81,7 @@ static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes
|
|||
|
||||
static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) {
|
||||
SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback;
|
||||
if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {
|
||||
if (code >=0 && (size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {
|
||||
callback = SWIG_csharp_exceptions_argument[code].callback;
|
||||
}
|
||||
callback(msg, param_name);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define CSHARP_CSHARPKW_SWG_
|
||||
|
||||
/* Warnings for C# keywords */
|
||||
#define CSHARPKW(x) %keywordwarn("'" `x` "' is a C# keyword, renaming to '_" `x` "'",rename="_%s") `x`
|
||||
#define CSHARPKW(x) %namewarn("314:" #x " is a csharp keyword") #x
|
||||
|
||||
/*
|
||||
from
|
||||
|
|
|
@ -117,18 +117,12 @@ namespace Swig {
|
|||
JNIEnv *jenv_;
|
||||
public:
|
||||
JNIEnvWrapper(const Director *director) : director_(director), jenv_(0) {
|
||||
#if defined(SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON)
|
||||
// Attach a daemon thread to the JVM. Useful when the JVM should not wait for
|
||||
// the thread to exit upon shutdown. Only for jdk-1.4 and later.
|
||||
director_->swig_jvm_->AttachCurrentThreadAsDaemon((void **) &jenv_, NULL);
|
||||
#else
|
||||
director_->swig_jvm_->AttachCurrentThread((void **) &jenv_, NULL);
|
||||
#endif
|
||||
}
|
||||
~JNIEnvWrapper() {
|
||||
// Some JVMs, eg JDK 1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call.
|
||||
// However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak.
|
||||
#if !defined(SWIG_JAVA_NO_DETACH_CURRENT_THREAD)
|
||||
// Some JVMs, eg jdk-1.4.2 and lower on Solaris have a bug and crash with the DetachCurrentThread call.
|
||||
// However, without this call, the JVM hangs on exit when the thread was not created by the JVM and creates a memory leak.
|
||||
director_->swig_jvm_->DetachCurrentThread();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define JAVA_JAVAKW_SWG_
|
||||
|
||||
/* Warnings for Java keywords */
|
||||
#define JAVAKW(x) %keywordwarn("'" `x` "' is a java keyword, renaming to '_"`x`"'",rename="_%s") `x`
|
||||
#define JAVAKW(x) %namewarn("314:" #x " is a java keyword") #x
|
||||
|
||||
/*
|
||||
from
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
#endif
|
||||
}
|
||||
|
||||
%typemap(out) char **STRING_ARRAY {
|
||||
%typemap(out) char **STRING_ARRAY (char *s) {
|
||||
int i;
|
||||
int len=0;
|
||||
jstring temp_string;
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
%{$1 = (lua_toboolean(L, $input)!=0);%}
|
||||
|
||||
%typemap(out) bool
|
||||
%{ lua_pushboolean(L,(int)($1!=0)); SWIG_arg++;%}
|
||||
%{ lua_pushboolean(L,(int)($1==true)); SWIG_arg++;%}
|
||||
|
||||
// for const bool&, SWIG treats this as a const bool* so we must dereference it
|
||||
%typemap(in,checkfn="lua_isboolean") const bool& (bool temp)
|
||||
|
@ -81,7 +81,7 @@
|
|||
$1=&temp;%}
|
||||
|
||||
%typemap(out) const bool&
|
||||
%{ lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%}
|
||||
%{ lua_pushboolean(L,(int)(*$1==true)); SWIG_arg++;%}
|
||||
|
||||
// strings (char* and char[])
|
||||
%typemap(in,checkfn="lua_isstring") const char*, char*
|
||||
|
|
|
@ -80,22 +80,6 @@ SWIG_NUMBER_TYPEMAP(long long); SWIG_NUMBER_TYPEMAP(unsigned long long); SWIG_NU
|
|||
|
||||
// note we dont do char, as a char* is probably a string not a ptr to a single char
|
||||
|
||||
// similar for booleans
|
||||
%typemap(in,checkfn="lua_isboolean") bool *INPUT(bool temp), bool &INPUT(bool temp)
|
||||
%{ temp = (lua_toboolean(L,$input)!=0);
|
||||
$1 = &temp; %}
|
||||
|
||||
%typemap(in, numinputs=0) bool *OUTPUT (bool temp),bool &OUTPUT (bool temp)
|
||||
%{ $1 = &temp; %}
|
||||
|
||||
%typemap(argout) bool *OUTPUT,bool &OUTPUT
|
||||
%{ lua_pushboolean(L, (int)((*$1)!=0)); SWIG_arg++;%}
|
||||
|
||||
%typemap(in) bool *INOUT = bool *INPUT;
|
||||
%typemap(argout) bool *INOUT = bool *OUTPUT;
|
||||
%typemap(in) bool &INOUT = bool &INPUT;
|
||||
%typemap(argout) bool &INOUT = bool &OUTPUT;
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Basic Array typemaps
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
@ -336,11 +320,6 @@ for array handling
|
|||
%typemap(freearg) (TYPE *INOUT,int)=(TYPE *INPUT,int);
|
||||
|
||||
// TODO out variable arrays (is there a standard form for such things?)
|
||||
|
||||
// referencing so that (int *INPUT,int) and (int INPUT[],int) are the same
|
||||
%typemap(in) (TYPE INPUT[],int)=(TYPE *INPUT,int);
|
||||
%typemap(freearg) (TYPE INPUT[],int)=(TYPE *INPUT,int);
|
||||
|
||||
%enddef
|
||||
|
||||
// the following line of code
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define OCAML_OCAMLKW_SWG_
|
||||
|
||||
/* Warnings for Ocaml keywords */
|
||||
#define OCAMLKW(x) %namewarn("314: '" #x "' is a ocaml keyword and it will properly renamed") #x
|
||||
#define OCAMLKW(x) %namewarn("314:" #x " is a ocaml keyword and it will properly renamed") #x
|
||||
|
||||
/*
|
||||
from
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Warnings for Perl keywords */
|
||||
#define PERLKW(x) %keywordwarn("'" `x` "' is a perl keyword") `x`
|
||||
#define PERLBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in perl") "::" `x`
|
||||
#define PERLKW(x) %keywordwarn(`x` " is a perl keyword") `x`
|
||||
#define PERLBN(x) %builtinwarn(`x` " conflicts with a built-in name in perl") "::" `x`
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -8,15 +8,15 @@
|
|||
* when used as class methods.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#define PHPKW(x) %keywordwarn("'" `x` "' is a php keyword, renamed as 'c_" `x` "'",sourcefmt="%(lower)s", rename="c_%s",fullname=1) `x`
|
||||
#define PHPKW(x) %keywordwarn(`x` " is a php keyword, renamed as c_"`x`,sourcefmt="%(lower)s", rename="c_%s",fullname=1) `x`
|
||||
|
||||
%define PHPCN(x)
|
||||
%keywordwarn("'" `x` "' is a php reserved class name, class renamed as 'c_" `x` "'",%$isclass,rename="c_%s") `x`;
|
||||
%keywordwarn("'" `x` "' is a php reserved class name, constructor renamed as 'c_" `x` "'",%$isconstructor,rename="c_%s") `x`;
|
||||
%keywordwarn(`x` " is a php reserved class name, class renamed as c_"`x`,%$isclass,rename="c_%s") `x`;
|
||||
%keywordwarn(`x` " is a php reserved class name, constructor renamed as c_"`x`,%$isconstructor,rename="c_%s") `x`;
|
||||
%enddef
|
||||
|
||||
#define PHPBN1(x) %builtinwarn("'" `x` "' conflicts with a built-in name in php",sourcefmt="%(lower)s",fullname=1) `x`
|
||||
#define PHPBN2(x) %builtinwarn("'" `x` "' conflicts with a built-in name in php") "::" `x`
|
||||
#define PHPBN1(x) %builtinwarn(`x` " conflicts with a built-in name in php",sourcefmt="%(lower)s",fullname=1) `x`
|
||||
#define PHPBN2(x) %builtinwarn(`x` " conflicts with a built-in name in php") "::" `x`
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define PIKE_PIKEKW_SWG_
|
||||
|
||||
/* Warnings for Pike keywords */
|
||||
#define PIKEKW(x) %namewarn("314: '" #x "' is a pike keyword") #x
|
||||
#define PIKEKW(x) %namewarn("314:" #x " is a pike keyword") #x
|
||||
|
||||
/*
|
||||
from
|
||||
|
|
|
@ -738,12 +738,12 @@ namespace swig {
|
|||
typedef typename sequence::const_iterator const_iterator;
|
||||
|
||||
static PyObject *from(const sequence& seq) {
|
||||
%#ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS
|
||||
#ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS
|
||||
swig_type_info *desc = swig::type_info<sequence>();
|
||||
if (desc && desc->clientdata) {
|
||||
return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN);
|
||||
}
|
||||
%#endif
|
||||
#endif
|
||||
size_type size = seq.size();
|
||||
if (size <= (size_type)INT_MAX) {
|
||||
PyObject *obj = PyTuple_New((int)size);
|
||||
|
|
|
@ -38,18 +38,18 @@ namespace swig {
|
|||
virtual PySwigIterator *incr(size_t n = 1) = 0;
|
||||
|
||||
// Backward iterator method, very common in C++, but not required in Python
|
||||
virtual PySwigIterator *decr(size_t /*n*/ = 1)
|
||||
virtual PySwigIterator *decr(size_t n = 1)
|
||||
{
|
||||
throw stop_iteration();
|
||||
}
|
||||
|
||||
// Random access iterator methods, but not required in Python
|
||||
virtual ptrdiff_t distance(const PySwigIterator &/*x*/) const
|
||||
virtual ptrdiff_t distance(const PySwigIterator &x) const
|
||||
{
|
||||
throw std::invalid_argument("operation not supported");
|
||||
}
|
||||
|
||||
virtual bool equal (const PySwigIterator &/*x*/) const
|
||||
virtual bool equal (const PySwigIterator &x) const
|
||||
{
|
||||
throw std::invalid_argument("operation not supported");
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
Warnings for Python keywords, built-in names and bad names.
|
||||
*/
|
||||
|
||||
#define PYTHONKW(x) %keywordwarn("'" `x` "' is a python keyword, renaming to '_" `x` "'", rename="_%s") `x`
|
||||
#define PYTHONBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in python") "::"`x`
|
||||
#define PYTHONKW(x) %keywordwarn(`x` " is a python keyword, symbol will be renamed as '_" `x`"'", rename="_%s") `x`
|
||||
#define PYTHONBN(x) %builtinwarn(`x` " conflicts with a built-in name in python") "::"`x`
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
SWIGEXPORT void SWIG_init(void) {
|
||||
%}
|
||||
|
||||
%include <rkw.swg>
|
||||
|
||||
#define %Rruntime %insert("s")
|
||||
|
||||
#define SWIG_Object SEXP
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
Warnings for R keywords, built-in names and bad names.
|
||||
*/
|
||||
|
||||
#define RKW(x) %keywordwarn("'" `x` "' is a R keyword, renaming to '_" `x`"'", rename="_%s") `x`
|
||||
|
||||
/*
|
||||
Warnings for R reserved words taken from
|
||||
http://cran.r-project.org/doc/manuals/R-lang.html#Reserved-words
|
||||
*/
|
||||
|
||||
RKW(if);
|
||||
RKW(else);
|
||||
RKW(repeat);
|
||||
RKW(while);
|
||||
RKW(function);
|
||||
RKW(for);
|
||||
RKW(in);
|
||||
RKW(next);
|
||||
RKW(break);
|
||||
RKW(TRUE);
|
||||
RKW(FALSE);
|
||||
RKW(NULL);
|
||||
RKW(Inf);
|
||||
RKW(NaN);
|
||||
RKW(NA);
|
||||
RKW(NA_integer_);
|
||||
RKW(NA_real_);
|
||||
RKW(NA_complex_);
|
||||
RKW(NA_character_);
|
||||
|
||||
#undef RKW
|
|
@ -691,12 +691,10 @@ namespace swig
|
|||
for ( ; i != e; )
|
||||
{
|
||||
VALUE r = swig::from< Sequence::value_type >(*i);
|
||||
if ( RTEST( rb_yield(r) ) ) {
|
||||
if ( RTEST( rb_yield(r) ) )
|
||||
$self->erase(i++);
|
||||
e = self->end();
|
||||
} else {
|
||||
else
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define RUBY_RUBYKW_SWG_
|
||||
|
||||
/* Warnings for Ruby keywords */
|
||||
#define RUBYKW(x) %keywordwarn("'" `x` "' is a ruby keyword, renaming to 'C_" `x` "'",rename="C_%s",fullname=1) `x`
|
||||
#define RUBYKW(x) %keywordwarn("'" `x` "' is a ruby keyword, and it will renamed as 'C_"`x`"'",rename="C_%s",fullname=1) `x`
|
||||
|
||||
/*
|
||||
|
||||
|
|
|
@ -40,12 +40,6 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SWIG_MSC_UNSUPPRESS_4505
|
||||
# if defined(_MSC_VER)
|
||||
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SWIGUNUSEDPARM
|
||||
# ifdef __cplusplus
|
||||
# define SWIGUNUSEDPARM(p)
|
||||
|
|
|
@ -283,7 +283,6 @@ _apply_macro(Macro, ptrdiff_t , Arg2);
|
|||
_apply_macro(Macro, std::size_t, Arg2);
|
||||
_apply_macro(Macro, std::ptrdiff_t, Arg2);
|
||||
_apply_macro(Macro, std::string, Arg2);
|
||||
_apply_macro(Macro, std::wstring, Arg2);
|
||||
_apply_macro(Macro, std::complex<float>, Arg2);
|
||||
_apply_macro(Macro, std::complex<double>, Arg2);
|
||||
%enddef
|
||||
|
|
9
README
9
README
|
@ -1,6 +1,6 @@
|
|||
SWIG (Simplified Wrapper and Interface Generator)
|
||||
|
||||
Version: 1.3.36 (24 June 2008)
|
||||
Version: 1.3.35 (7 April 2008)
|
||||
|
||||
Tagline: SWIG is a compiler that integrates C and C++ with languages
|
||||
including Perl, Python, Tcl, Ruby, PHP, Java, Ocaml, Lua,
|
||||
|
@ -91,13 +91,6 @@ A SWIG FAQ and other hints can be found on the SWIG Wiki:
|
|||
What's New?
|
||||
===========
|
||||
|
||||
SWIG-1.3.36 summary:
|
||||
- Enhancement to directors to wrap all protected members
|
||||
- Optimisation feature for objects returned by value
|
||||
- A few bugs fixes in the PHP, Java, Ruby, R, C#, Python, Lua and
|
||||
Perl modules
|
||||
- Other minor generic bug fixes
|
||||
|
||||
SWIG-1.3.35 summary:
|
||||
- Octave language module added
|
||||
- Bug fixes in Python, Lua, Java, C#, Perl modules
|
||||
|
|
|
@ -423,7 +423,7 @@ int yylook(void) {
|
|||
{
|
||||
String *cmt = Scanner_text(scan);
|
||||
char *loc = Char(cmt);
|
||||
if ((strncmp(loc,"/*@SWIG",7) == 0) && (loc[Len(cmt)-3] == '@')) {
|
||||
if ((strncmp(loc,"/*@SWIG@",6) == 0) && (loc[Len(cmt)-3] == '@')) {
|
||||
scanner_locator(cmt);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -331,9 +331,7 @@ static void add_symbols(Node *n) {
|
|||
Delete(prefix);
|
||||
}
|
||||
|
||||
/*
|
||||
if (!Getattr(n,"parentNode") && class_level) set_parentNode(n,class_decl[class_level - 1]);
|
||||
*/
|
||||
if (0 && !Getattr(n,"parentNode") && class_level) set_parentNode(n,class_decl[class_level - 1]);
|
||||
Setattr(n,"ismember","1");
|
||||
}
|
||||
}
|
||||
|
@ -4111,11 +4109,10 @@ cpp_destructor_decl : NOT idtemplate LPAREN parms RPAREN cpp_end {
|
|||
/* Check for template names. If the class is a template
|
||||
and the constructor is missing the template part, we
|
||||
add it */
|
||||
if (Classprefix) {
|
||||
c = strchr(Char(Classprefix),'<');
|
||||
if (c && !Strchr($3,'<')) {
|
||||
$3 = NewStringf("%s%s",$3,c);
|
||||
}
|
||||
if (Classprefix && (c = strchr(Char(Classprefix),'<'))) {
|
||||
if (!Strchr($3,'<')) {
|
||||
$3 = NewStringf("%s%s",$3,c);
|
||||
}
|
||||
}
|
||||
Setattr($$,"storage","virtual");
|
||||
name = NewStringf("%s",$3);
|
||||
|
@ -4431,8 +4428,12 @@ parms : rawparms {
|
|||
;
|
||||
|
||||
rawparms : parm ptail {
|
||||
set_nextSibling($1,$2);
|
||||
$$ = $1;
|
||||
if (1) {
|
||||
set_nextSibling($1,$2);
|
||||
$$ = $1;
|
||||
} else {
|
||||
$$ = $2;
|
||||
}
|
||||
}
|
||||
| empty { $$ = 0; }
|
||||
;
|
||||
|
@ -4485,8 +4486,12 @@ valparms : rawvalparms {
|
|||
;
|
||||
|
||||
rawvalparms : valparm valptail {
|
||||
set_nextSibling($1,$2);
|
||||
$$ = $1;
|
||||
if (1) {
|
||||
set_nextSibling($1,$2);
|
||||
$$ = $1;
|
||||
} else {
|
||||
$$ = $2;
|
||||
}
|
||||
}
|
||||
| empty { $$ = 0; }
|
||||
;
|
||||
|
|
|
@ -281,13 +281,13 @@ int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab
|
|||
Delete(ptargs);
|
||||
}
|
||||
|
||||
/*
|
||||
if (0) {
|
||||
Parm *p = tparms;
|
||||
while (p) {
|
||||
Printf(stdout, "tparm: '%s' '%s' '%s'\n", Getattr(p, "name"), Getattr(p, "type"), Getattr(p, "value"));
|
||||
p = nextSibling(p);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/* Printf(stdout,"targs = '%s'\n", templateargs);
|
||||
Printf(stdout,"rname = '%s'\n", rname);
|
||||
|
|
|
@ -112,11 +112,12 @@ static void DelHash(DOH *ho) {
|
|||
int i;
|
||||
|
||||
for (i = 0; i < h->hashsize; i++) {
|
||||
n = h->hashtable[i];
|
||||
while (n) {
|
||||
next = n->next;
|
||||
DelNode(n);
|
||||
n = next;
|
||||
if ((n = h->hashtable[i])) {
|
||||
while (n) {
|
||||
next = n->next;
|
||||
DelNode(n);
|
||||
n = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
DohFree(h->hashtable);
|
||||
|
@ -137,11 +138,12 @@ static void Hash_clear(DOH *ho) {
|
|||
int i;
|
||||
|
||||
for (i = 0; i < h->hashsize; i++) {
|
||||
n = h->hashtable[i];
|
||||
while (n) {
|
||||
next = n->next;
|
||||
DelNode(n);
|
||||
n = next;
|
||||
if ((n = h->hashtable[i])) {
|
||||
while (n) {
|
||||
next = n->next;
|
||||
DelNode(n);
|
||||
n = next;
|
||||
}
|
||||
}
|
||||
h->hashtable[i] = 0;
|
||||
}
|
||||
|
@ -452,10 +454,11 @@ static DOH *CopyHash(DOH *ho) {
|
|||
|
||||
nho = DohObjMalloc(&DohHashType, nh);
|
||||
for (i = 0; i < h->hashsize; i++) {
|
||||
n = h->hashtable[i];
|
||||
while (n) {
|
||||
Hash_setattr(nho, n->key, n->object);
|
||||
n = n->next;
|
||||
if ((n = h->hashtable[i])) {
|
||||
while (n) {
|
||||
Hash_setattr(nho, n->key, n->object);
|
||||
n = n->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nho;
|
||||
|
|
|
@ -2271,7 +2271,7 @@ int ALLEGROCL::emit_dispatch_defun(Node *n) {
|
|||
return SWIG_OK;
|
||||
}
|
||||
|
||||
int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
||||
int ALLEGROCL::emit_defun(Node *n, File *f_cl) {
|
||||
#ifdef ALLEGROCL_WRAP_DEBUG
|
||||
Printf(stderr, "emit_defun: ENTER... ");
|
||||
#endif
|
||||
|
@ -2307,27 +2307,27 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
if (Generate_Wrapper) {
|
||||
String *extra_parms = id_converter_arguments(n)->noname_str();
|
||||
if (Getattr(n, "sym:overloaded"))
|
||||
Printf(fcl, "(swig-defmethod (\"%s\" \"%s\"%s)\n", funcname, mangled_name, extra_parms);
|
||||
Printf(f_cl, "(swig-defmethod (\"%s\" \"%s\"%s)\n", funcname, mangled_name, extra_parms);
|
||||
else
|
||||
Printf(fcl, "(swig-defun (\"%s\" \"%s\"%s)\n", funcname, mangled_name, extra_parms);
|
||||
Printf(f_cl, "(swig-defun (\"%s\" \"%s\"%s)\n", funcname, mangled_name, extra_parms);
|
||||
Delete(extra_parms);
|
||||
}
|
||||
// Just C
|
||||
else {
|
||||
Printf(fcl, "(swig-defun (\"%s\" \"%s\")\n", funcname, Generate_Wrapper ? mangled_name : funcname);
|
||||
Printf(f_cl, "(swig-defun (\"%s\" \"%s\")\n", funcname, Generate_Wrapper ? mangled_name : funcname);
|
||||
}
|
||||
|
||||
//////////////////////////////////////
|
||||
// Lisp foreign call parameter list //
|
||||
//////////////////////////////////////
|
||||
Printf(fcl, " (");
|
||||
Printf(f_cl, " (");
|
||||
|
||||
/* Special cases */
|
||||
|
||||
if (ParmList_len(pl) == 0) {
|
||||
Printf(fcl, ":void");
|
||||
Printf(f_cl, ":void");
|
||||
/* } else if (any_varargs(pl)) {
|
||||
Printf(fcl, "#| varargs |#");
|
||||
Printf(f_cl, "#| varargs |#");
|
||||
varargs=1; */
|
||||
} else {
|
||||
String *largs = NewString("");
|
||||
|
@ -2337,7 +2337,7 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
SwigType *argtype = Swig_cparse_type(Getattr(p, "tmap:ctype"));
|
||||
|
||||
if (!first) {
|
||||
Printf(fcl, "\n ");
|
||||
Printf(f_cl, "\n ");
|
||||
}
|
||||
|
||||
if (SwigType_isvarargs(argtype)) {
|
||||
|
@ -2393,7 +2393,7 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
// if this parameter has been removed from the C/++ wrapper
|
||||
// it shouldn't be in the lisp wrapper either.
|
||||
if (!checkAttribute(p, "tmap:in:numinputs", "0")) {
|
||||
Printf(fcl, "(%s %s %s %s %s)",
|
||||
Printf(f_cl, "(%s %s %s %s %s)",
|
||||
// parms in the ff wrapper, but not in the lisp wrapper.
|
||||
(checkAttribute(p, "tmap:lin:numinputs", "0") ? ":p-" : ":p+"), argname, dispatchtype, ffitype, lisptype);
|
||||
|
||||
|
@ -2479,12 +2479,12 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
Replaceall(wrap->code, "$ldestructor", ldestructor);
|
||||
Delete(ldestructor);
|
||||
|
||||
Printf(fcl, ")\n"); /* finish arg list */
|
||||
Printf(f_cl, ")\n"); /* finish arg list */
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// Lisp foreign call return type and optimizations //
|
||||
/////////////////////////////////////////////////////
|
||||
Printf(fcl, " (:returning (%s %s)", compose_foreign_type(result_type), get_lisp_type(Getattr(n, "type"), "result"));
|
||||
Printf(f_cl, " (:returning (%s %s)", compose_foreign_type(result_type), get_lisp_type(Getattr(n, "type"), "result"));
|
||||
|
||||
for (Iterator option = First(n); option.item; option = Next(option)) {
|
||||
if (Strncmp("feature:ffargs:", option.key, 15))
|
||||
|
@ -2494,12 +2494,12 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
Replaceall(option_name, "_", "-");
|
||||
|
||||
// TODO: varargs vs call-direct ?
|
||||
Printf(fcl, "\n %s %s", option_name, option_val);
|
||||
Printf(f_cl, "\n %s %s", option_name, option_val);
|
||||
|
||||
Delete(option_name);
|
||||
}
|
||||
|
||||
Printf(fcl, ")\n %s)\n\n", wrap->code);
|
||||
Printf(f_cl, ")\n %s)\n\n", wrap->code);
|
||||
// Wrapper_print(wrap, stderr);
|
||||
|
||||
Delete(result_type);
|
||||
|
@ -2935,9 +2935,11 @@ int ALLEGROCL::classHandler(Node *n) {
|
|||
#endif
|
||||
|
||||
if (Generate_Wrapper)
|
||||
return cppClassHandler(n);
|
||||
return cppClassHandler(n);
|
||||
else
|
||||
return cClassHandler(n);
|
||||
return cClassHandler(n);
|
||||
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
int ALLEGROCL::cClassHandler(Node *n) {
|
||||
|
|
|
@ -329,6 +329,7 @@ int CHICKEN::functionWrapper(Node *n) {
|
|||
Parm *p;
|
||||
int i;
|
||||
String *wname;
|
||||
String *source;
|
||||
Wrapper *f;
|
||||
String *mangle = NewString("");
|
||||
String *get_pointers;
|
||||
|
@ -397,6 +398,8 @@ int CHICKEN::functionWrapper(Node *n) {
|
|||
SwigType *pt = Getattr(p, "type");
|
||||
String *ln = Getattr(p, "lname");
|
||||
|
||||
source = NewStringf("scm%d", i + 1);
|
||||
|
||||
Printf(f->def, ", C_word scm%d", i + 1);
|
||||
Printf(declfunc, ",C_word");
|
||||
|
||||
|
@ -404,7 +407,6 @@ int CHICKEN::functionWrapper(Node *n) {
|
|||
if ((tm = Getattr(p, "tmap:in"))) {
|
||||
String *parse = Getattr(p, "tmap:in:parse");
|
||||
if (!parse) {
|
||||
String *source = NewStringf("scm%d", i + 1);
|
||||
Replaceall(tm, "$source", source);
|
||||
Replaceall(tm, "$target", ln);
|
||||
Replaceall(tm, "$input", source);
|
||||
|
@ -443,15 +445,20 @@ int CHICKEN::functionWrapper(Node *n) {
|
|||
}
|
||||
}
|
||||
}
|
||||
Delete(source);
|
||||
|
||||
} else {
|
||||
}
|
||||
|
||||
|
||||
p = Getattr(p, "tmap:in:next");
|
||||
continue;
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0));
|
||||
break;
|
||||
}
|
||||
|
||||
Delete(source);
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
||||
/* finish argument marshalling */
|
||||
|
@ -1503,7 +1510,7 @@ int CHICKEN::validIdentifier(String *s) {
|
|||
/* ------------------------------------------------------------
|
||||
* closNameMapping()
|
||||
* Maps the identifier from C++ to the CLOS based on command
|
||||
* line parameters and such.
|
||||
* line paramaters and such.
|
||||
* If class_name = "" that means the mapping is for a function or
|
||||
* variable not attached to any class.
|
||||
* ------------------------------------------------------------ */
|
||||
|
|
|
@ -1073,9 +1073,7 @@ public:
|
|||
global_variable_flag = false;
|
||||
generate_property_declaration_flag = false;
|
||||
|
||||
if (proxy_flag) {
|
||||
Printf(module_class_code, "\n }\n\n");
|
||||
}
|
||||
Printf(module_class_code, "\n }\n\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1926,7 +1924,7 @@ public:
|
|||
Swig_warning(WARN_CSHARP_TYPEMAP_CSWTYPE_UNDEF, input_file, line_number, "No cstype typemap defined for %s\n", SwigType_str(t, 0));
|
||||
}
|
||||
|
||||
if (wrapping_member_flag && !enum_constant_flag) {
|
||||
if (proxy_flag && wrapping_member_flag && !enum_constant_flag) {
|
||||
// Properties
|
||||
setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(Swig_name_member(proxy_class_name, variable_name))) == 0);
|
||||
if (setter_flag)
|
||||
|
@ -2109,7 +2107,7 @@ public:
|
|||
Swig_warning(WARN_CSHARP_TYPEMAP_CSOUT_UNDEF, input_file, line_number, "No csout typemap defined for %s\n", SwigType_str(t, 0));
|
||||
}
|
||||
|
||||
if (wrapping_member_flag && !enum_constant_flag) {
|
||||
if (proxy_flag && wrapping_member_flag && !enum_constant_flag) {
|
||||
// Properties
|
||||
if (generate_property_declaration_flag) { // Ensure the declaration is generated just once should the property contain both a set and get
|
||||
// Get the C# variable type - obtained differently depending on whether a setter is required.
|
||||
|
@ -2543,7 +2541,6 @@ public:
|
|||
num_arguments = emit_num_arguments(l);
|
||||
num_required = emit_num_required(l);
|
||||
|
||||
bool global_or_member_variable = global_variable_flag || (wrapping_member_flag && !enum_constant_flag);
|
||||
int gencomma = 0;
|
||||
|
||||
/* Output each parameter */
|
||||
|
@ -2570,7 +2567,7 @@ public:
|
|||
if (gencomma)
|
||||
Printf(imcall, ", ");
|
||||
|
||||
String *arg = makeParameterName(n, p, i, global_or_member_variable);
|
||||
String *arg = makeParameterName(n, p, i, setter_flag);
|
||||
|
||||
// Use typemaps to transform type used in C# wrapper function (in proxy class) to type used in PInvoke function (in intermediary class)
|
||||
if ((tm = Getattr(p, "tmap:csin"))) {
|
||||
|
@ -2758,7 +2755,7 @@ public:
|
|||
value = Getattr(n, "enumvalue") ? Copy(Getattr(n, "enumvalue")) : Copy(Getattr(n, "enumvalueex"));
|
||||
} else {
|
||||
// Get the enumvalue from a PINVOKE call
|
||||
if (!getCurrentClass() || !cparse_cplusplus || !proxy_flag) {
|
||||
if (!getCurrentClass() || !cparse_cplusplus) {
|
||||
// Strange hack to change the name
|
||||
Setattr(n, "name", Getattr(n, "value")); /* for wrapping of enums in a namespace when emit_action is used */
|
||||
constantWrapper(n);
|
||||
|
@ -2880,7 +2877,7 @@ public:
|
|||
* n - Node
|
||||
* p - parameter node
|
||||
* arg_num - parameter argument number
|
||||
* setter - set this flag when wrapping variables
|
||||
* setter - set this flag when wrapping member variables
|
||||
* Return:
|
||||
* arg - a unique parameter name
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
@ -2889,22 +2886,20 @@ public:
|
|||
|
||||
String *arg = 0;
|
||||
String *pn = Getattr(p, "name");
|
||||
|
||||
// Use C parameter name unless it is a duplicate or an empty parameter name
|
||||
int count = 0;
|
||||
ParmList *plist = Getattr(n, "parms");
|
||||
while (plist) {
|
||||
if ((Cmp(pn, Getattr(plist, "name")) == 0))
|
||||
count++;
|
||||
plist = nextSibling(plist);
|
||||
}
|
||||
String *wrn = pn ? Swig_name_warning(p, 0, pn, 0) : 0;
|
||||
arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d", arg_num) : Copy(pn);
|
||||
|
||||
if (setter && Cmp(arg, "self") != 0) {
|
||||
if (setter) {
|
||||
// Note that in C# properties, the input variable name is always called 'value'
|
||||
Delete(arg);
|
||||
arg = NewString("value");
|
||||
} else {
|
||||
// Use C parameter name unless it is a duplicate or an empty parameter name
|
||||
int count = 0;
|
||||
ParmList *plist = Getattr(n, "parms");
|
||||
while (plist) {
|
||||
if ((Cmp(pn, Getattr(plist, "name")) == 0))
|
||||
count++;
|
||||
plist = nextSibling(plist);
|
||||
}
|
||||
String *wrn = pn ? Swig_name_warning(p, 0, pn, 0) : 0;
|
||||
arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d", arg_num) : Copy(pn);
|
||||
}
|
||||
|
||||
return arg;
|
||||
|
|
|
@ -1649,7 +1649,7 @@ public:
|
|||
/* ------------------------------------------------------------
|
||||
* goopsNameMapping()
|
||||
* Maps the identifier from C++ to the GOOPS based * on command
|
||||
* line parameters and such.
|
||||
* line paramaters and such.
|
||||
* If class_name = "" that means the mapping is for a function or
|
||||
* variable not attached to any class.
|
||||
* ------------------------------------------------------------ */
|
||||
|
|
|
@ -1932,7 +1932,7 @@ public:
|
|||
Swig_warning(WARN_JAVA_TYPEMAP_JSTYPE_UNDEF, input_file, line_number, "No jstype typemap defined for %s\n", SwigType_str(t, 0));
|
||||
}
|
||||
|
||||
if (wrapping_member_flag && !enum_constant_flag) {
|
||||
if (proxy_flag && wrapping_member_flag && !enum_constant_flag) {
|
||||
// For wrapping member variables (Javabean setter)
|
||||
setter_flag = (Cmp(Getattr(n, "sym:name"), Swig_name_set(Swig_name_member(proxy_class_name, variable_name))) == 0);
|
||||
}
|
||||
|
@ -2463,7 +2463,6 @@ public:
|
|||
num_arguments = emit_num_arguments(l);
|
||||
num_required = emit_num_required(l);
|
||||
|
||||
bool global_or_member_variable = global_variable_flag || (wrapping_member_flag && !enum_constant_flag);
|
||||
int gencomma = 0;
|
||||
|
||||
/* Output each parameter */
|
||||
|
@ -2488,7 +2487,7 @@ public:
|
|||
if (gencomma)
|
||||
Printf(imcall, ", ");
|
||||
|
||||
String *arg = makeParameterName(n, p, i, global_or_member_variable);
|
||||
String *arg = makeParameterName(n, p, i, setter_flag);
|
||||
|
||||
// Use typemaps to transform type used in Java wrapper function (in proxy class) to type used in JNI function (in intermediary class)
|
||||
if ((tm = Getattr(p, "tmap:javain"))) {
|
||||
|
@ -2633,7 +2632,7 @@ public:
|
|||
value = Getattr(n, "enumvalue") ? Copy(Getattr(n, "enumvalue")) : Copy(Getattr(n, "enumvalueex"));
|
||||
} else {
|
||||
// Get the enumvalue from a JNI call
|
||||
if (!getCurrentClass() || !cparse_cplusplus || !proxy_flag) {
|
||||
if (!getCurrentClass() || !cparse_cplusplus) {
|
||||
// Strange hack to change the name
|
||||
Setattr(n, "name", Getattr(n, "value")); /* for wrapping of enums in a namespace when emit_action is used */
|
||||
constantWrapper(n);
|
||||
|
@ -2760,7 +2759,7 @@ public:
|
|||
* n - Node
|
||||
* p - parameter node
|
||||
* arg_num - parameter argument number
|
||||
* setter - set this flag when wrapping variables
|
||||
* setter - set this flag when wrapping member variables
|
||||
* Return:
|
||||
* arg - a unique parameter name
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
@ -2769,23 +2768,21 @@ public:
|
|||
|
||||
String *arg = 0;
|
||||
String *pn = Getattr(p, "name");
|
||||
|
||||
// Use C parameter name unless it is a duplicate or an empty parameter name
|
||||
int count = 0;
|
||||
ParmList *plist = Getattr(n, "parms");
|
||||
while (plist) {
|
||||
if ((Cmp(pn, Getattr(plist, "name")) == 0))
|
||||
count++;
|
||||
plist = nextSibling(plist);
|
||||
}
|
||||
String *wrn = pn ? Swig_name_warning(p, 0, pn, 0) : 0;
|
||||
arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d", arg_num) : Copy(pn);
|
||||
|
||||
if (setter && Cmp(arg, "self") != 0) {
|
||||
if (setter) {
|
||||
// Note that for setters the parameter name is always set but sometimes includes C++
|
||||
// scope resolution, so we need to strip off the scope resolution to make a valid name.
|
||||
Delete(arg);
|
||||
arg = NewString("value"); //Swig_scopename_last(pn);
|
||||
} else {
|
||||
// Use C parameter name unless it is a duplicate or an empty parameter name
|
||||
int count = 0;
|
||||
ParmList *plist = Getattr(n, "parms");
|
||||
while (plist) {
|
||||
if ((Cmp(pn, Getattr(plist, "name")) == 0))
|
||||
count++;
|
||||
plist = nextSibling(plist);
|
||||
}
|
||||
String *wrn = pn ? Swig_name_warning(p, 0, pn, 0) : 0;
|
||||
arg = (!pn || (count > 1) || wrn) ? NewStringf("arg%d", arg_num) : Copy(pn);
|
||||
}
|
||||
|
||||
return arg;
|
||||
|
|
|
@ -1097,33 +1097,38 @@ int Language::globalfunctionHandler(Node *n) {
|
|||
String *name = Getattr(n, "name");
|
||||
String *symname = Getattr(n, "sym:name");
|
||||
SwigType *type = Getattr(n, "type");
|
||||
String *storage = Getattr(n, "storage");
|
||||
ParmList *parms = Getattr(n, "parms");
|
||||
|
||||
/* Check for callback mode */
|
||||
String *cb = GetFlagAttr(n, "feature:callback");
|
||||
if (cb) {
|
||||
String *cbname = Getattr(n, "feature:callback:name");
|
||||
if (!cbname) {
|
||||
cbname = NewStringf(cb, symname);
|
||||
Setattr(n, "feature:callback:name", cbname);
|
||||
}
|
||||
if (0 && (Cmp(storage, "static") == 0)) {
|
||||
Swig_restore(n);
|
||||
return SWIG_NOWRAP; /* Can't wrap static functions */
|
||||
} else {
|
||||
/* Check for callback mode */
|
||||
String *cb = GetFlagAttr(n, "feature:callback");
|
||||
if (cb) {
|
||||
String *cbname = Getattr(n, "feature:callback:name");
|
||||
if (!cbname) {
|
||||
cbname = NewStringf(cb, symname);
|
||||
Setattr(n, "feature:callback:name", cbname);
|
||||
}
|
||||
|
||||
callbackfunctionHandler(n);
|
||||
if (Cmp(cbname, symname) == 0) {
|
||||
callbackfunctionHandler(n);
|
||||
if (Cmp(cbname, symname) == 0) {
|
||||
Delete(cbname);
|
||||
Swig_restore(n);
|
||||
return SWIG_NOWRAP;
|
||||
}
|
||||
Delete(cbname);
|
||||
Swig_restore(n);
|
||||
return SWIG_NOWRAP;
|
||||
}
|
||||
Delete(cbname);
|
||||
Setattr(n, "parms", nonvoid_parms(parms));
|
||||
String *call = Swig_cfunction_call(name, parms);
|
||||
String *cres = Swig_cresult(type, "result", call);
|
||||
Setattr(n, "wrap:action", cres);
|
||||
Delete(cres);
|
||||
Delete(call);
|
||||
functionWrapper(n);
|
||||
}
|
||||
Setattr(n, "parms", nonvoid_parms(parms));
|
||||
String *call = Swig_cfunction_call(name, parms);
|
||||
String *cres = Swig_cresult(type, "result", call);
|
||||
Setattr(n, "wrap:action", cres);
|
||||
Delete(cres);
|
||||
Delete(call);
|
||||
functionWrapper(n);
|
||||
|
||||
Swig_restore(n);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
@ -1371,6 +1376,9 @@ int Language::variableHandler(Node *n) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::globalvariableHandler(Node *n) {
|
||||
String *storage = Getattr(n, "storage");
|
||||
if (0 && (Cmp(storage, "static") == 0))
|
||||
return SWIG_NOWRAP;
|
||||
variableWrapper(n);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
@ -2100,8 +2108,8 @@ int Language::classDirector(Node *n) {
|
|||
String *using_protected_members_code = NewString("");
|
||||
for (ni = Getattr(n, "firstChild"); ni; ni = nextSibling(ni)) {
|
||||
Node *nodeType = Getattr(ni, "nodeType");
|
||||
bool cdeclaration = (Cmp(nodeType, "cdecl") == 0);
|
||||
if (cdeclaration && !GetFlag(ni, "feature:ignore")) {
|
||||
bool cdecl = (Cmp(nodeType, "cdecl") == 0);
|
||||
if (cdecl && !GetFlag(ni, "feature:ignore")) {
|
||||
if (is_non_virtual_protected_access(ni)) {
|
||||
Node *overloaded = Getattr(ni, "sym:overloaded");
|
||||
// emit the using base::member statement (but only once if the method is overloaded)
|
||||
|
@ -3383,8 +3391,7 @@ int Language::is_assignable(Node *n) {
|
|||
SwigType *ftd = SwigType_typedef_resolve_all(type);
|
||||
SwigType *td = SwigType_strip_qualifiers(ftd);
|
||||
if (SwigType_type(td) == T_USER) {
|
||||
cn = Swig_symbol_clookup(td, 0);
|
||||
if (cn) {
|
||||
if ((cn = Swig_symbol_clookup(td, 0))) {
|
||||
if ((Strcmp(nodeType(cn), "class") == 0)) {
|
||||
if (Getattr(cn, "allocate:noassign")) {
|
||||
SetFlag(n, "feature:immutable");
|
||||
|
|
|
@ -490,6 +490,8 @@ public:
|
|||
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0));
|
||||
break;
|
||||
}
|
||||
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
||||
// add all argcheck code
|
||||
|
@ -1099,6 +1101,7 @@ public:
|
|||
virtual int staticmemberfunctionHandler(Node *n) {
|
||||
current = STATIC_FUNC;
|
||||
return Language::staticmemberfunctionHandler(n);
|
||||
current = NO_CPP;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------
|
||||
|
@ -1120,6 +1123,7 @@ public:
|
|||
// REPORT("staticmembervariableHandler",n);
|
||||
current = STATIC_VAR;
|
||||
return Language::staticmembervariableHandler(n);
|
||||
current = NO_CPP;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
|
|
|
@ -33,7 +33,7 @@ int GenerateDefault = 1; // Generate default constructors
|
|||
int Verbose = 0;
|
||||
int AddExtern = 0;
|
||||
int NoExcept = 0;
|
||||
int SwigRuntime = 0; // 0 = no option, 1 = -runtime, 2 = -noruntime
|
||||
int SwigRuntime = 0; // 0 = no option, 1 = -c or -runtime, 2 = -noruntime
|
||||
|
||||
/* Suppress warning messages for private inheritance, preprocessor evaluation etc...
|
||||
WARN_PP_EVALUATION 202
|
||||
|
@ -491,13 +491,13 @@ void SWIG_getoptions(int argc, char *argv[]) {
|
|||
Wrapper_compact_print_mode_set(1);
|
||||
Wrapper_virtual_elimination_mode_set(1);
|
||||
Swig_mark_arg(i);
|
||||
} else if (strcmp(argv[i], "-runtime") == 0) { // Used to also accept -c. removed in swig-1.3.36
|
||||
} else if (strcmp(argv[i], "-runtime") == 0) {
|
||||
Swig_mark_arg(i);
|
||||
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-runtime, -noruntime command line options are deprecated.\n");
|
||||
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-c, -runtime, -noruntime command line options are deprecated.\n");
|
||||
SwigRuntime = 1;
|
||||
} else if (strcmp(argv[i], "-noruntime") == 0) {
|
||||
} else if ((strcmp(argv[i], "-c") == 0) || (strcmp(argv[i], "-noruntime") == 0)) {
|
||||
Swig_mark_arg(i);
|
||||
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-runtime, -noruntime command line options are deprecated.\n");
|
||||
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-c, -runtime, -noruntime command line options are deprecated.\n");
|
||||
SwigRuntime = 2;
|
||||
} else if (strcmp(argv[i], "-external-runtime") == 0) {
|
||||
external_runtime = 1;
|
||||
|
|
|
@ -472,9 +472,9 @@ MODULA3():
|
|||
cap = true;
|
||||
} else {
|
||||
if (cap) {
|
||||
m3sym[i] = (char)toupper(c);
|
||||
m3sym[i] = toupper(c);
|
||||
} else {
|
||||
m3sym[i] = (char)tolower(c);
|
||||
m3sym[i] = tolower(c);
|
||||
}
|
||||
cap = false;
|
||||
}
|
||||
|
|
|
@ -150,44 +150,45 @@ void SwigPHP_emit_resource_registrations() {
|
|||
ki = First(zend_types);
|
||||
if (ki.key)
|
||||
Printf(s_oinit, "\n/* Register resource destructors for pointer types */\n");
|
||||
while (ki.key) {
|
||||
DOH *key = ki.key;
|
||||
Node *class_node = ki.item;
|
||||
String *human_name = key;
|
||||
while (ki.key)
|
||||
if (1 /* is pointer type */ ) {
|
||||
DOH *key = ki.key;
|
||||
Node *class_node = ki.item;
|
||||
String *human_name = key;
|
||||
|
||||
// Write out destructor function header
|
||||
Printf(s_wrappers, "/* NEW Destructor style */\nstatic ZEND_RSRC_DTOR_FUNC(_wrap_destroy%s) {\n", key);
|
||||
// Write out destructor function header
|
||||
Printf(s_wrappers, "/* NEW Destructor style */\nstatic ZEND_RSRC_DTOR_FUNC(_wrap_destroy%s) {\n", key);
|
||||
|
||||
// write out body
|
||||
if ((class_node != NOTCLASS)) {
|
||||
String *destructor = Getattr(class_node, "destructor");
|
||||
human_name = Getattr(class_node, "sym:name");
|
||||
if (!human_name)
|
||||
human_name = Getattr(class_node, "name");
|
||||
// Do we have a known destructor for this type?
|
||||
if (destructor) {
|
||||
Printf(s_wrappers, " %s(rsrc, SWIGTYPE%s->name TSRMLS_CC);\n", destructor, key);
|
||||
// write out body
|
||||
if ((class_node != NOTCLASS)) {
|
||||
String *destructor = Getattr(class_node, "destructor");
|
||||
human_name = Getattr(class_node, "sym:name");
|
||||
if (!human_name)
|
||||
human_name = Getattr(class_node, "name");
|
||||
// Do we have a known destructor for this type?
|
||||
if (destructor) {
|
||||
Printf(s_wrappers, " %s(rsrc, SWIGTYPE%s->name TSRMLS_CC);\n", destructor, key);
|
||||
} else {
|
||||
Printf(s_wrappers, " /* No destructor for class %s */\n", human_name);
|
||||
}
|
||||
} else {
|
||||
Printf(s_wrappers, " /* No destructor for class %s */\n", human_name);
|
||||
Printf(s_wrappers, " /* No destructor for simple type %s */\n", key);
|
||||
}
|
||||
} else {
|
||||
Printf(s_wrappers, " /* No destructor for simple type %s */\n", key);
|
||||
|
||||
// close function
|
||||
Printf(s_wrappers, "}\n");
|
||||
|
||||
// declare le_swig_<mangled> to store php registration
|
||||
Printf(s_vdecl, "static int le_swig_%s=0; /* handle for %s */\n", key, human_name);
|
||||
|
||||
// register with php
|
||||
Printf(s_oinit, "le_swig_%s=zend_register_list_destructors_ex" "(_wrap_destroy%s,NULL,(char *)(SWIGTYPE%s->name),module_number);\n", key, key, key);
|
||||
|
||||
// store php type in class struct
|
||||
Printf(s_oinit, "SWIG_TypeClientData(SWIGTYPE%s,&le_swig_%s);\n", key, key);
|
||||
|
||||
ki = Next(ki);
|
||||
}
|
||||
|
||||
// close function
|
||||
Printf(s_wrappers, "}\n");
|
||||
|
||||
// declare le_swig_<mangled> to store php registration
|
||||
Printf(s_vdecl, "static int le_swig_%s=0; /* handle for %s */\n", key, human_name);
|
||||
|
||||
// register with php
|
||||
Printf(s_oinit, "le_swig_%s=zend_register_list_destructors_ex" "(_wrap_destroy%s,NULL,(char *)(SWIGTYPE%s->name),module_number);\n", key, key, key);
|
||||
|
||||
// store php type in class struct
|
||||
Printf(s_oinit, "SWIG_TypeClientData(SWIGTYPE%s,&le_swig_%s);\n", key, key);
|
||||
|
||||
ki = Next(ki);
|
||||
}
|
||||
}
|
||||
|
||||
class PHP:public Language {
|
||||
|
@ -1194,7 +1195,7 @@ public:
|
|||
if (native_constructor == NATIVE_CONSTRUCTOR) {
|
||||
Printf(f->code, "add_property_zval(this_ptr,\"" SWIG_PTR "\",_cPtr);\n");
|
||||
} else {
|
||||
String *shadowrettype = GetShadowReturnType(n);
|
||||
String *shadowrettype = SwigToPhpType(n, true);
|
||||
Printf(f->code, "object_init_ex(return_value,ptr_ce_swig_%s);\n", shadowrettype);
|
||||
Delete(shadowrettype);
|
||||
Printf(f->code, "add_property_zval(return_value,\"" SWIG_PTR "\",_cPtr);\n");
|
||||
|
@ -1439,10 +1440,6 @@ public:
|
|||
if (wrapperType == memberfn)
|
||||
p = nextSibling(p);
|
||||
while (p) {
|
||||
if (GetInt(p, "tmap:in:numinputs") == 0) {
|
||||
p = nextSibling(p);
|
||||
continue;
|
||||
}
|
||||
assert(0 <= argno && argno < max_num_of_arguments);
|
||||
String *&pname = arg_names[argno];
|
||||
const char *pname_cstr = GetChar(p, "name");
|
||||
|
@ -1753,8 +1750,7 @@ public:
|
|||
}
|
||||
|
||||
Printf(output, "\n");
|
||||
// If it's a member function or a class constructor...
|
||||
if (wrapperType == memberfn || (newobject && current_class)) {
|
||||
if (wrapperType == memberfn || newobject) {
|
||||
Printf(output, "\tfunction %s(%s) {\n", methodname, args);
|
||||
// We don't need this code if the wrapped class has a copy ctor
|
||||
// since the flat function new_CLASSNAME will handle it for us.
|
||||
|
@ -2559,9 +2555,20 @@ public:
|
|||
return SWIG_OK;
|
||||
}
|
||||
|
||||
String * GetShadowReturnType(Node *n) {
|
||||
|
||||
String * SwigToPhpType(Node *n, int shadow_flag) {
|
||||
String *ptype = 0;
|
||||
SwigType *t = Getattr(n, "type");
|
||||
|
||||
if (shadow_flag) {
|
||||
ptype = PhpTypeFromTypemap((char *) "pstype", n, (char *) "");
|
||||
}
|
||||
if (!ptype) {
|
||||
ptype = PhpTypeFromTypemap((char *) "ptype", n, (char *) "");
|
||||
}
|
||||
|
||||
if (ptype) return ptype;
|
||||
|
||||
/* Map type here */
|
||||
switch (SwigType_type(t)) {
|
||||
case T_CHAR:
|
||||
|
@ -2582,7 +2589,7 @@ public:
|
|||
case T_POINTER:
|
||||
case T_REFERENCE:
|
||||
case T_USER:
|
||||
if (is_shadow(t)) {
|
||||
if (shadow_flag && is_shadow(t)) {
|
||||
return NewString(Char(is_shadow(t)));
|
||||
}
|
||||
break;
|
||||
|
@ -2590,7 +2597,7 @@ public:
|
|||
/* TODO */
|
||||
break;
|
||||
default:
|
||||
Printf(stderr, "GetShadowReturnType: unhandled data type: %s\n", SwigType_str(t, 0));
|
||||
Printf(stderr, "SwigToPhpType: unhandled data type: %s\n", SwigType_str(t, 0));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1773,6 +1773,7 @@ public:
|
|||
Swig_warning(WARN_TYPEMAP_IN_UNDEF, input_file, line_number, "Unable to use type %s as a function argument.\n", SwigType_str(pt, 0));
|
||||
break;
|
||||
}
|
||||
p = nextSibling(p);
|
||||
}
|
||||
|
||||
/* finish argument marshalling */
|
||||
|
|
|
@ -57,13 +57,11 @@ static String * getRTypeName(SwigType *t, int *outCount = NULL) {
|
|||
Insert(tmp, 0, retName);
|
||||
return tmp;
|
||||
|
||||
/*
|
||||
if(count)
|
||||
return(b);
|
||||
|
||||
Delete(b);
|
||||
return(NewString(""));
|
||||
*/
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -106,7 +104,7 @@ static String * getRType(Node *n) {
|
|||
Now handles arrays, i.e. struct A[2]
|
||||
****************/
|
||||
|
||||
static String *getRClassName(String *retType, int /*addRef*/ = 1, int upRef=0) {
|
||||
static String *getRClassName(String *retType, int addRef = 1, int upRef=0) {
|
||||
String *tmp = NewString("");
|
||||
SwigType *resolved = SwigType_typedef_resolve_all(retType);
|
||||
char *retName = Char(SwigType_manglestr(resolved));
|
||||
|
@ -117,7 +115,6 @@ static String *getRClassName(String *retType, int /*addRef*/ = 1, int upRef=0) {
|
|||
}
|
||||
|
||||
return tmp;
|
||||
/*
|
||||
#if 1
|
||||
List *l = SwigType_split(retType);
|
||||
int n = Len(l);
|
||||
|
@ -163,7 +160,6 @@ static String *getRClassName(String *retType, int /*addRef*/ = 1, int upRef=0) {
|
|||
#endif
|
||||
|
||||
return tmp;
|
||||
*/
|
||||
}
|
||||
|
||||
/*********************
|
||||
|
@ -1845,9 +1841,6 @@ int R::functionWrapper(Node *n) {
|
|||
String *name = Getattr(p,"name");
|
||||
String *lname = Getattr(p,"lname");
|
||||
|
||||
// R keyword renaming
|
||||
if (name && Swig_name_warning(p, 0, name, 0))
|
||||
name = 0;
|
||||
|
||||
/* If we have a :: in the parameter name because we are accessing a static member of a class, say, then
|
||||
we need to remove that prefix. */
|
||||
|
@ -2034,18 +2027,14 @@ int R::functionWrapper(Node *n) {
|
|||
Replaceall(tm,"$owner", "R_SWIG_EXTERNAL");
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(addCopyParam) {
|
||||
if(0 && addCopyParam) {
|
||||
Printf(f->code, "if(LOGICAL(s_swig_copy)[0]) {\n");
|
||||
Printf(f->code, "/* Deal with returning a reference. */\nr_ans = R_NilValue;\n");
|
||||
Printf(f->code, "}\n else {\n");
|
||||
}
|
||||
#endif
|
||||
Printf(f->code, "%s\n", tm);
|
||||
#if 0
|
||||
if(addCopyParam)
|
||||
if(0 && addCopyParam)
|
||||
Printf(f->code, "}\n"); /* end of if(s_swig_copy) ... else { ... } */
|
||||
#endif
|
||||
|
||||
} else {
|
||||
Swig_warning(WARN_TYPEMAP_OUT_UNDEF, input_file, line_number,
|
||||
|
|
|
@ -448,7 +448,7 @@ private:
|
|||
parent_name = Copy( Getattr(mod, "name") );
|
||||
if ( parent_name )
|
||||
{
|
||||
(Char(parent_name))[0] = (char)toupper((Char(parent_name))[0]);
|
||||
(Char(parent_name))[0] = toupper((Char(parent_name))[0]);
|
||||
}
|
||||
}
|
||||
if ( parent_name )
|
||||
|
@ -1194,7 +1194,7 @@ public:
|
|||
while (m.item) {
|
||||
if (Len(m.item) > 0) {
|
||||
String *cap = NewString(m.item);
|
||||
(Char(cap))[0] = (char)toupper((Char(cap))[0]);
|
||||
(Char(cap))[0] = toupper((Char(cap))[0]);
|
||||
if (last != 0) {
|
||||
Append(module, "::");
|
||||
}
|
||||
|
@ -1206,7 +1206,7 @@ public:
|
|||
if (feature == 0) {
|
||||
feature = Copy(last);
|
||||
}
|
||||
(Char(last))[0] = (char)toupper((Char(last))[0]);
|
||||
(Char(last))[0] = toupper((Char(last))[0]);
|
||||
modvar = NewStringf("m%s", last);
|
||||
Delete(modules);
|
||||
}
|
||||
|
@ -2219,7 +2219,7 @@ public:
|
|||
return name;
|
||||
|
||||
if (islower(name[0])) {
|
||||
name[0] = (char)toupper(name[0]);
|
||||
name[0] = toupper(name[0]);
|
||||
Swig_warning(WARN_RUBY_WRONG_NAME, input_file, line_number, "Wrong %s name (corrected to `%s')\n", reason, name);
|
||||
return name;
|
||||
}
|
||||
|
@ -2545,7 +2545,7 @@ public:
|
|||
String *name = Copy(symname);
|
||||
char *cname = Char(name);
|
||||
if (cname)
|
||||
cname[0] = (char)toupper(cname[0]);
|
||||
cname[0] = toupper(cname[0]);
|
||||
Printv(director_prot_ctor_code,
|
||||
"if ( $comparison ) { /* subclassed */\n",
|
||||
" $director_new \n",
|
||||
|
|
|
@ -36,7 +36,6 @@ static int error_as_warning = 0; /* Understand the cpp #error directive as a spe
|
|||
/* Test a character to see if it valid in an identifier (after the first letter) */
|
||||
#define isidchar(c) ((isalnum(c)) || (c == '_') || (c == '$'))
|
||||
|
||||
DOH *Preprocessor_replace(DOH *);
|
||||
|
||||
/* Skip whitespace */
|
||||
static void skip_whitespace(String *s, String *out) {
|
||||
|
@ -699,6 +698,7 @@ static String *get_options(String *str) {
|
|||
static String *expand_macro(String *name, List *args) {
|
||||
String *ns;
|
||||
DOH *symbols, *macro, *margs, *mvalue, *temp, *tempa, *e;
|
||||
DOH *Preprocessor_replace(DOH *);
|
||||
int i, l;
|
||||
int isvarargs = 0;
|
||||
|
||||
|
@ -935,6 +935,7 @@ static String *expand_macro(String *name, List *args) {
|
|||
|
||||
List *evaluate_args(List *x) {
|
||||
Iterator i;
|
||||
String *Preprocessor_replace(String *);
|
||||
List *nl = NewList();
|
||||
|
||||
for (i = First(x); i.item; i = Next(i)) {
|
||||
|
@ -1794,7 +1795,7 @@ String *Preprocessor_parse(String *s) {
|
|||
for (i = 0; i < 6;) {
|
||||
c = Getc(s);
|
||||
Putc(c, value);
|
||||
statement[i++] = (char)c;
|
||||
statement[i++] = c;
|
||||
if (strncmp(statement, ed, i) && strncmp(statement, df, i))
|
||||
break;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue