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

https://swig.svn.sourceforge.net/svnroot/swig/trunk

........
  r10498 | talby | 2008-05-26 22:09:56 +0200 (Pn, 26 maj 2008) | 2 lines
  
  run test cases in the Perl set by the --with-perl5 configure option.
........
  r10499 | talby | 2008-05-26 23:04:06 +0200 (Pn, 26 maj 2008) | 3 lines
  
  The perl5 minherit runtime test will work better if the classes are 
  actually built under SWIGPERL.
........
  r10503 | wsfulton | 2008-05-28 11:44:37 +0200 (Śr, 28 maj 2008) | 1 line
  
  Fix variable wrappers when using -proxy. Patch from Jan Jezabek
........
  r10504 | bhy | 2008-05-28 19:27:48 +0200 (Śr, 28 maj 2008) | 2 lines
  
  Fixed SF #1971977:  typo in pycontainer.swg (related to -extranative option)
........
  r10506 | wsfulton | 2008-05-29 02:45:28 +0200 (Cz, 29 maj 2008) | 1 line
  
  Fix variable wrappers when using -noproxy
........
  r10508 | bhy | 2008-05-30 15:53:33 +0200 (Pt, 30 maj 2008) | 1 line
  
  Fixed SF #1976978, apply the macros for primitive types to std::wstring
