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
111 changed files with 482 additions and 757 deletions
|
|
@ -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 *;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue