diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..596615322
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+.gitattributes export-ignore
+.gitignore export-ignore
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..c375a7c77
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,130 @@
+# Compiled Source
+*.o
+*.class
+
+# Editor files and various other junk
+.*.sw?
+*.bak
+
+# Local PCRE
+pcre
+*.gz
+
+# C/C++ object files, based on:
+# https://github.com/github/gitignore/blob/master/C.gitignore
+# https://github.com/github/gitignore/blob/master/C%2B%2B.gitignore
+*.slo
+*.lo
+
+# C/C++ dynamic libraries, based on:
+# https://github.com/github/gitignore/blob/master/C.gitignore
+# https://github.com/github/gitignore/blob/master/C%2B%2B.gitignore
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# C/C++ static libraries, based on:
+# https://github.com/github/gitignore/blob/master/C.gitignore
+# https://github.com/github/gitignore/blob/master/C%2B%2B.gitignore
+*.lib
+*.lai
+*.la
+*.a
+
+# C/C++ executables, based on:
+# https://github.com/github/gitignore/blob/master/C.gitignore
+# https://github.com/github/gitignore/blob/master/C%2B%2B.gitignore
+*.exe
+*.out
+*.app
+
+# Generated by autogen.sh
+CCache/autom4te.cache/
+CCache/config.h.in
+CCache/configure
+Source/Include/swigconfig.h.in
+Source/Include/swigconfig.h.in~
+Source/Makefile.in
+Tools/config/compile
+Tools/config/config.guess
+Tools/config/config.sub
+Tools/config/depcomp
+Tools/config/install-sh
+Tools/config/missing
+Tools/config/ylwrap
+aclocal.m4
+autom4te.cache/
+configure
+
+# Generated by ./configure
+CCache/Makefile
+CCache/ccache_swig_config.h
+CCache/config.h
+CCache/config.log
+CCache/config.status
+Examples/Makefile
+Examples/guile/Makefile
+Examples/test-suite/*/Makefile
+Examples/xml/Makefile
+/Makefile
+Source/Include/stamp-h1
+Source/Include/swigconfig.h
+Source/Makefile
+.deps
+config.log
+config.status
+preinst-swig
+swig.spec
+
+# Build Artifacts
+.dirstamp
+CCache/ccache-swig
+CCache/ccache-swig.1
+Lib/swigwarn.swg
+Source/CParse/parser.c
+Source/CParse/parser.h
+Source/eswig
+swig
+
+# Generated documentation
+Doc/Manual/CCache.html
+Doc/Manual/SWIGDocumentation.html
+Doc/Manual/SWIGDocumentation.pdf
+Doc/Manual/*.book
+
+# Test Suite Generated Files
+Examples/test-suite/allegrocl/*/
+Examples/test-suite/cffi/*/
+Examples/test-suite/chicken/*/
+Examples/test-suite/clisp/*/
+Examples/test-suite/csharp/*/
+Examples/test-suite/d/*/
+Examples/test-suite/go/*/
+Examples/test-suite/guile/*/
+Examples/test-suite/java/*/
+Examples/test-suite/lua/*/
+Examples/test-suite/mzscheme/*/
+Examples/test-suite/ocaml/*/
+Examples/test-suite/octave/*/
+Examples/test-suite/perl5/*/
+Examples/test-suite/php/*/
+Examples/test-suite/pike/*/
+Examples/test-suite/python/*/
+Examples/test-suite/r/*/
+Examples/test-suite/ruby/*/
+Examples/test-suite/tcl/*/
+Examples/test-suite/uffi/*/
+
+# Python generated files, based on:
+# https://github.com/github/gitignore/blob/master/Python.gitignore
+*.py[cod]
+*/__pycache__/
+/__pycache__/
+
+# C# generated files
+*_runme.exe.mdb
+*_runme.exe
+
+# Scratch directories
+Examples/scratch
diff --git a/.project b/.project
deleted file mode 100644
index a7f89f57a..000000000
--- a/.project
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
- SWIG
-
-
-
-
-
- org.eclipse.cdt.autotools.core.genmakebuilderV2
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.genmakebuilder
-
-
-
-
- org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
- full,incremental,
-
-
-
-
-
- org.eclipse.cdt.core.cnature
- org.eclipse.cdt.core.ccnature
- org.eclipse.cdt.managedbuilder.core.managedBuildNature
- org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
- org.eclipse.cdt.autotools.core.autotoolsNatureV2
-
-
diff --git a/.travis.yml b/.travis.yml
index c41027bc0..7983d0ecd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,73 @@
language: cpp
compiler:
- - gcc
- clang
-script: ./autogen.sh && ./configure && make -s
+ - gcc
+env:
+ - SWIGLANG=
+matrix:
+ include:
+ - compiler: gcc
+ env: SWIGLANG=csharp
+ - compiler: gcc
+ env: SWIGLANG=go
+ - compiler: gcc
+ env: SWIGLANG=guile
+ - compiler: gcc
+ env: SWIGLANG=java
+ - compiler: gcc
+ env: SWIGLANG=lua
+ - compiler: gcc
+ env: SWIGLANG=octave SWIGJOBS=-j4
+ - compiler: gcc
+ env: SWIGLANG=perl5
+ - compiler: gcc
+ env: SWIGLANG=php
+ - compiler: gcc
+ env: SWIGLANG=python VER=2.4
+ - compiler: gcc
+ env: SWIGLANG=python VER=2.5
+ - compiler: gcc
+ env: SWIGLANG=python VER=2.6
+ - compiler: gcc
+ env: SWIGLANG=python # 2.7
+ - compiler: gcc
+ env: SWIGLANG=python PY3=3 # 3.2
+ - compiler: gcc
+ env: SWIGLANG=python PY3=3 VER=3.3
+ - compiler: gcc
+ env: SWIGLANG=python PY3=3 VER=3.4
+ - compiler: gcc
+ env: SWIGLANG=ruby
+ - compiler: gcc
+ env: SWIGLANG=tcl
+ allow_failures:
+ # None
+before_install:
+ - date -u
+ - lsb_release -a
+ - uname -a
+ - sudo apt-get -qq update
+ - time sudo apt-get -qq install libboost-dev
+ - if test -z "$SWIGLANG"; then sudo apt-get -qq install yodl; fi
+ - if test "$SWIGLANG" = "csharp"; then sudo apt-get -qq install mono-devel; fi
+ - if test "$SWIGLANG" = "go"; then go env | sed -e 's/^/export /' > goenvsetup && source goenvsetup && rm -f goenvsetup; fi # Until configure.ac is fixed
+ - if test "$SWIGLANG" = "guile"; then sudo apt-get -qq install guile-2.0-dev; fi
+ - if test "$SWIGLANG" = "lua"; then sudo apt-get -qq install lua5.1 liblua5.1-dev; fi
+ - if test "$SWIGLANG" = "octave"; then sudo apt-get -qq install octave3.2 octave3.2-headers; fi
+ - if test "$SWIGLANG" = "php"; then sudo apt-get install php5-cli php5-dev; fi
+ - if test "$SWIGLANG" = "python" -a "$PY3" -a -z "$VER"; then sudo apt-get install -qq python3-dev; fi
+ - if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi
+ - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi
+script:
+ - ./autogen.sh && ./configure $CONFIGOPTS
+ - make -s $SWIGJOBS
+ - ./swig -version && ./swig -pcreversion
+ - if test -z "$SWIGLANG"; then make -s $SWIGJOBS check-ccache; fi
+ - if test -z "$SWIGLANG"; then make -s $SWIGJOBS check-errors-test-suite; fi
+ - if test -z "$SWIGLANG"; then sudo make -s install && swig -version && ccache-swig -V; fi
+ - if test -n "$SWIGLANG"; then make -s check-$SWIGLANG-version; fi
+ - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples; fi
+ - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-test-suite; fi
branches:
only:
- master
diff --git a/ANNOUNCE b/ANNOUNCE
index 825837614..6229edc4a 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,31 +1,31 @@
-*** ANNOUNCE: SWIG 2.0.6 (30 April 2012) ***
+*** ANNOUNCE: SWIG 3.0.1 (in progress) ***
http://www.swig.org
-We're pleased to announce SWIG-2.0.6, the latest SWIG release.
+We're pleased to announce SWIG-3.0.1, the latest SWIG release.
What is SWIG?
=============
SWIG is a software development tool that reads C/C++ header files and
generates the wrapper code needed to make C and C++ code accessible
-from other languages including Perl, Python, Tcl, Ruby, PHP, Java,
-Scheme (Guile, MzScheme, CHICKEN), D, Ocaml, Lua, Pike, C#, Modula-3,
-Octave, R, Common Lisp (CLISP, Allegro CL, CFFI, UFFI). SWIG can also
-export its parse tree in the form of XML and Lisp s-expressions. Major
-applications of SWIG include generation of scripting language extension
-modules, rapid prototyping, testing, and user interface development for
-large C/C++ systems.
+from other programming languages including Perl, Python, Tcl, Ruby,
+PHP, C#, Go, Java, Lua, Scheme (Guile, MzScheme, CHICKEN), D, Ocaml,
+Pike, Modula-3, Octave, R, Common Lisp (CLISP, Allegro CL, CFFI, UFFI).
+SWIG can also export its parse tree in the form of XML and Lisp
+s-expressions. Major applications of SWIG include generation of
+scripting language extension modules, rapid prototyping, testing,
+and user interface development for large C/C++ systems.
Availability
============
The release is available for download on Sourceforge at
- http://prdownloads.sourceforge.net/swig/swig-2.0.6.tar.gz
+ http://prdownloads.sourceforge.net/swig/swig-3.0.1.tar.gz
A Windows version is also available at
- http://prdownloads.sourceforge.net/swig/swigwin-2.0.6.zip
+ http://prdownloads.sourceforge.net/swig/swigwin-3.0.1.zip
Please report problems with this release to the swig-devel mailing list,
details at http://www.swig.org/mail.html.
diff --git a/CCache/ccache.c b/CCache/ccache.c
index d1696da88..e7dd1d30a 100644
--- a/CCache/ccache.c
+++ b/CCache/ccache.c
@@ -712,12 +712,13 @@ static void from_cache(int first)
passfail = retrieve_from_cache(hashname, output_file, hardlink);
}
- free(stderr_file);
if (passfail == -1) {
close(fd_stderr);
unlink(stderr_file);
+ free(stderr_file);
return;
}
+ free(stderr_file);
}
/* get rid of the intermediate preprocessor file */
diff --git a/CCache/ccache.h b/CCache/ccache.h
index 668ce8288..dcbb03f0c 100644
--- a/CCache/ccache.h
+++ b/CCache/ccache.h
@@ -159,7 +159,7 @@ int asprintf(char **ptr, const char *format, ...);
int snprintf(char *,size_t ,const char *, ...);
#endif
-void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize);
+void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize, size_t minfiles);
void cleanup_all(const char *dir);
void wipe_all(const char *dir);
@@ -200,6 +200,8 @@ typedef int (*COMPAR_FN_T)(const void *, const void *);
/* mkstemp() on some versions of cygwin don't handle binary files, so
override */
+/* Seems okay in Cygwin 1.7.0
#ifdef __CYGWIN__
#undef HAVE_MKSTEMP
#endif
+*/
diff --git a/CCache/cleanup.c b/CCache/cleanup.c
index 99312283e..f54ee54d9 100644
--- a/CCache/cleanup.c
+++ b/CCache/cleanup.c
@@ -75,21 +75,40 @@ static void traverse_fn(const char *fname, struct stat *st)
/* sort the files we've found and delete the oldest ones until we are
below the thresholds */
-static void sort_and_clean(void)
+static void sort_and_clean(size_t minfiles)
{
unsigned i;
+ size_t adjusted_minfiles = minfiles;
if (num_files > 1) {
/* sort in ascending data order */
qsort(files, num_files, sizeof(struct files *),
(COMPAR_FN_T)files_compare);
}
+ /* ensure newly cached files (minfiles) are kept - instead of matching
+ the filenames of those newly cached, a faster and simpler approach
+ assumes these are the most recent in the cache and if any other
+ cached files have an identical time stamp, they will also be kept -
+ this approach would not be needed if the cleanup was done at exit. */
+ if (minfiles != 0 && minfiles < num_files) {
+ unsigned minfiles_index = num_files - minfiles;
+ time_t minfiles_time = files[minfiles_index]->mtime;
+ for (i=1; i<=minfiles_index; i++) {
+ if (files[minfiles_index-i]->mtime == minfiles_time)
+ adjusted_minfiles++;
+ else
+ break;
+ }
+ }
/* delete enough files to bring us below the threshold */
for (i=0;ifname) != 0 && errno != ENOENT) {
fprintf(stderr, "unlink %s - %s\n",
files[i]->fname, strerror(errno));
@@ -103,7 +122,7 @@ static void sort_and_clean(void)
}
/* cleanup in one cache subdir */
-void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize)
+void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize, size_t minfiles)
{
unsigned i;
@@ -117,7 +136,7 @@ void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize)
traverse(dir, traverse_fn);
/* clean the cache */
- sort_and_clean();
+ sort_and_clean(minfiles);
stats_set_sizes(dir, total_files, total_size);
@@ -151,7 +170,8 @@ void cleanup_all(const char *dir)
cleanup_dir(dname,
counters[STATS_MAXFILES],
- counters[STATS_MAXSIZE]);
+ counters[STATS_MAXSIZE],
+ 0);
free(dname);
free(sfile);
}
diff --git a/CCache/configure.in b/CCache/configure.ac
similarity index 100%
rename from CCache/configure.in
rename to CCache/configure.ac
diff --git a/CCache/stats.c b/CCache/stats.c
index 92bc4a835..d2122bcd3 100644
--- a/CCache/stats.c
+++ b/CCache/stats.c
@@ -168,7 +168,8 @@ static void stats_update_size(enum stats stat, size_t size, size_t numfiles)
if (need_cleanup) {
char *p = dirname(stats_file);
- cleanup_dir(p, counters[STATS_MAXFILES], counters[STATS_MAXSIZE]);
+ cleanup_dir(p, counters[STATS_MAXFILES], counters[STATS_MAXSIZE],
+ numfiles);
free(p);
}
}
diff --git a/CCache/test.sh b/CCache/test.sh
index 9581c85e3..f64c3e3de 100755
--- a/CCache/test.sh
+++ b/CCache/test.sh
@@ -142,7 +142,7 @@ basetests() {
testname="non-regular"
mkdir testd
$CCACHE_COMPILE -o testd -c test1.c > /dev/null 2>&1
- rmdir testd
+ rm -rf testd
checkstat 'output to a non-regular file' 1
testname="no-input"
@@ -315,7 +315,7 @@ swigtests() {
testname="non-regular"
mkdir testd
$CCACHE_COMPILE -o testd -java testswig1.i > /dev/null 2>&1
- rmdir testd
+ rm -rf testd
checkstat 'output to a non-regular file' 1
testname="no-input"
diff --git a/CCache/util.c b/CCache/util.c
index bba232492..66f9823b9 100644
--- a/CCache/util.c
+++ b/CCache/util.c
@@ -82,7 +82,7 @@ void copy_fd(int fd_in, int fd_out)
#ifndef HAVE_MKSTEMP
/* cheap and nasty mkstemp replacement */
-static int mkstemp(char *template)
+int mkstemp(char *template)
{
mktemp(template);
return open(template, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600);
diff --git a/CHANGES b/CHANGES
index 70af78333..821d76b2c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,1220 @@ SWIG (Simplified Wrapper and Interface Generator)
See the CHANGES.current file for changes in the current version.
See the RELEASENOTES file for a summary of changes in each release.
+Version 3.0.0 (16 Mar 2014)
+===========================
+
+2014-03-16: wsfulton
+ C++11 support initially developed as C++0x support by Matevz Jekovec as a Google Summer of Code
+ project has been further extended. The C++11 support is comprehensive, but by no means complete
+ or without limitations. Full details for each new feature in C++11 is covered in the
+ CPlusPlus11.html chapter in the documentation which is included in SWIG and also available
+ online at http://www.swig.org/Doc3.0/CPlusPlus11.html.
+
+2014-03-14: v-for-vandal
+ [Lua] Numerous Lua improvements:
+ 1. %nspace support has been added. Namespaces are mapped to tables in the module, with the same
+ name as the C++ namespace.
+ 2. Inheritance is now handled differently. Each class metatable keeps a list of class bases instead
+ of merging all members of all bases into the derived class.
+ 3. The new metatables result in differences in accessing class members. For example:
+
+ %module example
+ struct Test {
+ enum { TEST1 = 10, TEST2 = 20 };
+ static const int ICONST = 12;
+ };
+
+ Now this can be used as follows:
+ print(example.Test.TEST1)
+ print(example.Test.ICONST)
+ The old way was:
+ print(example.Test_TEST1)
+ print(example.Test_ICONST)
+
+ 4. The special class metatable member ".constructor" was removed. Now SWIG generates the proxy
+ function by itself and assigns it directly to the class table "__call" method.
+ 5. eLua should also now support inheritance.
+ 6. 'const' subtable in eLua is considered deprecated.
+
+ Changes in behaviour:
+ a. You can no longer assign to non-existing class members in classes without a __setitem__ method.
+ It will cause a Lua error.
+ b. You can no longer iterate over a module table and copy everything into the global namespace.
+ Actually, this was never the case, but it is now explicitly prohibited.
+ c. Now changing a base class will immediately affect all derived classes.
+ d. There might be some issues with inheritance. Although the bases iteration scheme is the same
+ as was used for merging base classes into derived one, some unknown issues may arise.
+
+ The old metatable behaviour can be restored by using the -no-old-metatable-bindings option.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2014-03-06: wsfulton
+ [Python] Change in default behaviour wrapping C++ bool. Only a Python True or False
+ will now work for C++ bool parameters. This fixes overloading bool with other types.
+ Python 2.3 minimum is now required for wrapping bool.
+
+ When wrapping:
+
+ const char* overloaded(bool value) { return "bool"; }
+ const char* overloaded(int value) { return "int"; }
+
+ Previous behaviour:
+ >>> overloaded(False)
+ 'int'
+ >>> overloaded(True)
+ 'int'
+ >>> overloaded(0)
+ 'int'
+
+ Now we get the expected behaviour:
+ >>> overloaded(False)
+ 'bool'
+ >>> overloaded(0)
+ 'int'
+
+ The consequence is when wrapping bool in non-overloaded functions:
+
+ const char* boolfunction(bool value) { return value ? "true" : "false"; }
+
+ The previous behaviour was very Pythonic:
+ >>> boolfunction("")
+ 'false'
+ >>> boolfunction("hi")
+ 'true'
+ >>> boolfunction(12.34)
+ 'true'
+ >>> boolfunction(0)
+ 'false'
+ >>> boolfunction(1)
+ 'true'
+
+ Now the new behaviour more along the lines of C++ due to stricter type checking. The
+ above calls result in an exception and need to be explicitly converted into a bool as
+ follows:
+ >>> boolfunction(0)
+ Traceback (most recent call last):
+ File "", line 1, in
+ TypeError: in method 'boolfunction', argument 1 of type 'bool'
+ >>> boolfunction(bool(0))
+ 'false'
+
+ The old behaviour can be resurrected by passing the -DSWIG_PYTHON_LEGACY_BOOL command line
+ parameter when executing SWIG. Typemaps can of course be written to customise the behaviour
+ for specific parameters.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2014-03-06: wsfulton
+ Fix SF Bug #1363 - Problem with method overloading when some methods are added by %extend
+ and others are real methods and using template default parameters with smart pointers.
+ This is noticeable as a regression since 2.0.12 when using the default smart pointer
+ handling for some languages when the smart pointer wraps std::map and other STL containers.
+
+2014-03-02: wsfulton
+ [Python] SF Patch #346 from Jens Krueger. Correct exception thrown attempting to
+ access a non-existent C/C++ global variable on the 'cvar' object. The exception thrown
+ used to be a NameError. However, as this access is via a primary, an AttributeError
+ is more correct and so the exception thrown now is an AttributeError. Reference:
+ http://docs.python.org/2/reference/expressions.html#attribute-references
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2014-03-01: wsfulton
+ [Python] Patch #143 Fix type shown when using type() to include the module and package
+ name when using -builtin.
+
+2014-03-01: wsfulton
+ [Python] SF patch #347 Fix missing argument count checking with -modern.
+ Fixes regression introduced when builtin changes were introduced in SWIG-2.0.3.
+
+2014-02-21: wsfulton
+ [PHP] Fix warning suppression using %warnfilter for PHP reserved class names.
+
+2014-02-19: olly
+ [Lua] Add keyword warnings for Lua keywords and Basic Functions.
+
+2014-02-19: olly
+ -Wallkw now includes keywords for all languages with keyword
+ warnings (previously Go and R were missing).
+
+2014-02-19: olly
+ [PHP] Update the lists of PHP keywords with new ones from PHP 5.4
+ and newer (and some missing ones from 5.3). Reserved PHP constants
+ names are now checked against enum values and constants, instead
+ of against function and method names. Built-in PHP function names
+ no longer match methods added by %extend. Functions and methods
+ named '__sleep', '__wakeup', 'not', 'parent', or 'virtual' are no
+ longer needlessly renamed.
+
+2014-02-15: wsfulton
+ Fix the %$ismember %rename predicates to also apply to members added via %extend.
+
+ Add %$isextendmember for %rename of members added via %extend. This can be used to
+ distinguish between normal class/struct members and %extend members. For example
+ '%$ismember, %$not %$isextendmember' will now identify just class/struct members.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2014-02-16: hfalcic
+ [Python] Patch #137 - fix crashes/exceptions in exception handling in Python 3.3
+
+2014-02-15: wsfulton
+ [Java] Add support for the cdata library.
+
+2014-02-08: vkalinin
+ Nested class support added. This primarily allows SWIG to properly parse nested
+ classes and keep the nested class information in the parse tree. Java and C#
+ have utilised this information wrapping the C++ nested classes as Java/C#
+ nested classes. The remaining target languages ignore nested classes as in
+ previous versions. Help is needed by users of these remaining languages to
+ design how C++ nested classes can be best wrapped. Please talk to us on the
+ swig-devel mailing list if you think you can help.
+
+ Previously, there was limited nested class support. Nested classes were treated
+ as opaque pointers. However, the "nestedworkaround" feature provided a way to
+ wrap a nested class as if it was a global class. This feature no longer exists
+ and is replaced by the new "flatnested" feature. This effectively does the same
+ thing with less manual code to be written. Please see the 'Nested classes'
+ section in the documentation in SWIGPlus.html if you were previously using this
+ feature.
+
+ SWIG now parses the contents of nested classes where previously it did not. You
+ may find that you will need to make adjustments to your interface file as
+ effectively extra code is being wrapped.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2014-02-06: gjanssens
+ [Guile] Patch #133. Make scm to string conversion work with non-ascii strings.
+ Guile 2 has a completely rewritten string implementation. SWIG made some assumptions
+ that are no longer valid as to the internals of guile's string representation.
+
+2014-01-30: wsfulton
+ [C#] Add new swigtype_inout.i library containing SWIGTYPE *& OUTPUT typemaps.
+
+ Example usage wrapping:
+
+ void f(XXX *& x) { x = new XXX(111); }
+
+ would be:
+
+ XXX x = null;
+ f(out x);
+ // use x
+ x.Dispose(); // manually clear memory or otherwise leave out and leave it to the garbage collector
+
+2014-01-21: ianlancetaylor
+ [Go] Add %go_import directive.
+
+2014-01-21: ianlancetaylor
+ [Go] Add support for Go 1.3, not yet released.
+
+2014-01-20: wsfulton
+ Director exceptions (Swig::DirectorException) now derive from std::exception
+ and hence provide the what() method. In Python and Ruby, this replaces the now
+ deprecated DirectorException::getMessage() method.
+
+2014-01-14: diorcety
+ Patch #112 - Fix symbol resolution involving scopes that have multiple levels
+ of typedefs - fixes some template resolutions as well as some typemap searches.
+
+2014-01-11: wsfulton
+ Fix and document the naturalvar feature override behaviour - the naturalvar
+ feature attached to a variable name has precedence over the naturalvar
+ feature attached to the variable's type. The overriding was not working
+ when turning the feature off on the variable's name.
+
+ Fix so that any use of the naturalvar feature will override the global
+ setting. Previously when set globally by -naturalvar or %module(naturalvar=1),
+ use of the naturalvar feature was not always honoured.
+
+2014-01-06: ianlancetaylor
+ [Go] Fix bug that broke using directors from a thread not
+ created by Go.
+
+2013-12-24: ptomulik
+ [Python] SF Bug #1297
+
+ Resolve several issues related to python imports.
+ For example, it's now possible to import modules having the same module
+ names, but belonging in different packages.
+
+ From the user's viewpoint, this patch gives a little bit more control on
+ import statements generated by SWIG. The user may choose to use relative
+ or absolute imports.
+
+ Some details:
+ - we (still) generate import statements in the form 'import a.b.c' which
+ corresponds to absolute imports in python3 and (the only available)
+ ambiguous one in python2.
+ - added -relativeimport option to use explicit relative import syntax
+ (python3),
+
+ The "Python Packages" section in the documentation discusses how to work
+ with importing packages including the new -relativeimport command line option.
+
+2013-12-23: vadz
+ [Octave, Perl, Python, R, Ruby, Tcl] Change the length of strings created from fixed-size char
+ buffers in C code.
+
+ This is a potential backwards compatibility break: a "char buf[5]" containing "ho\0la" was
+ returned as a string of length 5 before, but is returned as a string of length 2 now. Also,
+ it was possible to assign a (non-NUL-terminated) string "hello" to such a buffer before but
+ now this fails and only "helo" can fit.
+
+ Apply "char FIXSIZE[ANY]" typemaps to explicitly choose the old behaviour.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2013-12-23: talby
+ [Perl] Add support for directors.
+
+2013-12-18: ianlancetaylor
+ [Go] Don't require that Go environment variables be set
+ when running examples or testsuite when using Go 1 or
+ later.
+
+2013-12-17: ianlancetaylor
+ [Go] Remove -longsize option (for backward compatibility,
+ ignore it if seen).
+
+2013-12-17: ianlancetaylor
+ [Go] Add -go-pkgpath option.
+
+2013-12-16: ianlancetaylor
+ [Go] Update for Go 1.2 release. Add support for linking
+ SWIG code directly into executable, rather than using a
+ shared library.
+
+2013-12-13: ianlancetaylor
+ [Go] Add SWIG source file name as comments in generated
+ files. This can be used by Go documentation tools.
+
+2013-12-12: jleveque
+ [Lua] Fix typo (wchar instead of wchar_t) which made wchar.i
+ for Lua useless.
+
+2013-12-12: vmiklos
+ [PHP] PHP's peculiar call-time pass-by-reference feature was
+ deprecated in PHP 5.3 and removed in PHP 5.4, so update the REF
+ typemaps in phppointers.i to specify pass-by-reference in the
+ function definition. Examples/php/pointer has been updated
+ accordingly.
+
+2013-12-12: olly
+ [PHP] The usage of $input in PHP directorout typemaps has been
+ changed to be consistent with other languages. The typemaps
+ provided by SWIG have been updated accordingly, but if you
+ have written your own directorout typemaps, you'll need to
+ update $input to &$input (or make equivalent changes).
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2013-11-27: vadz
+ [C#, Java, Python] Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>.
+
+2013-11-09: wsfulton
+ [C#] Apply patch #79 from Brant Kyser
+ - Remove using directives from the generated C# code and fully qualify the use of all .NET
+ framework types in order to minimize potential name collisions from input files defining
+ types, namespace, etc with the same name as .NET framework members.
+ - Globally qualify the use of .NET framework types in the System namespace
+ - Remove .NET 1.1 support, .NET 2 is the minimum for the C# module
+
+ This is a potential backwards compatibility break if code has been added relying on these using
+ statements that used to be generated:
+
+ using System;
+ using System.Runtime.InteropServices;
+
+ The quick fix to add these back in is to add the -DSWIG2_CSHARP command line option when
+ executing SWIG. See CSharp.html documentation for more info.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2013-11-05: wsfulton
+ [Java] Fix some corner cases for the $packagepath/$javaclassname special variable substitution.
+
+2013-11-05: wsfulton
+ [Java] Apply patch #91 from Marvin Greenberg - Add director:except feature for improved
+ exception handling in director methods for Java.
+
+2013-10-15: vadz
+ Allow using \l, \L, \u, \U and \E in the substitution part of %(regex:/pattern/subst/)
+ inside %rename to change the case of the text being replaced.
+
+2013-10-12: wsfulton
+ [CFFI] Apply #96 - superclass not lispify
+
+2013-10-12: wsfulton
+ Merge in C++11 support from the gsoc2009-matevz branch where Matevz Jekovec first
+ started the C++0x additions. Documentation of the C++11 features supported is in a
+ new Chapter of the documentation, "SWIG and C++11" in Doc/Manual/CPlusPlus11.html.
+
+2013-10-04: wsfulton
+ Fix %naturalvar not having any affect on templated classes instantiated with an
+ enum as the template parameter type. Problem reported by Vadim Zeitlin.
+
+2013-09-20: wsfulton
+ [Java] Fix a memory leak for the java char **STRING_ARRAY typemaps.
+
+Version 2.0.12 (9 Feb 2014)
+===========================
+
+2014-01-16: wsfulton
+ [PHP] Fix compilation error in ZTS mode (64 bit windows) due to incorrect placement
+ of TSRMLS_FETCH() in SWIG_Php_GetModule() as reported by Mark Dawson-Butterworth.
+
+2014-01-13: kwwette
+ [Octave] update support to Octave version 3.8.0
+
+ - Octave 3.8.0 no longer defines OCTAVE_API_VERSION_NUMBER, but 3.8.1
+ will define OCTAVE_{MAJOR,MINOR,PATCH}_VERSION instead: see
+ http://hg.savannah.gnu.org/hgweb/octave/rev/b6b6e0dc700e
+ So we now use a new macro SWIG_OCTAVE_PREREQ(major,minor,patch) to
+ enable features requiring Octave version major.minor.patch or later.
+
+ For Octave versions prior to 3.8.1, we reconstruct values for
+ OCTAVE_{MAJOR,MINOR,PATCH}_VERSION based on OCTAVE_API_VERSION_NUMBER,
+ extracted from Octave's ChangeLogs. An additional hack is needed to
+ distinguish between Octave <= 3.2.x and 3.8.0, neither of which define
+ OCTAVE_API_VERSION_NUMBER.
+
+ - Octave 3.8.0 deprecates symbol_table::varref(), so remove its use
+ for this and future versions of Octave.
+
+ - Octave 3.8.0 removes octave_value::is_real_nd_array(), used in
+ octave_swig_type::dims(). Its use is not required here, so remove it.
+
+ - Retested against Octave versions 3.0.5, 3.2.4, 3.4.3, 3.6.4, and 3.8.0.
+
+ - Updated Octave documentation with tested Octave versions, and added a
+ warning against using versions <= 3.x.x, which are no longer tested.
+
+2013-12-22: wsfulton
+ C++11 support for new versions of erase and insert in the STL containers.
+
+ The erase and insert methods in the containers use const_iterator instead
+ of iterator in C++11. There are times when the methods wrapped must match
+ the parameters exactly. Specifically when full type information for
+ template types is missing or SWIG fails to look up the type correctly,
+ for example:
+
+ %include
+ typedef float Real;
+ %template(RealVector) std::vector;
+
+ SWIG does not find std::vector::iterator because %template using
+ typedefs does not always work and so SWIG doesn't know if the type is
+ copyable and so uses SwigValueWrapper which does
+ not support conversion to another type (const_iterator). This resulted
+ in compilation errors when using the C++11 version of the containers.
+
+ Closes #73
+
+2013-10-17: wsfulton
+ [R] Fix SF #1340 - Visual Studio compile error in C++ wrappers due to #include
+ within extern "C" block.
+
+2013-10-17: wsfulton
+ [Python] Fix SF #1345 - Missing #include for offsetof when using -builtin.
+
+2013-10-12: wsfulton
+ [Lua] Apply #92 - missing return statements for SWIG_Lua_add_namespace_details()
+ and SWIG_Lua_namespace_register().
+
+Version 2.0.11 (15 Sep 2013)
+============================
+
+2013-09-15: wsfulton
+ [R] Fix attempt to free a non-heap object in OUTPUT typemaps for:
+ unsigned short *OUTPUT
+ unsigned long *OUTPUT
+ signed long long *OUTPUT
+ char *OUTPUT
+ signed char*OUTPUT
+ unsigned char*OUTPUT
+
+2013-09-12: wsfulton
+ [Lua] Pull Git patch #62.
+ 1) Static members and static functions inside class can be accessed as
+ ModuleName.ClassName.FunctionName (MemberName respectively). Old way such as
+ ModuleName.ClassName_FunctionName still works.
+ 2) Same goes for enums inside classes: ModuleName.ClassName.EnumValue1 etc.
+
+2013-09-12: wsfulton
+ [UTL] Infinity is now by default an acceptable value for type 'float'. This fix makes
+ the handling of type 'float' and 'double' the same. The implementation requires the
+ C99 isfinite() macro, or otherwise some platform dependent equivalents, to be available.
+
+ Users requiring the old behaviour of not accepting infinity, can define a 'check' typemap
+ wherever a float is used, such as:
+
+ %typemap(check,fragment="") float, const float & %{
+ if ($1 < -FLT_MAX || $1 > FLT_MAX) {
+ SWIG_exception_fail(SWIG_TypeError, "Overflow in type float");
+ }
+ %}
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2013-08-30: wsfulton
+ [Lua] Pull Git patch #81: Include Lua error locus in SWIG error messages.
+ This is standard information in Lua error messages, and makes it much
+ easier to find bugs.
+
+2013-08-29: wsfulton
+ Pull Git patch #75: Handle UTF-8 files with BOM at beginning of file. Was giving an
+ 'Illegal token' syntax error.
+
+2013-08-29: wsfulton
+ [C#] Pull Git patch #77: Allow exporting std::map using non-default comparison function.
+
+2013-08-28: wsfulton
+ [Python] %implicitconv is improved for overloaded functions. Like in C++, the methods
+ with the actual types are considered before trying implicit conversions. Example:
+
+ %implicitconv A;
+ struct A {
+ A(int i);
+ };
+ class CCC {
+ public:
+ int xx(int i) { return 11; }
+ int xx(const A& i) { return 22; }
+ };
+
+ The following python code:
+
+ CCC().xx(-1)
+
+ will now return 11 instead of 22 - the implicit conversion is not done.
+
+2013-08-23: olly
+ [Python] Fix clang++ warning in generated wrapper code.
+
+2013-08-16: wsfulton
+ [Python] %implicitconv will now accept None where the implicit conversion takes a C/C++ pointer.
+ Problem highlighted by Bo Peng. Closes SF patch #230.
+
+2013-08-07: wsfulton
+ [Python] SF Patch #326 from Kris Thielemans - Remove SwigPyObject_print and SwigPyObject_str and
+ make the generated wrapper use the default python implementations, which will fall back to repr
+ (for -builtin option).
+
+ Advantages:
+ - it avoids the swig user having to jump through hoops to get print to work as expected when
+ redefining repr/str slots.
+ - typing the name of a variable on the python prompt now prints the result of a (possibly redefined)
+ repr, without the swig user having to do any extra work.
+ - when redefining repr, the swig user doesn't necessarily have to redefine str as it will call the
+ redefined repr
+ - the behaviour is exactly the same as without the -builtin option while requiring no extra work
+ by the user (aside from adding the %feature("python:slot...) statements of course)
+
+ Disadvantage:
+ - default str() will give different (but clearer?) output on swigged classes
+
+2013-07-30: wsfulton
+ [Python, Ruby] Fix #64 #65: Missing code in std::multimap wrappers. Previously an instantiation
+ of a std::map was erroneously required in addition to an instantiation of std::multimap with the
+ same template parameters to prevent compilation errors for the wrappers of a std::multimap.
+
+2013-07-14: joequant
+ [R] Change types file to allow for SEXP return values
+
+2013-07-05: wsfulton
+ [Python] Add %pythonbegin directive which works like %pythoncode, except the specified code is
+ added at the beginning of the generated .py file. This is primarily needed for importing from
+ __future__ statements required to be at the very beginning of the file. Example:
+
+ %pythonbegin %{
+ from __future__ import print_function
+ print("Loading", "Whizz", "Bang", sep=' ... ')
+ %}
+
+2013-07-01: wsfulton
+ [Python] Apply SF patch #340 - Uninitialized variable fix in SWIG_Python_NonDynamicSetAttr
+ when using -builtin.
+
+2013-07-01: wsfulton
+ [Python, Ruby, Ocaml] Apply SF patch #341 - fix a const_cast in generated code that was generating
+ a <:: digraph when using the unary scope operator (::) (global scope) in a template type.
+
+2013-07-01: wsfulton
+ [Python] Add SF patch #342 from Christian Delbaere to fix some director classes crashing on
+ object deletion when using -builtin. Fixes SF bug #1301.
+
+2013-06-11: wsfulton
+ [Python] Add SWIG_PYTHON_INTERPRETER_NO_DEBUG macro which can be defined to use the Release version
+ of the Python interpreter in Debug builds of the wrappers. The Visual Studio .dsp example
+ files have been modified to use this so that Debug builds will now work without having
+ to install or build a Debug build of the interpreter.
+
+2013-06-07: wsfulton
+ [Ruby] Git issue #52. Fix regression with missing rb_complex_new function for Ruby
+ versions prior to 1.9 using std::complex wrappers if just using std::complex as an output type.
+ Also fix the Complex helper functions external visibility (to static by default).
+
+2013-06-04: olly
+ [PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL
+ if the type lookup fails.
+
+Version 2.0.10 (27 May 2013)
+============================
+
+2013-05-25: wsfulton
+ [Python] Fix Python 3 inconsistency when negative numbers are passed
+ where a parameter expects an unsigned C type. An OverFlow error is
+ now consistently thrown instead of a TypeError.
+
+2013-05-25: Artem Serebriyskiy
+ SVN Patch ticket #338 - fixes to %attribute macros for template usage
+ with %arg.
+
+2013-05-19: wsfulton
+ Fix ccache-swig internal error bug due to premature file cleanup.
+
+ Fixes SF bug 1319 which shows up as a failure in the ccache tests on
+ Debian 64 bit Wheezy, possibly because ENABLE_ZLIB is defined.
+
+ This is a corner case which will be hit when the maximum number of files
+ in the cache is set to be quite low (-F option), resulting in a cache miss.
+
+2013-05-09: kwwette
+ [Octave] Fix bugs in Octave module loading:
+ - fix a memory leak in setting of global variables
+ - install functions only once, to speed up module loads
+
+2013-04-28: gjanssens
+ [Guile] Updates in guile module:
+ - Add support for guile 2.0
+ - Drop support for guile 1.6
+ - Drop support for generating wrappers using guile's gh interface.
+ All generated wrappers will use the scm interface from now on.
+ - Deprecate -gh and -scm options. They are no longer needed.
+ A warning will be issued when these options are still used.
+ - Fix all tests and examples to have a successful travis test
+
+2013-04-18: wsfulton
+ Apply Patch #36 from Jesus Lopez to add support for $descriptor() special variable macro expansion
+ in fragments. For example:
+
+ %fragment("nameDescriptor", "header")
+ %{
+ static const char *nameDescriptor = "$descriptor(Name)";
+ %}
+
+ which will generate into the wrapper if the fragment is used:
+
+ static const char *nameDescriptor = "SWIGTYPE_Name";
+
+2013-04-18: wsfulton
+ Fix SF Bug #428 - Syntax error when preprocessor macros are defined inside of enum lists, such as:
+
+ typedef enum {
+ eZero = 0
+ #define ONE 1
+ } EFoo;
+
+ The macros are silently ignored.
+
+2013-04-17: wsfulton
+ [C#] Pull patch #34 from BrantKyser to fix smart pointers in conjunction with directors.
+
+2013-04-15: kwwette
+ [Octave] Fix bugs in output of cleanup code.
+ - Cleanup code is now written also after the "fail:" label, so it will be called if
+ a SWIG_exception is raised by the wrapping function, consistent with other modules.
+ - Octave module now also recognises the "$cleanup" special variable, if needed.
+
+2013-04-08: kwwette
+ Add -MP option to SWIG for generating phony targets for all dependencies.
+ - Prevents make from complaining if header files have been deleted before
+ the dependency file has been updated.
+ - Modelled on similar option in GCC.
+
+2013-04-09: olly
+ [PHP] Add missing directorin typemap for char* and char[] which
+ fixes director_string testcase failure.
+
+2013-04-05: wsfulton
+ [Ruby] SF Bug #1292 - Runtime fixes for Proc changes in ruby-1.9 when using STL
+ wrappers that override the default predicate, such as:
+
+ %template(Map) std::map >;
+
+2013-04-05: wsfulton
+ [Ruby] SF Bug #1159 - Correctly check rb_respond_to call return values to fix some
+ further 1.9 problems with functors and use of Complex wrappers.
+
+2013-04-02: wsfulton
+ [Ruby] Runtime fixes for std::complex wrappers for ruby-1.9 - new native Ruby complex numbers are used.
+
+2013-03-30: wsfulton
+ [Ruby] Fix seg fault when using STL containers of generic Ruby types, GC_VALUE or LANGUAGE_OBJECT,
+ on exit of the Ruby interpreter. More frequently observed in ruby-1.9.
+
+2013-03-29: wsfulton
+ [Ruby] Fix delete_if (reject!) for the STL container wrappers which previously would
+ sometimes seg fault or not work.
+
+2013-03-25: wsfulton
+ [Python] Fix some undefined behaviour deleting slices in the STL containers.
+
+2013-03-19: wsfulton
+ [C#, Java, D] Fix seg fault in SWIG using directors when class and virtual method names are
+ the same except being in different namespaces when the %nspace feature is not being used.
+
+2013-02-19: kwwette
+ Fix bug in SWIG's handling of qualified (e.g. const) variables of array type. Given the typedef
+ a(7).q(volatile).double myarray // typedef volatile double[7] myarray;
+ the type
+ q(const).myarray // const myarray
+ becomes
+ a(7).q(const volatile).double // const volatile double[7]
+ Previously, SwigType_typedef_resolve() produces the type
+ q(const).a(7).q(volatile).double // non-sensical type
+ which would never match %typemap declarations, whose types were parsed correctly.
+ Add typemap_array_qualifiers.i to the test suite which checks for the correct behaviour.
+
+2013-02-18: wsfulton
+ Deprecate typedef names used as constructor and destructor names in %extend. The real
+ class/struct name should be used.
+
+ typedef struct tagEStruct {
+ int ivar;
+ } EStruct;
+
+ %extend tagEStruct {
+ EStruct() // illegal name, should be tagEStruct()
+ {
+ EStruct *s = new EStruct();
+ s->ivar = ivar0;
+ return s;
+ }
+ ~EStruct() // illegal name, should be ~tagEStruct()
+ {
+ delete $self;
+ }
+ }
+
+ For now these trigger a warning:
+
+ extend_constructor_destructor.i:107: Warning 522: Use of an illegal constructor name 'EStruct' in
+ %extend is deprecated, the constructor name should be 'tagEStruct'.
+ extend_constructor_destructor.i:111: Warning 523: Use of an illegal destructor name 'EStruct' in
+ %extend is deprecated, the destructor name should be 'tagEStruct'.
+
+ These %extend destructor and constructor names were valid up to swig-2.0.4, however swig-2.0.5 ignored
+ them altogether for C code as reported in SF bug #1306. The old behaviour of using them has been
+ restored for now, but is officially deprecated. This does not apply to anonymously defined typedef
+ classes/structs such as:
+
+ typedef struct {...} X;
+
+2013-02-17: kwwette
+ When generating functions provided by %extend, use "(void)" for no-argument functions
+ instead of "()". This prevents warnings when compiling with "gcc -Wstrict-prototypes".
+
+2013-02-17: kwwette
+ [Octave] Minor fix to autodoc generation: get the right type for functions returning structs.
+
+2013-02-15: wsfulton
+ Deprecate typedef names used in %extend that are not the real class/struct name. For example:
+
+ typedef struct StructBName {
+ int myint;
+ } StructB;
+
+ %extend StructB {
+ void method() {}
+ }
+
+ will now trigger a warning:
+
+ swig_extend.i:19: Warning 326: Deprecated %extend name used - the struct name StructBName
+ should be used instead of the typedef name StructB.
+
+ This is only partially working anyway (the %extend only worked if placed after the class
+ definition).
+
+2013-02-09: wsfulton
+ [CFFI] Apply patch #22 - Fix missing package before &body
+
+2013-01-29: wsfulton
+ [Java] Ensure 'javapackage' typemap is used as it stopped working from version 2.0.5.
+
+2013-01-28: wsfulton
+ [Python] Apply patch SF #334 - Fix default value conversions "TRUE"->True, "FALSE"->False.
+
+2013-01-28: wsfulton
+ [Java] Apply patch SF #335 - Truly ignore constructors in directors with %ignore.
+
+2013-01-18: Brant Kyser
+ [Java] Patch #15 - Allow the use of the nspace feature without the -package commandline option.
+ This works as long and the new jniclasspackage pragma is used to place the JNI intermediate class
+ into a package and the nspace feature is used to place all exposed types into a package.
+
+2013-01-15: wsfulton
+ Fix Visual Studio examples to work when SWIG is unzipped into a directory containing spaces.
+
+2013-01-15: wsfulton
+ [C#] Fix cstype typemap lookup for member variables so that a fully qualified variable name
+ matches. For example:
+ %typemap(cstype) bool MVar::mvar "MyBool"
+ struct MVar {
+ bool mvar;
+ };
+
+2013-01-11: Brant Kyser
+ [Java, C#, D] SF Bug #1299 - Fix generated names for when %nspace is used on
+ classes with the same name in two different namespaces.
+
+2013-01-11: Vladimir Kalinin
+ [C#] Add support for csdirectorin 'pre', 'post' and 'terminator' attributes.
+
+2013-01-08: olly
+ [PHP] Fix to work with a ZTS build of PHP (broken in 2.0.7).
+
+2013-01-07: olly
+ Fix bashism in configure, introduced in 2.0.9.
+
+2013-01-06: wsfulton
+ Pull patch #4 from ptomulik to fix SF Bug #1296 - Fix incorrect warning for virtual destructors
+ in templates, such as:
+ Warning 521: Illegal destructor name B< A >::~B(). Ignored.
+
+2013-01-05: wsfulton
+ [Python] Pull patch #3 from ptomulik to fix SF Bug #1295 - standard exceptions as
+ classes using the SWIG_STD_EXCEPTIONS_AS_CLASSES macro.
+
+2013-01-04: wsfulton
+ [Java] Pull patch #2 from BrantKyser to fix SF Bug #1283 - fix smart pointers in conjuction
+ with directors.
+
+2013-01-03: wsfulton
+ [Java] Pull patch #1 from BrantKyser to fix SF Bug #1278 - fix directors and nspace feature when
+ multilevel namespaces are used.
+
+Version 2.0.9 (16 December 2012)
+================================
+
+2012-12-16: wsfulton
+ Fix garbage line number / empty file name reporting for some missing
+ '}' or ')' error messages.
+
+2012-12-15: kkaempf
+ [Ruby] Apply patch 3530444, Class#methods and Class#constants returns array of
+ symbols in Ruby 1.9+
+
+2012-12-14: kkaempf
+ [Ruby] Apply patch 3530439 and finally replace all occurrences of the STR2CSTR() macro
+ with StringValuePtr(). STR2CSTR was deprecated since years and got removed in Ruby 1.9
+
+2012-12-14: kkaempf
+ [Ruby] Applied patches #3530442 and 3530443 to adapt compile and runtime include
+ paths to match Ruby 1.9+
+
+2012-12-14: wsfulton
+ [CFFI] Fix #3161614 - Some string constants are incorrect
+
+2012-12-13: wsfulton
+ [CFFI] Fix #3529690 - Fix incorrect constant names.
+
+2012-12-12: drjoe
+ [R] add fix to finalizer that was missed earlier
+
+2012-12-11: wsfulton
+ [Python] Apply patch #3590522 - fully qualified package paths for Python 3 even if a module is in the
+ same package.
+
+2012-12-08: wsfulton
+ [Python] Bug #3563647 - PyInt_FromSize_t unavailable prior to Python 2.5 for unsigned int types.
+
+2012-12-08: wsfulton
+ [Perl] Fix bug #3571361 - C++ comment in C wrappers.
+
+2012-12-07: wsfulton
+ [C#] Apply patch #3571029 which adds missing director support for const unsigned long long &.
+
+2012-11-28: kwwette
+ [Octave] Simplified module loading: now just the syntax
+ $ example;
+ is accepted, which loads functions globally but constants and variables relative to the current scope.
+ This make module loading behaviour reliably consistent, and reduces problems when loading modules which
+ depend on other modules which may not have been previously loaded.
+
+2012-11-27: wsfulton
+ [cffi] Fix junk output when wrapping single character literal constants.
+
+2012-11-17: wsfulton
+ [Tcl, Modula3] Add missing support for -outdir.
+
+2012-11-17: wsfulton
+ Fix segfaults when using filename paths greater than 1024 characters in length.
+
+2012-11-14: wsfulton
+ [ccache-swig] Apply patch #3586392 from Frederik Deweerdt to fix some error cases - incorrectly using
+ memory after it has been deleted.
+
+2012-11-09: vzeitlin
+ [Python] Fix overflow when passing values greater than LONG_MAX from Python 3 for parameters with unsigned long C type.
+
+2012-11-09: wsfulton
+ Fix some feature matching issues for implicit destructors and implicit constructors and implicit
+ copy constructors added with %copyctor. Previously a feature for these had to be fully qualified
+ in order to match. Now the following will also match:
+
+ %feature("xyz") ~XXX();
+ struct XXX {};
+
+2012-11-09: wsfulton
+ Further consistency in named output typemap lookups for implicit constructors and destructors and
+ implicit copy constructors added with %copyctor. Previously only the fully qualified name was being
+ used, now the unqualified name will also be used. For example, previously:
+
+ example.i:38: Searching for a suitable 'out' typemap for: void Space::More::~More
+ Looking for: void Space::More::~More
+ Looking for: void
+
+ Now the unqualified name is also used:
+
+ example.i:38: Searching for a suitable 'out' typemap for: void Space::More::~More
+ Looking for: void Space::More::~More
+ Looking for: void ~More
+ Looking for: void
+
+2012-11-02: wsfulton
+ Fix some subtle named output typemap lookup misses, the fully qualified name was not always being
+ used for variables, for example:
+
+ struct Glob {
+ int MyVar;
+ };
+
+ Previously the search rules (as shown by -debug-tmsearch) for the getter wrapper were:
+
+ example.i:44: Searching for a suitable 'out' typemap for: int MyVar
+ Looking for: int MyVar
+ Looking for: int
+
+ Now the scope is named correctly:
+
+ example.i:44: Searching for a suitable 'out' typemap for: int Glob::MyVar
+ Looking for: int Glob::MyVar
+ Looking for: int MyVar
+ Looking for: int
+
+2012-10-26: wsfulton
+ Fix director typemap searching so that a typemap specified with a name will be correctly matched. Previously
+ the name was ignored during the typemap search. Applies to the following list of typemaps:
+ directorout, csdirectorout, cstype, imtype, ctype, ddirectorout, dtype, gotype, jtype, jni, javadirectorout.
+
+2012-10-11: wsfulton
+ Most of the special variables available for use in %exception are now also available for expansion in
+ %extend blocks. These are: $name $symname $overname $decl $fulldecl $parentname $parentsymname, see docs
+ on "Class extension" in SWIGPlus.html. Patch based on submission from Kris Thielemans.
+
+2012-10-10: wsfulton
+ Additional new special variables in %exception are expanded as follows:
+ $parentname - The parent class name (if any) for a method.
+ $parentsymname - The target language parent class name (if any) for a method.
+
+2012-10-08: iant
+ [Go] Generating Go code now requires using the -intgosize option to
+ indicate the size of the 'int' type in Go. This is because the
+ size of the type is changing from Go 1.0 to Go 1.1 for x86_64.
+
+2012-09-14: wsfulton
+ Add new warning if the empty template instantiation is used as a base class, for example:
+
+ template class Base {};
+ %template() Base;
+ class Derived : public Base {};
+
+ gives the following warning instead of silently ignoring the base:
+
+ cpp_inherit.i:52: Warning 401: Base class 'Base< int >' has no name as it is an empty template instantiated with '%template()'. Ignored.
+ cpp_inherit.i:51: Warning 401: The %template directive must be written before 'Base< int >' is used as a base class and be declared with a name.
+
+
+2012-09-11: wsfulton
+ [Java] Fix #3535304 - Direct use of a weak global reference in directors
+ sometimes causing seg faults especially on Android.
+
+2012-09-06: wsfulton
+ [Java] Fix (char *STRING, size_t LENGTH) typemaps to accept NULL string.
+
+2012-08-26: drjoe
+ [R] make ExternalReference slot ref to contain reference
+
+2012-08-26: drjoe
+ [R] fix Examples/Makefile to use C in $(CC) rather than $(CXX)
+
+Version 2.0.8 (20 August 2012)
+==============================
+
+2012-08-15: wsfulton
+ [Perl] Add size_type, value_type, const_reference to the STL containers.
+
+2012-08-15: wsfulton
+ [Python] Add discard and add methods to std::set wrappers so that pyabc.i can be used ensuring
+ MutableSet is a valid abstract base class for std::set. As reported by Alexey Sokolov.
+ Similarly for std::multiset.
+
+2012-08-15: wsfulton
+ [Python] Fix #3541744 - Missing PyInt_FromSize_t calls for Python 3.
+
+2012-08-13: wsfulton
+ [Java] Patch from David Baum to add the assumeoverride feature for Java directors to
+ improve performance when all overridden methods can be assumed to be overridden.
+
+2012-08-05: wsfulton
+ [Python] #3530021 Fix unused variable warning.
+
+2012-08-05: wsfulton
+ [C#] Fix #3536360 - Invalid code sometimes being generated for director methods
+ with many arguments.
+
+2012-08-05: wsfulton
+ [Perl] #3545877 - Don't undefine bool if defined by C99 stdbool.h - problem using
+ Perl 5.16 and later.
+
+2012-08-04: wsfulton
+ Remove incorrect warning (314) about target language keywords which were triggered
+ by using declarations and using directives. For example 'string' is a keyword in C#:
+ namespace std { class string; }
+ using std::string;
+
+2012-07-21: wsfulton
+ Fix display of pointers in various places on 64 bit systems - only 32 bits were being shown.
+
+2012-07-21: wsfulton
+ Fix gdb debugger functions 'swigprint' and 'locswigprint' to display to the gdb output window
+ rather than stdout. This fixes display problems in gdbtui and the ensures the output
+ appears where expected in other gdb based debuggers such as Eclipse CDT.
+
+2012-07-20: kwwette
+ [Octave] segfault-on-exit prevention hack now preserves exit status, and uses C99 _Exit().
+
+2012-07-02: wsfulton
+ Fix Debian bug http://bugs.debian.org/672035, typemap copy failure - regression introduced
+ in swig-2.0.5:
+ %include
+ using std::pair;
+ %template(StrPair) pair;
+
+2012-07-02: wsfulton
+ Fix using declarations combined with using directives with forward class declarations so that
+ types are correctly found in scope for templates. Example:
+
+ namespace Outer2 {
+ namespace Space2 {
+ template class Thing2;
+ }
+ }
+ using namespace Outer2;
+ using Space2::Thing2;
+ template class Thing2 {};
+ // STILL BROKEN void useit2(Thing2 t) {}
+ void useit2a(Outer2::Space2::Thing2 t) {}
+ void useit2b(::Outer2::Space2::Thing2 t) {}
+ void useit2c(Space2::Thing2 t) {}
+ namespace Outer2 {
+ void useit2d(Space2::Thing2 t) {}
+ }
+
+ %template(Thing2Int) Thing2;
+
+
+2012-06-30: wsfulton
+ Fix template namespace problems for symbols declared with a forward class declarations, such as:
+
+ namespace Space1 {
+ namespace Space2 {
+ template struct YYY;
+ }
+ template struct Space2::YYY {
+ T yyy(T h) {
+ return h;
+ }
+ };
+ void testYYY1(Space1::Space2::YYY yy) {}
+ void testYYY2(Space2::YYY yy) {}
+ void testYYY3(::Space1::Space2::YYY yy) {}
+ }
+
+ %template(YYYInt) Space1::Space2::YYY;
+
+2012-06-30: wsfulton
+ Fix namespace problems for symbols declared with a forward class declarations, such as:
+
+ namespace Space1 {
+ namespace Space2 {
+ struct XXX;
+ struct YYY;
+ }
+
+ struct Space2::YYY {};
+ struct Space1::Space2::XXX {};
+
+ void testXXX2(Space2::XXX xx) {}
+ void testYYY2(Space2::YYY yy) {}
+ }
+
+ where xx and yy were not recognised as the proxy classes XXX and YYY.
+
+2012-06-30: wsfulton
+ Fix using declarations combined with using directives with forward class declarations so that
+ types are correctly found in scope.
+
+ namespace Outer2 {
+ namespace Space2 {
+ class Thing2;
+ }
+ }
+ using namespace Outer2;
+ using Space2::Thing2;
+ class Thing2 {};
+ // None of the methods below correctly used the Thing2 proxy class
+ void useit2(Thing2 t) {}
+ void useit2a(Outer2::Space2::Thing2 t) {}
+ void useit2b(::Outer2::Space2::Thing2 t) {}
+ void useit2c(Space2::Thing2 t) {}
+ namespace Outer2 {
+ void useit2d(Space2::Thing2 t) {}
+ }
+
+2012-06-25: wsfulton
+ Fix using declarations combined with using directives so that types are correctly found in scope.
+ Example:
+
+ namespace Outer2 {
+ namespace Space2 {
+ class Thing2 {};
+ }
+ }
+ using namespace Outer2; // using directive
+ using Space2::Thing2; // using declaration
+ void useit2(Thing2 t) {}
+
+ Similarly for templated classes.
+
+2012-05-29: wsfulton
+ Fix #3529601 - seg fault when a protected method has the "director"
+ feature but the parent class does not. Also fix similar problems with
+ the allprotected feature.
+
+2012-05-28: wsfulton
+ Fix seg fault when attempting to warn about an illegal destructor - #3530055, 3530078 and #3530118.
+
+Version 2.0.7 (26 May 2012)
+===========================
+2012-05-26: wsfulton
+ std::string typemap modifications so they can be used with %apply for other string
+ classes.
+
+2012-05-25: wsfulton
+ [Lua] Fixes for -external-runtime to work again.
+
+2012-05-22: szager
+ [python] Disambiguate SWIG_From_unsigned_SS_int and SWIG_From_unsigned_SS_long.
+
+2012-05-18: olly
+ [PHP] Fix getters for template members. (SF#3428833, SF#3528035)
+
+2012-05-14: wsfulton
+ Fix some language's std::map wrappers to recognise difference_type, size_type, key_type
+ and mapped_type.
+
+2012-05-14: kwwette (signed off by xavier98)
+ [Octave] Prevent Octave from seg-faulting at exit when SWIG
+ modules are loaded, due to bugs in Octave's cleanup code:
+ * Wrapping functions now declared with Octave DEFUN_DLD macro,
+ and loaded through Octave's dynamic module loader
+ * Global variables of swigref type are now assigned a new()
+ copy of the swigref class, to prevent double-free errors
+ * SWIG module at-exit cleanup function now created in Octave
+ through eval(), so not dependent on loaded .oct library
+ * For Octave versions 3.1.* to 3.3.*, register C-level at-exit
+ function which terminates Octave immediately (with correct
+ status code) without performing memory cleanup. This function
+ can be controlled with macros in Lib/octave/octruntime.swg
+
+ [Octave] New syntax for determing whether SWIG module should be
+ loaded globally or non-globally. To load module "example" globally,
+ type the module name
+ $ example;
+ as before; to load module non-globally, assign it to a variable:
+ $ example = example;
+ or
+ $ ex = example;
+ for a shorter (local) module name. -global/-noglobal command-line
+ options and module command line are deprecated. Added usage info
+ to module, so typing
+ $ help example
+ or incorrect usage should display proper usage, with examples.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2012-05-12: olly
+ [PHP] Fix memory leak in code generated for a callback. Patch from
+ SF bug #3510806.
+
+2012-05-12: olly
+ [PHP] Avoid using zend_error_noreturn() as it doesn't work with all
+ builds of PHP (SF bug #3166423). Instead we now wrap it in a
+ SWIG_FAIL() function which we annotate as "noreturn" for GCC to
+ avoids warnings. This also reduces the size of the compiled
+ wrapper (e.g. the stripped size is reduced by 6% for Xapian's PHP
+ bindings).
+
+2012-05-11: wsfulton
+ [Java] SF patch #3522855 Fix unintended uninitialised memory access in OUTPUT typemaps.
+
+2012-05-11: wsfulton
+ [Java] SF patch #3522674 Fix possible uninitialised memory access in char **STRING_OUT
+ typemap.
+
+2012-05-11: wsfulton
+ [Java] SF patch #3522611 Fix uninitialised size regression in char **STRING_ARRAY
+ introduced in swig-2.0.6.
+
+2012-05-11: wsfulton
+ SF bug #3525050 - Fix regression introduced in swig-2.0.5 whereby defining one typemap
+ method such as an 'out' typemap may hide another typemap method such as an 'in' typemap -
+ only occurs when the type is a template type where the template parameters are the same
+ via a typedef.
+
+2012-05-10: olly
+ [PHP] Fix the constant typemaps for SWIGTYPE, etc - previously
+ these used the wrong name for renamed constants. Add
+ autodoc_runme.php to the testsuite as a regression test for this.
+
+2012-05-02: ianlancetaylor
+ [Go] Remove compatibility support for gccgo 4.6. Using
+ SWIG with gccgo will now require gccgo 4.7. Using SWIG
+ with the more commonly used gc compiler is unaffected.
+
+2012-05-01: wsfulton
+ Fix generated code for C forward enum declarations in some languages.
+
+Version 2.0.6 (30 April 2012)
+=============================
+
+2012-04-25: wsfulton
+ [Lua] Fix uninitialised variable in SWIGTYPE **OUTPUT typemaps as reported by Jim Anderson.
+
+2012-04-28: wsfulton
+ [Python] Fix compilation errors when wrapping STL containers on Mac OSX and possibly other systems.
+
+2012-04-28: wsfulton
+ [Java] Patch 3521811 from Leo Davis - char **STRING_ARRAY typemaps fixed to handle
+ null pointers.
+
Version 2.0.5 (19 April 2012)
=============================
@@ -349,7 +1563,7 @@ Version 2.0.5 (19 April 2012)
namespace std {
template struct map {
class iterator;
- }
+ };
}
iterator was scoped as std::iterator, but now it is correctly std::map::iterator;
@@ -361,10 +1575,10 @@ Version 2.0.5 (19 April 2012)
template struct Map {
typedef Key key_type;
typedef T mapped_type;
- }
+ };
}
- tyepdef double DOUBLE;
- %typemap(MM) Std::Map;
+ typedef double DOUBLE;
+ %template(MM) Std::Map;
All symbols within Map will be resolved correctly, eg key_type and mapped_type no matter if the
wrapped code uses Std::Map or std::Map or Std::Map
@@ -2512,8 +3726,8 @@ Version 1.3.36 (24 June 2008)
Makefile target being generated when generating makefiles with the -M family
of options. For example:
- $ swig -java -MM -MT overiddenname -c++ example.i
- overiddenname: \
+ $ swig -java -MM -MT overriddenname -c++ example.i
+ overriddenname: \
example.i \
example.h
@@ -3199,7 +4413,7 @@ Version 1.3.32 (November 15, 2007)
[C#] Added missing support for C++ class member pointers.
08/09/2007: wsfulton
- [C#, Java] Add support for $owner in the "out" typemaps like in the the scripting
+ [C#, Java] Add support for $owner in the "out" typemaps like in the scripting
language modules. Note that $owner has always been supported in the "javaout" / "csout"
typemaps.
@@ -3899,7 +5113,7 @@ Version 1.3.30 (November 13, 2006)
10/12/2006: wsfulton
[Java] Remove potential race condition on the proxy class' delete() method
(it is now a synchronized method, but is now customisable by changing the
- methodmodifiers attribute in the the javadestruct or javadestruct_derived typemap)
+ methodmodifiers attribute in the javadestruct or javadestruct_derived typemap)
[C#] Remove potential race condition on the proxy class' Dispose() method,
similar to Java's delete() above.
@@ -4415,7 +5629,7 @@ Version 1.3.29 (March 21, 2006)
6146 _std_containers.so
174 _std_containers.so.hidden
- Excecution times:
+ Execution times:
real 0m0.050s user 0m0.039s sys 0m0.005s _std_containers.so
real 0m0.039s user 0m0.026s sys 0m0.007s _std_containers.so.hidden
@@ -4501,7 +5715,7 @@ Version 1.3.29 (March 21, 2006)
protected methods by default.
In previous releases, you needed to use the 'dirprot'
- option to acheive the same.
+ option to achieve the same.
If you want, you can disable the new default behaviour,
use the 'nodirprot' option:
@@ -4707,7 +5921,7 @@ Version 1.3.28 (February 12, 2006)
%naturalvar std::string;
%include
- that will tell swig to use the the 'natural' wrapping
+ that will tell swig to use the 'natural' wrapping
mechanism to all std::string global and member
variables.
@@ -4828,7 +6042,7 @@ Version 1.3.28 (February 12, 2006)
%rename("%(utitle)s",%$isfunction,%$ismember) "";
- to avoid clashings with other swig macros/directives.
+ to avoid clashes with other swig macros/directives.
01/14/2006: cfisavage
[Ruby]
@@ -8214,7 +9428,7 @@ Version 1.3.23 (November 11, 2004)
b = B()
b.bar(1)
- note the the methods are emitted inside the classes,
+ note the methods are emitted inside the classes,
and hence, the %template name refers to the 'member'
method name, not a global namespace name.
@@ -8756,7 +9970,7 @@ Version 1.3.23 (November 11, 2004)
- Remove the ability to share type information by using c linking.
All type sharing happens through a global variable in the target language.
+ Remove SWIG_NOIMPORT, SWIG_RUNTIME, and related defines.
- + Depreciate -runtime, -noruntime command line options
+ + Deprecate -runtime, -noruntime command line options
+ Update test-suite common.mk to correctly build multicpptest
+ Remove reference to precommon.swg
+ Update the guile_gh interface to share data by a global var instead
@@ -10931,7 +12145,7 @@ Version 1.3.20 (December 17, 2003)
11/30/2003: cheetah (William Fulton)
[Java] Fixed [ 766409 ] missing symbol SWIG_JavaThrowException during module load
- SWIGs internal functions are all static as there is no need for different SWIG
+ SWIG's internal functions are all static as there is no need for different SWIG
generated modules to share any code at runtime.
11/30/2003: beazley
@@ -11728,7 +12942,7 @@ Version 1.3.20 (December 17, 2003)
06/25/2003: mrose (Mark Rose)
[Python] Director typemap marshalling checks for null pointers when
walking the parameter list instead of relying soley on the parameter
- count. Cures a segfault that occured for multiple argument inv typemaps.
+ count. Cures a segfault that occurred for multiple argument inv typemaps.
Someone with more Swig experience should probably review this code.
06/24/2003: mkoeppe (Matthias Koeppe)
@@ -16162,7 +17376,7 @@ Version 1.3.12 (June 2, 2002)
%feature, %rename, %ignore, %exception, and related directives:
- Namespaces are fully integrated into the the renaming and declaration
+ Namespaces are fully integrated into the renaming and declaration
matcher. For example:
%rename(display) Foo::print; // Rename in namespace Foo
@@ -17203,7 +18417,7 @@ Version 1.3.10 (December 10, 2001)
shadow classes. In early implementations, shadow classes were
merely Python wrappers around typed pointer objects. However,
some users actually wanted to receive the shadow class object in C.
- To accomodate this, the dereferencing of the "this" pointer in
+ To accommodate this, the dereferencing of the "this" pointer in
a shadow class was moved to C as described in CHANGES [8/8/99].
However, the process of returning pointers to Python was still
somewhat problematic. Specifically, shadow classes never worked
@@ -19117,7 +20331,7 @@ Version 1.3.6 (July 9, 2001)
[Java] destructor (_delete()) was not aware of %name renaming
[Java] extends baseclass did not know about %name renaming
[Java] extends baseclass did extend even when the baseclass was not known to swig
- [Java] sometimes enum-declarations occured before the Java class declaration
+ [Java] sometimes enum-declarations occurred before the Java class declaration
[Java] unrelated enum initialisations no longer appear in Java class
[Java] if module ends in '_' correct JNI names are now produced
@@ -19998,9 +21212,9 @@ Version 1.3 Alpha 1 (February 11, 2000)
*** POTENTIAL INCOMPATIBILITY ***
1/30/00 : loic
- Conditionaly compile experimental code with --enable-experiment
+ Conditionally compile experimental code with --enable-experiment
configure flag.
- Fix .cvsignore to ignore configrue & yacc generated files
+ Fix .cvsignore to ignore configure & yacc generated files
1/28/00 : loic
Apply automake everywhere
@@ -20270,7 +21484,7 @@ Version 1.3 Alpha 1 (February 11, 2000)
names or use %apply to map typemaps to alternate names.
8/8/99 : Handling of the 'this' pointer has been changed in Python shadow
- classes. Previously, dereferencing of '.this' occured in the
+ classes. Previously, dereferencing of '.this' occurred in the
Python shadow class itself. Now, this step occurs in the C
wrappers using the following function:
@@ -20512,7 +21726,7 @@ Version 1.1 Patch 4 (January 4, 1998)
12/29/97: Fixed configure script and a few makefiles to support Python 1.5
12/29/97: Added 'embed15.i' library file. This file should be used to
- staticly link versions of Python 1.5. To make it the default,
+ statically link versions of Python 1.5. To make it the default,
simply copy 'swig_lib/python/embed15.i' to 'swig_lib/python/embed.i'
Version 1.1 Patch 3 (November 24, 1997)
@@ -20827,7 +22041,7 @@ Version 1.1 Patch 1 (August 27, 1997)
Would generate completely bogus code with garbage replacing
the '%d'. Caused by one faulty use of printf (wasn't able to find
- any other occurences).
+ any other occurrences).
7/7/97 : Fixed bug in Python shadow class generation with non-member
functions that are returning more than one value.
@@ -20943,7 +22157,7 @@ Version 1.1 (June 24, 1997)
.... later ...
int OldName(int);
- Unlike %name, %rename will rename any occurence of the old name.
+ Unlike %name, %rename will rename any occurrence of the old name.
This applies to functions, variables, class members and so forth.
There is no way to disable %rename once set, but you can change the
name by redeclaring it to something else.
diff --git a/CHANGES.current b/CHANGES.current
index cb64a7937..11682c9dd 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -2,16 +2,40 @@ Below are the changes for the current release.
See the CHANGES file for changes in older releases.
See the RELEASENOTES file for a summary of changes in each release.
-Version 2.0.6 (30 April 2012)
-=============================
+Version 3.0.1 (in progress)
+===========================
-2012-04-25: wsfulton
- [Lua] Fix uninitialised variable in SWIGTYPE **OUTPUT typemaps as reported by Jim Anderson.
+2014-04-08: wsfulton
+ SF Bug #1366 - Remove duplicate declarations of strtoimax and strtoumax in inttypes.i
-2012-04-28: wsfulton
- [Python] Fix compilation errors when wrapping STL containers on Mac OSX and possibly other systems.
+2014-04-08: wsfulton
+ [Java C#] Enums which have been ignored via %ignore and are subsequently
+ used are handled slightly differently. Type wrapper classes are now generated
+ which are effectively a wrapper of an empty enum. Previously in Java uncompilable
+ code was generated and in C# an int was used.
-2012-04-28: wsfulton
- [Java] Patch 3521811 from Leo Davis - char **STRING_ARRAY typemaps fixed to handle
- null pointers.
+2014-04-04: wsfulton
+ Fix regression in 3.0.0 where legal code following an operator<< definition might
+ give a syntax error. SF Bug #1365.
+2014-04-03: olly
+ [PHP] Fix wrapping director constructors with default parameters
+ with a ZTS-enabled build of PHP.
+
+2014-04-02: olly
+ [PHP] Pass the ZTS context we already have to avoid needing to
+ call TSRMLS_FETCH, which is relatively expensive.
+
+2014-04-02: olly
+ [PHP] Pass ZTS context through to t_output_helper() so it works
+ with a ZTS-enabled build of PHP. Reported by Pierre Labastie in
+ github PR#155.
+
+2014-03-28: wsfulton
+ [Java C# D Go] Fixes for C enums used in an API and the definition of the enum
+ has not been parsed. For D, this fixes a segfault in SWIG. The other languages
+ now produce code that compiles, although the definition of the enum is needed
+ in order to use the enum properly from the target language.
+
+2014-03-23: v-for-vandal
+ [Lua] Fix for usage of snprintf in Lua runtime which Visual Studio does not have.
diff --git a/COPYRIGHT b/COPYRIGHT
index dc61d89b4..188af4876 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -66,7 +66,7 @@ Past contributors include:
James Michael DuPont, Clark McGrew, Dustin Mitchell, Ian Cooke, Catalin Dumitrescu, Baran
Kovuk, Oleg Tolmatcev, Tal Shalif, Lluis Padro, Chris Seatory, Igor Bely, Robin Dunn,
Edward Zimmermann, David Ascher, Dominique Dumont, Pier Giorgio Esposito, Hasan Baran Kovuk,
- Klaus Wiederänders
+ Klaus Wiederänders, Richard Beare, Hans Oesterholt.
(See CHANGES and CHANGES.current and the bug tracker for a more complete list).
Past students:
diff --git a/Doc/Devel/cpp11.html b/Doc/Devel/cpp11.html
new file mode 100644
index 000000000..fc35465ae
--- /dev/null
+++ b/Doc/Devel/cpp11.html
@@ -0,0 +1,788 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
C++0x/C++11 support for SWIG
+
Summary
+
This is a technical overview of the C++0x/C++11 support for the Swig.
+This area of Swig is a work in progress. Initial C++0x/C++11 support for
+Swig was written during the Google Summer of Code 2009 period by
+Matevž Jekovec.
The Rvalues are used in practice to speed up the move operations
+on different containers.
+
In the following example, we want to swap the given elements:
+
template <class T> swap(T& a, T& b) {
+ T tmp(a); // now we have two copies of a
+ a = b; // now we have two copies of b
+ b = tmp; // now we have two copies of tmp (aka a)
+}
+This can now be solved using the new function std::move():
+
template <class T> swap(T& a, T& b) {
+ T tmp(std::move(a));
+ a = std::move(b);
+ b = std::move(tmp);
+}
+For the move function to take effect, user needs to reimplement the
+move constructor (taking ClassType&& as an argument) and
+operator=(ClassType&&):
In C++11 you can define functions as constant expressions.
+Functions need to return constant value in form "return expr",
+where expr is a constant expression.
+
+
A keyword "constexpr" is introduced for this. eg.:
+constexpr int getNumber() { return 5; } const int MY_CONSTANT =
+getNumber();
+
+
Constants are treated as normal variables in interpreted languages
+because they are not compiled into the executable. Java "final"
+constants are defined runtime as well. C++ constants need to be
+declared in the header file and defined in the implementation file,
+so swig doesn't need to know about the constant values when parsing
+the header file.
+
+
Done: Added the “constexpr “ keyword to Swig. Added testcase
+cpp11_constexpr. R11322
+
Problem: No compilers were known to support constexpr yet, so the
+testcase was temporarily commented out in common.mk.
+
+
Extern template [done]
+
Extern template forces the GCC compiler to not instantiate the
+template in the translation unit at that time. It's a feature
+specifically aimed at compilers to speed up the compilation process.
+
+
Done: Added support for 'extern template class
+std::vector<MyClass>;'. Added testcase cpp11_template_explicit.
+R11385 , R11386
+
Initializer lists [done]
+
Initializer list is a new type in standard library:
+std::initializer_list<T>. New symbols {} are introduced for the
+initializer lists.
+
+
One can now use:
+
+
class A {
+ public:
+ A( std::initializer_list<int> );
+ };
+ A a1 = {1,2,3,4};
+Languages like Java, C# and Python already support direct creation of
+lists natively.
+
Problem: initializer_list cannot be treated as an ordinary list.
+The constructor containing initializer_list can only be accessed by
+assigning the value using the {} brackets. I also don't think there
+is a simple way to convert an ordinary list or a vector to the
+initializer_list.
+
Done: Ignored the constructor having initializer_list as its
+argument. Show warning to the user. Added testcase
+cpp11_initializer_list. R11450
+The new way of using uniform initialization allows the following:
+
struct BasicStruct {
+ int x;
+ double y;
+};
+
+struct AltStruct {
+ AltStruct(int x, double y) : x_{x}, y_{y} {}
+
+private:
+ int x_;
+ double y_;
+};
+
+BasicStruct var1{5, 3.2}; // only fills the struct components
+AltStruct var2{2, 4.3}; // calls the constructor
+The new syntax is specific to C++. Java, C# and scripting languages
+do not support this behaviour, but always need constructors. They
+support {} brackets for declaration of arrays as C does + they add
+support for creation of arrays on-the-fly (what C++11 introduced with
+this feature and more).
+
Done: Added syntax for {} member initialization in class
+constructor. Added testcase cpp11_uniform_initialization. R11413
+
Type inference [partially done]
+
A new keyword 'auto' is introduced in C++11:
+
auto a1 = 100;
+auto a2 = myFunc();
+The type of a1 and a2 is automatically determined according to the
+initialization value during the semantic phase of the compiler.
+
Another macro 'decltype()' is introduced. The macro takes the
+concrete object as an argument and returns its type. User could use
+this as:
+
int i = 100;
+decltype(i) j = 200; // decltype(i) = int
+Calling operators are allowed as well:
+
decltype(i+j) k = 300;
+Done: Added support for decltype() syntax. Test cases for normal
+decltype members and alternate function members work fine. Currently
+only syntax in form decltype(variable name) work. No support for
+custom expresions eg. decltype(i+j) yet. R11525
+
TODO: William proposed to support the hidden variables as well
+(ones not parsed by Swig and added to symbol table). This also allows
+Swig to parse custom expressions like decltype(i+j). The idea is to
+introduce a new SwigType for this.
+
Range-based for-loop [ignored]
+
This feature is always present inside the implementation block
+only.
+
+
Lambda functions and expressions [done]
+
C++11 introduces lambda functions defined as:
+
[](int x, int y) -> int { return x + y; }
+If the lambda function contains a single return statement only or the
+function doesn't return any type, the return type '->' can be
+omitted. Lambda functions are function objects.
+
The following example prints the number of items stored in a list:
+Parameters inside the [] are the visible parameters of the lambda
+functions. These can be & (references), = (copies), variable name
+(variable copy), &variable name (variable reference) or this
+(copy of the current object).
+
Lambda functions can be stored using:
+
auto myLambdaFunc = [this]() { this->SomePrivateMemberFunction() };
+Proposal: Lambda functions are most commonly used inside the function
+block to quickly define how the sort, find and similar functions
+should work (the other way would be overriding a class – the Java
+style). The latest GCC does not support lambda functions yet so it is
+difficult to test the feature once implemented. I would implement the
+syntax support for this feature, but produce no wrapper code. Lambda
+functions still work inside the function block though.
Done: Added syntax support for the lambda functions. Added
+testcase cpp11_lambda_functions.i. R11491, R11492
+
Alternate function syntax [done]
+
The problem with decltype() is that the parameters need to be
+defined before the decltype. The following syntax is not valid,
+because lhs and rhs hasn't been defined at the time of decltype:
+The new syntax only makes the job for the C++ compilers easier when
+parsing such functions. The new syntax can be used for ordinary
+functions as well:
+
struct SomeStruct {
+ auto FuncName(int x, int y) -> int;
+};
+
+auto SomeStruct::FuncName(int x, int y) -> int {
+ return x + y;
+}
+Done: Added support for the 'auto' return type. Added support for the
+'-> type' after the funtion declaration. Added testcases
+cpp11_alternate_function_syntax.i and
+cpp11_alternate_function_syntax_runme.py. R11414
+
Concepts, Axioms [ignored]
+
In C++ there is a common problem when you use a template in the
+class which doesn't support all the operations the functions in the
+class actually do on the type. Compiler errors are usually very long
+and unreadable. C++11 adds support for the "concepts". The
+idea is to define what operations and attributes should the template
+have. In contrast to class inheritance and polimorphism, all lookups
+are done in compile-time.
+
+
Basic syntax (note LessThanComparable?
+instead of "class" or "typename"):
+
+
template<LessThanComparable? T>
+ const T& min(const T &x, const T &y) {
+ return y < x ? y : x;
+ }
+Extended syntax (requires conditions are separated with &&,
+|| or !):
+
+
template< typename T> requires LessThanComparable?<T>
+ const T& min(const T &x, const T &y) {
+ return y < x ? y : x;
+ }
+Axioms are a facility pertaining to concepts supplied by C++11 to
+express the semantic properties of concepts. For example, the concept
+Semigroup can be defined with an axiom Associativity as:
+
+
concept Semigroup< typename Op, typename T> : CopyConstructible?<T> {
+ T operator()(Op, T, T);
+ axiom Associativity(Op op, T x, T y, T z) {
+ op(x, op(y, z)) == op(op(x, y), z);
+ }
+ };
+Axioms are more like hints to the compiler to speed-up the process of
+compilation.
+
+
Ignored: Concepts and axioms were removed from the C++11 standard.
+
+
Object construction improvement [done]
+
This feature allows classes constructors to call other
+constructors with different arguments (similar to Java and C#
+behaviour).
+
+Also when using the inheritance, the feature introduces inheritance
+of all superclass constructors without being defined separately in
+the inherited class:
+
+
class BaseClass {
+ public:
+ BaseClass(int iValue);
+ };
+ class DerivedClass: public BaseClass {
+ public:
+ using BaseClass::BaseClass; // Adds DerivedClass(int) constructor
+ };
+Swig already correctly parses and produces the correct wrapper for
+the “using” keyword.
+
Done: Added testcase cpp11_constructors.i which covers both
+constructor delegation and constructor inheritance. R11532
+
Problem: Constructor delegation and constructor inheritance is not
+supported by any compiler yet, so it's impossible to try and test
+this feature.
+
Null pointer constant [done]
+
nullptr is part of the standard library.
+
+
It's defined as typedef decltype(nullptr) nullptr_t;
+
+
nullptr_t is defined in <cstddef>.
+
+
As far as the C++ is compatible with 0 as the pointer value, swig
+values will work for the C++. And the other way around, nullptr
+behaves as the ordinary pointer (false, if empty, true, if not
+empty), so it's ok for swig to compare it.
+
Done: Written a testcase cpp11_null_pointer_constant.i and
+cpp11_null_pointer_constant_runme.py to prove the nullptr
+functionality. R11484
+
Strongly typed enumerations [partially done]
+
C++11 introduces a new syntax for strongly typed enum declaration:
+
+Typing if (Val4 == 101) will result in compilation error.
+
+
The enum itself can now be explicitely of type int, long, unsigned
+int etc.:
+
+
enum class Enum2 : unsigned int {Val1, Val2};
+And it can be forward declared as well:
+
+
enum Enum1; //Illegal in C++ and C++11; no size is explicitly specified.
+ enum Enum2 : unsigned int; //Legal in C++11.
+ enum class Enum3; //Legal in C++11, because enum class declarations have a default type of "int".
+ enum class Enum4: unsigned int; //Legal C++11.
+ enum Enum2 : unsigned short; //Illegal in C++11, because Enum2 was previously declared with a different type.
+Done: Added syntax 'enum class Name' and forward declarators 'enum
+Name : inherited type' or 'enum class Name : inherited type' in
+R11449.
+
TODO: Add semantic support for enum elements not clashing with
+enum elements in other enum classes. See cpp11_strongly_typed_enums.i
+warnings.
+
Problem: Swig currently doesn't support nested classes. This
+feature should be implemented using a new nested class when using
+“enum class” with a single anonymous “enum {elements}”
+element inside. For example:
+Here we created a new wrapper TypedefName taking one template
+argument <second> which creates a type SomeType<OtherType,
+second, 5>. OtherType and 5 are predefined here and hidden from
+the user – the user only uses TypedefName type.
+
The same goes for the following example:
+
typedef void (*PFD)(double); // Old style
+using PF = void (*)(double); // New introduced syntax
+Swig supports parsing typedefs for templates as well for example:
+
typedef List<int> intList;
+Done: Expanded support for the new 'using' syntax and template
+aliasing. Added testcase cpp11_template_typedefs. R11533
+
TODO: Make Swig aware of the newly defined typedef. The TYPEDEF
+keyword is part of the storage_class rule and type+declarator (see
+c_decl rule) is the right part of the definition – for example void
+(*PFD)(double) cannot be transformed to void *(double) easily. To
+fully support the new 'using' form, we'll probably have to change the
+type, type_right rules and declarator, direct_declarator,
+notso_direct_declarator etc., which is PITA.
+
Unrestricted unions [done]
+
C++ currently offers usage of unions for types with trivial
+constructors only. The new C++11 standard allows usage of types with
+non-trivial constructors as well:
+
struct point {
+ point() {}
+ point(int x, int y): x_(x), y_(y) {}
+ int x_, y_;
+ };
+ union P {
+ int z;
+ double w;
+ point p; // Illegal in C++; point has a non-trivial constructor. However, this is legal in C++11.
+ } p1;
Problem: GCC doesn't support unrestricted unions yet so there is
+no way to actually test, if it works.
+
Variadic templates [partially done]
+
The new C++11 offers the following syntax:
+
template<typename... Values> class tuple;
+This can be used for example:
+
class tuple<int, std::vector<int>, std::map<std::string, std::vector<int>>> someInstanceName;
+The ... is used in two cases. One is in the template header where it
+marks on the left the keywords 'typename' or 'class' and a type name
+on the right. The second case is usually in the function block to
+decompose typename on the left of the ... . For example:
+
void printf(const char *s) {
+ while (*s) {
+ if (*s == '%' && *(++s) != '%')
+ throw std::runtime_error("invalid format string: missing arguments");
+ std::cout << *s++;
+ }
+}
+
+template<typename T, typename... Args>
+void printf(const char* s, T value, Args... args) { // recursive action – split previous args to value + args
+ while (*s) {
+ if (*s == '%' && *(++s) != '%') {
+ std::cout << value;
+ printf(*s ? ++s : s, args...); // call even when *s == 0 to detect extra arguments
+ return;
+ }
+ std::cout << *s++;
+ }
+ throw std::logic_error("extra arguments provided to printf");
+}
+The tricky part is that variadic templates can unpack actually
+anywhere – including the class inheritance :(
+
template <typename... BaseClasses> class ClassName : public BaseClasses... {
+public:
+
+ ClassName (BaseClasses&&... baseClasses) : BaseClasses(baseClasses)... {}
+}
+A new extension to sizeof is also introduced with this feature. The
+... after sizeof returns number of arguments:
+
template<typename ...Args> struct SomeStruct {
+ static const int size = sizeof...(Args);
+}
+// SomeStruct<Type1, Type2>::size is 2 and SomeStruct<>::size is 0
+Done: Added syntax support for 'typename' or 'class' + ... + id.
+Added testcase cpp11_variadic_templates. R11458
+
Done: Added syntax support for BaseClass + ..., type + ... + id in
+parameters and baseclass + ... for intializers after constructor.
+Extended Swig syntax to support sizeof...(Args). R11467
+
Done: Fixed %template to support variadic number of templates.
+
TODO: Only (if present) first variadically defined argument is
+currently used in %template directive. The next ones are ignored.
+
New string literals [partially done]
+
Beside the implementation, the new C++11 Unicode and custom
+delimeter constants can occur in templates in the header file.
+
+
Done: Added symbols 'u', 'u8' and 'U' to mark the beginning of the
+UTF string. Also added test case cpp11_raw_string_literals. R11327
+
Done: Added R"DELIMITER[, ]DELIMITER" for a custom
+delimiter for the beginning/end of the string. R11328
+
TODO: Fix the Swig's C++ preprocessor bug when parsing an odd
+number of “ inside the string brackets. See
+Source/Preprocessor/cpp.c.
+
User-defined literals [partially done]
+
C++ has different suffix literals. eg. 12.5f marks the number 12.5
+as float.
+
+
C++11 allows user to define his own suffix for the strings always
+starting with the underscore (_). eg. int a = "hello"_mySuffix;
+
+
The syntax is similar to other operator overloading functions:
+
+The null terminated const char* is the string between the "".
+The _mySuffix is the name of the suffix operator. And the OutputType
+is the outputType the operator returns.
+
+This instantiates the literal processing function as
+operator""_Suffix<'1', '2', '3', '4'>. In this form,
+there is no terminating null character to the string. The main
+purpose to doing this is to use C++11's constexpr keyword and the
+compiler to allow the literal to be transformed entirely at compile
+time, assuming OutputType is a constexpr-constructable and copyable
+type, and the literal processing function is a constexpr function.
Done: Added syntax support for userdefined literals. Added
+testcase cpp11_userdefined_literals.i. R11494
+
TODO: %rename doesn't parse operator”” yet.
+
Thread-local storage [done]
+
+
New C++11 introduces keyword "thread_local" which marks
+the following variable dynamically located depending on the current
+thread when using the address-of (&) operator.
+
+
Syntax:
+
+
struct A {
+ thread_local int val;
+ };
+Done: Add "thread_local" keyword to Swig. Added testcase
+cpp11_thread_local. R11393
+
Defaulting/deleting of standard functions on C++ objects [done]
+
C++ automatically creates default constructor with empty
+parameters, copy constructor, operator= and destructor for any class.
+Sometimes user wants to explicitly remove one of them or enable them
+(eg. default constructor with empty parameters doesn't work any more,
+if any other constructor is defined).
+
+
Words "default" and "delete" are introduced.
+The syntax is similar to declaration of pure virtual function:
+
+Ignored: Swig already parses the keywords "= delete" and "=
+default". These keywords are used for built-in functions (copy
+constructor, operator= etc.), which are ignored by Swig anyway.
+
Done: Added testcase cpp11_default_delete. R11535
+
Type long long int [done]
+
Type long long int is an integer type that has at least 64 useful
+bits. C99 added it to its standard, but the C++ didn't adopt it until
+C++11. Most C++ compilers supported it though.
+
+
Done: Swig already parses the C code including the long long type.
+
+
Static assertions [done]
+
static_assert() can be used at class scope as well eg.:
+
+Ignored: No changes to the language itself is made.
+
+
Tuple types [TODO]
+
Tuple is array of various types. C++11 introduced this feature
+using variadic templates. Tuple is defined as:
+
template <class ...Types> class tuple;
+Constructor is automatically generated filling the tuple elements.
+get<X> function is introduced to get the Xth element in the
+tuple.
+
typedef tuple< int, double, long &, const char * > test_tuple ;
+long lengthy = 12 ;
+test_tuple proof( 18, 6.5, lengthy, "Ciao!" ) ;
+lengthy = get<0>(proof) ; // Assign to 'lengthy' the value 18.
+get<3>(proof) = " Beautiful!" ; // Modify the tuple’s fourth element.
+Tuples can be copied to each other, if all the elements are copiable:
+
typedef tuple< int , double, string > tuple_1 t1 ;
+typedef tuple< char, short , const char * > tuple_2 t2( 'X', 2, "Hola!" ) ;
+t1 = t2 ; // Ok, first two elements can be converted,
+ // the third one can be constructed from a 'const char *'.
+TODO: Implement wrappers for the tuplet<> class.
+
Hash tables [TODO]
+
C++11 introduces the "unordered" version of existing
+types, which in practice work faster than the linear types:
+
+Swig should use the "unordered" types exactly the same as
+the original linear types.
+
Problem: Unordered types do not contain exactly same members as
+ordered ones (eg. _Hashtable_iterator does not offer operator--() and
+constructor with compare function which is required). So simply
+aliasing unordered classes to ordered ones doesn't work.
+
TODO: Implement wrappers for unordered_ types. Initial work is
+already done in Lib/std/unordered_*.i files.
+
Regular expressions [ignored]
+
Two new classes are introduced in C++11: basic_regex and
+match_results. Both are defined in regex header file.
+
+
Ignored: The new feature extends the standardy library only. No
+changes to Swig needed.
+
+
General-purpose smart pointers [done]
+
This feature deprecates auto_ptr and adds shared_ptr, weak_ptr and
+unique_ptr to the standard library.
+
+
This feature only adds the smart pointers to the standard library
+and doesn't effect the C++ syntax.
+
Done: Added test case which uses all three smart pointers in the
+class. R11394
+
Problem: GCC standard library doesn't contain the new smart
+pointers yet.
+
+
Extensible random number facility [ignored]
+
This feature standardize the pseudo random number algorithm
+(currently, the random number generator was dependent on the
+platform/compiler). It adds functions linear_congruential,
+subtract_with_carry and mersenne_twister and symbols
+uniform_int_distribution, bernoulli_distribution,
+geometric_distribution, poisson_distribution, binomial_distribution,
+uniform_real_distribution, exponential_distribution,
+normal_distribution and gamma_distribution to the standard library.
+
+
Ignored: The new feature extends the standardy library only. No
+changes to Swig needed.
+
+
Wrapper reference [ignored]
+
This feature adds ref and cref classes to the standard library
+(#include <utility>) usually used in tempalte functions.
+
+
Ignored: The new feature extends the standardy library only. No
+changes to Swig needed.
+
+
Polymorphous wrappers for function objects [done]
+
Two features are introduced:
+
+
+
The function template wrapper:
+
+
+
function<int ( int, int )> pF;
+
+
and the function object:
+
+
+
struct Test {
+ bool operator()( short x, short y );
+ };
+Swig already supports the two.
+
Done: Added a runtime testcase for function objects
+cpp11_function_objects. R11419.
+
Type traits for metaprogramming [ignored]
+
C++11 adds a new header file <type_traits> which includes
+helper functions to determine the template type while initializing
+the object at compile time.
+
+
Swig already supports the following code:
+
+
template< int B, int N >
+ struct Pow {
+ // recursive call and recombination.
+ enum{ value = B*Pow< B, N-1 >::value };
+ };
+ template< int B > struct Pow< B, 0 > // N == 0 condition of termination.
+ {
+ enum{ value = 1 };
+ };
+ int quartic_of_three = Pow< 3, 4 >::value ;
+Functions is_convertible, is_integral, is_integral_const etc. are
+part of the new header:
+
+
// First way of operating.
+template< bool B > struct algorithm {
+ template< class T1, class T2 > int do_it( T1 &, T2 & ) { /*...*/ }
+};
+// Second way of operating.
+template<> struct algorithm<true> {
+ template< class T1, class T2 > int do_it( T1, T2 ) { /*...*/ }
+};
+// Instantiating 'elaborate' will automatically instantiate the correct way to operate.
+template< class T1, class T2 > int elaborate( T1 A, T2 B ) {
+ // Use the second way only if 'T1' is an integer and if 'T2' is
+ // in floating point, otherwise use the first way.
+ return algorithm< is_integral<T1>::value && is_floating_point<T2>::value >::do_it( A, B );
+}
+Swig correctly parses the syntax for template<bool>,
+template<class T> and template<>.
+
+
Ignored: Swig requires explicitly defined template class
+(%template directive) to export it to the target language.
+
Uniform method for computing return type of function objects
+[partially done]
+
The template function is introduced: std::result_of() which
+depends on decltype:
+
-Use svn tag to declare some set of file revisions as related in some
+Use git tag to declare some set of file revisions as related in some
symbolic way. This eases reference, retrieval and manipulation of these files
later. At the moment (2001/01/16 14:02:53), the conventions are very simple;
let's hope they stay that way!
@@ -390,10 +382,10 @@ let's hope they stay that way!
There are two types of tags, internal (aka personal) and external.
Internal tags are used by SWIG developers primarily, whereas external
-tags are used when communicating with people w/ anonymous svn access.
+tags are used when communicating with people w/ anonymous git access.
Internal tags should start with the developer name and a hyphen.
-
External tags should start with "v-".
+
External tags should start with "rel-".
That's all there is to it. Some example tags:
@@ -402,10 +394,8 @@ That's all there is to it. Some example tags:
@@ -346,7 +347,7 @@ Delete(a); /* Destroy a */
All objects are referenced counted and given a reference count of 1 when initially created. The
Delete() function only destroys an object when the reference count reaches zero. When
-an object is placed in a list or hash table, it's reference count is automatically increased. For example:
+an object is placed in a list or hash table, its reference count is automatically increased. For example:
@@ -843,7 +844,7 @@ Returns a type object corresponding to the type string produced by the Swig_cloc
char *Swig_clocal_deref(DataType *t, char *name)
This function is the inverse of the clocal() function. Given a type and a name,
it produces a string containing the code needed to cast/convert the type produced by
-Swig_clocal() back into it's original type.
+Swig_clocal() back into its original type.
+The DOH objects are reference counted and use pools for memory allocation.
+The implementation is in memory.c. When there are memory corruption problems,
+various memory allocator tools are normally used to diagnose problems. These can be used
+on SWIG and can be very useful. However, they won't necessarily find use of stale DOH objects,
+that is, DOH objects
+that are used after they have been deleted. This is because the DOH memory allocator
+grabs a chunk of memory from the C memory allocator and manages the usage internally.
+Stale DOH object usage can be checked for by defining DOH_DEBUG_MEMORY_POOLS in
+memory.c. If an attempt to use an object is made after the reference count is
+zero, an assertion is triggered instead of quietly re-using the stale object...
+
+This can be memory intensive as previously used memory in the pool is not re-used so is
+only recommended for diagnosing memory corruption problems.
+
+
Copyright (C) 1999-2010 SWIG Development Team.
diff --git a/Doc/Devel/tree.html b/Doc/Devel/tree.html
index db3c6fee4..73a49ed55 100644
--- a/Doc/Devel/tree.html
+++ b/Doc/Devel/tree.html
@@ -185,7 +185,7 @@ this function merely records that those attributes did not exist in the original
This function is similar to Swig_save() except that adds additional attribute checking. There are different interpretations
of the attribute names. A name of "attr" merely requests that the function check for the presence of an attribute. If the attribute is missing, SWIG will exit with a failed assertion. An attribute name of "?attr" specifies that the attribute "attr" is optional and
-that it's old value must be saved (if any). An attribute name of "*attr" specifies that the attribute is required and that
+that its old value must be saved (if any). An attribute name of "*attr" specifies that the attribute is required and that
its value must be saved. The saving of attributes is performed in the same manner as with Swig_save(). Here is an example:
@@ -135,10 +135,10 @@ be unhappy to see some enterprising folk use this work to add
to it.
-
17.1 Basics
+
18.1 Basics
-
17.1.1 Running SWIG
+
18.1.1 Running SWIG
@@ -360,7 +360,7 @@ need to link in the Allegro shared library. The library you create from
the C++ wrapper will be what you then load into Allegro CL.
@@ -606,7 +606,7 @@ char *xxx();
this function can be manipulated via the lout typemap.
-
17.2.5 Overloaded Defuns
+
18.2.5 Overloaded Defuns
@@ -622,7 +622,7 @@ char *xxx();
can be manipulated via the lout typemap.
-
17.2.6 What about constant and variable access?
+
18.2.6 What about constant and variable access?
@@ -635,7 +635,7 @@ char *xxx();
into the foreign module.
-
17.2.7 Object Wrapping
+
18.2.7 Object Wrapping
@@ -657,7 +657,7 @@ char *xxx();
foreign function interface.
-
17.3 Wrapping Details
+
18.3 Wrapping Details
@@ -665,7 +665,7 @@ char *xxx();
translated into lisp.
-
17.3.1 Namespaces
+
18.3.1 Namespaces
@@ -742,13 +742,13 @@ namespace car {
function such as (car '(1 2 3).
-
17.3.2 Constants
+
18.3.2 Constants
Constants, as declared by the preprocessor #define macro or SWIG
- %constant directive, are included in SWIGs parse tree
+ %constant directive, are included in SWIG's parse tree
when it can be determined that they are, or could be reduced to,
a literal value. Such values are translated into defconstant
forms in the generated lisp wrapper when the -nocwrap command-line
@@ -803,7 +803,7 @@ namespace car {
not use the -nocwrap command-line option.
In C, an enumeration value is an integer value, while in C++ an
enumeration value is implicitly convertible to an integer value,
- but can also be distinguished by it's enum type. For each enum
+ but can also be distinguished by its enum type. For each enum
declaration a def-foreign-type is generated, assigning the enum
a default type of :int. Users may adjust the foreign type of
enums via SWIG typemaps.
@@ -901,7 +901,7 @@ globalvar> (globalvar.nnn::glob_float)
of it not being necessary to probe into foreign space to retrieve enum
values. When generating a .cxx wrapper file, a more general solution is
employed. A wrapper variable is created in the module_wrap.cxx file, and
- a ff:def-foreign-variable call is generated to retrieve it's value into lisp.
+ a ff:def-foreign-variable call is generated to retrieve its value into lisp.
For example, the following header file
@@ -957,7 +957,7 @@ EXPORT const int ACL_ENUM___FOO3__SWIG_0 = FOO3;
-
17.3.5 Arrays
+
18.3.5 Arrays
@@ -1105,10 +1105,10 @@ namespace BAR {
-
17.3.6 Classes and Structs and Unions (oh my!)
+
18.3.6 Classes and Structs and Unions (oh my!)
-
17.3.6.1 CLOS wrapping of
+
18.3.6.1 CLOS wrapping of
@@ -1118,12 +1118,12 @@ namespace BAR {
function that returns an object (or pointer/reference) of C/C++
type X, the wrapping defun (or defmethod) on the Lisp
side will automatically wrap the pointer returned in an instance
- of the apropriate class. This makes it much easier to write and
+ of the appropriate class. This makes it much easier to write and
debug code than if pointers were passed around as a jumble of
integer values.
-
17.3.6.2 CLOS Inheritance
+
18.3.6.2 CLOS Inheritance
@@ -1131,12 +1131,12 @@ namespace BAR {
inheritance of the classes in foreign code, with the
ff:foreign-pointer class at its root. ff:foreign-pointer is a thin
wrapper for pointers that is made available by the foreign function
- interface. It's key benefit is that it may be passed as an argument
+ interface. Its key benefit is that it may be passed as an argument
to any ff:def-foreign-call that is expecting a pointer as the
parameter.
-
17.3.6.3 Member fields and functions
+
18.3.6.3 Member fields and functions
@@ -1152,7 +1152,7 @@ namespace BAR {
the interface does nothing for friend directives,
-
17.3.6.4 Why not directly access C++ classes using foreign types?
+
18.3.6.4 Why not directly access C++ classes using foreign types?
@@ -1170,11 +1170,11 @@ namespace BAR {
use the more robust wrapper functions.
-
17.3.7 Templates
+
18.3.7 Templates
-
17.3.7.1 Generating wrapper code for templates
+
18.3.7.1 Generating wrapper code for templates
@@ -1187,7 +1187,7 @@ namespace BAR {
directive.
-
17.3.7.2 Implicit Template instantiation
+
18.3.7.2 Implicit Template instantiation
@@ -1197,7 +1197,7 @@ namespace BAR {
class schema.
-
17.3.8 Typedef, Templates, and Synonym Types
+
18.3.8 Typedef, Templates, and Synonym Types
@@ -1277,7 +1277,7 @@ synonym>
-
17.3.8.1 Choosing a primary type
+
18.3.8.1 Choosing a primary type
@@ -1298,7 +1298,7 @@ synonym>
-
17.3.9 Function overloading/Parameter defaulting
+
18.3.9 Function overloading/Parameter defaulting
@@ -1461,7 +1461,7 @@ overload>
-
17.3.10 Operator wrapping and Operator overloading
+
18.3.10 Operator wrapping and Operator overloading
@@ -1607,28 +1607,28 @@ opoverload>
-
17.3.11 Varargs
+
18.3.11 Varargs
Variable length argument lists are not supported, by default. If
such a function is encountered, a warning will generated to
- stderr. Varargs are supported via the SWIG %vararg
+ stderr. Varargs are supported via the SWIG %varargs
directive. This directive allows you to specify a (finite)
argument list which will be inserted into the wrapper in place
of the variable length argument indicator. As an example,
- consider the function printf(). It's declaration would
+ consider the function printf(). Its declaration would
appear as follows:
See the following section
on Variable Length arguments
- provides examples on how %vararg can be used, along
+ provides examples on how %varargs can be used, along
with other ways such functions can be wrapped.
-
17.3.12 C++ Exceptions
+
18.3.12 C++ Exceptions
@@ -1640,7 +1640,7 @@ opoverload>
implemented.
-
17.3.13 Pass by value, pass by reference
+
18.3.13 Pass by value, pass by reference
@@ -1652,7 +1652,7 @@ opoverload>
newly defined types.
-
17.4 Typemaps
+
18.4 Typemaps
@@ -1663,7 +1663,7 @@ opoverload>
on Typemaps for more information.
The out typemap is used to generate code to form the
return value of the wrapper from the return value of the wrapped
function. This code is placed in the <convert and bind result to lresult>
- section of the above code diagram. It's default mapping is as follows:
+ section of the above code diagram. Its default mapping is as follows:
This typemap is not used for code generation, but purely for the
transformation of types in the parameter list of the wrapper function.
- It's primary use is to handle by-value to by-reference conversion in the
+ Its primary use is to handle by-value to by-reference conversion in the
wrappers parameter list. Its default settings are:
@@ -1784,7 +1784,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
these common typemaps here.
The :type keyword argument provides more information on the type of
-identifier. It's value is a symbol. This allows the
+identifier. Its value is a symbol. This allows the
identifier-converter to apply different heuristics when mapping
different types of identifiers to symbols. SWIG will generate calls
to your identifier-converter using the following types.
@@ -2123,12 +2123,12 @@ scope in the specified class.
The :arity keyword argument only appears in swig:swig-defmethod forms
-generated for overloaded functions. It's value is an integer
+generated for overloaded functions. Its value is an integer
indicating the number of arguments passed to the routine indicated by
this identifier.
-
17.5.4 Instructing SWIG to use a particular identifier-converter
+
18.5.4 Instructing SWIG to use a particular identifier-converter
@@ -28,7 +30,7 @@ This chapter describes SWIG's support of Android.
-
18.1 Overview
+
19.1 Overview
@@ -38,14 +40,14 @@ Everything in the Java chapter applies to generating cod
This chapter contains a few Android specific notes and examples.
-
18.2 Android examples
+
19.2 Android examples
-
18.2.1 Examples introduction
+
19.2.1 Examples introduction
-The examples require the the Android SDK and Android NDK which can be installed as per instructions in the links.
+The examples require the Android SDK and Android NDK which can be installed as per instructions in the links.
The Eclipse version is not required for these examples as just the command line tools are used (shown for Linux as the host, but Windows will be very similar, if not identical in most places).
Add the SDK tools and NDK tools to your path and create a directory somewhere for your Android projects (adjust PATH as necessary to where you installed the tools):
@@ -74,7 +76,7 @@ $ android list targets
The following examples are shipped with SWIG under the Examples/android directory and include a Makefile to build and install each example.
-
18.2.2 Simple C example
+
19.2.2 Simple C example
@@ -396,7 +398,7 @@ Run the app again and this time you will see the output pictured below, showing
+The Examples/android directory contains further examples which can be run and installed in a similar manner to the previous two examples.
+
+
+
+Note that the 'extend' example is demonstrates the directors feature.
+Normally C++ exception handling and the STL is not available by default in the version of g++ shipped with Android, but this example turns these features on as described in the next section.
+
+
+
19.3 C++ STL
+
+
+
+Should the C++ Standard Template Library (STL) be required, an Application.mk file needs to be created
+in the same directory as the Android.mk directory containing information about the STL to use.
+See the NDK documentation in the $NDKROOT/docs folder especially CPLUSPLUS-SUPPORT.html.
+Below is an example of the Application.mk file to make the STLport static library available for use:
+