........
  r10511 | olly | 2008-05-30 18:11:27 +0200 (Pt, 30 maj 2008) | 4 lines
  
  Fix typo in handling of /*@SWIG[...]*/ comments in the scanner.  This just
  meant we were only actually looking for /*@SWI at the start of the comment, so
  was pretty harmless in practice.
........
  r10515 | wsfulton | 2008-06-02 22:10:40 +0200 (Pn, 02 cze 2008) | 1 line
  
  Fix samename testcase for c# and java
........
  r10516 | wsfulton | 2008-06-02 22:15:39 +0200 (Pn, 02 cze 2008) | 1 line
  
  Fix enums when using -noproxy
........
  r10518 | bhy | 2008-06-07 13:20:07 +0200 (So, 07 cze 2008) | 4 lines
  
  Added a test case for keyword renaming.
  Now it works for Python in SWIG's -c++ mode,
  but in C mode it doesn't work! (you can try with make keyword_rename.ctest)
........
  r10519 | bhy | 2008-06-07 15:40:51 +0200 (So, 07 cze 2008) | 1 line
  
  fixed keyword_rename.ctest tese case, caused by a mistake in Swig/naming.c
........
  r10527 | mgossage | 2008-06-17 04:57:15 +0200 (Wt, 17 cze 2008) | 1 line
  
  [lua] bugfix 1938142 (bool& and bool* support)
........
  r10530 | wsfulton | 2008-06-19 22:02:13 +0200 (Cz, 19 cze 2008) | 1 line
  
  Add R keyword support. Rename keywords for successful compilation of Java and C# code. More consistent keyword warnings across the different languages.
........
  r10531 | wsfulton | 2008-06-19 23:15:48 +0200 (Cz, 19 cze 2008) | 1 line
  
  add complete list of R reserved words
........
  r10536 | wsfulton | 2008-06-21 13:35:33 +0200 (So, 21 cze 2008) | 1 line
  
  better terminology for static types
........
  r10537 | wsfulton | 2008-06-21 13:42:48 +0200 (So, 21 cze 2008) | 1 line
  
  remove raise as keyword test- it conflicts with _raise in LIBCMT on windows
........
  r10539 | wsfulton | 2008-06-21 17:21:29 +0200 (So, 21 cze 2008) | 1 line
  
  Lua example warning removal fixes for vc++
........
  r10540 | wsfulton | 2008-06-21 17:23:02 +0200 (So, 21 cze 2008) | 1 line
  
  Remove some vc++ /W4 warnings
........
  r10541 | wsfulton | 2008-06-21 18:04:55 +0200 (So, 21 cze 2008) | 1 line
  
  minor vc++ /W4 warning fixes
........
  r10542 | wsfulton | 2008-06-21 21:07:51 +0200 (So, 21 cze 2008) | 1 line
  
  'byte' is already used in Ruby on windows, so use another keyword
........
  r10543 | wsfulton | 2008-06-21 22:45:32 +0200 (So, 21 cze 2008) | 1 line
  
  Fix crashing in the Ruby reject method in the STL wrappers
........
  r10544 | wsfulton | 2008-06-21 22:48:28 +0200 (So, 21 cze 2008) | 1 line
  
  Fix crashing in the Ruby reject method in the STL wrappers
........
  r10545 | wsfulton | 2008-06-21 22:49:10 +0200 (So, 21 cze 2008) | 1 line
  
  remove unnecessary variable int the char **STRING_ARRAY out typemap
........
  r10546 | wsfulton | 2008-06-21 23:07:49 +0200 (So, 21 cze 2008) | 1 line
  
  Fix Ruby C++ example dependencies in dsp files
........
  r10547 | wsfulton | 2008-06-22 00:25:36 +0200 (N, 22 cze 2008) | 1 line
  
  Fix unused parameter warnings in python when using gcc's -W -Wall options
........
  r10548 | wsfulton | 2008-06-22 00:26:35 +0200 (N, 22 cze 2008) | 1 line
  
  Fix virtual destructor
........
  r10549 | wsfulton | 2008-06-22 01:25:20 +0200 (N, 22 cze 2008) | 1 line
  
  various warning fixes
........
  r10550 | wsfulton | 2008-06-22 02:09:11 +0200 (N, 22 cze 2008) | 1 line
  
  Another fix for the JVM hanging on exit problem when using directors
........
  r10551 | wsfulton | 2008-06-22 02:09:51 +0200 (N, 22 cze 2008) | 1 line
  
  documentation sections update
........
  r10552 | wsfulton | 2008-06-22 02:18:10 +0200 (N, 22 cze 2008) | 1 line
  
  more docs on defining macros for the thread hanging problem
........
  r10558 | wsfulton | 2008-06-22 23:30:20 +0200 (N, 22 cze 2008) | 1 line
  
  fix unused parms in last commit for C code
........
  r10559 | wsfulton | 2008-06-23 00:12:43 +0200 (Pn, 23 cze 2008) | 1 line
  
  Suppress unused methods warning for VC++
........
  r10560 | wsfulton | 2008-06-23 22:26:07 +0200 (Pn, 23 cze 2008) | 1 line
  
  fix partialcheck-test-suite and parallel make for r, chicken, tcl and php
........
  r10561 | wsfulton | 2008-06-23 22:39:41 +0200 (Pn, 23 cze 2008) | 1 line
  
  correct message display when running the partialcheck-test-suite make target
........
  r10562 | wsfulton | 2008-06-23 23:14:53 +0200 (Pn, 23 cze 2008) | 1 line
  
  fix typo
........
  r10563 | olly | 2008-06-23 23:23:54 +0200 (Pn, 23 cze 2008) | 3 lines
  
  Fix bad use of Python API (untested, since I can't even compile this code on
  x86-64!)
........
  r10564 | olly | 2008-06-24 00:58:03 +0200 (Wt, 24 cze 2008) | 3 lines
  
  [PHP] Fix segfault when wrapping a non-class function marked with
  %newobject (testcase char_strings).
........
  r10565 | olly | 2008-06-24 02:27:34 +0200 (Wt, 24 cze 2008) | 3 lines
  
  [PHP] Fix assertion failure when handling %typemap(in,numinputs=0)
  (testcase ignore_parameter).
........
  r10566 | olly | 2008-06-24 02:33:08 +0200 (Wt, 24 cze 2008) | 2 lines
  
  [PHP] Fix typemap_namespace.i to not try to copy a non-existent typemap.
........
  r10567 | olly | 2008-06-24 02:41:07 +0200 (Wt, 24 cze 2008) | 3 lines
  
  Clean up dead and unused code in SwigToPhpType(), and rename to
  GetShadowReturnType().
........
  r10568 | olly | 2008-06-24 02:42:29 +0200 (Wt, 24 cze 2008) | 2 lines
  
  Fix cosmetic typo in string constant.
........
  r10574 | wsfulton | 2008-06-24 22:10:28 +0200 (Wt, 24 cze 2008) | 1 line
  
  zap last entry
........
  r10575 | wsfulton | 2008-06-24 22:11:46 +0200 (Wt, 24 cze 2008) | 1 line
  
  variable name changes to remove php keywords
........
  r10576 | wsfulton | 2008-06-24 22:12:08 +0200 (Wt, 24 cze 2008) | 1 line
  
  variable name hiding fix
........
  r10577 | wsfulton | 2008-06-24 22:12:43 +0200 (Wt, 24 cze 2008) | 1 line
  
  More info about numobjects added
........
  r10578 | wsfulton | 2008-06-24 22:13:41 +0200 (Wt, 24 cze 2008) | 1 line
  
  update for 1.3.36 release
........
  r10579 | wsfulton | 2008-06-24 23:48:46 +0200 (Wt, 24 cze 2008) | 1 line
  
  remove deprecated -c commandline option (runtime library generation)
........
  r10580 | wsfulton | 2008-06-24 23:53:12 +0200 (Wt, 24 cze 2008) | 1 line
  
  correct comment about deprecated option
........
  r10582 | wsfulton | 2008-06-25 01:00:27 +0200 (Śr, 25 cze 2008) | 1 line
  
  use rsync and ssh to upload releases to SourceForge as ftp no longer works
........
  r10584 | wsfulton | 2008-06-25 01:24:48 +0200 (Śr, 25 cze 2008) | 1 line
  
  correction for 1.3.36
........
  r10588 | wsfulton | 2008-06-25 02:16:04 +0200 (Śr, 25 cze 2008) | 1 line
  
  section update
........
  r10589 | wsfulton | 2008-06-25 02:16:40 +0200 (Śr, 25 cze 2008) | 1 line
  
  bump version to 1.3.37
........
  r10594 | wsfulton | 2008-06-26 20:33:06 +0200 (Cz, 26 cze 2008) | 1 line
  
  correct typo in first entry about %fragment
........


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@10606 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Maciej Drwal 2008-06-28 23:26:18 +00:00
commit e058e1f42f
111 changed files with 759 additions and 484 deletions

View file

@ -40,8 +40,9 @@ LIBCRYPT = @LIBCRYPT@
SYSLIBS = $(LIBM) $(LIBC) $(LIBCRYPT)
LIBPREFIX =
# RUNTOOL is for use as with runtime tools, eg set it to valgrind
# RUNTOOL is for use 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
@ -94,8 +95,6 @@ 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@
# -----------------------------------------------------------
@ -135,7 +134,7 @@ wish_cpp: $(SRCS)
tcl: $(SRCS)
$(SWIG) -tcl8 $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
$(CC) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(ISRCS) $(INCLUDES) $(TCL_INCLUDE)
$(TCL_LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
# -----------------------------------------------------------
# Build a Tcl7.5 dynamic loadable module for C++
@ -144,7 +143,7 @@ tcl: $(SRCS)
tcl_cpp: $(SRCS)
$(SWIG) -tcl8 -c++ $(SWIGOPT) $(TCL_SWIGOPTS) $(INTERFACE)
$(CXX) -c $(CCSHARED) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) $(TCL_INCLUDE)
$(TCL_CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(TCL_DLNK) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(TCL_SO)
# -----------------------------------------------------------------
# Cleaning the Tcl examples
@ -880,11 +879,11 @@ chicken_static_cpp: $(CXXSRCS) $(CHICKSRCS)
chicken:
$(SWIG) -chicken $(SWIGOPT) $(INCLUDE) $(INTERFACE)
$(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ISRCS) -o $(TARGET)$(SO)
$(COMPILETOOL) $(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)
$(CHICKEN_CSC) -s `echo $(INCLUDES) | sed 's/-I/-C -I/g'` $(CHICKEN_GENERATED_SCHEME) $(SRCS) $(ICXXSRCS) $(CXXSRCS) -o $(TARGET)$(SO)
$(COMPILETOOL) $(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)
@ -1078,11 +1077,11 @@ RRSRC = $(INTERFACE:.i=.R)
r: $(SRCS)
$(SWIG) -r $(SWIGOPT) $(INTERFACE)
+( PKG_LIBS="$(SRCS)" PKG_CPPFLAGS="$(INCLUDES)" $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(ISRCS) )
+( PKG_LIBS="$(SRCS)" PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(ISRCS) )
r_cpp: $(CXXSRCS)
$(SWIG) -c++ -r $(SWIGOPT) -o $(RCXXSRCS) $(INTERFACE)
+( PKG_LIBS="$(CXXSRCS)" PKG_CPPFLAGS="$(INCLUDES)" $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) )
+( PKG_LIBS="$(CXXSRCS)" PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) )
r_clean:
rm -f *_wrap* *~ .~*

View file

@ -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;
return 0;
}
$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;
return 0;
}
$2[i] = SCM_CHARS(v[i]);
}

View file

@ -2,6 +2,12 @@
%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: */

