Merge branch 'master' into javascript
* master:
Fix some typos
[PHP] The generated __isset() method now returns true for read-only properties.
Eliminate needless casting away const from string constants
Fix typos
Fix missing ")" in code example
Fix comment typos
Fix m4 quoting of checks for yodl2man and yodl2html versions
Fixed errors from previous commit.
Removed all unnecessary asserts
Remove unused variable
Another go html fix
Fix intgosize arg documentation
Optimize metamethods inheritance resolving
Updating documentation
Whitespace cleanup of Example Makefiles
.gitignore: ignore Lib/swigwarn.swg
Fixing unused variable warnings
Finish implementation with proxy functions
Remove duplicate declarations of strtoimax and strtoumax in inttypes.i
Ignored enum fixes.
Further shift operator regression fixes
Fix use of shift operators in expressions regression since 3.0.0
Fix seg fault with extra ) brackets and >>
More efficient end of template bracket (>>) handling
beautify scanner.c
Tidy up scanner.c
DOH readme correction
Fix typo in -lua -help output
Remove extra </div>
Update documentation for deprecation and removal of Close()
Fix segfault when there are too many closing round brackets in parsed code
Refix operator<< definition giving a syntax error
Fix regression in 3.0.0 where legal code following an operator<< definition might give a syntax error.
Remove unnecessary block from PHP version of SWIG_exception macro
[PHP] Fix wrapping director constructors with default parameters with a ZTS-enabled build of PHP.
Fix potential bugs found by Coverity analysis
Eliminate unused parameter from SWIG_Php_GetModule()
Fix comment typo
Fix compiler warnings in generated Lua code
[PHP] Pass the ZTS context we already have to avoid needing to call TSRMLS_FETCH, which is relatively expensive.
[PHP] Pass ZTS context through to t_output_helper() so it works with a ZTS-enabled build of PHP. Reported by Pierre Labastie in github PR#155.
Lua test-suite can now be run out of source
Fix out of source test-suite runs for Octave
Add runtime test for commit 7a96fba836
Add C++11 constexpr runtime test
This commit is contained in:
commit
f51be1ca5c
150 changed files with 935 additions and 410 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -85,6 +85,7 @@ swig.spec
|
|||
.dirstamp
|
||||
CCache/ccache-swig
|
||||
CCache/ccache-swig.1
|
||||
Lib/swigwarn.swg
|
||||
Source/CParse/parser.c
|
||||
Source/CParse/parser.h
|
||||
Source/eswig
|
||||
|
|
|
|||
6
CHANGES
6
CHANGES
|
|
@ -9970,7 +9970,7 @@ Version 1.3.23 (November 11, 2004)
|
|||
- Remove the ability to share type information by using c linking.
|
||||
All type sharing happens through a global variable in the target language.
|
||||
+ Remove SWIG_NOIMPORT, SWIG_RUNTIME, and related defines.
|
||||
+ Depreciate -runtime, -noruntime command line options
|
||||
+ Deprecate -runtime, -noruntime command line options
|
||||
+ Update test-suite common.mk to correctly build multicpptest
|
||||
+ Remove reference to precommon.swg
|
||||
+ Update the guile_gh interface to share data by a global var instead
|
||||
|
|
@ -21212,9 +21212,9 @@ Version 1.3 Alpha 1 (February 11, 2000)
|
|||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
1/30/00 : loic
|
||||
Conditionaly compile experimental code with --enable-experiment
|
||||
Conditionally compile experimental code with --enable-experiment
|
||||
configure flag.
|
||||
Fix .cvsignore to ignore configrue & yacc generated files
|
||||
Fix .cvsignore to ignore configure & yacc generated files
|
||||
|
||||
1/28/00 : loic
|
||||
Apply automake everywhere
|
||||
|
|
|
|||
|
|
@ -5,6 +5,35 @@ See the RELEASENOTES file for a summary of changes in each release.
|
|||
Version 3.0.1 (in progress)
|
||||
===========================
|
||||
|
||||
2014-05-01: olly
|
||||
[PHP] The generated __isset() method now returns true for read-only properties.
|
||||
|
||||
2014-04-08: wsfulton
|
||||
SF Bug #1366 - Remove duplicate declarations of strtoimax and strtoumax in inttypes.i
|
||||
|
||||
2014-04-08: wsfulton
|
||||
[Java C#] Enums which have been ignored via %ignore and are subsequently
|
||||
used are handled slightly differently. Type wrapper classes are now generated
|
||||
which are effectively a wrapper of an empty enum. Previously in Java uncompilable
|
||||
code was generated and in C# an int was used.
|
||||
|
||||
2014-04-04: wsfulton
|
||||
Fix regression in 3.0.0 where legal code following an operator<< definition might
|
||||
give a syntax error. SF Bug #1365.
|
||||
|
||||
2014-04-03: olly
|
||||
[PHP] Fix wrapping director constructors with default parameters
|
||||
with a ZTS-enabled build of PHP.
|
||||
|
||||
2014-04-02: olly
|
||||
[PHP] Pass the ZTS context we already have to avoid needing to
|
||||
call TSRMLS_FETCH, which is relatively expensive.
|
||||
|
||||
2014-04-02: olly
|
||||
[PHP] Pass ZTS context through to t_output_helper() so it works
|
||||
with a ZTS-enabled build of PHP. Reported by Pierre Labastie in
|
||||
github PR#155.
|
||||
|
||||
2014-03-28: wsfulton
|
||||
[Java C# D Go] Fixes for C enums used in an API and the definition of the enum
|
||||
has not been parsed. For D, this fixes a segfault in SWIG. The other languages
|
||||
|
|
|
|||
|
|
@ -1500,12 +1500,11 @@ Create a File object wrapper around an existing <tt>FILE *</tt> object.
|
|||
</div>
|
||||
|
||||
<p>
|
||||
<b><tt>int Close(String_or_FILE *f)</tt></b>
|
||||
There's no explicit function to close a file, just call <tt>Delete(f)</tt> -
|
||||
this decreases the reference count, and the file will be closed when the
|
||||
reference count reaches zero.
|
||||
</p>
|
||||
|
||||
<div class="indent">
|
||||
<p>Closes a file. Has no effect on strings.</p>
|
||||
|
||||
<p>
|
||||
The use of the above I/O functions and strings play a critical role in SWIG. It is
|
||||
common to see small code fragments of code generated using code like this:
|
||||
|
|
@ -1529,8 +1528,6 @@ Printf(f, "%s\n", s);
|
|||
Similarly, the preprocessor and parser all operate on string-files.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<H2><a name="Extending_nn21"></a>39.6 Navigating and manipulating parse trees</H2>
|
||||
|
||||
|
||||
|
|
@ -2832,7 +2829,6 @@ int Python::top(Node *n) {
|
|||
Delete(f_header);
|
||||
Delete(f_wrappers);
|
||||
Delete(f_init);
|
||||
Close(f_begin);
|
||||
Delete(f_begin);
|
||||
|
||||
return SWIG_OK;
|
||||
|
|
|
|||
|
|
@ -94,9 +94,9 @@ swig -go -help
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>-intgo-type-size %lt;s%gt;</td>
|
||||
<td>-intgosize <s></td>
|
||||
<td>Set the size for the Go type <tt>int</tt>. This controls the size
|
||||
that the C/C++ code expects to see. The %lt;s%gt; argument should
|
||||
that the C/C++ code expects to see. The <s> argument should
|
||||
be 32 or 64. This option is currently required during the
|
||||
transition from Go 1.0 to Go 1.1, as the size of <tt>int</tt> on
|
||||
64-bit x86 systems changes between those releases (from 32 bits to
|
||||
|
|
@ -125,7 +125,7 @@ swig -go -help
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>-soname %lt;name%gt;</td>
|
||||
<td>-soname <name></td>
|
||||
<td>Set the runtime name of the shared library that the dynamic linker
|
||||
should include at runtime. The default is the package name with
|
||||
".so" appended. This is only used when generating code for
|
||||
|
|
|
|||
|
|
@ -990,7 +990,7 @@ The current list of operators which can be overloaded (and the alternative funct
|
|||
<li><tt>__sub__</tt> operator-
|
||||
<li><tt>__mul__</tt> operator *
|
||||
<li><tt>__div__</tt> operator/
|
||||
<li><tt>__neg__</tt> unary minus
|
||||
<li><tt>__unm__</tt> unary minus
|
||||
<li><tt>__call__</tt> operator<tt>()</tt> (often used in functor classes)
|
||||
<li><tt>__pow__</tt> the exponential fn (no C++ equivalent, Lua uses <tt>^</tt>)
|
||||
<li><tt>__concat__</tt> the concatenation operator (SWIG maps C++'s <tt>~</tt> to Lua's <tt>..</tt>)
|
||||
|
|
@ -1037,7 +1037,29 @@ It is also possible to overload the operator<tt>[]</tt>, but currently this cann
|
|||
void __setitem__(int i,double d); // i is the index, d is the data
|
||||
};
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
C++ operators are mapped to Lua predefined metafunctions. Class inherits from its bases the following list of metafunctions ( thus inheriting the folloging
|
||||
operators and pseudo-operators):</p>
|
||||
<ul>
|
||||
<li><tt>__add__</tt>
|
||||
<li><tt>__sub__</tt>
|
||||
<li><tt>__mul__</tt>
|
||||
<li><tt>__div__</tt>
|
||||
<li><tt>__unm__</tt>
|
||||
<li><tt>__mod__</tt>
|
||||
<li><tt>__call__</tt>
|
||||
<li><tt>__pow__</tt>
|
||||
<li><tt>__concat__</tt>
|
||||
<li><tt>__eq__</tt>
|
||||
<li><tt>__lt__</tt>
|
||||
<li><tt>__le__</tt>
|
||||
<li><tt>__len__</tt>
|
||||
<li><tt>__getitem__</tt>
|
||||
<li><tt>__setitem__</tt>
|
||||
<li><tt>__tostring</tt> used internally by Lua for tostring() function. __str__ is mapped to this function
|
||||
</ul>
|
||||
<p>No other lua metafunction is inherited. For example, __gc is not inherited and must be redefined in every class. <tt>__tostring</tt> is subject to a special handling. If absent in class and in class bases, a default one will be provided by SWIG</p>
|
||||
</p>
|
||||
<H3><a name="Lua_nn19"></a>27.3.12 Class extension with %extend</H3>
|
||||
|
||||
|
||||
|
|
@ -1073,7 +1095,7 @@ Now we extend it with some new code
|
|||
return tmp;
|
||||
}
|
||||
bool operator==(const Complex& c)
|
||||
{ return ($self->re()==c.re() && $self->im()==c.im();}
|
||||
{ return ($self->re()==c.re() && $self->im()==c.im());}
|
||||
};
|
||||
</pre></div>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -4690,7 +4690,7 @@ public:
|
|||
C++ constructor, thus creating a new <tt>foo</tt> object.
|
||||
By default, SWIG will assign the new Ruby object a "free" function.
|
||||
When the Ruby object is garbage collected, the "free" function will be
|
||||
called. It in turn will call <tt>Foo's</tt> destructor.</p>
|
||||
called. It in turn will call <tt>Foo</tt>'s destructor.</p>
|
||||
|
||||
<p>Next, consider this code: </p>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ INTERFACE = example.i
|
|||
INTERFACEDIR = jni/
|
||||
PACKAGEDIR = src/org/swig
|
||||
PACKAGENAME= org.swig.classexample
|
||||
SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/classexample
|
||||
SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/classexample
|
||||
PROJECTNAME= SwigClass
|
||||
TARGETID = 1
|
||||
#INSTALLOPTIONS = -s # To install on SD Card
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ INTERFACE = example.i
|
|||
INTERFACEDIR = jni/
|
||||
PACKAGEDIR = src/org/swig
|
||||
PACKAGENAME= org.swig.extendexample
|
||||
SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/extendexample
|
||||
SWIGOPT = -package $(PACKAGENAME) -outdir $(PACKAGEDIR)/extendexample
|
||||
PROJECTNAME= SwigExtend
|
||||
TARGETID = 1
|
||||
#INSTALLOPTIONS = -s # To install on SD Card
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
INTERFACE = example.i
|
||||
SRCS =
|
||||
SRCS =
|
||||
CXXSRCS = example.cxx
|
||||
TARGET = class
|
||||
INCLUDE =
|
||||
SWIGOPT =
|
||||
CFLAGS =
|
||||
CFLAGS =
|
||||
VARIANT =
|
||||
|
||||
# uncomment the following lines to build a static exe (only pick one of the CHICKEN_MAIN lines)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ TOP = ../..
|
|||
SWIG = $(TOP)/../preinst-swig
|
||||
INTERFACE = example.i
|
||||
SRCS =
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = constants
|
||||
INCLUDE =
|
||||
SWIGOPT =
|
||||
CFLAGS =
|
||||
VARIANT =
|
||||
SWIGOPT =
|
||||
CFLAGS =
|
||||
VARIANT =
|
||||
|
||||
# uncomment the following two lines to build a static exe
|
||||
#CHICKEN_MAIN = runme.scm
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ TOP = ../..
|
|||
SWIG = $(TOP)/../preinst-swig
|
||||
INTERFACE = example.i
|
||||
SRCS = example.c
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = multimap
|
||||
INCLUDE =
|
||||
SWIGOPT =
|
||||
CFLAGS =
|
||||
VARIANT =
|
||||
SWIGOPT =
|
||||
CFLAGS =
|
||||
VARIANT =
|
||||
|
||||
# uncomment the following two lines to build a static exe
|
||||
#CHICKEN_MAIN = runme.scm
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
INTERFACE = example.i
|
||||
SRCS =
|
||||
SRCS =
|
||||
CXXSRCS = example.cxx
|
||||
TARGET = overload
|
||||
INCLUDE =
|
||||
SWIGOPT = -proxy -unhideprimitive
|
||||
CFLAGS =
|
||||
VARIANT =
|
||||
CFLAGS =
|
||||
VARIANT =
|
||||
|
||||
# uncomment the following lines to build a static exe
|
||||
#CHICKEN_MAIN = runme.scm
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ TOP = ../..
|
|||
SWIG = $(TOP)/../preinst-swig
|
||||
INTERFACE = example.i
|
||||
SRCS = example.c
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = simple
|
||||
INCLUDE =
|
||||
SWIGOPT =
|
||||
CFLAGS =
|
||||
VARIANT =
|
||||
SWIGOPT =
|
||||
CFLAGS =
|
||||
VARIANT =
|
||||
|
||||
# uncomment the following two lines to build a static exe
|
||||
#CHICKEN_MAIN = runme.scm
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = my-guile
|
||||
INTERFACE = example.i
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ math.randomseed(0) -- init random
|
|||
|
||||
|
||||
--[[ version 1: passing a C array to the code
|
||||
lets test call sort_int()
|
||||
let's test call sort_int()
|
||||
this requires a C array, so is the hardest to use]]
|
||||
ARRAY_SIZE=10
|
||||
arr=example.new_int(ARRAY_SIZE)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS =
|
||||
LIBS =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile lua_run
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
dual.cpp a test for multiple modules and multiple intrepreters staticly linked together.
|
||||
dual.cpp a test for multiple modules and multiple interpreters statically linked together.
|
||||
|
||||
Earlier version of lua bindings for SWIG would fail if staticly linked.
|
||||
Earlier version of lua bindings for SWIG would fail if statically linked.
|
||||
|
||||
What is happening is as follows:
|
||||
example.i declares a type Foo
|
||||
|
|
@ -28,7 +28,7 @@ both Foo and Bar.
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// the 2 libraries which are wrappered via SWIG
|
||||
// the 2 libraries which are wrapped via SWIG
|
||||
extern "C" int luaopen_example(lua_State*L);
|
||||
extern "C" int luaopen_example2(lua_State*L);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
/* embed.c a simple test for an embeded interpreter
|
||||
/* embed.c a simple test for an embedded interpreter
|
||||
|
||||
The idea is that we wrapper a few simple function (example.c)
|
||||
and write our own app to call it.
|
||||
|
||||
What it will do is load the wrappered lib, load runme.lua and then call some functions.
|
||||
What it will do is load the wrapped lib, load runme.lua and then call some functions.
|
||||
To make life easier, all the printf's have either [C] or [Lua] at the start
|
||||
so you can see where they are coming from.
|
||||
|
||||
|
|
@ -28,8 +28,8 @@ extern int luaopen_example(lua_State*L);
|
|||
/* a really simple way of calling lua from C
|
||||
just give it a lua state & a string to execute
|
||||
Unfortunately lua keeps changing its API's.
|
||||
In lua 5.0.X its lua_dostring()
|
||||
In lua 5.1.X its luaL_dostring()
|
||||
In lua 5.0.X it's lua_dostring()
|
||||
In lua 5.1.X it's luaL_dostring()
|
||||
so we have a few extra compiles
|
||||
*/
|
||||
int dostring(lua_State *L, char* str) {
|
||||
|
|
@ -58,11 +58,11 @@ int main(int argc,char* argv[]) {
|
|||
luaopen_base(L);
|
||||
luaopen_string(L);
|
||||
luaopen_math(L);
|
||||
printf("[C] now loading the SWIG wrappered library\n");
|
||||
printf("[C] now loading the SWIG wrapped library\n");
|
||||
luaopen_example(L);
|
||||
printf("[C] all looks ok\n");
|
||||
printf("\n");
|
||||
printf("[C] lets load the file 'runme.lua'\n");
|
||||
printf("[C] let's load the file 'runme.lua'\n");
|
||||
printf("[C] any lua code in this file will be executed\n");
|
||||
if (luaL_loadfile(L, "runme.lua") || lua_pcall(L, 0, 0, 0)) {
|
||||
printf("[C] ERROR: cannot run lua file: %s",lua_tostring(L, -1));
|
||||
|
|
@ -70,16 +70,16 @@ int main(int argc,char* argv[]) {
|
|||
}
|
||||
printf("[C] We are now back in C, all looks ok\n");
|
||||
printf("\n");
|
||||
printf("[C] lets call the function 'do_tests()'\n");
|
||||
printf("[C] let's call the function 'do_tests()'\n");
|
||||
ok=dostring(L,"do_tests()");
|
||||
printf("[C] We are back in C, the dostring() function returned %d\n",ok);
|
||||
printf("\n");
|
||||
printf("[C] Lets call lua again, but create an error\n");
|
||||
printf("[C] Let's call lua again, but create an error\n");
|
||||
ok=dostring(L,"no_such_function()");
|
||||
printf("[C] We are back in C, the dostring() function returned %d\n",ok);
|
||||
printf("[C] it should also have returned 1 and printed an error message\n");
|
||||
printf("\n");
|
||||
printf("[C] Lets call lua again, calling the greeting function\n");
|
||||
printf("[C] Let's call lua again, calling the greeting function\n");
|
||||
ok=dostring(L,"call_greeting()");
|
||||
printf("[C] This was C=>Lua=>C (getting a bit complex)\n");
|
||||
printf("\n");
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
print "[lua] This is runme.lua"
|
||||
-- test program for embeded lua
|
||||
-- we do not need to load the library, as it was already in the intrepreter
|
||||
-- but lets check anyway
|
||||
-- test program for embedded lua
|
||||
-- we do not need to load the library, as it was already in the interpreter
|
||||
-- but let's check anyway
|
||||
assert(type(example)=='table',"Don't appear to have loaded the example module")
|
||||
|
||||
-- a test function to run the tests
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
/* embed2.c some more test for an embeded interpreter
|
||||
/* embed2.c some more tests for an embedded interpreter
|
||||
|
||||
This will go a bit further as it will pass values to and from the lua code.
|
||||
It uses less of the SWIG code, and more of the raw lua API's
|
||||
|
||||
What it will do is load the wrappered lib, load runme.lua and then call some functions.
|
||||
What it will do is load the wrapped lib, load runme.lua and then call some functions.
|
||||
To make life easier, all the printf's have either [C] or [Lua] at the start
|
||||
so you can see where they are coming from.
|
||||
|
||||
|
|
@ -35,12 +35,12 @@ We will be using the luaL_dostring()/lua_dostring() function to call into lua
|
|||
#define lua_open luaL_newstate
|
||||
#endif
|
||||
|
||||
/* the SWIG wrappered library */
|
||||
/* the SWIG wrapped library */
|
||||
extern int luaopen_example(lua_State*L);
|
||||
|
||||
/* This is an example of how to call the Lua function
|
||||
int add(int,int)
|
||||
its very tedious, but gives you an idea of the issues involded.
|
||||
its very tedious, but gives you an idea of the issues involved.
|
||||
(look below for a better idea)
|
||||
*/
|
||||
int call_add(lua_State *L,int a,int b,int* res) {
|
||||
|
|
@ -78,7 +78,7 @@ int call_add(lua_State *L,int a,int b,int* res) {
|
|||
Original Code from Programming in Lua (PIL) by Roberto Ierusalimschy
|
||||
ISBN 85-903798-1-7
|
||||
http://www.lua.org/pil/25.3.html
|
||||
This has been modified slightly to make it compile, and its still a bit rough.
|
||||
This has been modified slightly to make it compile, and it's still a bit rough.
|
||||
But it gives the idea of how to make it work.
|
||||
*/
|
||||
int call_va (lua_State *L,const char *func, const char *sig, ...) {
|
||||
|
|
@ -189,7 +189,7 @@ int main(int argc,char* argv[]) {
|
|||
luaopen_example(L);
|
||||
printf("[C] all looks ok\n");
|
||||
printf("\n");
|
||||
printf("[C] lets load the file 'runme.lua'\n");
|
||||
printf("[C] let's load the file 'runme.lua'\n");
|
||||
printf("[C] any lua code in this file will be executed\n");
|
||||
if (luaL_loadfile(L, "runme.lua") || lua_pcall(L, 0, 0, 0)) {
|
||||
printf("[C] ERROR: cannot run lua file: %s",lua_tostring(L, -1));
|
||||
|
|
@ -197,12 +197,12 @@ int main(int argc,char* argv[]) {
|
|||
}
|
||||
printf("[C] We are now back in C, all looks ok\n");
|
||||
printf("\n");
|
||||
printf("[C] lets call the Lua function 'add(1,1)'\n");
|
||||
printf("[C] let's call the Lua function 'add(1,1)'\n");
|
||||
printf("[C] using the C function 'call_add'\n");
|
||||
ok=call_add(L,1,1,&res);
|
||||
printf("[C] the function returned %d with value %d\n",ok,res);
|
||||
printf("\n");
|
||||
printf("[C] lets do this rather easier\n");
|
||||
printf("[C] let's do this rather easier\n");
|
||||
printf("[C] we will call the same Lua function using a generic C function 'call_va'\n");
|
||||
ok=call_va(L,"add","ii>i",1,1,&res);
|
||||
printf("[C] the function returned %d with value %d\n",ok,res);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
print "[lua] This is runme.lua"
|
||||
-- test program for embeded lua
|
||||
-- we do not need to load the library, as it was already in the intrepreter
|
||||
-- but lets check anyway
|
||||
-- test program for embedded lua
|
||||
-- we do not need to load the library, as it was already in the interpreter
|
||||
-- but let's check anyway
|
||||
assert(type(example)=='table',"Don't appear to have loaded the example module")
|
||||
|
||||
-- note: we will copy the functions from example table into global
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* embed3.cpp A C++ embeded interpreter
|
||||
/* embed3.cpp A C++ embedded interpreter
|
||||
|
||||
This will register a C++ class with Lua, and then call a Lua function
|
||||
passing C++ objects to this function.
|
||||
|
|
@ -33,12 +33,12 @@ extern "C" {
|
|||
|
||||
/* The SWIG external runtime is generated by using.
|
||||
swig -lua -externalruntime swigluarun.h
|
||||
It contains useful function used by SWIG in its wrappering
|
||||
It contains useful function used by SWIG in its wrapper
|
||||
SWIG_TypeQuery() SWIG_NewPointerObj()
|
||||
*/
|
||||
#include "swigluarun.h" // the SWIG external runtime
|
||||
|
||||
/* the SWIG wrappered library */
|
||||
/* the SWIG wrapped library */
|
||||
extern "C" int luaopen_example(lua_State*L);
|
||||
|
||||
// the code itself
|
||||
|
|
@ -100,10 +100,10 @@ int main(int argc, char* argv[]) {
|
|||
luaopen_example(L);
|
||||
printf("[C++] all looks ok\n");
|
||||
printf("\n");
|
||||
printf("[C++] lets create an Engine and pass a pointer to Lua\n");
|
||||
printf("[C++] let's create an Engine and pass a pointer to Lua\n");
|
||||
Engine engine;
|
||||
/* this code will pass a pointer into lua, but C++ still owns the object
|
||||
this is a little tedious, to do, but lets do it
|
||||
this is a little tedious, to do, but let's do it
|
||||
we need to pass the pointer (obviously), the type name
|
||||
and a flag which states if Lua should delete the pointer once its finished with it
|
||||
The type name is a class name string which is registered with SWIG
|
||||
|
|
@ -113,7 +113,7 @@ int main(int argc, char* argv[]) {
|
|||
push_pointer(L,&engine,"Engine *",0);
|
||||
lua_setglobal(L, "pEngine"); // set as global variable
|
||||
|
||||
printf("[C++] now lets load the file 'runme.lua'\n");
|
||||
printf("[C++] now let's load the file 'runme.lua'\n");
|
||||
printf("[C++] any lua code in this file will be executed\n");
|
||||
if (luaL_loadfile(L, "runme.lua") || lua_pcall(L, 0, 0, 0)) {
|
||||
printf("[C++] ERROR: cannot run lua file: %s", lua_tostring(L, -1));
|
||||
|
|
@ -122,7 +122,7 @@ int main(int argc, char* argv[]) {
|
|||
printf("[C++] We are now back in C++, all looks ok\n");
|
||||
printf("\n");
|
||||
|
||||
printf("[C++] Lets call the Lua function onEvent(e)\n");
|
||||
printf("[C++] Let's call the Lua function onEvent(e)\n");
|
||||
printf("[C++] We will give it different events, as we wish\n");
|
||||
printf("[C++] Starting with STARTUP\n");
|
||||
Event ev;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public:
|
|||
};
|
||||
|
||||
|
||||
/* We also want to pass some events to Lua, so lets have a few classes
|
||||
/* We also want to pass some events to Lua, so let's have a few classes
|
||||
to do this.
|
||||
*/
|
||||
class Event
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
print "[lua] This is runme.lua"
|
||||
-- test program for embeded lua
|
||||
-- we do not need to load the library, as it was already in the intrepreter
|
||||
-- but lets check anyway
|
||||
-- test program for embedded lua
|
||||
-- we do not need to load the library, as it was already in the interpreter
|
||||
-- but let's check anyway
|
||||
|
||||
assert(type(example)=='table',"Don't appear to have loaded the example module. Do not run this file directly, run the embed3 executable")
|
||||
|
||||
|
|
@ -13,12 +13,12 @@ else
|
|||
end
|
||||
|
||||
|
||||
-- the embed program expects a function void onEvent(Event)
|
||||
-- the embedded program expects a function void onEvent(Event)
|
||||
-- this is it
|
||||
|
||||
function onEvent(e)
|
||||
print("[Lua] onEvent with event",e.mType)
|
||||
-- lets do something with the Engine
|
||||
-- let's do something with the Engine
|
||||
-- nothing clever, but ...
|
||||
if e.mType==example.Event_STARTUP then
|
||||
pEngine:start()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ function b()
|
|||
t:message()
|
||||
end
|
||||
print [[
|
||||
Now lets call function a()
|
||||
Now let's call function a()
|
||||
which calls b()
|
||||
which calls into C++
|
||||
which will throw an exception!]]
|
||||
|
|
@ -80,7 +80,7 @@ if ok then
|
|||
else
|
||||
print(" call failed with error:",res)
|
||||
end
|
||||
print "Now lets do the same using xpcall(a,debug.traceback)"
|
||||
print "Now let's do the same using xpcall(a,debug.traceback)"
|
||||
ok,res=xpcall(a,debug.traceback)
|
||||
if ok then
|
||||
print " that worked! Funny"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS =
|
||||
LIBS =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile lua_run
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS =
|
||||
LIBS =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile lua_run
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile lua_run
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ TOP = ../..
|
|||
SWIG = $(TOP)/../preinst-swig
|
||||
SWIGOPT =
|
||||
LIBS =
|
||||
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile lua_run
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
||||
|
|
|
|||
|
|
@ -9,15 +9,15 @@ else
|
|||
require('example')
|
||||
end
|
||||
|
||||
print "ok, lets test Lua's ownership of C++ objects"
|
||||
print "ok, let's test Lua's ownership of C++ objects"
|
||||
print("Currently there are",example.Shape_nshapes,"shapes (there should be 0)")
|
||||
|
||||
print "\nLets make a couple"
|
||||
print "\nLet's make a couple"
|
||||
a=example.Square(10)
|
||||
b=example.Circle(1)
|
||||
print("Currently there are",example.Shape_nshapes,"shapes (there should be 2)")
|
||||
|
||||
print "\nNote lets use the createX functions"
|
||||
print "\nNote let's use the createX functions"
|
||||
c=example.createCircle(5)
|
||||
d=example.createSquare(3)
|
||||
print("Currently there are",example.Shape_nshapes,"shapes (there should be 4)")
|
||||
|
|
@ -26,12 +26,12 @@ print "\nWe will run the garbage collector & see if they are till here"
|
|||
collectgarbage()
|
||||
print("Currently there are",example.Shape_nshapes,"shapes (there should be 4)")
|
||||
|
||||
print "\nLets get rid of them all, collect garbage & see if they are till here"
|
||||
print "\nLet's get rid of them all, collect garbage & see if they are till here"
|
||||
a,b,c,d=nil,nil,nil,nil
|
||||
collectgarbage()
|
||||
print("Currently there are",example.Shape_nshapes,"shapes (there should be 0)")
|
||||
|
||||
print "\nLets start putting stuff into the ShapeOwner"
|
||||
print "\nLet's start putting stuff into the ShapeOwner"
|
||||
print "The ShapeOwner now owns the shapes, but Lua still has pointers to them"
|
||||
o=example.ShapeOwner()
|
||||
a=example.Square(10)
|
||||
|
|
@ -41,7 +41,7 @@ o:add(b)
|
|||
o:add(example.createSquare(5))
|
||||
print("Currently there are",example.Shape_nshapes,"shapes (there should be 3)")
|
||||
|
||||
print "\nWe will nil our references,run the garbage collector & see if they are till here"
|
||||
print "\nWe will nil our references,run the garbage collector & see if they are still here"
|
||||
print "they should be, as the ShapeOwner owns them"
|
||||
a,b=nil,nil
|
||||
collectgarbage()
|
||||
|
|
@ -101,4 +101,4 @@ print "done"
|
|||
o,sh=nil,nil
|
||||
collectgarbage()
|
||||
print("Currently there are",example.Shape_nshapes,"shapes (there should be 0)")
|
||||
print "thats all folks!"
|
||||
print "that's all folks!"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS =
|
||||
LIBS =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile lua_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
PLATFORM = LINUXLIBC6
|
||||
INTERFACE = example.i
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
CONSTNUMERIC = example_const
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT = -c++
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile mzscheme_run
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile mzscheme_run
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
GPP = `which g++`
|
||||
MZC = test -n "/usr/bin/mzc" && /usr/bin/mzc
|
||||
|
|
@ -14,7 +14,7 @@ check: build
|
|||
build:
|
||||
$(SWIG) -mzscheme -c++ $(SWIGOPT) $(INTERFACE)
|
||||
$(MZC) --compiler $(GPP) ++ccf "-I." --cc example_wrap.cxx
|
||||
$(MZC) --linker $(GPP) --ld $(TARGET).so example_wrap.o
|
||||
|
||||
$(MZC) --linker $(GPP) --ld $(TARGET).so example_wrap.o
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(TOP)/Makefile mzscheme_clean
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
MLFILE = example.ml
|
||||
PROGFILE = example_prog.ml
|
||||
OBJS =
|
||||
OBJS =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
MLFILE = example.ml
|
||||
PROGFILE = example_prog.ml
|
||||
OBJS =
|
||||
OBJS =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
PROGFILE = runme.ml
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
PROGFILE = runme.ml
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
PROGFILE = runme.ml
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SWIGOPT = -c++
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = foolib.i
|
||||
MLFILE = foolib.ml
|
||||
PROGFILE = example_prog.ml
|
||||
OBJS =
|
||||
OBJS =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' ocaml_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
PROGFILE = runme.ml
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
|
|
@ -15,7 +15,7 @@ build: Example.class
|
|||
|
||||
clean:
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_clean
|
||||
rm -f *.class Example.h
|
||||
rm -f *.class Example.h
|
||||
|
||||
Example.class: Example.java
|
||||
gcj -fPIC -C -c -g Example.java
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_run
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS =
|
||||
LIBS =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_run
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_run
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ CXXSRCS = example.cxx
|
|||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT = -noproxy
|
||||
SWIGOPT = -noproxy
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_run
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_run
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_run
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile perl5_run
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ CXXSRCS = example.cxx
|
|||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile php_run
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ CXXSRCS = example.cxx
|
|||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile php_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile pike_run
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ CXXSRCS = example.cxx
|
|||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ SWIG = $(TOP)/../preinst-swig
|
|||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ CXXSRCS = example.cxx
|
|||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
|
|
@ -20,4 +20,3 @@ clean:
|
|||
Example.class: Example.java
|
||||
gcj -fPIC -C -c -g Example.java
|
||||
gcjh Example
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ CXXSRCS = example.cxx
|
|||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ CXXSRCS = example.cxx
|
|||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile python_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS =
|
||||
SRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile ruby_run
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ TOP = ../..
|
|||
SWIG = $(TOP)/../preinst-swig
|
||||
SWIGOPT =
|
||||
LIBS =
|
||||
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile ruby_run
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ TOP = ../..
|
|||
SWIG = $(TOP)/../preinst-swig
|
||||
SWIGOPT =
|
||||
LIBS =
|
||||
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile ruby_run
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
|
|
@ -20,4 +20,3 @@ clean:
|
|||
Example.class: Example.java
|
||||
gcj -fPIC -C -c -g Example.java
|
||||
gcjh Example
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile ruby_run
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile ruby_run
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile ruby_run
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
|
|
@ -23,4 +23,3 @@ run:
|
|||
Example.class: Example.java
|
||||
gcj -fPIC -C -c -g Example.java
|
||||
gcjh Example
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
CXXSRCS =
|
||||
TARGET = my_tclsh
|
||||
DLTARGET = example
|
||||
INTERFACE = example.i
|
||||
|
|
|
|||
|
|
@ -197,6 +197,7 @@ CPP_TEST_CASES += \
|
|||
disown \
|
||||
dynamic_cast \
|
||||
empty \
|
||||
enum_ignore \
|
||||
enum_plus \
|
||||
enum_rename \
|
||||
enum_scope_template \
|
||||
|
|
|
|||
|
|
@ -24,6 +24,14 @@ public:
|
|||
int operator<<(ABC &) { return 0; }
|
||||
};
|
||||
|
||||
class DEF {
|
||||
public:
|
||||
int a;
|
||||
int operator<<(DEF &) { return 0; }
|
||||
int operator>>(DEF &) { return 0; }
|
||||
};
|
||||
|
||||
|
||||
template<class T>
|
||||
class ABC2 {
|
||||
public:
|
||||
|
|
@ -37,3 +45,9 @@ public:
|
|||
};
|
||||
%}
|
||||
|
||||
// Test shifts are still working
|
||||
%inline %{
|
||||
int shift_init1 = 4 << 2 >> 1;
|
||||
int shift_init2 = 4 >> 2 << 1 << 1 >> 2;
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,19 @@ class Foo {
|
|||
}
|
||||
|
||||
int (Foo::*func_ptr)(int);
|
||||
|
||||
const char* __str__() const { return "Foo"; }
|
||||
};
|
||||
|
||||
class FooSub : public Foo {
|
||||
public:
|
||||
FooSub() :Foo(42) {}
|
||||
};
|
||||
|
||||
class FooSubSub : public FooSub {
|
||||
public:
|
||||
FooSubSub() : FooSub() {}
|
||||
const char* __str__() const { return "FooSubSub"; }
|
||||
};
|
||||
|
||||
%}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue