diff options
author | Haoyu Bai <divinekid@gmail.com> | 2009-02-07 16:06:51 +0000 |
---|---|---|
committer | Haoyu Bai <divinekid@gmail.com> | 2009-02-07 16:06:51 +0000 |
commit | a4f0656fd1a88045186272f366c74d623d6c94ea (patch) | |
tree | 5a5603bb2c0aa22f2f9c98e2a071ff8c19426a0a | |
parent | 93d48cd1e50645c6d4a18589ca739b1d89e6f300 (diff) | |
download | swig-a4f0656fd1a88045186272f366c74d623d6c94ea.tar.gz |
Merged revisions 11092-11094,11098-11104,11107,11110-11111 via svnmerge from
https://swig.svn.sourceforge.net/svnroot/swig/trunk
........
r11092 | wsfulton | 2009-01-29 02:45:13 +0800 (Thu, 29 Jan 2009) | 1 line
Fix classLookup and enumLookup when the global scope operator is used on objects passed by value
........
r11093 | wsfulton | 2009-01-30 03:25:37 +0800 (Fri, 30 Jan 2009) | 1 line
Fix regression introduced in 1.3.37 where the default output directory for target language specific files (in the absence of -outdir) was no longer the same as the generated c/c++ file
........
r11094 | wsfulton | 2009-01-30 05:20:31 +0800 (Fri, 30 Jan 2009) | 1 line
remove debugging output
........
r11098 | bhy | 2009-01-30 18:32:59 +0800 (Fri, 30 Jan 2009) | 1 line
Fix broken caused by merge
........
r11099 | bhy | 2009-01-31 21:38:39 +0800 (Sat, 31 Jan 2009) | 1 line
Fix SF#2552048. Remove the 'self' parameter in Python proxy code for static member function.
........
r11100 | bhy | 2009-01-31 22:37:54 +0800 (Sat, 31 Jan 2009) | 1 line
Fix SF#2552488: indentation adjust of %pythonappend and %pythonprepend
........
r11101 | wsfulton | 2009-02-01 03:02:10 +0800 (Sun, 01 Feb 2009) | 1 line
const / non-const warning fix
........
r11102 | wsfulton | 2009-02-01 03:10:55 +0800 (Sun, 01 Feb 2009) | 1 line
fix tab alignment - all tabs in SWIG are 8 chars
........
r11103 | wsfulton | 2009-02-01 03:37:58 +0800 (Sun, 01 Feb 2009) | 1 line
finishing touches for 1.3.38
........
r11104 | wsfulton | 2009-02-01 07:14:02 +0800 (Sun, 01 Feb 2009) | 1 line
html fix
........
r11107 | wsfulton | 2009-02-01 08:31:19 +0800 (Sun, 01 Feb 2009) | 1 line
bump version to 1.3.39
........
r11110 | talby | 2009-02-05 23:47:42 +0800 (Thu, 05 Feb 2009) | 1 line
Fix SF#2564192
........
r11111 | wsfulton | 2009-02-07 09:58:39 +0800 (Sat, 07 Feb 2009) | 1 line
Apply #2081967 configure changes for mzscheme configure errors and breaking of swig exe build
........
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/swig-2.0@11113 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r-- | ANNOUNCE | 10 | ||||
-rw-r--r-- | CHANGES | 24 | ||||
-rw-r--r-- | CHANGES.current | 13 | ||||
-rw-r--r-- | Doc/Manual/Lua.html | 7 | ||||
-rw-r--r-- | Doc/Manual/Modula3.html | 8 | ||||
-rw-r--r-- | Doc/Manual/SWIG.html | 11 | ||||
-rw-r--r-- | Doc/Manual/Sections.html | 2 | ||||
-rw-r--r-- | Examples/test-suite/common.mk | 1 | ||||
-rw-r--r-- | Examples/test-suite/global_namespace.i | 60 | ||||
-rw-r--r-- | Examples/test-suite/java/global_namespace_runme.java | 25 | ||||
-rw-r--r-- | Examples/test-suite/perl5/char_strings_runme.pl | 5 | ||||
-rw-r--r-- | Examples/test-suite/python/Makefile.in | 1 | ||||
-rw-r--r-- | Examples/test-suite/python/cpp_static_runme.py | 7 | ||||
-rw-r--r-- | Examples/test-suite/python/python_append_runme.py | 4 | ||||
-rw-r--r-- | Examples/test-suite/python_append.i | 32 | ||||
-rw-r--r-- | Lib/perl5/perlstrings.swg | 5 | ||||
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | Source/Modules/lang.cxx | 17 | ||||
-rw-r--r-- | Source/Modules/main.cxx | 2 | ||||
-rw-r--r-- | Source/Modules/python.cxx | 30 | ||||
-rw-r--r-- | Source/Swig/swig.h | 4 | ||||
-rw-r--r-- | Source/Swig/typesys.c | 1 | ||||
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | configure.in | 48 |
24 files changed, 263 insertions, 61 deletions
@@ -1,10 +1,10 @@ -*** ANNOUNCE: SWIG 1.3.38 (in progress) *** +*** ANNOUNCE: SWIG 1.3.39 (in progress) *** http://www.swig.org -We're pleased to announce SWIG-1.3.38, the latest installment in the -SWIG development effort. SWIG-1.3.38 includes a number of bug fixes +We're pleased to announce SWIG-1.3.39, the latest installment in the +SWIG development effort. SWIG-1.3.39 includes a number of bug fixes and enhancements. What is SWIG? @@ -24,11 +24,11 @@ Availability: ------------- The release is available for download on Sourceforge at - http://prdownloads.sourceforge.net/swig/swig-1.3.38.tar.gz + http://prdownloads.sourceforge.net/swig/swig-1.3.39.tar.gz A Windows version is also available at - http://prdownloads.sourceforge.net/swig/swigwin-1.3.38.zip + http://prdownloads.sourceforge.net/swig/swigwin-1.3.39.zip Release numbers --------------- @@ -2,6 +2,30 @@ SWIG (Simplified Wrapper and Interface Generator) See CHANGES.current for current version. +Version 1.3.38 (31 January 2009) +================================ + +2008-01-31: bhy + [Python] Fix SF#2552488 reported by Gaetan Lehmann. Now %pythonprepend + and %pythonappend have correct indentation. + +2008-01-31: bhy + [Python] Fix SF#2552048 reported by Gaetan Lehmann. The parameter list + of static member function in generated proxy code should not have the + 'self' parameter. + +2008-01-29: wsfulton + Fix regression introduced in 1.3.37 where the default output directory + for target language specific files (in the absence of -outdir) was no + longer the same directory as the generated c/c++ file. + +2008-01-28: wsfulton + [Java, C#] Fix proxy class not being used when the global scope operator + was used for parameters passed by value. Reported by David Piepgrass. + +2008-01-15: wsfulton + [Perl] Fix seg fault when running with -v option, reported by John Ky. + Version 1.3.37 (13 January 2009) ================================ diff --git a/CHANGES.current b/CHANGES.current index 4f43526a1..60f5fdf20 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,11 @@ -Version 1.3.38 (in progress) -================================ +Version 1.3.39 (in progress) +============================ -2008-01-15: wsfulton - [Perl] Fix seg fault when running with -v option, reported by John Ky. +2008-02-07: wsfulton + [MzScheme] Apply #2081967 configure changes for examples to build with recent PLT versions. + Also fixes Makefile errors building SWIG executable when mzscheme package is installed + (version 3.72 approx and later). +2009-02-04: talby + [Perl] Fix SF#2564192 reported by David Kolovratnk. + SWIG_AsCharPtrAndSize() now handles "get" magic. diff --git a/Doc/Manual/Lua.html b/Doc/Manual/Lua.html index 3856c98ec..e66c1c7f3 100644 --- a/Doc/Manual/Lua.html +++ b/Doc/Manual/Lua.html @@ -1355,12 +1355,15 @@ if (!SWIG_IsOK(SWIG_ConvertPtr( .....)){ <p><tt>SWIG_fail_arg(char* func_name,int argnum,char* type)</tt></p> <div class="indent"> -This macro, when called within the context of a SWIG wrappered function, will display the error message and jump to the error handler code. The error message is of the form "Error in <i>func_name</i> (arg <i>argnum</i>), expected '<i>type</i>' got '<i>whatever the type was</i>'"</pre></div> +This macro, when called within the context of a SWIG wrappered function, will display the error message and jump to the error handler code. The error message is of the form +<pre> +"Error in <i>func_name</i> (arg <i>argnum</i>), expected '<i>type</i>' got '<i>whatever the type was</i>'" +</pre></div> <p><tt>SWIG_fail_ptr(const char* fn_name,int argnum,swig_type_info* type);</tt></p> <div class="indent"> -Similar to SWIG_fail_arg, except that it will display the swig_type_info information instead.</pre></div> +Similar to SWIG_fail_arg, except that it will display the swig_type_info information instead.</div> <H2><a name="Lua_nn31"></a>23.6 Customization of your Bindings</H2> diff --git a/Doc/Manual/Modula3.html b/Doc/Manual/Modula3.html index 7a6bacd34..c4e485202 100644 --- a/Doc/Manual/Modula3.html +++ b/Doc/Manual/Modula3.html @@ -860,8 +860,8 @@ that split the task up into converting the C bit patterns (integer or bit set) into Modula-3 bit patterns (integer or bit set) and change the type as requested. -See the corresponding -<a href="../../Examples/modula3/enum/example.i">example</a>. +See the corresponding example in the +Examples/modula3/enum/example.i file. This is quite messy and not satisfying. So the best what you can currently do is to rewrite constant definitions manually. @@ -877,8 +877,8 @@ that I'd like to automate. Declarations of C++ classes are mapped to <tt>OBJECT</tt> types while it is tried to retain the access hierarchy "public - protected - private" using partial revelation. -Though the -<a href="../../Examples/modula3/class/example.i">implementation</a> +Though the example in +Examples/modula3/class/example.i is not really useful, yet. </p> diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html index 48c2d9f2b..1c8d74f8c 100644 --- a/Doc/Manual/SWIG.html +++ b/Doc/Manual/SWIG.html @@ -247,6 +247,17 @@ cppfiles/example_wrap.cpp pyfiles/example.py </pre></div> +<p> +If the <tt>-outcurrentdir</tt> option is used (without <tt>-o</tt>) +then SWIG behaves like a typical C/C++ +compiler and the default output directory is then the current directory. Without +this option the default output directory is the path to the input file. +If <tt>-o</tt> and +<tt>-outcurrentdir</tt> are used together, <tt>-outcurrentdir</tt> is effectively ignored +as the output directory for the language files is the same directory as the +generated C/C++ file if not overidden with <tt>-outdir</tt>. +</p> + <H3><a name="SWIG_nn5"></a>5.1.3 Comments</H3> diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html index ddca5fed3..364be15db 100644 --- a/Doc/Manual/Sections.html +++ b/Doc/Manual/Sections.html @@ -6,7 +6,7 @@ <body bgcolor="#ffffff"> <H1><a name="Sections"></a>SWIG-1.3 Development Documentation</H1> -Last update : SWIG-1.3.38 (in progress) +Last update : SWIG-1.3.39 (in progress) <H2>Sections</H2> diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index bca58e75b..1d43f14ca 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -194,6 +194,7 @@ CPP_TEST_CASES += \ fragments \ friends \ fvirtual \ + global_namespace \ global_ns_arg \ global_vars \ grouping \ diff --git a/Examples/test-suite/global_namespace.i b/Examples/test-suite/global_namespace.i new file mode 100644 index 000000000..02139f6c4 --- /dev/null +++ b/Examples/test-suite/global_namespace.i @@ -0,0 +1,60 @@ +%module global_namespace + +// classes +%inline %{ +class Klass1 {}; +class Klass2 {}; +class Klass3 {}; +class Klass4 {}; +class Klass5 {}; +class Klass6 {}; +class Klass7 {}; + +struct KlassMethods { + static void methodA(::Klass1 v, const ::Klass2 cv, const ::Klass3 *cp, ::Klass4 *p, const ::Klass5 &cr, ::Klass6 &r, Klass7*& pr) {} + static void methodB( Klass1 v, const Klass2 cv, const Klass3 *cp, Klass4 *p, const Klass5 &cr, Klass6 &r, Klass7*& pr) {} +}; +%} + +%inline %{ +namespace Space { +class XYZ1 {}; +class XYZ2 {}; +class XYZ3 {}; +class XYZ4 {}; +class XYZ5 {}; +class XYZ6 {}; +class XYZ7 {}; +} + +struct XYZMethods { + static void methodA(::Space::XYZ1 v, const ::Space::XYZ2 cv, const ::Space::XYZ3 *cp, ::Space::XYZ4 *p, const ::Space::XYZ5 &cr, ::Space::XYZ6 &r, Space::XYZ7*& pr) {} + static void methodB( Space::XYZ1 v, const Space::XYZ2 cv, const Space::XYZ3 *cp, Space::XYZ4 *p, const Space::XYZ5 &cr, Space::XYZ6 &r, Space::XYZ7*& pr) {} +}; +%} + +//enums +%inline %{ +enum AnEnum1 { anenum1 }; +enum AnEnum2 { anenum2 }; +enum AnEnum3 { anenum3 }; + +struct AnEnumMethods { + static void methodA(::AnEnum1 v, const ::AnEnum2 cv, const ::AnEnum3 &cr) {} + static void methodB( AnEnum1 v, const AnEnum2 cv, const AnEnum3 &cr) {} +}; +%} + +%inline %{ +namespace Space { +enum TheEnum1 { theenum1 }; +enum TheEnum2 { theenum2 }; +enum TheEnum3 { theenum3 }; + +struct TheEnumMethods { + static void methodA(::Space::TheEnum1 v, const ::Space::TheEnum2 cv, const ::Space::TheEnum3 &cr) {} + static void methodB( Space::TheEnum1 v, const Space::TheEnum2 cv, const Space::TheEnum3 &cr) {} +}; +} +%} + diff --git a/Examples/test-suite/java/global_namespace_runme.java b/Examples/test-suite/java/global_namespace_runme.java new file mode 100644 index 000000000..faab7d4ba --- /dev/null +++ b/Examples/test-suite/java/global_namespace_runme.java @@ -0,0 +1,25 @@ +import global_namespace.*; + +public class global_namespace_runme { + + static { + try { + System.loadLibrary("global_namespace"); + } 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); + } + } + + public static void main(String argv[]) { + + KlassMethods.methodA(new Klass1(), new Klass2(), new Klass3(), new Klass4(), new Klass5(), new Klass6(), new Klass7()); + KlassMethods.methodB(new Klass1(), new Klass2(), new Klass3(), new Klass4(), new Klass5(), new Klass6(), new Klass7()); + + XYZMethods.methodA(new XYZ1(), new XYZ2(), new XYZ3(), new XYZ4(), new XYZ5(), new XYZ6(), new XYZ7()); + XYZMethods.methodB(new XYZ1(), new XYZ2(), new XYZ3(), new XYZ4(), new XYZ5(), new XYZ6(), new XYZ7()); + + TheEnumMethods.methodA(TheEnum1.theenum1, TheEnum2.theenum2, TheEnum3.theenum3); + TheEnumMethods.methodA(TheEnum1.theenum1, TheEnum2.theenum2, TheEnum3.theenum3); + } +} diff --git a/Examples/test-suite/perl5/char_strings_runme.pl b/Examples/test-suite/perl5/char_strings_runme.pl index 51c227bb9..c4573737e 100644 --- a/Examples/test-suite/perl5/char_strings_runme.pl +++ b/Examples/test-suite/perl5/char_strings_runme.pl @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 5; BEGIN { use_ok('char_strings') } require_ok('char_strings'); @@ -10,3 +10,6 @@ is(char_strings::CharPingPong($val1), "100", 'cstr1'); my $val2 = "greetings"; is(char_strings::CharPingPong($val2), "greetings", 'cstr2'); +# SF#2564192 +"this is a test" =~ /(\w+)$/; +is(char_strings::CharPingPong($1), "test", "handles Magical"); diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in index 5237b3f69..f5058df9f 100644 --- a/Examples/test-suite/python/Makefile.in +++ b/Examples/test-suite/python/Makefile.in @@ -32,6 +32,7 @@ PY2TO3 = 2to3 -x import CPP_TEST_CASES += \ argcargvtest \ python_autodoc \ + python_append \ callback \ complextest \ director_stl \ diff --git a/Examples/test-suite/python/cpp_static_runme.py b/Examples/test-suite/python/cpp_static_runme.py new file mode 100644 index 000000000..ef8623359 --- /dev/null +++ b/Examples/test-suite/python/cpp_static_runme.py @@ -0,0 +1,7 @@ +#!/usr/bin/evn python +from cpp_static import * +StaticFunctionTest.static_func() +StaticFunctionTest.static_func_2(1) +StaticFunctionTest.static_func_3(1,2) +StaticMemberTest.static_int = 10 +assert StaticMemberTest.static_int == 10 diff --git a/Examples/test-suite/python/python_append_runme.py b/Examples/test-suite/python/python_append_runme.py new file mode 100644 index 000000000..c8e6b2640 --- /dev/null +++ b/Examples/test-suite/python/python_append_runme.py @@ -0,0 +1,4 @@ +from python_append import * +t=Test() +t.func() +t.static_func() diff --git a/Examples/test-suite/python_append.i b/Examples/test-suite/python_append.i new file mode 100644 index 000000000..2dc9cb970 --- /dev/null +++ b/Examples/test-suite/python_append.i @@ -0,0 +1,32 @@ +/* +Testcase to test %pythonprepend and %pythonappend +*/ + +%module python_append + +%pythonappend Test::func %{ + pass +%} + +%pythonprepend Test::func %{ + pass +%} + +%pythonappend Test::static_func %{ +pass +%} + +%pythonprepend Test::static_func { + pass +} + +%inline %{ + +class Test { +public: + static void static_func() {}; + void func() {}; +}; + +%} + diff --git a/Lib/perl5/perlstrings.swg b/Lib/perl5/perlstrings.swg index 2083f0bba..242a9c967 100644 --- a/Lib/perl5/perlstrings.swg +++ b/Lib/perl5/perlstrings.swg @@ -6,6 +6,11 @@ SWIGINTERN int SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) { + if (SvMAGICAL(obj)) { + SV *tmp = sv_newmortal(); + SvSetSV(tmp, obj); + obj = tmp; + } if (SvPOK(obj)) { STRLEN len = 0; char *cstr = SvPV(obj, len); @@ -1,6 +1,6 @@ SWIG (Simplified Wrapper and Interface Generator) -Version: 1.3.38 (in progress) +Version: 1.3.38 (31 January 2009) Tagline: SWIG is a compiler that integrates C and C++ with languages including Perl, Python, Tcl, Ruby, PHP, Java, Ocaml, Lua, @@ -91,6 +91,9 @@ A SWIG FAQ and other hints can be found on the SWIG Wiki: What's New? =========== +SWIG-1.3.38 summary: +- Output directory regression fix and other minor bug fixes + SWIG-1.3.37 summary: - Python 3 support added - SWIG now ships with a version of ccache that can be used with SWIG. diff --git a/Source/Modules/lang.cxx b/Source/Modules/lang.cxx index d31fc6fc5..a40c184a0 100644 --- a/Source/Modules/lang.cxx +++ b/Source/Modules/lang.cxx @@ -2959,14 +2959,9 @@ Node *Language::classLookup(SwigType *s) { n = Getattr(classtypes, s); if (!n) { Symtab *stab = 0; -// SwigType *lt = SwigType_ltype(s); -// SwigType *ty1 = SwigType_typedef_resolve_all(lt); SwigType *ty1 = SwigType_typedef_resolve_all(s); SwigType *ty2 = SwigType_strip_qualifiers(ty1); -// Printf(stdout, " stages... ty1: %s ty2: %s\n", ty1, ty2); -// Delete(lt); Delete(ty1); -// lt = 0; ty1 = 0; String *base = SwigType_base(ty2); @@ -2975,6 +2970,12 @@ Node *Language::classLookup(SwigType *s) { Replaceall(base, "struct ", ""); Replaceall(base, "union ", ""); + if (strncmp(Char(base), "::", 2) == 0) { + String *oldbase = base; + base = NewString(Char(base) + 2); + Delete(oldbase); + } + String *prefix = SwigType_prefix(ty2); /* Do a symbol table search on the base type */ @@ -3048,6 +3049,12 @@ Node *Language::enumLookup(SwigType *s) { Replaceall(base, "enum ", ""); String *prefix = SwigType_prefix(ty2); + if (strncmp(Char(base), "::", 2) == 0) { + String *oldbase = base; + base = NewString(Char(base) + 2); + Delete(oldbase); + } + /* Look for type in symbol table */ while (!n) { Hash *nstab; diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx index 18bb7bc2d..92d3effdb 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx @@ -1176,7 +1176,7 @@ int SWIG_main(int argc, char *argv[], Language *l) { } else { Setattr(top, "outfile_h", outfile_name_h); } - set_outdir(Swig_file_dirname(basename)); + set_outdir(Swig_file_dirname(Getattr(top, "outfile"))); if (Swig_contract_mode_get()) { Swig_contracts(top); } diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 8f549f663..a28915d34 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -958,7 +958,7 @@ public: * pythoncode() - Output python code into the shadow file * ------------------------------------------------------------ */ - String *pythoncode(String *code, const String *indent) { + String *pythoncode(String *code, const_String_or_char_ptr indent) { String *out = NewString(""); String *temp; const char *t; @@ -1645,10 +1645,10 @@ public: if (have_docstring(n)) Printv(f_dest, " ", docstring(n, AUTODOC_FUNC, tab4), "\n", NIL); if (have_pythonprepend(n)) - Printv(f_dest, " ", pythonprepend(n), "\n", NIL); + Printv(f_dest, pythoncode(pythonprepend(n), " "), "\n", NIL); if (have_pythonappend(n)) { Printv(f_dest, " val = ", funcCall(name, callParms), "\n", NIL); - Printv(f_dest, " ", pythonappend(n), "\n", NIL); + Printv(f_dest, pythoncode(pythonappend(n), " "), "\n", NIL); Printv(f_dest, " return val\n", NIL); } else { Printv(f_dest, " return ", funcCall(name, callParms), "\n", NIL); @@ -3118,12 +3118,12 @@ public: Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL); if (have_pythonprepend(n)) { fproxy = 0; - Printv(f_shadow, tab8, pythonprepend(n), "\n", NIL); + Printv(f_shadow, pythoncode(pythonprepend(n), tab8), "\n", NIL); } if (have_pythonappend(n)) { fproxy = 0; Printv(f_shadow, tab8, "val = ", funcCall(Swig_name_member(class_name, symname), callParms), "\n", NIL); - Printv(f_shadow, tab8, pythonappend(n), "\n", NIL); + Printv(f_shadow, pythoncode(pythonappend(n), tab8), "\n", NIL); Printv(f_shadow, tab8, "return val\n\n", NIL); } else { Printv(f_shadow, tab8, "return ", funcCall(Swig_name_member(class_name, symname), callParms), "\n\n", NIL); @@ -3159,16 +3159,16 @@ public: if (shadow) { if (!classic && !Getattr(n, "feature:python:callback") && have_addtofunc(n)) { int kw = (check_kwargs(n) && !Getattr(n, "sym:overloaded")) ? 1 : 0; - String *parms = make_pyParmList(n, true, false, kw); - String *callParms = make_pyParmList(n, true, true, kw); + String *parms = make_pyParmList(n, false, false, kw); + String *callParms = make_pyParmList(n, false, true, kw); Printv(f_shadow, tab4, "def ", symname, "(", parms, ")", returnTypeAnnotation(n), ":\n", NIL); if (have_docstring(n)) Printv(f_shadow, tab8, docstring(n, AUTODOC_STATICFUNC, tab8), "\n", NIL); if (have_pythonprepend(n)) - Printv(f_shadow, tab8, pythonprepend(n), "\n", NIL); + Printv(f_shadow, pythoncode(pythonprepend(n), tab8), "\n", NIL); if (have_pythonappend(n)) { Printv(f_shadow, tab8, "val = ", funcCall(Swig_name_member(class_name, symname), callParms), "\n", NIL); - Printv(f_shadow, tab8, pythonappend(n), "\n", NIL); + Printv(f_shadow, pythoncode(pythonappend(n), tab8), "\n", NIL); Printv(f_shadow, tab8, "return val\n\n", NIL); } else { Printv(f_shadow, tab8, "return ", funcCall(Swig_name_member(class_name, symname), callParms), "\n\n", NIL); @@ -3275,7 +3275,7 @@ public: if (have_docstring(n)) Printv(f_shadow, tab8, docstring(n, AUTODOC_CTOR, tab8), "\n", NIL); if (have_pythonprepend(n)) - Printv(f_shadow, tab8, pythonprepend(n), "\n", NIL); + Printv(f_shadow, pythoncode(pythonprepend(n), tab8), "\n", NIL); Printv(f_shadow, pass_self, NIL); if (fastinit) { Printv(f_shadow, tab8, module, ".", class_name, "_swiginit(self,", funcCall(Swig_name_construct(symname), callParms), ")\n", NIL); @@ -3285,7 +3285,7 @@ public: tab8, "try: self.this.append(this)\n", tab8, "except: self.this = this\n", NIL); } if (have_pythonappend(n)) - Printv(f_shadow, tab8, pythonappend(n), "\n\n", NIL); + Printv(f_shadow, pythoncode(pythonappend(n), tab8), "\n\n", NIL); Delete(pass_self); } have_constructor = 1; @@ -3308,13 +3308,13 @@ public: if (have_docstring(n)) Printv(f_shadow_stubs, tab4, docstring(n, AUTODOC_CTOR, tab4), "\n", NIL); if (have_pythonprepend(n)) - Printv(f_shadow_stubs, tab4, pythonprepend(n), "\n", NIL); + Printv(f_shadow_stubs, pythoncode(pythonprepend(n), tab4), "\n", NIL); Printv(f_shadow_stubs, tab4, "val = ", funcCall(Swig_name_construct(symname), callParms), "\n", NIL); #ifdef USE_THISOWN Printv(f_shadow_stubs, tab4, "val.thisown = 1\n", NIL); #endif if (have_pythonappend(n)) - Printv(f_shadow_stubs, tab4, pythonappend(n), "\n", NIL); + Printv(f_shadow_stubs, pythoncode(pythonappend(n), tab4), "\n", NIL); Printv(f_shadow_stubs, tab4, "return val\n", NIL); } } @@ -3356,7 +3356,7 @@ public: if (have_docstring(n)) Printv(f_shadow, tab8, docstring(n, AUTODOC_DTOR, tab8), "\n", NIL); if (have_pythonprepend(n)) - Printv(f_shadow, tab8, pythonprepend(n), "\n", NIL); + Printv(f_shadow, pythoncode(pythonprepend(n), tab8), "\n", NIL); #ifdef USE_THISOWN Printv(f_shadow, tab8, "try:\n", NIL); Printv(f_shadow, tab8, tab4, "if self.thisown: ", module, ".", Swig_name_destroy(symname), "(self)\n", NIL); @@ -3364,7 +3364,7 @@ public: #else #endif if (have_pythonappend(n)) - Printv(f_shadow, tab8, pythonappend(n), "\n", NIL); + Printv(f_shadow, pythoncode(pythonappend(n), tab8), "\n", NIL); Printv(f_shadow, tab8, "pass\n", NIL); Printv(f_shadow, "\n", NIL); } diff --git a/Source/Swig/swig.h b/Source/Swig/swig.h index 7ca8181f5..3cc251700 100644 --- a/Source/Swig/swig.h +++ b/Source/Swig/swig.h @@ -333,8 +333,8 @@ extern int ParmList_is_compactdefargs(ParmList *p); extern String *Swig_ref_call(Node *n, const String *lname); extern String *Swig_cdestructor_call(Node *n); extern String *Swig_cppdestructor_call(Node *n); - extern String *Swig_cmemberset_call(const_String_or_char_ptr name, SwigType *type, const_String_or_char_ptr self, int varcref); - extern String *Swig_cmemberget_call(const_String_or_char_ptr name, SwigType *t, const_String_or_char_ptr self, int varcref); + extern String *Swig_cmemberset_call(const_String_or_char_ptr name, SwigType *type, String *self, int varcref); + extern String *Swig_cmemberget_call(const_String_or_char_ptr name, SwigType *t, String *self, int varcref); extern int Swig_add_extension_code(Node *n, const String *function_name, ParmList *parms, SwigType *return_type, const String *code, int cplusplus, const String *self); diff --git a/Source/Swig/typesys.c b/Source/Swig/typesys.c index 2bb0fef09..4fc1cc1ed 100644 --- a/Source/Swig/typesys.c +++ b/Source/Swig/typesys.c @@ -840,6 +840,7 @@ SwigType *SwigType_typedef_resolve_all(SwigType *t) { * * Given a type declaration, this function tries to fully qualify it according to * typedef scope rules. + * Inconsistency to be fixed: ::Foo returns ::Foo, whereas ::Foo * returns Foo * * ----------------------------------------------------------------------------- */ SwigType *SwigType_typedef_qualified(SwigType *t) { @@ -1,6 +1,6 @@ SWIG TO-DO -Release: SWIG-1.3.38 +Release: SWIG-1.3.39 ----------------------------------------------------------------------------- diff --git a/configure.in b/configure.in index 0b05df2bc..5e6230bac 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. dnl The macros which aren't shipped with the autotools are stored in the dnl Tools/config directory in .m4 files. -AC_INIT([swig],[1.3.38],[http://www.swig.org]) +AC_INIT([swig],[1.3.39],[http://www.swig.org]) AC_PREREQ(2.58) AC_CONFIG_SRCDIR([Source/Swig/swig.h]) AC_CONFIG_AUX_DIR([Tools/config]) @@ -1195,25 +1195,35 @@ AC_ARG_WITH(mzc, AS_HELP_STRING([--with-mzc=path], [Set location of MzScheme's m # First, check for "--without-mzscheme" or "--with-mzscheme=no". if test x"${MZSCHEMEBIN}" = xno -o x"${with_alllang}" = xno ; then -AC_MSG_NOTICE([Disabling MzScheme]) -MZC= + AC_MSG_NOTICE([Disabling MzScheme]) + MZC= else + if test "x$MZSCHEMEBIN" = xyes; then + AC_PATH_PROG(MZSCHEME, mzscheme) + else + MZSCHEME="$MZSCHEMEBIN" + fi + + if test -z "$MZCBIN"; then + AC_PATH_PROG(MZC, mzc) + fi -if test "x$MZSCHEMEBIN" = xyes; then - AC_PATH_PROG(MZSCHEME, mzscheme) -else - MZSCHEME="$MZSCHEMEBIN" -fi - -if test -z "$MZCBIN"; then - AC_PATH_PROG(MZC, mzc) -fi - -if test -n "$MZSCHEME"; then -AC_MSG_CHECKING(for MzScheme dynext object) -MZDYNOBJ=`$MZSCHEME --mute-banner --version --eval '(begin (require (lib "link.ss" "dynext")) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x) (display " ")) ((current-make-standard-link-libraries)))) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x) (display " ")) (expand-for-link-variant (current-standard-link-libraries)))))'` -AC_MSG_RESULT($MZDYNOBJ) -fi + if test -n "$MZSCHEME"; then + AC_MSG_CHECKING(for MzScheme dynext object) + MZDYNOBJ=`$MZSCHEME --eval '(begin (require dynext/link) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (printf "~a" x)) (expand-for-link-variant (current-standard-link-libraries)))))' 2>/dev/null` + if test -f "$MZDYNOBJ"; then + MZDYNOBJ="$MZDYNOBJ" + else + # older versions + MZDYNOBJ=`$MZSCHEME --mute-banner --version --eval '(begin (require (lib "link.ss" "dynext")) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x) (display " ")) ((current-make-standard-link-libraries)))) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x) (display " ")) (expand-for-link-variant (current-standard-link-libraries)))))' 2>/dev/null` + fi + if test -f "$MZDYNOBJ"; then + AC_MSG_RESULT($MZDYNOBJ) + else + AC_MSG_RESULT(not found) + MZDYNOBJ="" + fi + fi fi AC_SUBST(MZDYNOBJ) @@ -2003,7 +2013,7 @@ AC_SUBST(SKIP_GUILESCM) SKIP_MZSCHEME= -if test -z "$MZC" ; then +if test -z "$MZC" || test -z "$MZDYNOBJ" ; then SKIP_MZSCHEME="1" fi AC_SUBST(SKIP_MZSCHEME) |