View file

@ -16,7 +16,7 @@ void sort_int(int* arr, int len)
// ditto doubles
int compare_double(const void * a, const void * b)
{
return ( *(double*)a - *(double*)b );
return (int)( *(double*)a - *(double*)b );
}
void sort_double(double* arr, int len)

View file

@ -11,6 +11,17 @@ 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>
@ -108,7 +119,7 @@ int call_va (lua_State *L,const char *func, const char *sig, ...) {
endwhile:
/* do the call */
nres = strlen(sig); /* number of expected results */
nres = (int)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));

View file

@ -5,6 +5,17 @@ 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>
@ -70,9 +81,6 @@ 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");

View file

@ -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>=shapes.size())
if (idx < 0 || idx >= static_cast<int>(shapes.size()))
return NULL;
return shapes[idx];
}
Shape* ShapeOwner::remove(int idx) // this method returns memory which must be deleted
{
if (idx<0 || idx>=shapes.size())
if (idx < 0 || idx >= static_cast<int>(shapes.size()))
return NULL;
Shape* ptr=shapes[idx];
shapes.erase(shapes.begin()+idx);

View file

@ -3,7 +3,7 @@
class Base {
public:
Base() { };
~Base() { };
virtual ~Base() { };
virtual void A() {
printf("I'm Base::A\n");
}

View file

@ -7,26 +7,25 @@ using namespace std;
class Bar
{
public:
virtual void bar ()
{
cout << "bar" << endl;
}
virtual void bar () {
cout << "bar" << endl;
}
virtual ~Bar() {}
};
class Foo
{
public:
virtual void foo ()
{
cout << "foo" << endl;
}
virtual void foo () {
cout << "foo" << endl;
}
virtual ~Foo() {}
};
class Foo_Bar : public Foo, public Bar
{
public:
virtual void fooBar ()
{
cout << "foobar" << endl;
}
virtual void fooBar () {
cout << "foobar" << endl;
}
};

View file

@ -123,7 +123,7 @@ SOURCE=.\example.i
InputPath=.\example.i
InputName=example
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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%

View file

@ -23,7 +23,7 @@ Zoo::~Zoo()
IterType iter = this->animals.begin();
IterType end = this->animals.end();
for(iter; iter != end; ++iter)
for(; iter != end; ++iter)
{
Animal* animal = *iter;
delete animal;

View file

@ -123,7 +123,7 @@ SOURCE=.\example.i
InputPath=.\example.i
InputName=example
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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%

View file

@ -115,7 +115,7 @@ SOURCE=.\bar.i
InputPath=.\bar.i
InputName=bar
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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%

View file

@ -115,7 +115,7 @@ SOURCE=.\base.i
InputPath=.\base.i
InputName=base
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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%

View file

@ -115,7 +115,7 @@ SOURCE=.\foo.i
InputPath=.\foo.i
InputName=foo
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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%

View file

@ -115,7 +115,7 @@ SOURCE=.\spam.i
InputPath=.\spam.i
InputName=spam
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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%

View file

@ -123,7 +123,7 @@ SOURCE=.\example.i
InputPath=.\example.i
InputName=example
"$(InputName)_wrap.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputName)_wrap.cxx" : $(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%

View file

@ -3,7 +3,7 @@
class Base {
public:
Base() { };
~Base() { };
virtual ~Base() { };
virtual void A() {
printf("I'm Base::A\n");
}

View file

@ -31,5 +31,7 @@
const char memberconstchar;
virtual ~DirectorTest() {}
private:
DirectorTest& operator=(const DirectorTest &);
};
%}

View file

@ -57,6 +57,8 @@ struct BoolStructure {
m_rbool(m_bool2),
m_const_pbool(m_pbool),
m_const_rbool(m_rbool) {}
private:
BoolStructure& operator=(const BoolStructure &);
};
%}

View file

@ -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 the safe world."
#define OTHERLAND_MSG "Little message from 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

View file

@ -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 "Checking testcase $* (with run test) under chicken with -proxy"
$(swig_and_compile_cpp)
echo "$(ACTION)ing testcase $* (with run test) under chicken with -proxy"
+$(swig_and_compile_cpp)
$(run_testcase)
%.cproxy: SWIGOPT += -proxy
%.cproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)
%.cproxy:
echo "Checking testcase $* (with run test) under chicken with -proxy"
echo "$(ACTION)ing testcase $* (with run test) under chicken with -proxy"
+$(swig_and_compile_c)
$(run_testcase)
%.multiproxy: SWIGOPT += -proxy -noclosuses
%.multiproxy: SCRIPTSUFFIX = $(PROXYSUFFIX)
%.multiproxy:
echo "Checking testcase $* (with run test) under chicken with -proxy"
echo "$(ACTION)ing testcase $* (with run test) under chicken with -proxy"
+$(swig_and_compile_multi_cpp)
$(run_testcase)

View file

@ -202,6 +202,7 @@ CPP_TEST_CASES += \
inherit_target_language \
inherit_void_arg \
inline_initializer \
keyword_rename \
kind \
langobj \
li_attribute \
@ -422,6 +423,7 @@ C_TEST_CASES += \
immutable \
inctest \
integers \
keyword_rename \
lextype \
li_carrays \
li_cdata \

View file

@ -46,6 +46,8 @@ 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) {}
@ -69,6 +71,8 @@ public:
void ret6(int*& a) {}
int*& ret7() {return GlobalIntPtr;}
ReturnValuesTest() : int3(NULL) {}
private:
ReturnValuesTest& operator=(const ReturnValuesTest&);
};
const int* globalRet1() {return &GlobalInt;}
@ -100,6 +104,8 @@ int* const globalRet2() {return &GlobalInt;}
A* ap;
const A* cap;
Acptr acptr;
private:
B& operator=(const B&);
};
const B* bar(const B* b) {

View file

@ -55,6 +55,8 @@ class Bar {
Foo *testFoo(int a, Foo *f) {
return new Foo(2 * a + (f ? f->num : 0) + fval.num);
}
private:
Bar& operator=(const Bar&);
};
%}

