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
|
|
@ -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"; }
|
||||
};
|
||||
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ void main() {
|
|||
assert(-a == a);
|
||||
assert(-b == new Op(-5));
|
||||
|
||||
// Unfortunaly, there is no way to override conversion to boolean for
|
||||
// Unfortunately, there is no way to override conversion to boolean for
|
||||
// classes in D, opCast!("bool") is only used for structs.
|
||||
|
||||
// test []
|
||||
|
|
|
|||
20
Examples/test-suite/enum_ignore.i
Normal file
20
Examples/test-suite/enum_ignore.i
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
%module enum_ignore
|
||||
|
||||
// Similar to enum_missing C test, but with namespaces and using %ignore
|
||||
|
||||
%ignore N::C;
|
||||
|
||||
%inline %{
|
||||
namespace N {
|
||||
enum C { Red, Green, Blue };
|
||||
|
||||
struct Draw {
|
||||
void DrawBW() {}
|
||||
void DrawC(C c) {}
|
||||
void DrawC_Ptr(C* c) {}
|
||||
void DrawC_ConstRef(C const& c) {}
|
||||
};
|
||||
}
|
||||
%}
|
||||
|
||||
|
||||
6
Examples/test-suite/errors/cpp_extra_brackets.i
Normal file
6
Examples/test-suite/errors/cpp_extra_brackets.i
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
%module cpp_extra_brackets
|
||||
|
||||
// Extra brackets was segfaulting in SWIG-3.0.0
|
||||
struct ABC {
|
||||
int operator<<(ABC &))) { return 0; }
|
||||
};
|
||||
1
Examples/test-suite/errors/cpp_extra_brackets.stderr
Normal file
1
Examples/test-suite/errors/cpp_extra_brackets.stderr
Normal file
|
|
@ -0,0 +1 @@
|
|||
cpp_extra_brackets.i:5: Error: Syntax error in input(3).
|
||||
9
Examples/test-suite/errors/cpp_extra_brackets2.i
Normal file
9
Examples/test-suite/errors/cpp_extra_brackets2.i
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
%module cpp_extra_brackets
|
||||
|
||||
// Extra brackets was segfaulting in SWIG-3.0.0
|
||||
struct ABC {
|
||||
;
|
||||
)))
|
||||
int operator<<(ABC &) { return 0; }
|
||||
int operator>>(ABC &) { return 0; }
|
||||
};
|
||||
1
Examples/test-suite/errors/cpp_extra_brackets2.stderr
Normal file
1
Examples/test-suite/errors/cpp_extra_brackets2.stderr
Normal file
|
|
@ -0,0 +1 @@
|
|||
cpp_extra_brackets2.i:6: Error: Syntax error in input(3).
|
||||
33
Examples/test-suite/java/cpp11_constexpr_runme.java
Normal file
33
Examples/test-suite/java/cpp11_constexpr_runme.java
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import cpp11_constexpr.*;
|
||||
|
||||
public class cpp11_constexpr_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("cpp11_constexpr");
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void check(int received, int expected) {
|
||||
if (expected != received)
|
||||
throw new RuntimeException("check failed, expected: " + expected + " received: " + received);
|
||||
}
|
||||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
check(cpp11_constexpr.getAAA(), 10);
|
||||
check(cpp11_constexpr.getBBB(), 20);
|
||||
check(cpp11_constexpr.CCC(), 30);
|
||||
check(cpp11_constexpr.DDD(), 40);
|
||||
|
||||
ConstExpressions ce = new ConstExpressions();
|
||||
check(ce.JJJ, 100);
|
||||
check(ce.KKK, 200);
|
||||
check(ce.LLL, 300);
|
||||
check(ce.MMM(), 400);
|
||||
check(ce.NNN(), 500);
|
||||
}
|
||||
}
|
||||
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