diff --git a/.gitignore b/.gitignore
index e94087e29..d2e6b841f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,6 +66,7 @@ CCache/ccache_swig_config.h
CCache/config.h
CCache/config.log
CCache/config.status
+CCache/config_win32.h
Examples/Makefile
Examples/d/example.mk
Examples/guile/Makefile
@@ -85,6 +86,8 @@ swig.spec
# Build Artifacts
.dirstamp
CCache/ccache-swig
+CCache/ccache-swig.1
+CCache/web/ccache-swig-man.html
Lib/swigwarn.swg
Source/CParse/parser.c
Source/CParse/parser.h
diff --git a/.travis.yml b/.travis.yml
index 27237815d..a82b2bc47 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,9 +6,6 @@ matrix:
env: SWIGLANG=
sudo: required
dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=
- compiler: gcc
os: linux
env: SWIGLANG=
@@ -55,6 +52,8 @@ matrix:
- compiler: gcc
os: linux
env: SWIGLANG=javascript ENGINE=node
+ sudo: required
+ dist: trusty
- compiler: gcc
os: linux
env: SWIGLANG=javascript ENGINE=jsc
@@ -75,6 +74,11 @@ matrix:
env: SWIGLANG=lua VER=5.3
sudo: required
dist: trusty
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ocaml
+ sudo: required
+ dist: trusty
- compiler: gcc
os: linux
env: SWIGLANG=octave SWIGJOBS=-j2 # 3.8
@@ -160,6 +164,14 @@ matrix:
env: SWIGLANG=python SWIG_FEATURES=-builtin
sudo: required
dist: trusty
+ - os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+ sudo: required
+ dist: trusty
+ - os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1 PY3=3 VER=3.5
+ sudo: required
+ dist: trusty
- compiler: gcc
os: linux
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.4
@@ -219,6 +231,10 @@ matrix:
env: SWIGLANG=csharp SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
sudo: required
dist: trusty
+ - os: linux
+ env: SWIGLANG=go SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+ sudo: required
+ dist: trusty
- os: linux
env: SWIGLANG=java SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
sudo: required
@@ -227,10 +243,26 @@ matrix:
env: SWIGLANG=python SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
sudo: required
dist: trusty
+ - os: linux
+ env: SWIGLANG=r CPP11=1 # Note: making 'R CMD SHLIB' use a different compiler is non-trivial
+ sudo: required
+ dist: trusty
+ - os: linux
+ env: SWIGLANG=ruby SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+ sudo: required
+ dist: trusty
+ - os: linux
+ env: SWIGLANG=tcl SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+ sudo: required
+ dist: trusty
- os: linux
env: SWIGLANG=csharp SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
sudo: required
dist: trusty
+ - os: linux
+ env: SWIGLANG=go SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+ sudo: required
+ dist: trusty
- os: linux
env: SWIGLANG=java SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
sudo: required
@@ -239,6 +271,14 @@ matrix:
env: SWIGLANG=python SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
sudo: required
dist: trusty
+ - os: linux
+ env: SWIGLANG=ruby SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+ sudo: required
+ dist: trusty
+ - os: linux
+ env: SWIGLANG=tcl SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+ sudo: required
+ dist: trusty
- compiler: gcc
os: osx
env: SWIGLANG=
@@ -280,6 +320,10 @@ matrix:
env: SWIGLANG=tcl
allow_failures:
+ # Started failing after upgrade from Guile 2.0.14 to Guile 2.2.0
+ - compiler: clang
+ os: osx
+ env: SWIGLANG=guile
# Lots of failing tests currently
- compiler: gcc
os: linux
diff --git a/ANNOUNCE b/ANNOUNCE
index e0bd4d0f9..109cf9216 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,8 +1,8 @@
-*** ANNOUNCE: SWIG 3.0.13 (in progress) ***
+*** ANNOUNCE: SWIG 4.0.0 (in progress) ***
http://www.swig.org
-We're pleased to announce SWIG-3.0.13, the latest SWIG release.
+We're pleased to announce SWIG-4.0.0, the latest SWIG release.
What is SWIG?
=============
@@ -27,11 +27,11 @@ Availability
============
The release is available for download on Sourceforge at
- http://prdownloads.sourceforge.net/swig/swig-3.0.13.tar.gz
+ http://prdownloads.sourceforge.net/swig/swig-4.0.0.tar.gz
A Windows version is also available at
- http://prdownloads.sourceforge.net/swig/swigwin-3.0.13.zip
+ http://prdownloads.sourceforge.net/swig/swigwin-4.0.0.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/Makefile.in b/CCache/Makefile.in
index 67fd3f363..d1bb8c526 100644
--- a/CCache/Makefile.in
+++ b/CCache/Makefile.in
@@ -8,6 +8,7 @@ bindir=@bindir@
mandir=@mandir@
INSTALLCMD=@INSTALL@
PACKAGE_NAME=@PACKAGE_NAME@
+PROGRAM_NAME=@PROGRAM_NAME@
# Soft link test can be skipped on systems that don't support soft linking
NOSOFTLINKSTEST=
@@ -17,13 +18,10 @@ SWIG=swig
SWIG_LIB=../$(srcdir)/../Lib
EXEEXT=@EXEEXT@
-# Use standard autoconf approach to transform executable name using --program-prefix and --program-suffix
-transform = @program_transform_name@
-
LIBS= @LIBS@
OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \
cleanup.o snprintf.o unify.o
-HEADERS = ccache.h mdfour.h
+HEADERS = ccache.h mdfour.h config.h config_win32.h
all: $(PACKAGE_NAME)$(EXEEXT)
@@ -32,7 +30,7 @@ Makefile: $(srcdir)/Makefile.in ./config.status
$(SHELL) ./config.status
# Note that HTML documentation is actually generated and used from the main SWIG documentation Makefile
-docs: $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/ccache-man.html
+docs: $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/$(PACKAGE_NAME)-man.html
$(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
@@ -40,40 +38,43 @@ $(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS)
$(srcdir)/$(PACKAGE_NAME).1: $(srcdir)/ccache.yo
-yodl2man -o $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/ccache.yo
-$(srcdir)/web/ccache-man.html: $(srcdir)/ccache.yo
- yodl2html -o $(srcdir)/web/ccache-man.html $(srcdir)/ccache.yo
+$(srcdir)/web/$(PACKAGE_NAME)-man.html: $(srcdir)/ccache.yo
+ yodl2html -o $(srcdir)/web/$(PACKAGE_NAME)-man.html $(srcdir)/ccache.yo
install: $(PACKAGE_NAME)$(EXEEXT)
@echo "Installing $(PACKAGE_NAME)"
- @echo "Installing $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)"
+ @echo "Installing $(DESTDIR)${bindir}/$(PROGRAM_NAME)$(EXEEXT)"
${INSTALLCMD} -d $(DESTDIR)${bindir}
- ${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)
+ ${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/$(PROGRAM_NAME)$(EXEEXT)
install-docs: $(srcdir)/$(PACKAGE_NAME).1
- @echo "Installing $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1"
+ @echo "Installing $(DESTDIR)${mandir}/man1/$(PROGRAM_NAME).1"
${INSTALLCMD} -d $(DESTDIR)${mandir}/man1
- ${INSTALLCMD} -m 644 $(srcdir)/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1
+ ${INSTALLCMD} -m 644 $(srcdir)/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/$(PROGRAM_NAME).1
uninstall: $(PACKAGE_NAME)$(EXEEXT)
- rm -f $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)
+ rm -f $(DESTDIR)${bindir}/$(PROGRAM_NAME)$(EXEEXT)
uninstall-docs: $(srcdir)/$(PACKAGE_NAME).1
- rm -f $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1
+ rm -f $(DESTDIR)${mandir}/man1/$(PROGRAM_NAME).1
-clean:
+clean: clean-docs
/bin/rm -f $(OBJS) *~ $(PACKAGE_NAME)$(EXEEXT)
+clean-docs:
+ rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/$(PACKAGE_NAME)-man.html
+
test: test.sh
- SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' $(srcdir)/test.sh
+ SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' CCACHE='../$(PACKAGE_NAME)' CCACHE_PROG=$(PROGRAM_NAME) $(srcdir)/test.sh
check: test
distclean: clean
- /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status ccache_swig_config.h
+ /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status ccache_swig_config.h config_win32.h
/bin/rm -rf autom4te.cache
maintainer-clean: distclean
- /bin/rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/ccache-man.html
+ /bin/rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/$(PACKAGE_NAME)-man.html
# FIXME: To fix this, test.sh needs to be able to take ccache from the
diff --git a/CCache/ccache.h b/CCache/ccache.h
index a79d88322..25e786496 100644
--- a/CCache/ccache.h
+++ b/CCache/ccache.h
@@ -6,7 +6,7 @@
#include "config.h"
#else
#include
-#define PACKAGE_NAME "ccache-swig.exe"
+#include "config_win32.h"
#endif
#include
@@ -51,7 +51,7 @@
#define STATUS_FATAL 4
#define STATUS_NOCACHE 5
-#define MYNAME PACKAGE_NAME
+#define MYNAME PROGRAM_NAME
#define LIMIT_MULTIPLE 0.8
diff --git a/CCache/config_win32.h.in b/CCache/config_win32.h.in
new file mode 100644
index 000000000..2d5ab97e3
--- /dev/null
+++ b/CCache/config_win32.h.in
@@ -0,0 +1,3 @@
+#if !defined(PROGRAM_NAME)
+#define PROGRAM_NAME "@PROGRAM_NAME@.exe"
+#endif
diff --git a/CCache/configure.ac b/CCache/configure.ac
index dfbf86dbc..e1c761860 100644
--- a/CCache/configure.ac
+++ b/CCache/configure.ac
@@ -7,6 +7,7 @@ AC_CONFIG_SRCDIR([ccache.h])
AC_MSG_NOTICE([Configuring ccache])
AC_CONFIG_HEADER(config.h)
+AC_CONFIG_FILES([config_win32.h])
dnl Checks for programs.
AC_PROG_CC
@@ -14,6 +15,20 @@ AC_PROG_CPP
AC_PROG_INSTALL
AC_ARG_PROGRAM # for program_transform_name
+AC_SUBST(PROGRAM_NAME)
+if test "x$program_prefix" != "xNONE" -a "x$program_prefix" != "x"
+then
+ PROGRAM_NAME="$program_prefix$PACKAGE_NAME"
+else
+ PROGRAM_NAME="$PACKAGE_NAME"
+fi
+if test "x$program_suffix" != "xNONE" -a "x$program_suffix" != "x"
+then
+ PROGRAM_NAME="$PROGRAM_NAME$program_suffix"
+fi
+
+AC_DEFINE_UNQUOTED(PROGRAM_NAME, "$PROGRAM_NAME", [Define my program name])
+
AC_DEFINE([_GNU_SOURCE], 1,
[Define _GNU_SOURCE so that we get all necessary prototypes])
diff --git a/CCache/test.sh b/CCache/test.sh
index 438e782cd..5b6f92a35 100755
--- a/CCache/test.sh
+++ b/CCache/test.sh
@@ -20,7 +20,12 @@ fi
PATH="`echo $PATH | \
sed -e 's!:/usr\(/local\)*/lib\([0-9]\)*/ccache\(/\)*!!g'`"
-CCACHE=../ccache-swig
+if test -n "$CCACHE"; then
+ CCACHE="$CCACHE"
+else
+ CCACHE=../ccache-swig
+fi
+
TESTDIR=test.$$
test_failed() {
@@ -406,6 +411,10 @@ swigtests() {
# main program
rm -rf $TESTDIR
mkdir $TESTDIR
+if test -n "$CCACHE_PROG"; then
+ ln -s $CCACHE $TESTDIR/$CCACHE_PROG
+ CCACHE=./$CCACHE_PROG
+fi
cd $TESTDIR || exit 1
unset CCACHE_DIR
diff --git a/CHANGES b/CHANGES
index 1b5cd47e4..8376c0b36 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,7 +5,7 @@ See the RELEASENOTES file for a summary of changes in each release.
Issue # numbers mentioned below can be found on Github. For more details, add
the issue number to the end of the URL: https://github.com/swig/swig/issues/
-Version 3.0.13 (27 Jan 2017)
+Version 3.0.12 (27 Jan 2017)
============================
2017-01-27: wsfulton
@@ -21116,7 +21116,7 @@ Version 1.3.7 (September 3, 2001)
typedef __name vector;
%enddef
- An a specific instantiation is created in exactly the same way:
+ A specific instantiation is created in exactly the same way:
%template(intvec) vector;
diff --git a/CHANGES.current b/CHANGES.current
index 16cbf043f..f76e5a58e 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -4,6 +4,437 @@ See the RELEASENOTES file for a summary of changes in each release.
Issue # numbers mentioned below can be found on Github. For more details, add
the issue number to the end of the URL: https://github.com/swig/swig/issues/
-Version 3.0.13 (in progress)
-============================
+Version 4.0.0 (in progress)
+===========================
+2017-09-18: wsfulton
+ Fix type promotion wrapping constant expressions of the form:
+ # define EXPR_MIXED1 (0x80 + 11.1) - 1
+ This was previously an integral type instead of a floating point type.
+
+2017-09-17: wsfulton
+ Fix generated code for constant expressions containing wchar_t L literals such as:
+ # define __WCHAR_MAX (0x7fffffff + L'\0')
+ # define __WCHAR_MIN (-__WCHAR_MAX - 1)
+
+2017-09-10: mlamarre
+ [Python] Patch #1083. Define_DEBUG to 1 to do exactly like Visual Studio
+ /LDd, /MDd or /MTd compiler options.
+
+2017-08-25: wsfulton
+ Issue #1059. Add support for C++11 ref-qualifiers on non-static member functions.
+ Members with lvalue ref-qualifiers such as:
+
+ struct RQ {
+ void m1(int x) &;
+ void m2(int x) const &;
+ };
+
+ are wrapped like any other member function. Member functions with rvalue ref-qualifiers
+ are ignored by default, such as:
+
+ struct RQ {
+ void m3(int x) &&;
+ void m4(int x) const &&;
+ };
+
+ example.i:7: Warning 405: Method with rvalue ref-qualifier m3(int) && ignored.
+ example.i:8: Warning 405: Method with rvalue ref-qualifier m4(int) const && ignored.
+
+ These can be unignored and exposed to the target language, see further documentation in
+ CPlusPlus11.html.
+
+2017-08-16: wsfulton
+ Fix #1063. Add using declarations to templates into typedef table.
+
+ Using declarations to templates were missing in SWIG's internal typedef tables.
+ This led to a few problems, such as, templates that did not instantiate and generated
+ C++ code that did not compile as SWIG did not know what scope the template was
+ in. This happened mostly when a using declaration was used on a template type in a
+ completely unrelated namespace.
+
+2017-08-16: wsfulton
+ Fix type lookup in the presence of using directives and using declarations.
+
+ Fix some cases of type lookup failure via a combination of both using directives and
+ using declarations resulting in C++ code that did not compile as the generated type was
+ not fully qualified for use in the global namespace. Example below:
+
+ namespace Space5 {
+ namespace SubSpace5 {
+ namespace SubSubSpace5 {
+ struct F {};
+ }
+ }
+ using namespace SubSpace5;
+ using SubSubSpace5::F;
+ void func(SubSubSpace5::F f);
+ }
+
+2017-08-16: wsfulton
+ Issue #1051. %template scope enforcement and class definition fixes.
+
+ The scoping rules around %template have been specified and enforced.
+ The %template directive for a class template is the equivalent to an
+ explicit instantiation of a C++ class template. The scope for a valid
+ %template instantiation is now the same as the scope required for a
+ valid explicit instantiation of a C++ template. A definition of the
+ template for the explicit instantiation must be in scope where the
+ instantiation is declared and must not be enclosed within a different
+ namespace.
+
+ For example, a few %template and C++ explicit instantiations of std::vector
+ are shown below:
+
+ // valid
+ namespace std {
+ %template(vin) vector;
+ template class vector;
+ }
+
+ // valid
+ using namespace std;
+ %template(vin) vector;
+ template class vector;
+
+ // valid
+ using std::vector;
+ %template(vin) vector;
+ template class vector;
+
+ // ill-formed
+ namespace unrelated {
+ using std::vector;
+ %template(vin) vector;
+ template class vector;
+ }
+
+ // ill-formed
+ namespace unrelated {
+ using namespace std;
+ %template(vin) vector;
+ template class vector;
+ }
+
+ // ill-formed
+ namespace unrelated {
+ namespace std {
+ %template(vin) vector;
+ template class vector;
+ }
+ }
+
+ // ill-formed
+ namespace unrelated {
+ %template(vin) std::vector;
+ template class std::vector;
+ }
+
+ When the scope is incorrect, an error now occurs such as:
+
+ cpp_template_scope.i:34: Error: 'vector' resolves to 'std::vector' and
+ was incorrectly instantiated in scope 'unrelated' instead of within scope 'std'.
+
+ Previously SWIG accepted the ill-formed examples above but this led to
+ numerous subtle template scope problems especially in the presence of
+ using declarations and using directives as well as with %feature and %typemap.
+
+ Actually, a valid instantiation is one which conforms to the C++03
+ standard as C++11 made a change to disallow using declarations and
+ using directives to find a template.
+
+ // valid C++03, ill-formed C++11
+ using std::vector;
+ template class vector;
+
+ Similar fixes for defining classes using forward class references have
+ also been put in place. For example:
+
+ namespace Space1 {
+ struct A;
+ }
+ namespace Space2 {
+ struct Space1::A {
+ void x();
+ }
+ }
+
+ will now error out with:
+
+ cpp_class_definition.i:5: Error: 'Space1::A' resolves to 'Space1::A' and
+ was incorrectly instantiated in scope 'Space2' instead of within scope 'Space1'.
+
+2017-08-16: wsfulton
+ Fix scope lookup for template parameters containing unary scope operators.
+
+ Fixes cases like:
+
+ namespace Alloc {
+ template struct Rebind {
+ typedef int Integer;
+ };
+ }
+ %template(RebindBucket) Alloc::Rebind< Bucket >;
+ OR
+ %template(RebindBucket) Alloc::Rebind< ::Bucket >;
+
+ Alloc::Rebind< Bucket >::Integer Bucket1();
+ Alloc::Rebind< ::Bucket >::Integer Bucket2();
+ Alloc::Rebind<::template TemplateBucket>::Integer Bucket3();
+
+2017-08-16: wsfulton
+ For templates only, the template parameters are fully resolved when
+ handling typemaps. Without this, it is too hard to have decent rules
+ to apply typemaps when parameter types are typedef'd and template
+ parameters have default values.
+
+ Fixes %clear for typedefs in templates, eg:
+
+ %typemap("in") XXX::Long "..."
+ template typename struct XXX {
+ typedef long Long;
+ };
+ %clear XXX::Long;
+
+ as the typemap was previously incorrectly stored as a typemap for long
+ instead of XXX::Long.
+
+2017-08-05: olly
+ [C++11] Allow static_assert at the top level (and disallow it right
+ after template). Fixes https://github.com/swig/swig/issues/1031
+ reported by Artem V L.
+
+2017-08-02: wsfulton
+ Fix incorrectly shown warning when an empty template instantiation was used on a
+ class used as a base class and that base class was explicitly ignored with %ignore.
+ Example of the warning which will no longer appear:
+
+ Warning 401: Base class 'Functor< int,int >' has no name as it is an empty
+ template instantiated with '%template()'. Ignored.
+
+2017-07-17: fflexo
+ [Java] #674 Add std_list.i to add support for std::list containers. The Java proxy
+ extends java.util.AbstractSequentialList and makes the C++ std::list container look
+ and feel much like a java.util.LinkedList from Java.
+
+2017-07-07: wsfulton
+ [Python] Fix display of documented template types when using the autodoc
+ feature. For example when wrapping:
+
+ %feature("autodoc");
+ template struct T {};
+ %template(TInteger) T;
+
+ the generated documentation contains:
+ """Proxy of C++ T< int > class."""
+ instead of:
+ """Proxy of C++ T<(int)> class."""
+ and
+ """__init__(TInteger self) -> TInteger"""
+ instead of
+ """__init__(T<(int)> self) -> TInteger"""
+
+2017-06-27: nihaln
+ [PHP] Update the OUTPUT Typemap to add return statement to the
+ PHP Wrapper.
+
+2017-06-27: nihaln
+ [PHP] Update the enum and value examples to use the OO wrappers
+ rather than the flat functions produced with -noproxy. There's
+ not been a good reason to use -noproxy for since PHP5 OO wrapping
+ was fixed back in 2005.
+
+2017-06-23: m7thon
+ [Python] fix and improve default argument handling:
+
+ 1. Fix negative octals. Currently not handled correctly by `-py3`
+ (unusual case, but incorrect).
+ 2. Fix arguments of type "octal + something" (e.g. `0640 | 04`).
+ Currently drops everything after the first octal. Nasty!
+ 3. Fix bool arguments "0 + something" (e.g. `0 | 1`) are always
+ "False" (unusual case, but incorrect).
+ 4. Remove special handling of "TRUE" and "FALSE" from
+ `convertValue` since there's no reason these have to match
+ "true" and "false".
+ 5. Remove the Python 2 vs. Python 3 distinction based on the
+ `-py3` flag. Now the same python code is produced for default
+ arguments for Python 2 and Python 3. For this, octal default
+ arguments, e.g. 0644, are now wrapped as `int('644', 8)`. This
+ is required, as Python 2 and Python 3 have incompatible syntax
+ for octal literals.
+
+ Fixes #707
+
+2017-06-21: futatuki
+ #1004 - Fix ccache-swig executable name to respect configure's --program-prefix and
+ --program-suffix values if used.
+
+2017-06-21: tamuratak
+ [Ruby] #911 - Add std::wstring support.
+
+2017-06-19: wsfulton
+ [Python] Fix handling of rich comparisons when wrapping overloaded operators:
+
+ operator< operator<= operator> operator>= operator== operator!=
+
+ Previously a TypeError was always thrown if the type was not correct. NotImplemented
+ is now returned from these wrapped functions if the type being compared with is
+ not correct. The subsequent behaviour varies between different versions of Python
+ and the comparison function being used, but is now consistent with normal Python
+ behaviour. For example, for the first 4 operator overloads above, a TypeError
+ 'unorderable types' is thrown in Python 3, but Python 2 will return True or False.
+ NotImplemented should be returned when the comparison cannot be done, see PEP 207 and
+ https://docs.python.org/3/library/constants.html#NotImplemented
+
+ Note that the bug was only present when overloaded operators did not also have a
+ function overload.
+
+ Fixes SF bug #1208 (3441262) and SF patch #303.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2017-06-17: fabrice102
+ [Go] Fix Go callback example. Fixes github #600, #955, #1000.
+
+2017-06-16: wsfulton
+ Make sure warning and error messages are not split up by other processes writing to
+ stdout at the same time.
+
+2017-06-16: wsfulton
+ [R] Fix wrapping function pointers containing rvalue and lvalue reference parameters.
+
+2017-06-13: olly
+ [Perl] Fix testsuite to work without . in @INC - it was removed in
+ Perl 5.26 for security reasons, and has also been removed from
+ older versions in some distros. Fixes
+ https://github.com/swig/swig/issues/997 reported by lfam.
+
+2017-06-03: wsfulton
+ Fix %import on a file containing a file scope %fragment forced inclusion to not
+ generate the fragment contents as %import should not result in code being generated.
+ The behaviour is now the same as importing code insertion blocks.
+ Wrapping FileC.i in the following example will result in no generated code, whereas
+ previously "#include " was generated:
+
+ // FileA.i
+ %fragment("", "header") %{
+ #include
+ %}
+
+ %{
+ #include
+ %}
+ %fragment("");
+
+ // FileC.i
+ %import "FileA.i"
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2017-05-26: Volker Diels-Grabsch, vadz
+ [Java] #842 Extend from java.util.AbstractList<> and implement java.util.RandomAccess for
+ std::vector wrappers. This notably allows to iterate over wrapped vectors in a natural way.
+2017-05-30: davidcl
+ [Scilab] #994 Undefined symbol error when loading in Scilab 6
+
+2017-05-25: asibross
+ [Java] #370 #417 Missing smart pointer handling in Java director extra methods
+ swigReleaseOwnership() and swigTakeOwnership().
+
+2017-05-23: wsfulton
+ [Java] #230 #759 Fix Java shared_ptr and directors for derived classes java compilation
+ error.
+
+ For shared_ptr proxy proxy classes, add a protected method swigSetCMemOwn for modifying
+ the swigCMemOwn and swigCMemOwnDerived member variables which are used by various other
+ methods for controlling memory ownership.
+
+2017-05-21: Sghirate
+ [Java, C#, D] #449 Remove unnecessary use of dynamic_cast in directors to enable
+ non-RTTI compilation.
+
+2017-05-21: wsfulton
+ [Python] #993 Fix handling of default -ve unsigned values, such as:
+ void f(unsigned = -1U);
+
+2017-05-20: jschueller
+ [Python] #991 Fix E731 PEP8 warning: do not assign a lambda expression
+
+2017-05-16: nihal95
+ [PHP] Add %pragma version directive to allow the version of the
+ extension to be set. Patch #970, fixes #360.
+
+2017-05-13: yag00
+ Patch #975 - Add support for noexcept on director methods.
+
+2017-04-27: redbrain
+ Issue #974, Patch #976 - Fix preprocessor handling of macros with commas in a comment.
+
+2017-04-25: jleveque
+ [Lua] #959 - Fix Visual Studio C4244 conversion warnings in Lua wrappers.
+
+2017-04-21: tamuratak
+ [Ruby] #964 - Add shared_ptr director typemaps.
+
+2017-04-20: wsfulton
+ [Ruby] #586, #935 Add assert for invalid NULL type parameter when calling SWIG_Ruby_NewPointerObj.
+
+2017-04-20: tamuratak
+ [Ruby] #930, #937 - Fix containers of std::shared_ptr.
+ Upcasting, const types (eg vector>) and NULL/nullptr support added.
+
+2017-04-12: smarchetto
+ [Scilab] New parameter targetversion to specify the Scilab target version (5, 6, ..) for code generation
+ With Scilab 6 target specified, identifier names truncation is disabled (no longer necessary)
+
+2017-03-24: tamuratak
+ [Ruby] Fix #939 - Wrapping std::vector fix due to incorrect null checks
+ on VALUE obj.
+
+2017-03-17: vadz
+ [C#] #947 Add support for std::complex
+
+2017-03-17: wsfulton
+ [Go] Fix handling of typedef'd function pointers and typedef'd member function pointers
+ such as:
+
+ typedef int (*FnPtr_td)(int, int);
+ int do_op(int x, int y, FnPtr_td op);
+
+2017-03-16: wsfulton
+ Add support for member const function pointers such as:
+
+ int fn(short (Funcs::* parm)(bool)) const;
+
+ Also fix parsing of references/pointers and qualifiers to member
+ pointers such as:
+
+ int fn(short (Funcs::* const parm)(bool));
+ int fn(short (Funcs::* & parm)(bool));
+
+2017-03-10: wsfulton
+ Extend C++11 alternate function syntax parsing to support const and noexcept, such as:
+
+ auto sum1(int x, int y) const -> int { return x + y; }
+ auto sum2(int x, int y) noexcept -> int { return x + y; }
+
+2017-02-29: tamuratak
+ [Ruby] #917 - Add Enumerable module to all container class wrappers. It was missing
+ for std::list, std::multiset, std::unordered_multiset and std::unordered_map.
+
+2017-02-27: assambar
+ [C++11] Extend parser to support throw specifier in combination
+ with override and/or final.
+
+2017-02-10: tamuratak
+ [Ruby] #883 - Add support for C++11 hash tables:
+ std::unordered_map
+ std::unordered_set
+ std::unordered_multimap
+ std::unordered_multiset
+
+2017-02-08: jcsharp
+ [C#] #887 Improve std::vector wrapper constructors -
+ Replace constructor taking ICollection with IEnumerable and also add IEnumerable
+ constructor to avoid the boxing and unboxing overhead of the original constructor,
+ when the type parameter is a value type.
diff --git a/Doc/Manual/Allegrocl.html b/Doc/Manual/Allegrocl.html
index ddb6fba55..c4d898130 100644
--- a/Doc/Manual/Allegrocl.html
+++ b/Doc/Manual/Allegrocl.html
@@ -155,7 +155,7 @@ SWIG directives. SWIG can be furnished with a header file, but an
interface can also be generated without library headers by supplying a
simple text file--called the interface file, which is typically named
with a .i extension--containing any foreign declarations of
-identifiers you wish to use. The most common approach is to use a an
+identifiers you wish to use. The most common approach is to use an
interface file with directives to parse the needed headers. A straight
parse of library headers will result in usable code, but SWIG
directives provides much freedom in how a user might tailor the
diff --git a/Doc/Manual/Android.html b/Doc/Manual/Android.html
index b295b5e04..726314228 100644
--- a/Doc/Manual/Android.html
+++ b/Doc/Manual/Android.html
@@ -409,7 +409,7 @@ All the steps required to compile and use a simple hierarchy of classes for shap
First create an Android project called SwigClass in a subdirectory called class.
-The steps below create and build a the JNI C++ app.
+The steps below create and build the JNI C++ app.
Adjust the --target id as mentioned earlier in the Examples introduction.
diff --git a/Doc/Manual/CCache.html b/Doc/Manual/CCache.html
index d23b0cb2f..521184ff0 100644
--- a/Doc/Manual/CCache.html
+++ b/Doc/Manual/CCache.html
@@ -411,7 +411,7 @@ following conditions need to be met:
-ccache was inspired by the compilercache shell script script written
+ccache was inspired by the compilercache shell script written
by Erik Thiele and I would like to thank him for an excellent piece of
work. See
http://www.erikyyy.de/compilercache/
diff --git a/Doc/Manual/CPlusPlus11.html b/Doc/Manual/CPlusPlus11.html
index 4d4261cd7..f9281bd56 100644
--- a/Doc/Manual/CPlusPlus11.html
+++ b/Doc/Manual/CPlusPlus11.html
@@ -42,6 +42,7 @@
Exception specifications and noexcept
Control and query object alignment
Attributes
+Methods with ref-qualifiers
Standard library changes
@@ -877,7 +878,8 @@ so in this case it is entirely possible to pass an int instead of a double to
-SWIG correctly parses the new static_assert declarations.
+SWIG correctly parses the new static_assert declarations (though 3.0.12 and earlier
+had a bug which meant this wasn't accepted at file scope).
This is a C++ compile time directive so there isn't anything useful that SWIG can do with it.
@@ -970,6 +972,104 @@ int [[attr1]] i [[attr2, attr3]];
[[noreturn, nothrow]] void f [[noreturn]] ();
+
+
+
+
+
+C++11 non-static member functions can be declared with ref-qualifiers.
+Member functions declared with a & lvalue ref-qualifiers are wrapped like any other function without ref-qualifiers.
+Member functions declared with a && rvalue ref-qualifiers are ignored by default
+as they are unlikely to be required from non-C++ languages where the concept of rvalue-ness
+for the implied *this pointer does not apply.
+The warning is hidden by default, but can be displayed as described in the section on Enabling extra warnings.
+
+
+
+Consider:
+
+
+
+struct RQ {
+ void m1(int x) &;
+ void m2(int x) &&;
+};
+
+
+
+The only wrapped method will be the lvalue ref-qualified method m1
+and if SWIG is run with the -Wextra command-line option, the following warning will be issued indicating m2 is not wrapped:
+
+
+
+
+example.i:7: Warning 405: Method with rvalue ref-qualifier m2(int) && ignored.
+
+
+
+
+If you unignore the method as follows, wrappers for m2 will be generated:
+
+
+
+%feature("ignore", "0") RQ::m2(int x) &&;
+struct RQ {
+ void m1(int x) &;
+ void m2(int x) &&;
+};
+
+
+
+Inspection of the generated C++ code, will show that std::move is used on the instance
+of the RQ * class:
+
+
+
+ RQ *arg1 = (RQ *) 0 ;
+ int arg2 ;
+
+ arg1 = ...marshalled from target language...
+ arg2 = ...marshalled from target language...
+
+ std::move(*arg1).m2(arg2);
+
+
+
+This will compile but when run, the move effects may not be what you want.
+As stated earlier, rvalue ref-qualifiers aren't really applicable outside the world of C++.
+However, if you really know what you are doing, full control over the call to the method is
+possible via the low-level "action" feature.
+This feature completely replaces the call to the underlying function, that is, the last line in the snippet of code above.
+
+
+
+%feature("ignore", "0") RQ::m2(int x) &&;
+%feature("action") RQ::m2(int x) && %{
+ RQ().m2(arg2);
+%}
+struct RQ {
+ void m1(int x) &;
+ void m2(int x) &&;
+};
+
+
+
+resulting in:
+
+
+
+ RQ *arg1 = (RQ *) 0 ;
+ int arg2 ;
+
+ arg1 = ...marshalled from target language...
+ arg2 = ...marshalled from target language...
+
+ RQ().m2(arg2);
+
+
+
+Compatibility note: SWIG-4.0.0 was the first version to support ref-qualifiers.
+
@@ -994,7 +1094,8 @@ Variadic template support requires further work to provide substantial tuple wra
The new hash tables in the STL are unordered_set, unordered_multiset, unordered_map, unordered_multimap.
-These are not available in SWIG, but in principle should be easily implemented by adapting the current STL containers.
+These are not available in all target languages.
+Any missing support can in principle be easily implemented by adapting the current STL containers.
@@ -1175,5 +1276,6 @@ Phew, that is a lot of hard work to get a callback working.
You could just go with the more attractive option of just using double as the return type in the function declaration instead of result_of!
+