View file

@ -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 "Checking testcase $* (with run test) under $(LANGUAGE)" ; \
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
else \
echo "Checking testcase $* under $(LANGUAGE)" ; \
echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
fi; \
if [ ! -d $* ]; then \
mkdir $*; \

View file

@ -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 the safe world.";
private static string OTHERLAND_MSG = "Little message from the safe world.";
public static void Main() {

View file

@ -81,6 +81,8 @@ struct SpeedClass {
const colour myColour2;
speedtd1 mySpeedtd1;
SpeedClass() : myColour2(red), mySpeedtd1(slow) { }
private:
SpeedClass& operator=(const SpeedClass&);
};
int speedTest0(int s) { return s; }

View file

@ -10,11 +10,11 @@
virtual ~Node() {}
};
class Switch : public Node {
class NodeSwitch : 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 ~Switch() {}
virtual ~NodeSwitch() {}
};
%}

View file

@ -21,9 +21,9 @@ run_testcase = \
setup = \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
echo "Checking testcase $* (with run test) under $(LANGUAGE) (with SCM API)" ; \
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE) (with SCM API)" ; \
else \
echo "Checking testcase $* under $(LANGUAGE) (with SCM API)" ; \
echo "$(ACTION)ing 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 "Checking testcase $* (with run test) under $(LANGUAGE) (with SCM API)" ; \
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE) (with SCM API)" ; \
else \
echo "Checking testcase $* under $(LANGUAGE) (with SCM API)" ; \
echo "$(ACTION)ing testcase $* under $(LANGUAGE) (with SCM API)" ; \
fi;
local_run_testcase = \

View file

@ -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 "Checking testcase $* (with run test) under $(LANGUAGE)" ; \
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
else \
echo "Checking testcase $* under $(LANGUAGE)" ; \
echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
fi; \
if [ ! -d $* ]; then \
mkdir $*; \

View file

@ -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 the safe world.";
private static String OTHERLAND_MSG = "Little message from the safe world.";
public static void main(String argv[]) {

View file

@ -119,6 +119,8 @@ 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) {}

View file

@ -0,0 +1,32 @@
/*
* 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;};
%}

View file

@ -129,7 +129,7 @@ public:
%}
%inline %{
std::string empty() {
std::string stdstring_empty() {
return std::string();
}

View file

@ -0,0 +1,40 @@
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)

View file

@ -6,7 +6,7 @@
%module(ruby_minherit="1") minherit
#if defined(SWIGPYTHON) || defined(SWIGRUBY) || defined(SWIGOCAML) || defined(SWIGOCTAVE)
#if defined(SWIGPYTHON) || defined(SWIGRUBY) || defined(SWIGOCAML) || defined(SWIGOCTAVE) || defined(SWIGPERL)
%inline %{

View file

@ -1,6 +1,6 @@
fvirtual
sw = Switch();
sw = NodeSwitch();
n = Node();
i = sw.addChild(n);

View file

@ -148,7 +148,7 @@ if (s != "hellohello")
endif
if (li_std_string.empty() != "")
if (li_std_string.stdstring_empty() != "")
error
endif

View file

@ -98,7 +98,7 @@ SKIP: {
is($gen1->testl("9234567890121111113"), "9234567890121111114", "ulonglong big number");
is(li_std_string::empty(), "", "empty");
is(li_std_string::stdstring_empty(), "", "stdstring_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::empty()), "non-null", "c_empty");
is(li_std_string::get_null(li_std_string::stdstring_empty()), "non-null", "stdstring_empty");

View file

@ -7,7 +7,7 @@ use strict;
my $command = shift @ARGV;
my $output = `perl $command 2>&1`;
my $output = `$^X $command 2>&1`;
die "SWIG Perl test failed: \n\n$output\n"
if $?;

View file

@ -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.

View file

@ -1,6 +1,6 @@
from fvirtual import *
sw = Switch()
sw = NodeSwitch()
n = Node()
i = sw.addChild(n);

View file

@ -0,0 +1,4 @@
#!/usr/bin/env python
import keyword_rename
keyword_rename._in(1)
keyword_rename._except(1)

View file

@ -121,7 +121,7 @@ if s != "hellohello":
raise RuntimeError
if li_std_string.empty() != "":
if li_std_string.stdstring_empty() != "":
raise RuntimeError

View file

@ -42,7 +42,7 @@ run_testcase = \
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" \
$(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ;) \
else \
($(RUNR) $(srcdir)/$(SCRIPTPREFIX)$*$(WRAPSUFFIX);) \
($(RUNTOOL) $(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 \
($(RUNR) $(srcdir)/$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX);) \
($(RUNTOOL) $(RUNR) $(srcdir)/$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX);) \
fi; \
done
# Clean

View file

@ -124,7 +124,7 @@ if (s != "hellohello")
end
if (empty() != "")
if (stdstring_empty() != "")
raise RuntimeError
end

View file

@ -1,6 +1,15 @@
%module samename
%inline {
#if !(defined(SWIGCSHARP) || defined(SWIGJAVA))
class samename {
public:
void do_something() {
// ...
}
};
#endif
%{
class samename {
public:
@ -9,5 +18,5 @@ class samename {
}
};
}
%}

View file

@ -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 :

View file

@ -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;
};

View file

@ -27,7 +27,7 @@ namespace Foo {
%typemap(javaout) Str1 * = char *;
#endif
%typemap(in) Str1 * = char *;
#if !(defined(SWIGCSHARP) || defined(SWIGLUA))
#if !(defined(SWIGCSHARP) || defined(SWIGLUA) || defined(SWIGPHP))
%typemap(freearg) Str1 * = char *;
#endif
%typemap(typecheck) Str1 * = char *;