Merge remote-tracking branch 'upstream/master' into OCaml-INPUT-OUTPUT-INOUT-primitives
diff --git a/.travis.yml b/.travis.yml
index b443ae0..bede4a0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,115 +5,139 @@
       os: linux
       env: SWIGLANG=
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG= SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+      env: SWIGLANG= GCC=4.4
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG= SWIG_CC=gcc-6 SWIG_CXX=g++-6
+      env: SWIGLANG= GCC=4.6
       sudo: required
-      dist: trusty
+      dist: xenial
+    - os: linux
+      env: SWIGLANG= GCC=4.7
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG= GCC=4.8
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG= GCC=4.9
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG= GCC=6
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG= GCC=7
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG= GCC=8
+      sudo: required
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=csharp
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=d
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=go
+      env: SWIGLANG=go VER=1.3
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=go VER=1.5
+      env: SWIGLANG=go VER=1.8
       sudo: required
-      dist: trusty
+      dist: xenial
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=go VER=1.12
+      sudo: required
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=guile
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=java
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=javascript ENGINE=node
+      env: SWIGLANG=javascript ENGINE=node VER=0.10
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=javascript ENGINE=node VER=4 CPP11=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=javascript ENGINE=node VER=6 CPP11=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=javascript ENGINE=node VER=8 CPP11=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=javascript ENGINE=node VER=10 CPP11=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=javascript ENGINE=jsc
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=javascript ENGINE=v8
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=lua
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=lua VER=5.3
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=mzscheme
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=ocaml
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=octave SWIGJOBS=-j2 # 3.8
+      env: SWIGLANG=octave SWIGJOBS=-j2
       sudo: required
-      dist: trusty
-    - compiler: gcc
-      os: linux
-      env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.0
-      sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.2 CPP11=1
@@ -128,130 +152,130 @@
       os: linux
       env: SWIGLANG=perl5
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=php VER=7.0
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=php VER=7.1
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=php VER=7.2
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=php VER=7.3
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python # 2.7
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python PY3=3 VER=3.2
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python PY3=3 VER=3.3
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python PY3=3 VER=3.4
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python PY3=3 VER=3.5
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python PY3=3 VER=3.6
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python PY3=3 VER=3.7
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python SWIG_FEATURES=-builtin
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python SWIG_FEATURES="-builtin -O"
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=python SWIG_FEATURES=-builtin SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP11=1
+      env: SWIGLANG=python SWIG_FEATURES=-builtin GCC=6 CPP11=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=python SWIG_FEATURES=-builtin SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP11=1 PY3=3 VER=3.7
+      env: SWIGLANG=python SWIG_FEATURES=-builtin GCC=6 CPP11=1 PY3=3 VER=3.7
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.4
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.5
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.7
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python SWIG_FEATURES="-builtin -O" PY3=3 VER=3.7
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.7 SWIGOPTPY3=
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python SWIG_FEATURES=-O
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=python SWIG_FEATURES=-O PY3=3 VER=3.7
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=r
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=ruby VER=1.9.3
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=ruby VER=2.0.0
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=ruby VER=2.3.0
@@ -261,84 +285,84 @@
       os: linux
       env: SWIGLANG=scilab
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=tcl
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=csharp SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+      env: SWIGLANG=csharp CPP11=1
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG=go VER=1.6 CPP11=1
       sudo: required
       dist: trusty
     - os: linux
-      env: SWIGLANG=go SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+      env: SWIGLANG=java CPP11=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=java SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+      env: SWIGLANG=python CPP11=1
       sudo: required
-      dist: trusty
-    - os: linux
-      env: SWIGLANG=python SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
-      sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
       env: SWIGLANG=r CPP11=1 # Note: making 'R CMD SHLIB' use a different compiler is non-trivial
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=ruby SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+      env: SWIGLANG=ruby CPP11=1
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG=tcl CPP11=1
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG=csharp GCC=6 CPP14=1
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG=go GCC=6 CPP14=1
       sudo: required
       dist: trusty
     - os: linux
-      env: SWIGLANG=tcl SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+      env: SWIGLANG=java GCC=6 CPP14=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=csharp SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+      env: SWIGLANG=python GCC=6 CPP14=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=go SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+      env: SWIGLANG=ruby GCC=6 CPP14=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=java SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+      env: SWIGLANG=tcl GCC=6 CPP14=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=python SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+      env: SWIGLANG=java GCC=7 CPP14=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=ruby SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+      env: SWIGLANG=python GCC=7 CPP14=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=tcl SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+      env: SWIGLANG=csharp GCC=8 CPP17=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=java SWIG_CC=gcc-7 SWIG_CXX=g++-7 CPP14=1
+      env: SWIGLANG=java GCC=8 CPP17=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=python SWIG_CC=gcc-7 SWIG_CXX=g++-7 CPP14=1
+      env: SWIGLANG=python GCC=8 CPP17=1 PY3=3 VER=3.7
       sudo: required
-      dist: trusty
-    - os: linux
-      env: SWIGLANG=csharp SWIG_CC=gcc-8 SWIG_CXX=g++-8 CPP17=1
-      sudo: required
-      dist: trusty
-    - os: linux
-      env: SWIGLANG=java SWIG_CC=gcc-8 SWIG_CXX=g++-8 CPP17=1
-      sudo: required
-      dist: trusty
-    - os: linux
-      env: SWIGLANG=python SWIG_CC=gcc-8 SWIG_CXX=g++-8 CPP17=1 PY3=3 VER=3.7
-      sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: osx
       env: SWIGLANG=
@@ -377,12 +401,12 @@
       env: SWIGLANG=tcl
 
   allow_failures:
-    # Deprecated functions causing build failure since upgrade from Node v10.11.0 to v10.12.0
+    # seg fault in director_basic testcase
     - compiler: gcc
       os: linux
-      env: SWIGLANG=javascript ENGINE=node VER=10 CPP11=1
+      env: SWIGLANG=php VER=7.2
       sudo: required
-      dist: trusty
+      dist: xenial
     # Sometimes hits the Travis 50 minute time limit
     - compiler: gcc
       os: linux
@@ -394,33 +418,29 @@
       os: linux
       env: SWIGLANG=mzscheme
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=ocaml
       sudo: required
-      dist: trusty
+      dist: xenial
 
 before_install:
   - date -u
   - uname -a
   - if test "$TRAVIS_OS_NAME" = "linux"; then lscpu && cat /proc/cpuinfo | grep "model name" && cat /proc/meminfo | grep MemTotal; fi
   - if test "$TRAVIS_OS_NAME" = "osx"; then sysctl -a | grep brand_string; fi
-    # Travis overrides CC environment with compiler predefined values
-  - if test -n "$SWIG_CC"; then export CC="$SWIG_CC"; fi
-  - if test -n "$SWIG_CXX"; then export CXX="$SWIG_CXX"; fi
+  # Travis overrides CC environment with compiler predefined values
+  - if test -n "$GCC"; then export CC="gcc-$GCC" && export CXX="g++-$GCC"; fi
 install:
   - if test "$TRAVIS_OS_NAME" = "linux"; then source Tools/travis-linux-install.sh; fi
   - if test "$TRAVIS_OS_NAME" = "osx"; then source Tools/travis-osx-install.sh; fi
+  - ls -la $(which $CC) $(which $CXX) && $CC --version && $CXX --version
+script:
+  - echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r'
   - if test -n "$CPP11"; then CONFIGOPTS+=(--enable-cpp11-testing --without-maximum-compile-warnings "CXXFLAGS=-std=c++11 -Wall -Wextra" "CFLAGS=-std=c11 -Wall -Wextra") && export CSTD=c11 && export CPPSTD=c++11; fi
   - if test -n "$CPP14"; then CONFIGOPTS+=(--enable-cpp11-testing --without-maximum-compile-warnings "CXXFLAGS=-std=c++14 -Wall -Wextra" "CFLAGS=-std=c11 -Wall -Wextra") && export CSTD=c11 && export CPPSTD=c++14; fi
   - if test -n "$CPP17"; then CONFIGOPTS+=(--enable-cpp11-testing --without-maximum-compile-warnings "CXXFLAGS=-std=c++17 -Wall -Wextra" "CFLAGS=-std=c17 -Wall -Wextra") && export CSTD=c17 && export CPPSTD=c++17; fi
-  - ls -la $(which $CC)
-  - ls -la $(which $CXX)
-  - $CC --version
-  - $CXX --version
-script:
-  - echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r'
   - if test -n "$SWIGLANG"; then CONFIGOPTS+=(--without-alllang --with-$WITHLANG); fi
   - echo "${CONFIGOPTS[@]}"
   - ./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
diff --git a/ANNOUNCE b/ANNOUNCE
index 764f39c..b83921c 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,8 +1,8 @@
-*** ANNOUNCE: SWIG 4.0.0 (in progress) ***
+*** ANNOUNCE: SWIG 4.0.1 (in progress) ***
 
 http://www.swig.org
 
-We're pleased to announce SWIG-4.0.0, the latest SWIG release.
+We're pleased to announce SWIG-4.0.1, the latest SWIG release.
 
 What is SWIG?
 =============
@@ -10,13 +10,11 @@
 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 programming languages including Perl, Python, Tcl, Ruby,
-PHP, C#, Go, Java, Javascript, Lua, Scheme (Guile, MzScheme),
-D, Ocaml, Octave, R, Scilab.
-SWIG can also export its parse tree in
-the form of XML.  Major applications of SWIG
-include generation of scripting language extension modules, rapid
-prototyping, testing, and user interface development for large
-C/C++ systems.
+PHP, C#, Go, Java, Javascript, Lua, Scheme (Guile, MzScheme), D,
+Ocaml, Octave, R, Scilab.  SWIG can also export its parse tree in
+the form of XML.  Major applications of SWIG include generation of
+scripting language extension modules, rapid prototyping, testing,
+and user interface development for large C/C++ systems.
 
 Release Notes
 =============
@@ -27,11 +25,11 @@
 ============
 The release is available for download on Sourceforge at
 
-     http://prdownloads.sourceforge.net/swig/swig-4.0.0.tar.gz
+     http://prdownloads.sourceforge.net/swig/swig-4.0.1.tar.gz
 
 A Windows version is also available at
 
-     http://prdownloads.sourceforge.net/swig/swigwin-4.0.0.zip
+     http://prdownloads.sourceforge.net/swig/swigwin-4.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/CHANGES b/CHANGES
index 958e7cb..77d570d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,1541 @@
 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 4.0.0 (27 Apr 2019)
+===========================
+
+2019-04-24: vadz
+            #1517 Fix crash if "@return" Doxygen tag was used on a node without any return type.
+
+2019-04-24: vadz
+            #1515 Fix parsing of enums with trailing comma when using -doxygen.
+
+2019-04-19: ianlancetaylor
+            [Go] #1055 When generating Go code, make -cgo the default. Add new -no-cgo option
+            to disable the default.
+
+2019-04-19: pbecherer
+            [Tcl] #1508 Fix Visual Studio 2015 and later compilation errors due to snprintf macro
+            definition.
+
+2019-04-09: wsfulton
+            [C#] Fix FxCop warning CA2002 in SWIGPendingException - a lock on a reference of
+            type 'Type'.
+
+2019-03-30: wsfulton
+            [Java, D] Add the parameters typemap attribute to the javadestruct,
+            javadestruct_derived, ddispose, ddispose_derived typemaps to mirror enhanced
+            flexibility in the csdisposing and csdisposing_derived (C#) typemaps. If provided
+            the contents are generated as the delete/dispose method's parameters declaration.
+
+2019-03-30: wsfulton
+            [C#] #421 Fix FxCop warning CA1063 by implementing the recommended Dispose methods for
+            the IDisposable interface. Previously just the Dispose() method was generated.
+            Now the Dispose() and Dispose(bool disposing) methods are generated.
+            Changes are required if custom "csfinalize", "csdestruct" or "csdestruct_derived"
+            typemaps are being used. Details in #421 on Github. SWIG will error out if one of
+            the "csfinalize, "csdestruct" or "csdestruct_derived" typemaps are found. Example
+            error message:
+
+              foo.h:60: Error: A deprecated csfinalize typemap was found for Foo, please remove
+              it and replace all csdestruct, csdestruct_derived and csfinalize typemaps by the
+              csdispose, csdispose_derived, csdisposing and csdisposing_derived typemaps.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2019-03-25: Liryna
+            [C#] #1143 Add std_list.i for std::list support.
+            The C# std::list<T> wrappers are made to look and feel like a C#
+            System.Collections.Generic.LinkedList<> collection.
+            The IEnumerable<> interface is implemented in the proxy class.
+            The ICollection<> interface can also be implemented to provide enhanced functionality
+            whenever a C++ operator== is available. This is the case for when T is a
+            primitive type or a pointer. If T does define an operator==, then use the
+            SWIG_STD_LIST_ENHANCED macro to obtain this enhanced functionality, for example:
+
+              SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass)
+              %template(ListKlass) std::list<SomeNamespace::Klass>;
+
+2019-03-18: richardbeare
+            [R] #1328 Non-trivial enums are working now. The enum values are now obtained from
+            the C/C++ layer. const reference enums and C++11 enum classes are also now working.
+
+2019-03-14: mochizk
+            [Javascript] #1500 Fix compilation errors due to deprecating V8 API in Node.js.
+            New V8 API is used if node.js >= v10.12, or if V8 >= v7.0.
+
+2019-03-12: vadz
+            [C#] #1495 Add std_set.i for std::set support.
+
+2019-03-11: dirteat,opoplawski
+            [Octave] Fix compilation errors in Octave 5.1.
+
+              error: format not a string literal and no format arguments [-Werror=format-security]
+
+2019-02-28: wsfulton
+            [Java] std::vector improvements for types that do not have a default constructor.
+
+            The std::vector wrappers have been changed to work by default for elements that are
+            not default insertable, i.e. have no default constructor. This has been achieved by
+            not wrapping:
+
+              vector(size_type n);
+
+            Previously the above had to be ignored via %ignore.
+
+            If the above constructor is still required it can be added back in again via %extend:
+
+              %extend std::vector {
+                vector(size_type count) { return new std::vector< T >(count); }
+              }
+
+            Alternatively, the following wrapped constructor could be used as it provides near-enough
+            equivalent functionality:
+
+              vector(jint count, const value_type& value);
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2019-02-25: wsfulton
+            [Python] Fix compile errors wrapping overloaded functions/constructors where a vararg
+            function is declared after a non-vararg function.
+
+2019-02-23: zphensley42
+            Use fully qualified name 'java.lang.Object' instead of 'Object' in generated code to
+            avoid clashes with wrapped C++ classes called 'Object'.
+
+2019-02-23: gtbX
+            [Java] #1035 Add (const char *STRING, size_t LENGTH) typemaps in addition to the non-const
+            typemaps (char *STRING, size_t LENGTH) which does not attempt to write back to the const
+            string.
+
+2019-02-22: tamuratak
+            [Ruby] #984 Add support for RTypedData introduced in Ruby 1.9.3.
+
+2019-02-22: ZackerySpytz
+            #1483 Fix compilation failures when a director class has final methods.
+
+2019-02-21: wsfulton
+            [Java] #1240 Suppress Java 9 deprecation warnings on finalize method.
+
+2019-02-21: ZackerySpytz
+            #1480 Fix some rejections of valid floating-point literals.
+
+2019-02-19: wsfulton
+            #1475 Fix regression parsing gcc preprocessor linemarkers in the form:
+
+            # linenum filename flags
+
+2019-02-18: jakecobb
+            [Python] #945 #1234 Elements in std::vector memory access fix.
+
+            Accessing an element in a std::vector obtains a reference to the element via an
+            iterator pointing to the element in the container. If the vector is garbage collected,
+            the SWIG wrapper containing the pointer to the element becomes invalid. The fix is
+            to obtain a back-reference to the container by the wrapper to the element in the Python
+            layer to prevent the garbage collector from destroying the underlying container.
+
+2019-02-17: wsfulton
+            Fix typemap matching to expand template parameters when the name contains
+            template parameters. In the %typemap below the type is T and the name is X<T>::make
+            and the name now expands correctly to X< int >::make
+
+              template<typename T> struct X {
+                %typemap(out) T X<T>::make "..."
+                T make();
+              };
+
+              %template(Xint) X<int>;
+
+2019-02-16: wsfulton
+            Fix parser error containing multiple #define statements inside an enum.
+
+            The second #define fails to parse:
+
+              enum FooEnum {
+                ENUM1 = 0,
+                ENUM2 = 1,
+
+              #define MACRO_DEF1 "Hello"
+              #define MACRO_DEF2 "World!"
+
+                ENUM3 = 2,
+                ENUM4 = 3,
+              };
+
+            Bug mentioned at https://sourceforge.net/p/swig/patches/333/
+
+2019-02-14: wsfulton
+            Add some missing copy constructors into STL containers.
+
+2019-02-14: bkotzz
+            [Java] #1356 Add STL containers:
+              std::unordered_map
+              std::unordered_set
+              std::set
+
+2019-02-14: bkotzz
+            [Java] #1356 std::map wrappers have been modified. Now the Java proxy class
+            extends java.util.AbstractMap. The std::map container looks and feels much like
+            a java.util.HashMap from Java.
+
+            A few members have changed their names. If the old method signatures are needed,
+            then copy std_map.i from swig-3.0.12 and use that instead. Alternatively,
+            add the old missing methods to the new methods by using the following %proxycode:
+
+              %extend std::map {
+              %proxycode %{
+                // Old API
+                public boolean empty() {
+                  return isEmpty();
+                }
+                public void set($typemap(jboxtype, K) key, $typemap(jboxtype, T) x) {
+                  put(key, x);
+                }
+                public void del($typemap(jboxtype, K) key) {
+                  remove(key);
+                }
+                public boolean has_key($typemap(jboxtype, K) key) {
+                  return containsKey(key);
+                }
+              %}
+              }
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2019-02-13: ZackerySpytz
+            #1469 Add support for C++17 hexadecimal floating literals.
+
+2019-02-11: wsfulton
+            [OCaml] #1437 OCaml has been give the 'Experimental' language status. The examples work
+            and most of the test-suite is also working, so it is quite close to being a 'Supported' language.
+
+2019-02-10: ZackerySpytz
+	    #1464 Add support for C++14 binary integer literals.
+
+2019-02-10: ZackerySpytz
+	    #1450 Add support for C++11 UCS-2 and UCS-4 character literals. Also, add support for
+            C++17 UTF-8 character literals.
+
+2019-02-10: wsfulton
+	    [MzScheme] #1437 MzScheme/Racket is now an 'Experimental' language. The examples work
+            and a large portion of the test-suite is also working.
+
+2019-02-10: wsfulton
+	    [MzScheme] Destructor wrappers were not being generated.
+
+2019-02-10: wsfulton
+	    [MzScheme] Static variable wrappers fixed - $argnum was not expanded.
+
+2019-02-10: sethrj
+	    #1452 Fix %apply for anonymous template instantiations
+
+2019-02-09: olly
+	    [PHP] Fix access to already released memory during PHP module
+	    shutdown, which often didn't cause visible problems, but could
+	    result in segmentation faults, bus errors, etc.  Fixes #1170,
+	    reported by Jitka Plesníková.
+
+2019-02-09: olly
+	    [PHP] A renamed constructor is now wrapped as a static method in
+	    PHP.
+
+2019-02-08: olly
+	    [PHP] Don't generate code which references $r when $r hasn't been
+	    defined.  This could happen in overloaded methods which returned
+	    void and took at least one const std::string& parameter.
+
+2019-02-08: olly
+	    [PHP] The generated code is now compatible with PHP 7.3, and the
+	    testsuite now runs cleanly with this version too.
+
+2019-02-05: wsfulton
+            #1437 SWIG now classifies the status of target languages into either 'Experimental' or
+            'Supported'. This status is provided to indicate the level of maturity to expect when using
+            a particular target language as not all target languages are fully developed. Details are
+            in the Introduction.html chapter of the documentation.
+
+2019-02-04: wsfulton
+	    [CFFI] #1447 Common Lisp CFFI has been disabled as a target language in SWIG as part of a
+            clean up to remove target languages that have been neglected/not functional.
+
+2019-02-04: wsfulton
+	    [Allegrocl] #1447 Allegro Common Lisp has been disabled as a target language in SWIG as part of a
+            clean up to remove target languages that have been neglected/not functional.
+
+2019-02-04: wsfulton
+	    [Chicken] #1447 CHICKEN has been disabled as a target language in SWIG as part of a
+            clean up to remove target languages that have been neglected/not functional.
+
+2019-02-04: wsfulton
+	    [CLISP] #1447 GNU Common Lisp has been disabled as a target language in SWIG as part of a
+            clean up to remove target languages that have been neglected/not functional.
+
+2019-02-04: wsfulton
+	    [S-EXP] #1447 Common Lisp S-Exp has been disabled as a target language in SWIG as part of a
+            clean up to remove target languages that have been neglected/not functional.
+
+2019-02-04: wsfulton
+	    [UFFI] #1447 Common Lisp UFFI has been disabled as a target language in SWIG as part of a
+            clean up to remove target languages that have been neglected/not functional.
+
+2019-02-04: wsfulton
+	    [Pike] #1447 Pike has been disabled as a target language in SWIG as part of a
+            clean up to remove target languages that have been neglected/not functional.
+
+2019-02-04: wsfulton
+	    [Modula3] #1447 Modula3 has been disabled as a target language in SWIG as part of a
+            clean up to remove target languages that have been neglected/not functional.
+
+2019-02-02: ahnolds
+	    [Python] Documentation enhancements for Python:
+
+            #728 Fixed the handling of autodoc when using -fastproxy.
+
+            #1367 Added documentation to wrapped member variables using the
+            property(... doc="...") construct.
+
+            Only show a single documentation entry for functions with default arguments when
+            using autodoc.
+
+            Fixed a bug where a cached doxygen docstring could be deleted while still in use,
+            causing swig to segfault.
+
+2019-01-31: olly
+	    SWIG now requires a target language to be specified instead of
+	    defaulting to wrapping for Tcl.  Specifying swig --help without
+	    a target language now just shows the generic help.  The -nolang
+	    option has been removed.
+
+2019-01-28: ZackerySpytz
+            [OCaml] #1429 Remove support for OCaml versions < 3.12.0.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2019-01-22: vadz
+            [Ruby, Octave] #1424 Improve autodoc parameter naming.
+
+2019-01-22: vadz
+            [Python] #1271 #1423 Always include default parameter values in autodoc strings.
+
+2019-01-19: vadz
+            #1272, #1421 When a function's parameter is a keyword, the name of the paramater is
+            no longer simply changed to argN, where N is the argument number. Instead the
+            parameter name is changed to the renaming rules for keywords that normally apply to
+            symbols such as classes/functions etc. Note that unlike other symbol renaming,
+            parameter renaming does not issue a warning when the parameter is renamed. This
+            change only affects languages where the parameter names are actually used, for example,
+            Java function parameter lists in the proxy class or Python documentation comments.
+
+2019-01-18: wsfulton
+            #1420 Fix gdb debugger functions 'swigprint' and 'locswigprint' from swig.gdb to
+            work with newer versions of gdb-8. Fixes errors when debugging SWIG source with gdb:
+
+              (gdb) swigprint n
+              Undefined command: "Printf".  Try "help".
+
+2019-01-16: wsfulton
+            Python static method wrapper changes
+
+            - Static method wrappers were using the 'fastproxy' approach by default.
+              This is inconsistent with instance method wrappers. The fastproxy approach
+              is now turned off by default to be consistent with instance methods.
+              Static method wrappers can now also be controlled using the -fastproxy and
+              -olddefs options.
+
+              Example:
+
+                struct Klass {
+                  static int statmethod(int a = 2);
+                };
+
+              generates by default:
+
+              class Klass(object):
+                  ...
+                  @staticmethod
+                  def statmethod(a=2):
+                      return _example.Klass_statmethod(a)
+
+              instead of the following (which can be restored by using -fastproxy):
+
+                class Klass(object):
+                  ...
+                  statmethod = staticmethod(_example.Klass_statmethod)
+
+              - Modernise wrappers for static methods to use decorator syntax - @staticmethod.
+
+              - Add missing runtime test for static class methods and using the actual class method.
+
+2019-01-12: ZackerySpytz
+            [OCaml] #1403 #1194 Fix compilation problems for OCaml >= 4.03.0 due to OCaml using
+            int64_t instead of int64.
+
+2019-01-11: ZackerySpytz
+            [OCaml] #1400 Fix the getters and setters of non-static member variables.
+
+2019-01-07: wsfulton
+            #358 Add VOID to windows.i
+
+2019-01-05: wsfulton
+            #948 #1019 #1273 Fix for C++11 raw strings where the delimiters were mistakenly left
+            in the string contents in situations where the string was copied into generated code.
+            For example, %constant, the "docstring" feature and for C#/Java/D constants turned on
+            with %javaconst/%csconst/%dmanifestconst.
+
+2019-01-05: wsfulton
+            [Ruby] #538. Fix Ruby support for %feature("docstring").
+
+2019-01-03: wsfulton
+            #1202 Fix overloading of non-pointer class types in scripting languages when overloaded
+            with a pointer and a NULL scripting language equivalent is used, eg None in Python.
+
+            The implementation changes the SWIGTYPE, SWIGTYPE& and SWIGTYPE&& typecheck typemaps to
+            prevent accepting a conversion to a NULL pointer.
+
+2019-01-03: ZackerySpytz
+            [OCaml] #1386 Fix the OCaml examples and test suite for out-of-source builds.
+
+2019-01-01: wsfulton
+            [Python] #639 remove duplicate proxy method definitions for global function wrappers.
+
+            Global functions previously generated two definitions, eg:
+
+              def foo():
+                  return _example.foo()
+              foo = _example.foo
+
+            The first definition is replaced by the second definition and so the second definition
+            is the one used when the method is actually called. Now just the first definition is
+            generated by default and if the -fastproxy command line option is used, just the second
+            definition is generated. The second definition is faster as it avoids the proxy Python
+            method as it calls the low-level C wrapper directly. Using both -fastproxy and -olddefs
+            command line options will restore the previously generated code as it will generate both
+            method definitions.
+
+            With this change, the wrappers for global C/C++ functions and C++ class methods now work
+            in the same way wrt to generating just a proxy method by default and control via
+            -fastproxy/-olddefs options.
+
+2018-12-20: hasinoff,wsfulton
+            [Java] #1334 Set Java thread name to native thread name when using directors.
+
+            Default is to use name "Thread-XXX" and is still works like this by default. However,
+            adding the following will turn on the thread name setting (works for more recent
+            versions of Linux and MacOS):
+
+            %begin %{
+            #define SWIG_JAVA_USE_THREAD_NAME
+            %}
+
+2018-12-20: chlandsi
+            [Python] #1357. Fix overriding __new__ in Python 3.6.
+
+            Fixes SystemError: Objects/tupleobject.c:81: bad argument to internal function"
+
+2018-12-16: wsfulton
+            [Python] #848 #1343 The module import logic has changed to stop obfuscating real ImportError
+            problems. Only one import of the low-level C/C++ module from the pure Python module is
+            attempted now. Previously a second import of the low-level C/C++ module was attempted
+            after an ImportError occurred and was done to support 'split modules'. A 'split module' is
+            a configuration where the pure Python module is a module within a Python package and the
+            low-level C/C++ module is a global Python module. Now a 'split module' configuration is
+            no longer supported by default. This configuration can be supported with a simple
+            customization, such as:
+
+              %module(package="mypackage", moduleimport="import $module") foo
+
+            or if using -builtin:
+
+              %module(package="mypackage", moduleimport="from $module import *") foo
+
+            instead of
+
+              %module(package="mypackage") foo
+
+            See the updated Python chapter titled "Location of modules" in the documentation.
+
+2018-12-11: tlby
+            [Perl] #1374 repair EXTEND() handling in typemaps
+
+2018-12-06: vadz
+            #1359 #1364 Add missing nested class destructor wrapper when the nested class is
+            inside a template. Removes associated bogus 'Illegal destructor name' warning. Only
+            occurred when the nested class' destructor is explicitly specified.
+
+2018-12-04: adr26
+            [Python] #1368 #1369 Access Violation in tp_print caused by mismatched Python/extension
+            CRT usage
+
+            Remove all use of tp_print, as this API uses a FILE*, which can be
+            mismatched when modules are built with different C libraries from
+            the main python executable.
+
+            This change also brings consistent output between Python 2 and 3 for the 'cvar' SWIG
+            object (that contains the global variables) and SWIG packed objects (such as callback
+            constants).
+
+2018-12-04: wsfulton
+            [Python] #1282 Fix running 'python -m'  when using 'swig -builtin'
+
+            Similar to the earlier PEP 366 conforming fix for non-builtin.
+
+2018-11-29: adr26
+            [Python] #1360 Leak of SWIG var link object
+
+            Fix reference counting on _SWIG_globals to allow var link to be freed on module unload.
+
+2018-11-28: wsfulton
+            [Python] When using -builtin, the two step C-extension module import is now
+            one step and the wrapped API is only available once and not in an underlying
+            module attribute like it is without -builtin. To understand this, consider a
+            module named 'example' (using: %module example). The C-extension is compiled into
+            a Python module called '_example' and a pure Python module provides the actual
+            API from the module called 'example'. It was previously possible to additionally
+            access the API from the module attribute 'example._example'. The latter was an
+            implementation detail and is no longer available. It shouldn't have been used, but
+            if necessary it can be resurrected using the moduleimport attribute described in the
+            Python chapter of the documentation. If both modules are provided in a Python
+            package, try:
+
+              %module(moduleimport="from . import _example\nfrom ._example import *") example
+            or more generically:
+              %module(moduleimport="from . import $module\nfrom .$module import *") example
+
+            and if both are provided as global modules, try:
+
+              %module(moduleimport="import _example\nfrom _example import *") example
+            or more generically:
+              %module(moduleimport="import $module\nfrom $module import *") example
+
+            The module import code shown will appear in the example.py file.
+
+2018-11-24: vadz
+            #1358 Fix handling of abstract base classes nested inside templates
+
+            Correct detecting of whether a derived class method overrides a pure virtual
+            base class method when both classes are nested inside a template class: this
+            notably didn't work correctly for methods taking parameters of the base class
+            type.
+
+2018-11-22: rupertnash
+            [Python] #1282 Make generated module runnable via python -m (PEP 366 conforming)
+
+            Previously any SWIG generated modules in a package would fail with an ImportError
+            when using 'python -m' for example 'python -m mypkg.mymodule'.
+
+            This fix also allows the SWIG generated module to be placed into a directory and
+            then renamed __init__.py to convert the module into a package again. This ability
+            stopped working in swig-3.0.9. However, only Python 2.7 or 3.3 and later work. If
+            Python 3.2 support is needed, use moduleimport in %module to customise the import
+            code.
+
+2018-11-13: wsfulton
+            #1340 Remove -cppcast and -nocppcast command line options (this was an option
+            available to the scripting language targets).
+
+            The -cppcast option is still turned on by default. The -nocppcast option
+            to turn off the use of c++ casts (const_cast, static_cast etc) has been
+            removed. However, defining SWIG_NO_CPLUSPLUS_CAST will still generate C casts
+            instead of C++ casts for C++ wrappers.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2018-11-13: wsfulton
+            [Python] #1340 Remove -outputtuple and -nooutputtuple command line options.
+
+            Both the command line and %module options of the same name have been
+            removed. These were undocumented. The -outputtuple option returned a
+            Python tuple instead of a list, mostly typically in the OUTPUT
+            typemap implementations.
+
+            It unclear why a tuple instead of a list return type is needed and
+            hence this option has been removed as part of the simplification of
+            the SWIG Python command line options for SWIG 4.
+
+2018-11-13: wsfulton
+            [Python] #1340 Remove -noproxyimport command line option.
+
+            This option turned off the insertion of Python import statements
+            derived from a %import directive. For example given:
+
+              %module module_b
+              %import "module_a.i"
+
+            then module_b.py will contain:
+
+              import module_a
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2018-10-29: AlexanderGabriel
+	    [PHP] The following PHP7 reserved keywords are now only renamed by
+	    SWIG when used as function names in the API being wrapper:
+	    __halt_compiler array die echo empty eval exit include include_once
+	    isset list print require require_once return unset
+
+2018-10-22: olly,wsfulton
+            [Python] #1261 #1340 Turn on many optimisation options by default and rationalise the
+            number of command line options.
+
+            There were an unnecessary number of command line options and many of these have now
+            been removed in a drive for simplification. Some were needed to support older versions
+            of Python (2.6 and earlier).
+
+            Many of the options could be turned on individually and when using -O. Previously -O
+            resulted in turning on a set of options:
+
+              -modern -fastdispatch -nosafecstrings -fvirtual -noproxydel
+              -fastproxy -fastinit -fastunpack -fastquery -modernargs -nobuildnone
+
+            Now -O results in turning on this reduced set:
+
+              -fastdispatch -fastproxy -fvirtual
+
+            The following options are now on by default, a deprecated warning is displayed if they
+            are used:
+              -fastinit     Class initialisation code done in C/C++ rather than in Python code.
+              -fastquery    Python dictionary used for lookup of types.
+              -fastunpack   Faster unpacking of function arguments in C/C++ wrappers.
+              -modern       Use Python 2.3 features such as object and property.
+              -modernargs   Use Python 2.3 C APIs for unpacking arguments in tuples.
+              -noproxydel   Stop generating a proxy __del__ method for backwards compatiblity.
+              -safecstrings No discernable difference
+
+            The following options have been removed altogether:
+              -aliasobj0
+              -buildnone
+              -classptr
+              -new_repr
+              -newrepr
+              -noaliasobj0
+              -nobuildnone
+              -nocastmode
+              -nodirvtable
+              -noextranative
+              -nofastinit
+              -nofastproxy
+              -nofastquery
+              -nomodern
+              -nomodernargs
+              -nooutputtuple
+              -nosafecstrings
+              -old_repr
+              -oldrepr
+              -proxydel
+
+            -new_vwm is no longer supported. Use the -newvwm alias instead.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2018-10-22: olly
+            [Python] #1261 Remove command line option no longer needed as Python 2.3 and earlier
+            are no longer supported:
+
+              -classic
+
+2018-10-09: wsfulton
+            [D, Go, Guile, Lua, Mzscheme, Ocaml, Perl5, Php, Scilab, Tcl]
+            Allow wrapping of std::map using non-default comparison function.
+
+2018-10-09: vadz
+            [Java] #1274 Allow wrapping of std::map using non-default comparison function.
+
+2018-10-04: wsfulton
+            [Python] #1126 Fix C default arguments with -builtin and -fastunpack and -modernargs.
+            Problem occurred when there is just one (defaulted) parameter in the parameter list.
+
+2018-09-24: wsfulton
+            [Python] #1319 C++11 hash tables implementation is finished now (including for -builtin):
+              std::unordered_map
+              std::unordered_set
+              std::unordered_multimap
+              std::unordered_multiset
+
+2018-09-21: wsfulton
+            [Python] Fix when using -builtin and wrapping std::map, std::set, std::unordered_map or
+            std::unordered_set to ensure __contains__ is called. This is a wrapper for the STL
+            container's find method. Without it, Python will do its own slower sequence search.
+
+2018-09-19: wsfulton
+            [Python] Fix functors (wrapped as __call__) when using -builtin -modern -fastunpack.
+
+2018-09-02: andreas.gaeer,tkrasnukha
+            [Python] #1321 Fix assert in PyTuple_GET_SIZE in debug interpreter builds of python-3.7
+            when calling tp_new.
+
+2018-09-01: ChristopherHogan
+            [Guile] #1288 Fix garbage collection for guile >= 2.0.12.
+
+2018-08-31: wsfulton
+            [Python] #1319 C++11 hash tables support:
+              std::unordered_map
+              std::unordered_set
+              std::unordered_multimap
+              std::unordered_multiset
+            is now compiling and working (sorting using -builtin not fully functional yet though).
+
+2018-08-20: wkalinin
+            #1305 Fix nested structure symbol tables in C mode to fix member name conflicts
+            in different structs with the same nested struct member name.
+
+2018-08-18: wsfulton
+            [Python] #688 Fix makefile recursion when running python test-suite.
+
+2018-08-18: wsfulton
+            [Python] #1310 Re-implement Python -fastproxy option.
+
+            The previous implementation failed with Python 3 and abstract base clases.
+            The new implementation replaces the Python 2 implementation using
+            new.instancemethod with the C API PyMethod_New to match the equivalent Python 3
+            implementation which uses PyInstanceMethod_New.
+
+            The new approach runs slightly faster. See #1310.
+
+2018-08-12: gmazzamuto
+            [Python] #1283 Update pybuffer.i library to use new-style Python buffer C API.
+
+2018-08-12: brianhatwood,wsfulton
+            [Java] #1303 #1304 Fix crash in directors when using OUTPUT and INOUT typemaps in typemaps.i and
+            passing NULL pointers in C++ to director method overloaded and implemented in Java.
+
+2018-08-10: wsfulton
+            [Python] #1293 Improve TypeError message inconsistencies between default and fastdispatch
+            mode when handling overloaded C++ functions. Previously the error message did not always
+            display the possible C/C++ prototypes in fastdispatch mode.
+
+2018-08-02: furylynx,jacobwgillespie,p2k
+            [Javascript] #1290, #968. Add support for NodeJS versions 2-10.
+
+2018-07-31: wsfulton
+            [Python] #1293 Overloaded C++ function wrappers now raise a TypeError instead
+            of NotImplementedError when the types passed are incorrect. This change means
+            there is now consistency with non-overloaded function wrappers which have always
+            raised TypeError when the incorrect types are passed. The error message remains
+            the same and is for example now:
+
+              TypeError: Wrong number or type of arguments for overloaded function 'f'.
+                Possible C/C++ prototypes are:
+                  f(int)
+                  f(char const *)
+
+            instead of:
+
+              NotImplementedError: Wrong number or type of arguments for overloaded function 'f'.
+                Possible C/C++ prototypes are:
+                  f(int)
+                  f(char const *)
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2018-06-23: wsfulton
+            [Python] #718 Fix pythonnondynamic feature for modern classes
+
+            Fixes nondynamic mode when an instance variable is set with the same
+            name as a class variable in a class derived from a SWIG proxy class.
+            This corner case set an instance variable instead of raising an AttributeError.
+
+            Also fix %pythonnondynamic in Python 3 with -modern. The metaclass
+            containing the implementation was previously not being applied in Python 3.
+
+2018-07-17: petrmitrichev,wsfulton
+            [Python] #1275 #1279 Initialize function-local statics (singletons) that call Python
+            code during Python module initialization in order to avoid deadlocks with subsequent
+            multi-threaded usage.
+
+2018-06-15: wsfulton
+            [Python] Fix seg fault using Python 2 when passing a Python string, containing
+            invalid utf-8 content, to a wstring or wchar * parameter. A TypeError is thrown instead, eg:
+
+              %include <std_wstring.i>
+              void instring(const std::wstring& s);
+
+              instring(b"h\xe9llooo") # Python
+
+2018-06-15: wsfulton
+            [Python] Python 3.7 support: Replace use of deprecated PyUnicode_GetSize with
+            PyUnicode_GetLength to remove deprecated warnings compiling the C/C++ wrappers.
+
+2018-06-12: wsfulton
+            [Python] Python 3.7 support: The %pythonabc feature in pyabc.i now uses base classes
+              collections.abc.MutableSequence
+              collections.abc.MutableMapping
+              collections.abc.MutableSet
+            instead of
+              collections.MutableSequence
+              collections.MutableMapping
+              collections.MutableSet
+            as the latter are deprecated in Python 3.7 and are due to be removed in Python 3.8.
+            The classes in collections.abc.* are available from Python 3.3 onwards. If you
+            require support for Python 3.2, then copy the pyabc.i file and modify by removing
+            the few instances of the .abc sub-module.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2018-06-12: olly,wsfulton
+            [Python] #701 Remove support for Python versions < 2.7 and 3.0 and 3.1.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2018-06-11: olly
+            [Python] Fix new GCC8 warnings in generated code by avoiding casts
+            between incompatible function types where possible, and by
+            suppressing the warning when it's due to the design of Python's C
+            API.  Fixes #1259.
+
+2018-06-08: philippkraft
+	    [Python] Stop exposing <CLASS>_swigregister to Python.  It's not
+	    useful for user Python code to call this, and it just clutters the
+	    API unnecessarily.  Fixes #1225.
+
+2018-06-07: cmfoil, kabbi, Jamie Kirkpatrick, markok314, vadz, wsfulton, Yann Diorcet
+            #170 Doxygen documentation support added. This allows translation of Doxygen comments
+            into JavaDoc and PyDoc documentation. It is enabled via the -doxygen command line
+            option. See the Doxygen.html chapter in the documentation for further information.
+
+2018-06-07: olly
+	    [PHP] We've finally removed support for %pragma(php4) which was
+	    deprecated back in 2008.  Use %pragma(php) instead, which has been
+	    supported since at least 2005.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2018-06-07: olly
+	    [PHP5] Support for PHP5 has been removed.  PHP5 is no longer
+	    actively supported by the PHP developers and security support for
+	    it ends completely at the end of 2018, so it doesn't make sense
+	    to include support for it in the upcoming SWIG 4.0.0 release.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2018-06-06: olly
+	    [Lua] Improve configure probes for Lua headers and libs used in testsuite.
+
+2018-05-15: kwwette
+            [Octave] add support for version 4.4
+            - Should not introduce any user-visible incompatibilities
+
+2018-05-15: wsfulton
+            [C#, D, Java] Fix lookup of csconstruct, dconstruct and javaconstruct typemaps.
+            The C++ namespace was previously ignored when looking up the typemap.
+
+2018-05-15: wsfulton
+            [Javascript] Fix generated C++ code when using %nspace on namespaces that are more
+            than two levels deep.
+
+2018-05-14: wsfulton
+            Issue #1251 Add support for C++17 nested namespace definitions,
+            for example:
+              namespace A::B { ... }
+
+2018-05-11: wsfulton
+            [C#, D, Java] Add support so that the %csmethodmodifiers, %dmethodmodifiers,
+            %javamethodmodifiers can modify the method modifiers for the destructor wrappers
+            in the proxy class: dispose, Dispose, delete. With this feature, it is now possible
+            to make a C# proxy class sealed, eg when wrapping a class X, the virtual method modifiers
+            can be removed using:
+
+              %typemap(csclassmodifiers) X "public sealed class"
+              %csmethodmodifiers X::~X "public /*virtual*/";
+
+2018-04-18: olly
+	    [Python] Suppress new pycodestyle warning:
+	    E252 missing whitespace around parameter equals
+
+2018-04-07: goatshriek
+            [Ruby] #1213 Fix ruby %alias directive for global C/C++ functions.
+
+2018-04-03: olly
+	    [Ruby] Fix to pass Qnil instead of NULL to rb_funcall(), which silences GCC
+	    -Wconversion-null warning (on by default with recent GCC).
+
+2018-03-09: wsfulton
+            [Java] #1184 Fix swigReleaseOwnership() and swigTakeOwnership() regression
+            for non-director classes. Restores a dynamic_cast which was previously removed.
+
+2018-03-07: llongi
+	    Github PR #1166 - Fix preprocessor handling of macros with commas
+	    in a // comment.
+
+2018-02-18: JPEWdev
+            Patch #1164 - Add support for a command-line options file, also sometimes
+            called a response file. This is useful if the command-line options exceed
+            the system command-line length limit. To use, put the command-line options
+            into a file, then provide the file name prefixed with @, for example using
+            a file called args.txt:
+
+              swig @args.txt
+
+2018-02-11: wsfulton
+            [Javascript] #1187 Fix compilation error wrapping std::complex via
+            std_complex.i.
+
+2018-01-30: smarchetto
+            [Scilab] add type name argument in SWIG_ptr() function to cast from pointer address to typed pointers
+
+2018-01-16: wsfulton
+            Expressions following a preprocessor directive must now be separated by whitespace
+            or non-numeric characters. This syntax change makes the SWIG preprocessor work like
+            the C preprocessor in this area.
+
+            For example, the following code used be accepted as valid syntax:
+              #if1
+              #define ABC 123
+              #endif
+
+            Now you get an error:
+              example.h:1: Error: Unknown SWIG preprocessor directive: if1 (if this is a block of
+              target language code, delimit it with %{ and %})
+              example.h:3: Error: Extraneous #endif.
+
+            The following is the correct syntax:
+              #if 1
+              #define ABC 123
+              #endif
+
+            The following of course also works:
+              #if(1)
+              #define ABC 123
+              #endif
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2018-01-15: wsfulton
+            Fix issue #1183. Floating point exception evaluating preprocessor expressions
+            resulting in division by zero.
+
+2018-01-14: wsfulton
+            Fix issue #1172. Seg fault parsing invalid exponents in the preprocessor.
+
+2018-01-12: Liryna
+            [C#] Patch #1128. Add ToArray function to std::vector wrappers.
+
+2018-01-12: wsfulton
+            [Java] Fix issue #1156. Add missing throws clause for interfaces when using the
+            %interface family of macros.
+
+2018-01-05: wsfulton
+            Fix default arguments using expressions containing -> syntax error. Problem reported on
+            swig-user mailing list.
+
+2017-12-30: wsfulton
+            [Python] Replace pep8 with pycodestyle for checking the Python code style when
+            running Python tests.
+
+2017-12-30: davedissian
+            Fixed a symbol lookup issue when encountering a typedef of a symbol from the tag
+            namespace to the global namespace when the names are identical, such as 'typedef
+            struct Foo Foo;'.
+
+2017-12-13: wsfulton
+            [Perl] add missing support for directorfree typemaps.
+
+2017-12-13: wsfulton
+            Issue #1167 Fix directorout typemaps which were causing undefined behaviour when
+            returning pointers by reference.
+
+2017-12-08: olly
+	    [PHP] Use ZEND_MODULE_GLOBALS_ACCESSOR to access globals - this
+	    should make the generated code work with PHP 7.2.0.
+
+2017-12-04: wsfulton
+            [Python] Add missing checks for failures in calls to PyUnicode_AsUTF8String. Previously a
+            seg fault could occur when passing invalid UTF8 strings (low surrogates), eg passing
+            u"\udcff" to the C layer (Python 3).
+
+2017-11-24: joequant
+	    [R] Fix #1124 and return R_NilValue for null pointers
+
+2017-11-29: wsfulton
+            [Java] director exception handling improvements.
+
+            When a director method throws an exception and it is caught by DirectorException
+            and passed back to Java using Swig::DirectorException::throwException, the Java
+            stack trace now contains the original source line that threw the exception.
+
+            Deprecate Swig::DirectorException::raiseJavaException, please replace usage with
+            Swig::DirectorException::throwException.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2017-10-26: wsfulton
+            Add support for C++11 ref-qualifiers when using directors.
+
+2017-10-26: wsfulton
+            Fix generated code when using directors and methods returning const ref pointers.
+
+2017-10-26: wsfulton
+            [C#, D, Java, Octave, R, Scilab] Port director typemaps to these additional languages.
+            Issue #700.
+
+2017-10-26: radarsat1
+            [Ruby Python] Patch #1029 - Correct handling of null using directors and shared_ptr.
+
+2017-10-10: joequant
+	    [R] pass enum expressions to R.  This will generate
+	    incorrect files when there is an arithmetic expression
+	    in the enum, but this is better than silently generating
+	    incorrect code
+
+2017-10-09: olly
+	    [PHP] Fix incorrect wrapper code generated when there's a
+	    combination of overloading, parameters with a default value
+	    and %newobject.  Fixes https://sourceforge.net/p/swig/bugs/1350/
+
+2017-10-09: olly
+	    Remove GCJ support.  It isn't in a good state and doesn't seem to
+	    be used, and GCC7 dropped GCJ.  Closes
+	    https://sourceforge.net/p/swig/bugs/823/
+
+2017-10-07: olly
+	    Fix preprocessor handling of empty macro arguments to match that of
+	    C/C++ compilers.  Fixes issue #1111 and
+	    https://sourceforge.net/p/swig/bugs/826/
+
+2017-10-06: wsfulton
+            [Python] Issue #1108. Fix platform inconsistency in Python default argument handling.
+            32 bit and 64 bit compiled versions of SWIG generated different Python files
+            when default arguments were outside the range of 32 bit signed integers.
+            The default arguments specified in Python are now only those that are in the
+            range of a 32 bit signed integer, otherwise the default is obtained from C/C++ code.
+
+2017-10-02: wsfulton
+            [C#] Fix std::complex types passed by value.
+
+2017-10-02: wsfulton
+            [Javascript, Python, Ruby] Issue #732 - Missing type information for std::complex
+            in std_complex.i meant that previously std::complex always had to be fully qualified
+            in order to be wrapped with the appropriate typemaps.
+
+2017-10-01: joequant
+            allow R package names with docs
+	    allowing multiple get accessors in R
+	    fix smart-pointer and NAMESPACE support
+	    constructors now returning smart pointers (if class
+	    declared as such)
+	    smart-pointer classes deriving from parent smart-pointers
+
+2017-09-29: wsfulton
+            Issue #1100 - Allow an instantiated template to have the same name in the target
+            language as the C++ template name, for example, this is now possible:
+
+              template<typename T> struct X { ... };
+              %template(X) X<int>;
+
+2017-09-23: wsfulton
+            Issue #1098. Fix overloading of shared_ptr with underlying pointer types, eg:
+
+              void m(std::shared_ptr<T> p);
+              void m(T &p);
+              void m(T *p);
+
+            Only the first method is wrapped and the others are ignored/shadowed.
+            The implementation is done via a new attribute in the 'typecheck' typemap called
+            'equivalent'. If specified, it must contain the equivalent pointer type for overloading
+            and can only be used for the special SWIG_TYPECHECK_POINTER precedence level.
+            The shared_ptr 'typecheck' typemaps have been modified accordingly.
+            Here is a simplified version:
+
+              %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="T *")
+                T,
+                T CONST &,
+                T CONST *,
+                T *CONST&,
+                std::shared_ptr< T >,
+                std::shared_ptr< T > &,
+                std::shared_ptr< T > *,
+                std::shared_ptr< T > *&
+                { ... }
+
+            Overloading with any of these types will result in SWIG ignoring all but the first
+            overloaded method by default. Without the 'equivalent' attribute, wrapping the overloaded
+            methods resulted in types being shadowed (scripting languages) or code that did not
+            compile (statically typed languages).
+
+2017-09-19: futatuki
+            [Python] #1003 Add --with-2to3=/path/to/2to3 option to configure.
+
+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<int>;
+                template class vector<int>;
+              }
+
+              // valid
+              using namespace std;
+              %template(vin) vector<int>;
+              template class vector<int>;
+
+              // valid
+              using std::vector;
+              %template(vin) vector<int>;
+              template class vector<int>;
+
+              // ill-formed
+              namespace unrelated {
+                using std::vector;
+                %template(vin) vector<int>;
+                template class vector<int>;
+              }
+
+              // ill-formed
+              namespace unrelated {
+                using namespace std;
+                %template(vin) vector<int>;
+                template class vector<int>;
+              }
+
+              // ill-formed
+              namespace unrelated {
+                namespace std {
+                  %template(vin) vector<int>;
+                  template class vector<int>;
+                }
+              }
+
+              // ill-formed
+              namespace unrelated {
+                %template(vin) std::vector<int>;
+                template class std::vector<int>;
+              }
+
+            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<int>;
+
+            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'.
+
+            Previously some symbols would have been instantiated in the wrong scope and led
+            to lots of scope problems involving SWIG typemaps, features, renames etc.
+            You will need to correct the scope used in other SWIG directives which do not
+            support 'using declarations' and 'using directives'. For example, if you previously had:
+
+              %rename(Zap) vector<int>::clear;
+              using namespace std;
+              %template(VectorInt) vector<int>;
+
+            Prior versions of SWIG incorrectly instantiated vector<int> in the global namespace
+            and so the %rename matched. Now the template is instantiated in the correct namespace,
+            so is fully qualified as std::vector<int>. The other SWIG directives need correcting as
+            they do not follow 'using declarations' and 'using directives'. Change it to:
+
+              %rename(Zap) std::vector<int>::clear;
+              using namespace std;
+              %template(vin) vector<int>;
+
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2017-08-16: wsfulton
+            Fix scope lookup for template parameters containing unary scope operators.
+
+            Fixes cases like:
+
+            namespace Alloc {
+              template<typename T> 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<double>>::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<int>::Long "..."
+              template typename<T> struct XXX {
+                typedef long Long;
+              };
+              %clear XXX<int>::Long;
+
+            as the typemap was previously incorrectly stored as a typemap for long
+            instead of XXX<int>::Long.
+
+2017-08-05: olly
+	    [C++11] Allow static_assert at the top level (and disallow it right
+	    after template<T>).  Fixes issue 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<typename X> struct T {};
+              %template(TInteger) T<int>;
+
+            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 #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 <limits.h>" was generated:
+
+              // FileA.i
+              %fragment("<limits.h>", "header") %{
+                #include <limits.h>
+              %}
+
+              %{
+                #include <stdio.h>
+              %}
+              %fragment("<limits.h>");
+
+              // 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.
+            Note that boxed types are now used in the Java layer when wrapping vector of C primitive
+            types, for example. This may introduce some subtle incompatibilities due to some
+            differences in how Java converts boxed types and unboxed types. For example,
+
+              int i=0;
+              double d1 = i; // ok
+              Double d2 = i; // error: incompatible types: int cannot be converted to Double
+
+            This can be a problem when calling the add and set functions. A suggested backwards
+            compatible workaround is to use something like (shown for std::vector<double>:
+
+              #if defined(SWIGJAVA)
+              // Add in old api that uses non-boxed types
+              %extend std::vector<double> {
+              %proxycode %{
+                public void add(double x) {
+                  add(Double.valueOf(x));
+                }
+                public void set(int i, double val) {
+                  set(i, Double.valueOf(val));
+                }
+              %}
+              }
+              #endif
+
+              %include "std_vector.i"
+              %template(VectorDouble) std::vector<double>;
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+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<shared_ptr<const T>>) 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<bool> fix due to incorrect null checks
+            on VALUE obj.
+
+2017-03-17: vadz
+            [C#] #947 Add support for std::complex<T>
+
+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<T> wrapper constructors -
+            Replace constructor taking ICollection with IEnumerable and also add IEnumerable<T>
+            constructor to avoid the boxing and unboxing overhead of the original constructor,
+            when the type parameter is a value type.
+
 Version 3.0.12 (27 Jan 2017)
 ============================
 
diff --git a/CHANGES.current b/CHANGES.current
index 6d7b0ca..06373db 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -4,1388 +4,6 @@
 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 4.0.0 (in progress)
+Version 4.0.1 (in progress)
 ===========================
 
-2019-02-18: jakecobb
-            [Python] #945 #1234 Elements in std::vector memory access fix.
-
-            Accessing an element in a std::vector obtains a reference to the element via an
-            iterator pointing to the element in the container. If the vector is garbage collected,
-            the SWIG wrapper containing the pointer to the element becomes invalid. The fix is
-            to obtain a back-reference to the container by the wrapper to the element in the Python
-            layer to prevent the garbage collector from destroying the underlying container.
-
-2019-02-17: wsfulton
-            Fix typemap matching to expand template parameters when the name contains
-            template parameters. In the %typemap below the type is T and the name is X<T>::make
-            and the name now expands correctly to X< int >::make
-
-              template<typename T> struct X {
-                %typemap(out) T X<T>::make "..."
-                T make();
-              };
-
-              %template(Xint) X<int>;
-
-2019-02-16: wsfulton
-            Fix parser error containing multiple #define statements inside an enum.
-
-            The second #define fails to parse:
-
-              enum FooEnum {
-                ENUM1 = 0,
-                ENUM2 = 1,
-
-              #define MACRO_DEF1 "Hello"
-              #define MACRO_DEF2 "World!"
-
-                ENUM3 = 2,
-                ENUM4 = 3,
-              };
-
-            Bug mentioned at https://sourceforge.net/p/swig/patches/333/
-
-2019-02-14: wsfulton
-            Add some missing copy constructors into STL containers.
-
-2019-02-14: bkotzz
-            [Java] #1356 Add STL containers:
-              std::unordered_map
-              std::unordered_set
-              std::set
-
-2019-02-14: bkotzz
-            [Java] #1356 std::map wrappers have been modified. Now the Java proxy class
-            extends java.util.AbstractMap. The std::map container looks and feels much like
-            a java.util.HashMap from Java.
-
-            A few members have changed their names. If the old method signatures are needed,
-            then copy std_map.i from swig-3.0.12 and use that instead. Alternatively,
-            add the old missing methods to the new methods by using the following %proxycode:
-
-              %extend std::map {
-              %proxycode %{
-                // Old API
-                public boolean empty() {
-                  return isEmpty();
-                }
-                public void set($typemap(jboxtype, K) key, $typemap(jboxtype, T) x) {
-                  put(key, x);
-                }
-                public void del($typemap(jboxtype, K) key) {
-                  remove(key);
-                }
-                public boolean has_key($typemap(jboxtype, K) key) {
-                  return containsKey(key);
-                }
-              %}
-              }
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2019-02-13: ZackerySpytz
-            #1469 Add support for C++17 hexadecimal floating literals.
-
-2019-02-11: wsfulton
-            [OCaml] #1437 OCaml has been give the 'Experimental' language status. The examples work
-            and most of the test-suite is also working, so it is quite close to being a 'Supported' language.
-
-2019-02-10: ZackerySpytz
-	    #1464 Add support for C++14 binary integer literals.
-
-2019-02-10: ZackerySpytz
-	    #1450 Add support for C++11 UCS-2 and UCS-4 character literals. Also, add support for
-            C++17 UTF-8 character literals.
-
-2019-02-10: wsfulton
-	    [MzScheme] #1437 MzScheme/Racket is now an 'Experimental' language. The examples work
-            and a large portion of the test-suite is also working.
-
-2019-02-10: wsfulton
-	    [MzScheme] Destructor wrappers were not being generated.
-
-2019-02-10: wsfulton
-	    [MzScheme] Static variable wrappers fixed - $argnum was not expanded.
-
-2019-02-10: sethrj
-	    #1452 Fix %apply for anonymous template instantiations
-
-2019-02-09: olly
-	    [PHP] Fix access to already released memory during PHP module
-	    shutdown, which often didn't cause visible problems, but could
-	    result in segmentation faults, bus errors, etc.  Fixes #1170,
-	    reported by Jitka Plesníková.
-
-2019-02-09: olly
-	    [PHP] A renamed constructor is now wrapped as a static method in
-	    PHP.
-
-2019-02-08: olly
-	    [PHP] Don't generate code which references $r when $r hasn't been
-	    defined.  This could happen in overloaded methods which returned
-	    void and took at least one const std::string& parameter.
-
-2019-02-08: olly
-	    [PHP] The generated code is now compatible with PHP 7.3, and the
-	    testsuite now runs cleanly with this version too.
-
-2019-02-05: wsfulton
-            #1437 SWIG now classifies the status of target languages into either 'Experimental' or
-            'Supported'. This status is provided to indicate the level of maturity to expect when using
-            a particular target language as not all target languages are fully developed. Details are
-            in the Introduction.html chapter of the documentation.
-
-2019-02-04: wsfulton
-	    [CFFI] #1447 Common Lisp CFFI has been disabled as a target language in SWIG as part of a
-            clean up to remove target languages that have been neglected/not functional.
-
-2019-02-04: wsfulton
-	    [Allegrocl] #1447 Allegro Common Lisp has been disabled as a target language in SWIG as part of a
-            clean up to remove target languages that have been neglected/not functional.
-
-2019-02-04: wsfulton
-	    [Chicken] #1447 CHICKEN has been disabled as a target language in SWIG as part of a
-            clean up to remove target languages that have been neglected/not functional.
-
-2019-02-04: wsfulton
-	    [CLISP] #1447 GNU Common Lisp has been disabled as a target language in SWIG as part of a
-            clean up to remove target languages that have been neglected/not functional.
-
-2019-02-04: wsfulton
-	    [S-EXP] #1447 Common Lisp S-Exp has been disabled as a target language in SWIG as part of a
-            clean up to remove target languages that have been neglected/not functional.
-
-2019-02-04: wsfulton
-	    [UFFI] #1447 Common Lisp UFFI has been disabled as a target language in SWIG as part of a
-            clean up to remove target languages that have been neglected/not functional.
-
-2019-02-04: wsfulton
-	    [Pike] #1447 Pike has been disabled as a target language in SWIG as part of a
-            clean up to remove target languages that have been neglected/not functional.
-
-2019-02-04: wsfulton
-	    [Modula3] #1447 Modula3 has been disabled as a target language in SWIG as part of a
-            clean up to remove target languages that have been neglected/not functional.
-
-2019-02-02: ahnolds
-	    [Python] Documentation enhancements for Python:
-
-            #728 Fixed the handling of autodoc when using -fastproxy.
-
-            #1367 Added documentation to wrapped member variables using the
-            property(... doc="...") construct.
-
-            Only show a single documentation entry for functions with default arguments when
-            using autodoc.
-
-            Fixed a bug where a cached doxygen docstring could be deleted while still in use,
-            causing swig to segfault.
-
-2019-01-31: olly
-	    SWIG now requires a target language to be specified instead of
-	    defaulting to wrapping for Tcl.  Specifying swig --help without
-	    a target language now just shows the generic help.  The -nolang
-	    option has been removed.
-
-2019-01-28: ZackerySpytz
-            [OCaml] #1429 Remove support for OCaml versions < 3.12.0.
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2019-01-22: vadz
-            [Ruby, Octave] #1424 Improve autodoc parameter naming.
-
-2019-01-22: vadz
-            [Python] #1271 #1423 Always include default parameter values in autodoc strings.
-
-2019-01-19: vadz
-            #1272, #1421 When a function's parameter is a keyword, the name of the paramater is
-            no longer simply changed to argN, where N is the argument number. Instead the
-            parameter name is changed to the renaming rules for keywords that normally apply to
-            symbols such as classes/functions etc. Note that unlike other symbol renaming,
-            parameter renaming does not issue a warning when the parameter is renamed. This
-            change only affects languages where the parameter names are actually used, for example,
-            Java function parameter lists in the proxy class or Python documentation comments.
-
-2019-01-18: wsfulton
-            #1420 Fix gdb debugger functions 'swigprint' and 'locswigprint' from swig.gdb to
-            work with newer versions of gdb-8. Fixes errors when debugging SWIG source with gdb:
-
-              (gdb) swigprint n
-              Undefined command: "Printf".  Try "help".
-
-2019-01-16: wsfulton
-            Python static method wrapper changes
-
-            - Static method wrappers were using the 'fastproxy' approach by default.
-              This is inconsistent with instance method wrappers. The fastproxy approach
-              is now turned off by default to be consistent with instance methods.
-              Static method wrappers can now also be controlled using the -fastproxy and
-              -olddefs options.
-
-              Example:
-
-                struct Klass {
-                  static int statmethod(int a = 2);
-                };
-
-              generates by default:
-
-              class Klass(object):
-                  ...
-                  @staticmethod
-                  def statmethod(a=2):
-                      return _example.Klass_statmethod(a)
-
-              instead of the following (which can be restored by using -fastproxy):
-
-                class Klass(object):
-                  ...
-                  statmethod = staticmethod(_example.Klass_statmethod)
-
-              - Modernise wrappers for static methods to use decorator syntax - @staticmethod.
-
-              - Add missing runtime test for static class methods and using the actual class method.
-
-2019-01-12: ZackerySpytz
-            [OCaml] #1403 #1194 Fix compilation problems for OCaml >= 4.03.0 due to OCaml using
-            int64_t instead of int64.
-
-2019-01-11: ZackerySpytz
-            [OCaml] #1400 Fix the getters and setters of non-static member variables.
-
-2019-01-07: wsfulton
-            #358 Add VOID to windows.i
-
-2019-01-05: wsfulton
-            #948 #1019 #1273 Fix for C++11 raw strings where the delimiters were mistakenly left
-            in the string contents in situations where the string was copied into generated code.
-            For example, %constant, the "docstring" feature and for C#/Java/D constants turned on
-            with %javaconst/%csconst/%dmanifestconst.
-
-2019-01-05: wsfulton
-            [Ruby] #538. Fix Ruby support for %feature("docstring").
-
-2019-01-03: wsfulton
-            #1202 Fix overloading of non-pointer class types in scripting languages when overloaded
-            with a pointer and a NULL scripting language equivalent is used, eg None in Python.
-
-            The implementation changes the SWIGTYPE, SWIGTYPE& and SWIGTYPE&& typecheck typemaps to
-            prevent accepting a conversion to a NULL pointer.
-
-2019-01-03: ZackerySpytz
-            [OCaml] #1386 Fix the OCaml examples and test suite for out-of-source builds.
-
-2019-01-01: wsfulton
-            [Python] #639 remove duplicate proxy method definitions for global function wrappers.
-
-            Global functions previously generated two definitions, eg:
-
-              def foo():
-                  return _example.foo()
-              foo = _example.foo
-
-            The first definition is replaced by the second definition and so the second definition
-            is the one used when the method is actually called. Now just the first definition is
-            generated by default and if the -fastproxy command line option is used, just the second
-            definition is generated. The second definition is faster as it avoids the proxy Python
-            method as it calls the low-level C wrapper directly. Using both -fastproxy and -olddefs
-            command line options will restore the previously generated code as it will generate both
-            method definitions.
-
-            With this change, the wrappers for global C/C++ functions and C++ class methods now work
-            in the same way wrt to generating just a proxy method by default and control via
-            -fastproxy/-olddefs options.
-
-2018-12-20: hasinoff,wsfulton
-            [Java] #1334 Set Java thread name to native thread name when using directors.
-
-            Default is to use name "Thread-XXX" and is still works like this by default. However,
-            adding the following will turn on the thread name setting (works for more recent
-            versions of Linux and MacOS):
-
-            %begin %{
-            #define SWIG_JAVA_USE_THREAD_NAME
-            %}
-
-2018-12-20: chlandsi
-            [Python] #1357. Fix overriding __new__ in Python 3.6.
-
-            Fixes SystemError: Objects/tupleobject.c:81: bad argument to internal function"
-
-2018-12-16: wsfulton
-            [Python] #848 #1343 The module import logic has changed to stop obfuscating real ImportError
-            problems. Only one import of the low-level C/C++ module from the pure Python module is
-            attempted now. Previously a second import of the low-level C/C++ module was attempted
-            after an ImportError occurred and was done to support 'split modules'. A 'split module' is
-            a configuration where the pure Python module is a module within a Python package and the
-            low-level C/C++ module is a global Python module. Now a 'split module' configuration is
-            no longer supported by default. This configuration can be supported with a simple
-            customization, such as:
-
-              %module(package="mypackage", moduleimport="import $module") foo
-
-            or if using -builtin:
-
-              %module(package="mypackage", moduleimport="from $module import *") foo
-
-            instead of
-
-              %module(package="mypackage") foo
-
-            See the updated Python chapter titled "Location of modules" in the documentation.
-
-2018-12-11: tlby
-            [Perl] #1374 repair EXTEND() handling in typemaps
-
-2018-12-06: vadz
-            #1359 #1364 Add missing nested class destructor wrapper when the nested class is
-            inside a template. Removes associated bogus 'Illegal destructor name' warning. Only
-            occurred when the nested class' destructor is explicitly specified.
-
-2018-12-04: adr26
-            [Python] #1368 #1369 Access Violation in tp_print caused by mismatched Python/extension
-            CRT usage
-
-            Remove all use of tp_print, as this API uses a FILE*, which can be
-            mismatched when modules are built with different C libraries from
-            the main python executable.
-
-            This change also brings consistent output between Python 2 and 3 for the 'cvar' SWIG
-            object (that contains the global variables) and SWIG packed objects (such as callback
-            constants).
-
-2018-12-04: wsfulton
-            [Python] #1282 Fix running 'python -m'  when using 'swig -builtin'
-
-            Similar to the earlier PEP 366 conforming fix for non-builtin.
-
-2018-11-29: adr26
-            [Python] #1360 Leak of SWIG var link object
-
-            Fix reference counting on _SWIG_globals to allow var link to be freed on module unload.
-
-2018-11-28: wsfulton
-            [Python] When using -builtin, the two step C-extension module import is now
-            one step and the wrapped API is only available once and not in an underlying
-            module attribute like it is without -builtin. To understand this, consider a
-            module named 'example' (using: %module example). The C-extension is compiled into
-            a Python module called '_example' and a pure Python module provides the actual
-            API from the module called 'example'. It was previously possible to additionally
-            access the API from the module attribute 'example._example'. The latter was an
-            implementation detail and is no longer available. It shouldn't have been used, but
-            if necessary it can be resurrected using the moduleimport attribute described in the
-            Python chapter of the documentation. If both modules are provided in a Python
-            package, try:
-
-              %module(moduleimport="from . import _example\nfrom ._example import *") example
-            or more generically:
-              %module(moduleimport="from . import $module\nfrom .$module import *") example
-
-            and if both are provided as global modules, try:
-
-              %module(moduleimport="import _example\nfrom _example import *") example
-            or more generically:
-              %module(moduleimport="import $module\nfrom $module import *") example
-
-            The module import code shown will appear in the example.py file.
-
-2018-11-24: vadz
-            #1358 Fix handling of abstract base classes nested inside templates
-
-            Correct detecting of whether a derived class method overrides a pure virtual
-            base class method when both classes are nested inside a template class: this
-            notably didn't work correctly for methods taking parameters of the base class
-            type.
-
-2018-11-22: rupertnash
-            [Python] #1282 Make generated module runnable via python -m (PEP 366 conforming)
-
-            Previously any SWIG generated modules in a package would fail with an ImportError
-            when using 'python -m' for example 'python -m mypkg.mymodule'.
-
-            This fix also allows the SWIG generated module to be placed into a directory and
-            then renamed __init__.py to convert the module into a package again. This ability
-            stopped working in swig-3.0.9. However, only Python 2.7 or 3.3 and later work. If
-            Python 3.2 support is needed, use moduleimport in %module to customise the import
-            code.
-
-2018-11-13: wsfulton
-            #1340 Remove -cppcast and -nocppcast command line options (this was an option
-            available to the scripting language targets).
-
-            The -cppcast option is still turned on by default. The -nocppcast option
-            to turn off the use of c++ casts (const_cast, static_cast etc) has been
-            removed. However, defining SWIG_NO_CPLUSPLUS_CAST will still generate C casts
-            instead of C++ casts for C++ wrappers.
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2018-11-13: wsfulton
-            [Python] #1340 Remove -outputtuple and -nooutputtuple command line options.
-
-            Both the command line and %module options of the same name have been
-            removed. These were undocumented. The -outputtuple option returned a
-            Python tuple instead of a list, mostly typically in the OUTPUT
-            typemap implementations.
-
-            It unclear why a tuple instead of a list return type is needed and
-            hence this option has been removed as part of the simplification of
-            the SWIG Python command line options for SWIG 4.
-
-2018-11-13: wsfulton
-            [Python] #1340 Remove -noproxyimport command line option.
-
-            This option turned off the insertion of Python import statements
-            derived from a %import directive. For example given:
-
-              %module module_b
-              %import "module_a.i"
-
-            then module_b.py will contain:
-
-              import module_a
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2018-10-29: AlexanderGabriel
-	    [PHP] The following PHP7 reserved keywords are now only renamed by
-	    SWIG when used as function names in the API being wrapper:
-	    __halt_compiler array die echo empty eval exit include include_once
-	    isset list print require require_once return unset
-
-2018-10-22: olly,wsfulton
-            [Python] #1261 #1340 Turn on many optimisation options by default and rationalise the
-            number of command line options.
-
-            There were an unnecessary number of command line options and many of these have now
-            been removed in a drive for simplification. Some were needed to support older versions
-            of Python (2.6 and earlier).
-
-            Many of the options could be turned on individually and when using -O. Previously -O
-            resulted in turning on a set of options:
-
-              -modern -fastdispatch -nosafecstrings -fvirtual -noproxydel
-              -fastproxy -fastinit -fastunpack -fastquery -modernargs -nobuildnone
-
-            Now -O results in turning on this reduced set:
-
-              -fastdispatch -fastproxy -fvirtual
-
-            The following options are now on by default, a deprecated warning is displayed if they
-            are used:
-              -fastinit     Class initialisation code done in C/C++ rather than in Python code.
-              -fastquery    Python dictionary used for lookup of types.
-              -fastunpack   Faster unpacking of function arguments in C/C++ wrappers.
-              -modern       Use Python 2.3 features such as object and property.
-              -modernargs   Use Python 2.3 C APIs for unpacking arguments in tuples.
-              -noproxydel   Stop generating a proxy __del__ method for backwards compatiblity.
-              -safecstrings No discernable difference
-
-            The following options have been removed altogether:
-              -aliasobj0
-              -buildnone
-              -classptr
-              -new_repr
-              -newrepr
-              -noaliasobj0
-              -nobuildnone
-              -nocastmode
-              -nodirvtable
-              -noextranative
-              -nofastinit
-              -nofastproxy
-              -nofastquery
-              -nomodern
-              -nomodernargs
-              -nooutputtuple
-              -nosafecstrings
-              -old_repr
-              -oldrepr
-              -proxydel
-
-            -new_vwm is no longer supported. Use the -newvwm alias instead.
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2018-10-22: olly
-            [Python] #1261 Remove command line option no longer needed as Python 2.3 and earlier
-            are no longer supported:
-
-              -classic
-
-2018-10-09: wsfulton
-            [D, Go, Guile, Lua, Mzscheme, Ocaml, Perl5, Php, Scilab, Tcl]
-            Allow wrapping of std::map using non-default comparison function.
-
-2018-10-09: vadz
-            [Java] #1274 Allow wrapping of std::map using non-default comparison function.
-
-2018-10-04: wsfulton
-            [Python] #1126 Fix C default arguments with -builtin and -fastunpack and -modernargs.
-            Problem occurred when there is just one (defaulted) parameter in the parameter list.
-
-2018-09-24: wsfulton
-            [Python] #1319 C++11 hash tables implementation is finished now (including for -builtin):
-              std::unordered_map
-              std::unordered_set
-              std::unordered_multimap
-              std::unordered_multiset
-
-2018-09-21: wsfulton
-            [Python] Fix when using -builtin and wrapping std::map, std::set, std::unordered_map or
-            std::unordered_set to ensure __contains__ is called. This is a wrapper for the STL
-            container's find method. Without it, Python will do its own slower sequence search.
-
-2018-09-19: wsfulton
-            [Python] Fix functors (wrapped as __call__) when using -builtin -modern -fastunpack.
-
-2018-09-02: andreas.gaeer,tkrasnukha
-            [Python] #1321 Fix assert in PyTuple_GET_SIZE in debug interpreter builds of python-3.7
-            when calling tp_new.
-
-2018-09-01: ChristopherHogan
-            [Guile] #1288 Fix garbage collection for guile >= 2.0.12.
-
-2018-08-31: wsfulton
-            [Python] #1319 C++11 hash tables support:
-              std::unordered_map
-              std::unordered_set
-              std::unordered_multimap
-              std::unordered_multiset
-            is now compiling and working (sorting using -builtin not fully functional yet though).
-
-2018-08-20: wkalinin
-            #1305 Fix nested structure symbol tables in C mode to fix member name conflicts
-            in different structs with the same nested struct member name.
-
-2018-08-18: wsfulton
-            [Python] #688 Fix makefile recursion when running python test-suite.
-
-2018-08-18: wsfulton
-            [Python] #1310 Re-implement Python -fastproxy option.
-
-            The previous implementation failed with Python 3 and abstract base clases.
-            The new implementation replaces the Python 2 implementation using
-            new.instancemethod with the C API PyMethod_New to match the equivalent Python 3
-            implementation which uses PyInstanceMethod_New.
-
-            The new approach runs slightly faster. See #1310.
-
-2018-08-12: gmazzamuto
-            [Python] #1283 Update pybuffer.i library to use new-style Python buffer C API.
-
-2018-08-12: brianhatwood,wsfulton
-            [Java] #1303 #1304 Fix crash in directors when using OUTPUT and INOUT typemaps in typemaps.i and
-            passing NULL pointers in C++ to director method overloaded and implemented in Java.
-
-2018-08-10: wsfulton
-            [Python] #1293 Improve TypeError message inconsistencies between default and fastdispatch
-            mode when handling overloaded C++ functions. Previously the error message did not always
-            display the possible C/C++ prototypes in fastdispatch mode.
-
-2018-08-02: furylynx,jacobwgillespie,p2k
-            [Javascript] #1290, #968. Add support for NodeJS versions 2-10.
-
-2018-07-31: wsfulton
-            [Python] #1293 Overloaded C++ function wrappers now raise a TypeError instead
-            of NotImplementedError when the types passed are incorrect. This change means
-            there is now consistency with non-overloaded function wrappers which have always
-            raised TypeError when the incorrect types are passed. The error message remains
-            the same and is for example now:
-
-              TypeError: Wrong number or type of arguments for overloaded function 'f'.
-                Possible C/C++ prototypes are:
-                  f(int)
-                  f(char const *)
-
-            instead of:
-
-              NotImplementedError: Wrong number or type of arguments for overloaded function 'f'.
-                Possible C/C++ prototypes are:
-                  f(int)
-                  f(char const *)
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2018-06-23: wsfulton
-            [Python] #718 Fix pythonnondynamic feature for modern classes
-
-            Fixes nondynamic mode when an instance variable is set with the same
-            name as a class variable in a class derived from a SWIG proxy class.
-            This corner case set an instance variable instead of raising an AttributeError.
-
-            Also fix %pythonnondynamic in Python 3 with -modern. The metaclass
-            containing the implementation was previously not being applied in Python 3.
-
-2018-07-17: petrmitrichev,wsfulton
-            [Python] #1275 #1279 Initialize function-local statics (singletons) that call Python
-            code during Python module initialization in order to avoid deadlocks with subsequent
-            multi-threaded usage.
-
-2018-06-15: wsfulton
-            [Python] Fix seg fault using Python 2 when passing a Python string, containing
-            invalid utf-8 content, to a wstring or wchar * parameter. A TypeError is thrown instead, eg:
-
-              %include <std_wstring.i>
-              void instring(const std::wstring& s);
-
-              instring(b"h\xe9llooo") # Python
-
-2018-06-15: wsfulton
-            [Python] Python 3.7 support: Replace use of deprecated PyUnicode_GetSize with
-            PyUnicode_GetLength to remove deprecated warnings compiling the C/C++ wrappers.
-
-2018-06-12: wsfulton
-            [Python] Python 3.7 support: The %pythonabc feature in pyabc.i now uses base classes
-              collections.abc.MutableSequence
-              collections.abc.MutableMapping
-              collections.abc.MutableSet
-            instead of
-              collections.MutableSequence
-              collections.MutableMapping
-              collections.MutableSet
-            as the latter are deprecated in Python 3.7 and are due to be removed in Python 3.8.
-            The classes in collections.abc.* are available from Python 3.3 onwards. If you
-            require support for Python 3.2, then copy the pyabc.i file and modify by removing
-            the few instances of the .abc sub-module.
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2018-06-12: olly,wsfulton
-            [Python] #701 Remove support for Python versions < 2.7 and 3.0 and 3.1.
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2018-06-11: olly
-            [Python] Fix new GCC8 warnings in generated code by avoiding casts
-            between incompatible function types where possible, and by
-            suppressing the warning when it's due to the design of Python's C
-            API.  Fixes #1259.
-
-2018-06-08: philippkraft
-	    [Python] Stop exposing <CLASS>_swigregister to Python.  It's not
-	    useful for user Python code to call this, and it just clutters the
-	    API unnecessarily.  Fixes #1225.
-
-2018-06-07: cmfoil, kabbi, Jamie Kirkpatrick, markok314, vadz, wsfulton, Yann Diorcet
-            #170 Doxygen documentation support added. This allows translation of Doxygen comments
-            into JavaDoc and PyDoc documentation. It is enabled via the -doxygen command line
-            option. See the Doxygen.html chapter in the documentation for further information.
-
-2018-06-07: olly
-	    [PHP] We've finally removed support for %pragma(php4) which was
-	    deprecated back in 2008.  Use %pragma(php) instead, which has been
-	    supported since at least 2005.
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2018-06-07: olly
-	    [PHP5] Support for PHP5 has been removed.  PHP5 is no longer
-	    actively supported by the PHP developers and security support for
-	    it ends completely at the end of 2018, so it doesn't make sense
-	    to include support for it in the upcoming SWIG 4.0.0 release.
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2018-06-06: olly
-	    [Lua] Improve configure probes for Lua headers and libs used in testsuite.
-
-2018-05-15: kwwette
-            [Octave] add support for version 4.4
-            - Should not introduce any user-visible incompatibilities
-
-2018-05-15: wsfulton
-            [C#, D, Java] Fix lookup of csconstruct, dconstruct and javaconstruct typemaps.
-            The C++ namespace was previously ignored when looking up the typemap.
-
-2018-05-15: wsfulton
-            [Javascript] Fix generated C++ code when using %nspace on namespaces that are more
-            than two levels deep.
-
-2018-05-14: wsfulton
-            Issue #1251 Add support for C++17 nested namespace definitions,
-            for example:
-              namespace A::B { ... }
-
-2018-05-11: wsfulton
-            [C#, D, Java] Add support so that the %csmethodmodifiers, %dmethodmodifiers,
-            %javamethodmodifiers can modify the method modifiers for the destructor wrappers
-            in the proxy class: dispose, Dispose, delete. With this feature, it is now possible
-            to make a C# proxy class sealed, eg when wrapping a class X, the virtual method modifiers
-            can be removed using:
-
-              %typemap(csclassmodifiers) X "public sealed class"
-              %csmethodmodifiers X::~X "public /*virtual*/";
-
-2018-04-18: olly
-	    [Python] Suppress new pycodestyle warning:
-	    E252 missing whitespace around parameter equals
-
-2018-04-07: goatshriek
-            [Ruby] #1213 Fix ruby %alias directive for global C/C++ functions.
-
-2018-04-03: olly
-	    [Ruby] Fix to pass Qnil instead of NULL to rb_funcall(), which silences GCC
-	    -Wconversion-null warning (on by default with recent GCC).
-
-2018-03-09: wsfulton
-            [Java] #1184 Fix swigReleaseOwnership() and swigTakeOwnership() regression
-            for non-director classes. Restores a dynamic_cast which was previously removed.
-
-2018-03-07: llongi
-	    Github PR #1166 - Fix preprocessor handling of macros with commas
-	    in a // comment.
-
-2018-02-18: JPEWdev
-            Patch #1164 - Add support for a command-line options file, also sometimes
-            called a response file. This is useful if the command-line options exceed
-            the system command-line length limit. To use, put the command-line options
-            into a file, then provide the file name prefixed with @, for example using
-            a file called args.txt:
-
-              swig @args.txt
-
-2018-02-11: wsfulton
-            [Javascript] #1187 Fix compilation error wrapping std::complex via
-            std_complex.i.
-
-2018-01-30: smarchetto
-            [Scilab] add type name argument in SWIG_ptr() function to cast from pointer address to typed pointers
-
-2018-01-16: wsfulton
-            Expressions following a preprocessor directive must now be separated by whitespace
-            or non-numeric characters. This syntax change makes the SWIG preprocessor work like
-            the C preprocessor in this area.
-
-            For example, the following code used be accepted as valid syntax:
-              #if1
-              #define ABC 123
-              #endif
-
-            Now you get an error:
-              example.h:1: Error: Unknown SWIG preprocessor directive: if1 (if this is a block of
-              target language code, delimit it with %{ and %})
-              example.h:3: Error: Extraneous #endif.
-
-            The following is the correct syntax:
-              #if 1
-              #define ABC 123
-              #endif
-
-            The following of course also works:
-              #if(1)
-              #define ABC 123
-              #endif
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2018-01-15: wsfulton
-            Fix issue #1183. Floating point exception evaluating preprocessor expressions
-            resulting in division by zero.
-
-2018-01-14: wsfulton
-            Fix issue #1172. Seg fault parsing invalid exponents in the preprocessor.
-
-2018-01-12: Liryna
-            [C#] Patch #1128. Add ToArray function to std::vector wrappers.
-
-2018-01-12: wsfulton
-            [Java] Fix issue #1156. Add missing throws clause for interfaces when using the
-            %interface family of macros.
-
-2018-01-05: wsfulton
-            Fix default arguments using expressions containing -> syntax error. Problem reported on
-            swig-user mailing list.
-
-2017-12-30: wsfulton
-            [Python] Replace pep8 with pycodestyle for checking the Python code style when
-            running Python tests.
-
-2017-12-30: davedissian
-            Fixed a symbol lookup issue when encountering a typedef of a symbol from the tag
-            namespace to the global namespace when the names are identical, such as 'typedef
-            struct Foo Foo;'.
-
-2017-12-13: wsfulton
-            [Perl] add missing support for directorfree typemaps.
-
-2017-12-13: wsfulton
-            Issue #1167 Fix directorout typemaps which were causing undefined behaviour when
-            returning pointers by reference.
-
-2017-12-08: olly
-	    [PHP] Use ZEND_MODULE_GLOBALS_ACCESSOR to access globals - this
-	    should make the generated code work with PHP 7.2.0.
-
-2017-12-04: wsfulton
-            [Python] Add missing checks for failures in calls to PyUnicode_AsUTF8String. Previously a
-            seg fault could occur when passing invalid UTF8 strings (low surrogates), eg passing
-            u"\udcff" to the C layer (Python 3).
-
-2017-11-24: joequant
-	    Fix #1124 and return R_NilValue for null pointers
-
-2017-11-29: wsfulton
-            [Java] director exception handling improvements.
-
-            When a director method throws an exception and it is caught by DirectorException
-            and passed back to Java using Swig::DirectorException::throwException, the Java
-            stack trace now contains the original source line that threw the exception.
-
-            Deprecate Swig::DirectorException::raiseJavaException, please replace usage with
-            Swig::DirectorException::throwException.
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2017-10-26: wsfulton
-            Add support for C++11 ref-qualifiers when using directors.
-
-2017-10-26: wsfulton
-            Fix generated code when using directors and methods returning const ref pointers.
-
-2017-10-26: wsfulton
-            [C#, D, Java, Octave, R, Scilab] Port director typemaps to these additional languages.
-            Issue #700.
-
-2017-10-26: radarsat1
-            [Ruby Python] Patch #1029 - Correct handling of null using directors and shared_ptr.
-
-2017-10-10: joequant
-	    [R] pass enum expressions to R.  This will generate
-	    incorrect files when there is an arithmetic expression
-	    in the enum, but this is better than silently generating
-	    incorrect code
-
-2017-10-09: olly
-	    [PHP] Fix incorrect wrapper code generated when there's a
-	    combination of overloading, parameters with a default value
-	    and %newobject.  Fixes https://sourceforge.net/p/swig/bugs/1350/
-
-2017-10-09: olly
-	    Remove GCJ support.  It isn't in a good state and doesn't seem to
-	    be used, and GCC7 dropped GCJ.  Closes
-	    https://sourceforge.net/p/swig/bugs/823/
-
-2017-10-07: olly
-	    Fix preprocessor handling of empty macro arguments to match that of
-	    C/C++ compilers.  Fixes https://github.com/swig/swig/pull/1111 and
-	    https://sourceforge.net/p/swig/bugs/826/
-
-2017-10-06: wsfulton
-            [Python] Issue #1108. Fix platform inconsistency in Python default argument handling.
-            32 bit and 64 bit compiled versions of SWIG generated different Python files
-            when default arguments were outside the range of 32 bit signed integers.
-            The default arguments specified in Python are now only those that are in the
-            range of a 32 bit signed integer, otherwise the default is obtained from C/C++ code.
-
-2017-10-02: wsfulton
-            [C#] Fix std::complex types passed by value.
-
-2017-10-02: wsfulton
-            [Javascript, Python, Ruby] Issue #732 - Missing type information for std::complex
-            in std_complex.i meant that previously std::complex always had to be fully qualified
-            in order to be wrapped with the appropriate typemaps.
-
-2017-10-01: joequant
-            allow R package names with docs
-	    allowing multiple get accessors in R
-	    fix smrt-pointer and NAMESPACE support
-	    constructors now returning smart pointers (if class
-	    declared as such)
-	    smart-pointer classes deriving from parent smart-pointers
-
-2017-09-29: wsfulton
-            Issue #1100 - Allow an instantiated template to have the same name in the target
-            language as the C++ template name, for example, this is now possible:
-
-              template<typename T> struct X { ... };
-              %template(X) X<int>;
-
-2017-09-23: wsfulton
-            Issue #1098. Fix overloading of shared_ptr with underlying pointer types, eg:
-
-              void m(std::shared_ptr<T> p);
-              void m(T &p);
-              void m(T *p);
-
-            Only the first method is wrapped and the others are ignored/shadowed.
-            The implementation is done via a new attribute in the 'typecheck' typemap called
-            'equivalent'. If specified, it must contain the equivalent pointer type for overloading
-            and can only be used for the special SWIG_TYPECHECK_POINTER precedence level.
-            The shared_ptr 'typecheck' typemaps have been modified accordingly.
-            Here is a simplified version:
-
-              %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="T *")
-                T,
-                T CONST &,
-                T CONST *,
-                T *CONST&,
-                std::shared_ptr< T >,
-                std::shared_ptr< T > &,
-                std::shared_ptr< T > *,
-                std::shared_ptr< T > *&
-                { ... }
-
-            Overloading with any of these types will result in SWIG ignoring all but the first
-            overloaded method by default. Without the 'equivalent' attribute, wrapping the overloaded
-            methods resulted in types being shadowed (scripting languages) or code that did not
-            compile (statically typed languages).
-
-2017-09-19: futatuki
-            [Python] #1003 Add --with-2to3=/path/to/2to3 option to configure.
-
-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<int>;
-                template class vector<int>;
-              }
-
-              // valid
-              using namespace std;
-              %template(vin) vector<int>;
-              template class vector<int>;
-
-              // valid
-              using std::vector;
-              %template(vin) vector<int>;
-              template class vector<int>;
-
-              // ill-formed
-              namespace unrelated {
-                using std::vector;
-                %template(vin) vector<int>;
-                template class vector<int>;
-              }
-
-              // ill-formed
-              namespace unrelated {
-                using namespace std;
-                %template(vin) vector<int>;
-                template class vector<int>;
-              }
-
-              // ill-formed
-              namespace unrelated {
-                namespace std {
-                  %template(vin) vector<int>;
-                  template class vector<int>;
-                }
-              }
-
-              // ill-formed
-              namespace unrelated {
-                %template(vin) std::vector<int>;
-                template class std::vector<int>;
-              }
-
-            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<int>;
-
-            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'.
-
-            Previously some symbols would have been instantiated in the wrong scope and led
-            to lots of scope problems involving SWIG typemaps, features, renames etc.
-            You will need to correct the scope used in other SWIG directives which do not
-            support 'using declarations' and 'using directives'. For example, if you previously had:
-
-              %rename(Zap) vector<int>::clear;
-              using namespace std;
-              %template(VectorInt) vector<int>;
-
-            Prior versions of SWIG incorrectly instantiated vector<int> in the global namespace
-            and so the %rename matched. Now the template is instantiated in the correct namespace,
-            so is fully qualified as std::vector<int>. The other SWIG directives need correcting as
-            they do not follow 'using declarations' and 'using directives'. Change it to:
-
-              %rename(Zap) std::vector<int>::clear;
-              using namespace std;
-              %template(vin) vector<int>;
-
-
-            *** POTENTIAL INCOMPATIBILITY ***
-
-2017-08-16: wsfulton
-            Fix scope lookup for template parameters containing unary scope operators.
-
-            Fixes cases like:
-
-            namespace Alloc {
-              template<typename T> 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<double>>::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<int>::Long "..."
-              template typename<T> struct XXX {
-                typedef long Long;
-              };
-              %clear XXX<int>::Long;
-
-            as the typemap was previously incorrectly stored as a typemap for long
-            instead of XXX<int>::Long.
-
-2017-08-05: olly
-	    [C++11] Allow static_assert at the top level (and disallow it right
-	    after template<T>).  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<typename X> struct T {};
-              %template(TInteger) T<int>;
-
-            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 <limits.h>" was generated:
-
-              // FileA.i
-              %fragment("<limits.h>", "header") %{
-                #include <limits.h>
-              %}
-
-              %{
-                #include <stdio.h>
-              %}
-              %fragment("<limits.h>");
-
-              // 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<shared_ptr<const T>>) 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<bool> fix due to incorrect null checks
-            on VALUE obj.
-
-2017-03-17: vadz
-            [C#] #947 Add support for std::complex<T>
-
-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<T> wrapper constructors -
-            Replace constructor taking ICollection with IEnumerable and also add IEnumerable<T>
-            constructor to avoid the boxing and unboxing overhead of the original constructor,
-            when the type parameter is a value type.
diff --git a/COPYRIGHT b/COPYRIGHT
index baf15a5..e6df73f 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -19,6 +19,7 @@
  Oliver Buchtala (oliver.buchtala@gmail.com)              (Javascript)
  Neha Narang (narangneha03@gmail.com)                     (Javascript)
  Simon Marchetto (simon.marchetto@scilab-enterprises.com) (Scilab)
+ Zackery Spytz (zspytz@gmail.com)                         (OCaml, SWIG core)
 
 Past SWIG developers and major contributors include:
  Dave Beazley (dave-swig@dabeaz.com)                      (SWIG core, Python, Tcl, Perl)
@@ -28,7 +29,7 @@
  Mikel Bancroft (mikel@franz.com)                         (Allegro CL)
  Surendra Singhi (efuzzyone@netscape.net)                 (CLISP, CFFI)
  Marcelo Matus (mmatus@acms.arizona.edu)                  (SWIG core, Python, UTL[python,perl,tcl,ruby])
- Art Yerkes (ayerkes@speakeasy.net)                       (Ocaml)
+ Art Yerkes (ayerkes@speakeasy.net)                       (OCaml)
  Lyle Johnson (lyle@users.sourceforge.net)                (Ruby)
  Charlie Savage (cfis@interserv.com)                      (Ruby)
  Thien-Thi Nguyen (ttn@glug.org)                          (build/test/misc)
diff --git a/Doc/Manual/Android.html b/Doc/Manual/Android.html
index 8947241..944a88d 100644
--- a/Doc/Manual/Android.html
+++ b/Doc/Manual/Android.html
@@ -48,7 +48,7 @@
 
 
 <p>
-The examples require the <a href="http://developer.android.com/sdk/index.html">Android SDK</a> and <a href="http://developer.android.com/tools/sdk/ndk/index.html">Android NDK</a> which can be installed as per instructions in the links.
+The examples require the <a href="https://developer.android.com/sdk/">Android SDK</a> and <a href="https://developer.android.com/ndk/">Android NDK</a> 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):
 </p>
@@ -326,7 +326,7 @@
 </div>
 
 <p>
-See the <a href="http://developer.android.com/sdk/ndk/index.html">Android NDK documentation</a> for more on the NDK build system and getting started with the NDK.
+See the <a href="https://developer.android.com/ndk/">Android NDK documentation</a> for more on the NDK build system and getting started with the NDK.
 A simple invocation of ndk-build will compile the .c files and generate a shared object/system library. Output will be similar to:
 </p>
 
diff --git a/Doc/Manual/CCache.html b/Doc/Manual/CCache.html
index 3a7db5c..edd435f 100644
--- a/Doc/Manual/CCache.html
+++ b/Doc/Manual/CCache.html
@@ -458,7 +458,7 @@
 
 <p>
 ccache was written by Andrew Tridgell
-<a href="http://samba.org/~tridge/">http://samba.org/~tridge/</a>.
+<a href="https://www.samba.org/~tridge/">https://www.samba.org/~tridge/</a>.
 ccache was adapted to create ccache-swig for use with SWIG by William Fulton.
 <p>
 If you wish to report a problem or make a suggestion then please email
diff --git a/Doc/Manual/CSharp.html b/Doc/Manual/CSharp.html
index 7a9b747..1fc2d21 100644
--- a/Doc/Manual/CSharp.html
+++ b/Doc/Manual/CSharp.html
@@ -64,15 +64,15 @@
 The PInvoke interface has been chosen over Microsoft's Managed C++ interface as it is portable to both Microsoft Windows and non-Microsoft platforms.
 PInvoke is part of the ECMA/ISO C# specification.
 It is also better suited for robust production environments due to the Managed C++ flaw called the
-<a href="http://msdn.microsoft.com/en-us/library/aa290048(VS.71).aspx">Mixed DLL Loading Problem</a>.
+<a href="https://msdn.microsoft.com/en-us/ie/aa290048(v=vs.94)">Mixed DLL Loading Problem</a>.
 SWIG C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using
-<a href="http://www.mono-project.com/Main_Page">Mono</a> and <a href="http://www.dotgnu.org/pnet.html">Portable.NET</a>.
+<a href="https://www.mono-project.com/Main_Page/">Mono</a> and <a href="http://www.dotgnu.org/pnet.html">Portable.NET</a>.
 </p>
 
 <p>
 To get the most out of this chapter an understanding of interop is required.
-The <a href="http://msdn.microsoft.com">Microsoft Developer Network (MSDN)</a> has a good reference guide in a section titled "Interop Marshaling".
-Monodoc, available from the Mono project, has a very useful section titled <a href="http://www.mono-project.com/docs/advanced/pinvoke/">Interop with native libraries</a>.
+The <a href="https://msdn.microsoft.com">Microsoft Developer Network (MSDN)</a> has a good reference guide in a section titled "Interop Marshaling".
+Monodoc, available from the Mono project, has a very useful section titled <a href="https://www.mono-project.com/docs/advanced/pinvoke/">Interop with native libraries</a>.
 </p>
 
 <H3><a name="CSharp_introduction_swig2_compatibility">22.1.1 SWIG 2 Compatibility</a></H3>
@@ -232,8 +232,8 @@
 javaimports                 -&gt; csimports
 javabody                    -&gt; csbody
 javafinalize                -&gt; csfinalize
-javadestruct                -&gt; csdestruct
-javadestruct_derived        -&gt; csdestruct_derived
+javadestruct                -&gt; csdisposing and csdispose
+javadestruct_derived        -&gt; csdisposing_derived and csdispose_derived
 javainterfacecode           -&gt; csinterfacecode
 </pre></div>
 
@@ -643,7 +643,7 @@
 
 <p>
 For more information on the subject, see  the
-<a href="http://msdn.microsoft.com/en-us/library/z6cfh6e6(VS.80).aspx">Default Marshaling for Arrays</a> article
+<a href="https://docs.microsoft.com/en-us/dotnet/framework/interop/default-marshaling-for-arrays">Default Marshaling for Arrays</a> article
 on MSDN.
 </p>
 
@@ -763,7 +763,7 @@
 </p>
 
 <p>
-For more information, see the <a href="http://msdn.microsoft.com/en-us/library/f58wzh21(VS.80).aspx">fixed statement</a> in the C# language reference.
+For more information, see the <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/fixed-statement">fixed statement</a> in the C# language reference.
 </p>
 
 
diff --git a/Doc/Manual/Contents.html b/Doc/Manual/Contents.html
index fa1ef9b..57aef5b 100644
--- a/Doc/Manual/Contents.html
+++ b/Doc/Manual/Contents.html
@@ -647,6 +647,10 @@
 <li><a href="Doxygen.html#Doxygen_python_unsupported_tags">Unsupported tags</a>
 <li><a href="Doxygen.html#Doxygen_python_further_details">Further details</a>
 </ul>
+<li><a href="Doxygen.html#Doxygen_troubleshooting">Troubleshooting</a>
+<ul>
+<li><a href="Doxygen.html#troubleshooting_ifndef">Problem with conditional compilation</a>
+</ul>
 <li><a href="Doxygen.html#Doxygen_developer_details">Developer information</a>
 <ul>
 <li><a href="Doxygen.html#Doxygen_translator_design">Doxygen translator design</a>
diff --git a/Doc/Manual/D.html b/Doc/Manual/D.html
index a252650..d97267a 100644
--- a/Doc/Manual/D.html
+++ b/Doc/Manual/D.html
@@ -56,7 +56,7 @@
 <H2><a name="D_command_line_invocation">23.2 Command line invocation</a></H2>
 
 
-<p>To activate the D module, pass the <tt>-d</tt> option to SWIG at the command line. The same standard command line switches as with any other language module are available, plus the following D specific ones:</p>
+<p>To activate the D module, pass the <tt>-d</tt> option to SWIG at the command line. The same standard command line options as with any other language module are available, plus the following D specific ones:</p>
 
 <dl>
   <dt><tt>-d2</tt></dt>
@@ -66,8 +66,8 @@
 
   <dt><a name="D_splitproxy"></a><tt>-splitproxy</tt></dt>
   <dd>
-    <p>By default, SWIG generates two D modules: the <em>proxy</em> module, named like the source module (either specified via the <tt>%module</tt> directive or via the <tt>module</tt> command line switch), which contains all the proxy classes, functions, enums, etc., and the <em>intermediary</em> module (named like the proxy module, but suffixed with <tt>_im</tt>), which contains all the <tt>extern(C)</tt> function declarations and other private parts only used internally by the proxy module.</p>
-    <p>If the split proxy mode is enabled by passing this switch at the command line, all proxy classes and enums are emitted to their own D module instead. The main proxy module only contains free functions and constants in this case.</p>
+    <p>By default, SWIG generates two D modules: the <em>proxy</em> module, named like the source module (either specified via the <tt>%module</tt> directive or via the <tt>module</tt> command line option), which contains all the proxy classes, functions, enums, etc., and the <em>intermediary</em> module (named like the proxy module, but suffixed with <tt>_im</tt>), which contains all the <tt>extern(C)</tt> function declarations and other private parts only used internally by the proxy module.</p>
+    <p>If the split proxy mode is enabled by passing this option at the command line, all proxy classes and enums are emitted to their own D module instead. The main proxy module only contains free functions and constants in this case.</p>
   </dd>
 
   <dt><tt>-package &lt;pkg&gt;</tt></dt>
@@ -77,7 +77,7 @@
 
   <dt><tt>-wrapperlibrary &lt;wl&gt;</tt></dt>
   <dd>
-    <p>The code SWIG generates to dynamically load the C/C++ wrapper layer looks for a library called <tt>$module_wrap</tt> by default. With this switch, you can override the name of the file the wrapper code loads at runtime (the <tt>lib</tt> prefix and the suffix for shared libraries are appended automatically, depending on the OS).</p>
+    <p>The code SWIG generates to dynamically load the C/C++ wrapper layer looks for a library called <tt>$module_wrap</tt> by default. With this option, you can override the name of the file the wrapper code loads at runtime (the <tt>lib</tt> prefix and the suffix for shared libraries are appended automatically, depending on the OS).</p>
     <p>This might especially be useful if you want to invoke SWIG several times on separate modules, but compile the resulting code into a single shared library.</p>
   </dd>
 </dl>
@@ -107,8 +107,8 @@
  csimports              &lt;-&gt;  dimports
  csbody                 &lt;-&gt;  dbody
  csfinalize             &lt;-&gt;  ddestructor
- csdestruct             &lt;-&gt;  ddispose
- csdestruct_derived     &lt;-&gt;  ddispose_derived
+ csdisposing            &lt;-&gt;  ddispose
+ csdisposing_derived    &lt;-&gt;  ddispose_derived
 </pre></div>
 
 
diff --git a/Doc/Manual/Doxygen.html b/Doc/Manual/Doxygen.html
index b14b05b..ff025c0 100644
--- a/Doc/Manual/Doxygen.html
+++ b/Doc/Manual/Doxygen.html
@@ -37,6 +37,10 @@
 <li><a href="#Doxygen_python_unsupported_tags">Unsupported tags</a>
 <li><a href="#Doxygen_python_further_details">Further details</a>
 </ul>
+<li><a href="#Doxygen_troubleshooting">Troubleshooting</a>
+<ul>
+<li><a href="#troubleshooting_ifndef">Problem with conditional compilation</a>
+</ul>
 <li><a href="#Doxygen_developer_details">Developer information</a>
 <ul>
 <li><a href="#Doxygen_translator_design">Doxygen translator design</a>
@@ -63,13 +67,13 @@
 <p>
 The Doxygen Translation module of SWIG adds an extra layer of
 functionality to SWIG, allowing automated translation of <a href=
-"http://www.stack.nl/~dimitri/doxygen/">Doxygen</a> formatted comments
+"http://www.doxygen.nl/manual/">Doxygen</a> formatted comments
 from input files into a documentation language more suited for the
 target language.  Currently this module only translates into Javadoc
 and Pydoc for the SWIG Java and Python modules.
 Other extensions could be added at a later date.
 The Doxygen Translation module originally started as
-a <a href="http://code.google.com/soc/2008/">Google Summer of
+a <a href="https://developers.google.com/open-source/gsoc/2008/">Google Summer of
 Code</a> proposal from Summer 2008.  
 </p>
 
@@ -79,14 +83,14 @@
 <p>
 To make use of the comment translation system, your documentation
 comments must be in properly formatted <a href=
-"http://www.stack.nl/~dimitri/doxygen/">Doxygen.</a> Doxygen comments can be
+"http://www.doxygen.nl/manual/">Doxygen.</a> Doxygen comments can be
 present in your main SWIG interface file or any header file that it
 imports.  You are advised to be validate that your comments compile
 properly with Doxygen before you try to translate them.  Doxygen
 itself is a more comprehensive tool and can provide you better feedback for
 correcting any syntax errors that may be present.  Please look at
 Doxygen's <a href=
-"http://www.stack.nl/~dimitri/doxygen/docblocks.html"> Documenting the
+"http://www.doxygen.nl/manual/docblocks.html"> Documenting the
 code</a> for the full comment format specifications.  However, SWIG's
 Doxygen parser will still report many errors and warnings found
 in comments (like unterminated strings or missing ending tags).
@@ -94,7 +98,7 @@
 
 <p>
 Currently, the whole subset of Doxygen comment styles is supported
-(See <a href="http://www.stack.nl/~dimitri/doxygen/docblocks.html">
+(See <a href="http://www.doxygen.nl/manual/docblocks.html">
 Documenting the code</a>). Here they are:
 </p>
 
@@ -194,7 +198,7 @@
 
 <p>
 Doxygen comments translation is disabled by default and needs to be explicitly
-enabled using the command line <tt>-doxygen</tt> switch for the languages that
+enabled using the command line <tt>-doxygen</tt> option for the languages that
 do support it (currently Java and Python).
 </p>
 
@@ -293,7 +297,7 @@
 <p>
 Doxygen syntax is rather rich and, in addition to simple commands such as
 <tt>@transferfull</tt>, it is also possible to define commands with arguments.
-As explained in <a href="http://www.stack.nl/~dimitri/doxygen/manual/commands.html">Doxygen documentation</a>,
+As explained in <a href="http://www.doxygen.nl/manual/commands.html">Doxygen documentation</a>,
 the arguments can have a range of a single word, everything until the end of
 line or everything until the end of the next paragraph. Currently, only the "end
 of line" case is supported using the <tt>range="line"</tt> argument of the
@@ -818,7 +822,7 @@
 <p>
 Doxygen has a wealth of tags such as @latexonly that have no
 equivalent in Javadoc (all supported tags are listed in
-<a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html">Javadoc documentation</a>).
+<a href="https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html">Javadoc documentation</a>).
 As a result several tags have no
 translation or particular use, such as some linking and section tags.
 These are suppressed with their content just printed out (if the tag has any
@@ -1223,9 +1227,9 @@
 the comments to the proxy file and reformat them if needed, but all
 the comment content will be left as is. As Doxygen doesn't support
 special commands in Python comments
-(see <a href="http://www.stack.nl/~dimitri/doxygen/docblocks.html#pythonblocks">Doxygen
+(see <a href="http://www.doxygen.nl/manual/docblocks.html#pythonblocks">Doxygen
 docs</a>), you may want to use some tool like doxypy
-(<a href="http://code.foosel.org/doxypy">http://code.foosel.org/doxypy</a>)
+(<a href="https://pypi.org/project/doxypy/">doxypy</a>)
 to do the work.
 </p>
 
@@ -1634,14 +1638,76 @@
 TO BE ADDED.
 </p>
 
-<H2><a name="Doxygen_developer_details">17.5 Developer information</a></H2>
+<H2><a name="Doxygen_troubleshooting">17.5 Troubleshooting</a></H2>
+
+
+<p>
+When running SWIG with command line option <tt>-doxygen</tt>, it may happen
+that SWIG will fail to parse the code, which is valid C++ code and
+is parsed without problems without the option. The problem is,
+that Doxygen comments are not tokens (the C/C++ compiler actually never
+sees them) and that they can appear anywhere in the code. That's why it is
+practically impossible to handle all corner cases with the parser.
+However, these problems can usually be avoided by minor changes in the
+code or comment. Known problems and solutions are shown in this section.
+</p>
+
+
+<p>
+Recommended approach is to first run SWIG without command line
+option <tt>-doxygen</tt>. When it successfully processes the code,
+include the option and fix problems with Doxygen comments.
+</p>
+
+
+<H3><a name="troubleshooting_ifndef">17.5.1 Problem with conditional compilation</a></H3>
+
+
+<p>
+  Inserting a conditional compilation preprocessor directive between a
+  Doxygen comment and a commented item may break parsing:
+</p>
+
+
+<div class="code"><pre>
+class A {
+  /**
+   * Some func.
+   */
+  <font color='#ff0000'>#ifndef SWIG</font>
+  void myfunc()
+  {
+  }
+  #endif
+};
+</pre></div>
+
+<p>
+  The solution is to move the directive above the comment:
+</p>
+
+<div class="code"><pre>
+class A {
+  <font color='#00d000'>#ifndef SWIG</font>
+  /**
+   * Some func.
+   */
+  void myfunc()
+  {
+  }
+  #endif
+};
+</pre></div>
+
+
+<H2><a name="Doxygen_developer_details">17.6 Developer information</a></H2>
 
 
 <p>
 This section contains information for developers enhancing the Doxygen translator.
 </p>
 
-<H3><a name="Doxygen_translator_design">17.5.1 Doxygen translator design</a></H3>
+<H3><a name="Doxygen_translator_design">17.6.1 Doxygen translator design</a></H3>
 
 
 <p>
@@ -1667,11 +1733,11 @@
 example, <tt>JavaDocConverter</tt> is the Javadoc module class.
 </p>
 
-<H3><a name="Doxygen_debugging_commands">17.5.2 Debugging the Doxygen parser and translator</a></H3>
+<H3><a name="Doxygen_debugging_commands">17.6.2 Debugging the Doxygen parser and translator</a></H3>
 
 
 <p>
-There are two handy command line switches, that enable lots of
+There are two handy command line options, that enable lots of
 detailed debug information printing.
 </p>
 
@@ -1680,7 +1746,7 @@
   -debug-doxygen-translator - Display Doxygen translator module debugging information
 </pre></div>
 
-<H3><a name="Doxygen_tests">17.5.3 Tests</a></H3>
+<H3><a name="Doxygen_tests">17.6.3 Tests</a></H3>
 
 
 <p>
@@ -1732,7 +1798,7 @@
 properties.
 </p>
 
-<H2><a name="Doxygen_language_extension">17.6 Extending to other languages</a></H2>
+<H2><a name="Doxygen_language_extension">17.7 Extending to other languages</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Go.html b/Doc/Manual/Go.html
index 4a60e45..cfa56db 100644
--- a/Doc/Manual/Go.html
+++ b/Doc/Manual/Go.html
@@ -125,16 +125,15 @@
 </p>
 
 <p>
-When using the <tt>-cgo</tt> option, SWIG will generate files that can be used
-directly by <tt>go build</tt>.  Starting with the Go 1.5 distribution the
-<tt>-cgo</tt> option has to be given.  Put your SWIG interface file in a
-directory under GOPATH/src, and give it a name that does <b>not</b> end in the
-.swig or .swigcxx extension.  Typically the SWIG interface file extension is .i
-in this case.
+By default SWIG will generate files that can be used directly
+by <tt>go build</tt>.  This requires Go 1.2 or later.  Put your SWIG
+interface file in a directory under GOPATH/src, and give it a name
+that does <b>not</b> end in the .swig or .swigcxx extension.
+Typically the SWIG interface file extension is .i in this case.
 </p>
 
 <div class="code"><pre>
-% swig -go -cgo example.i
+% swig -go example.i
 % go install
 </pre></div>
 
@@ -144,15 +143,16 @@
 </p>
 
 <p>
-To use SWIG without the <tt>-cgo</tt> option, more steps are required.  Recall
-that this only works with Go versions before 1.5.  When using Go version 1.2 or
-later, or when using gccgo, the code generated by SWIG can be linked directly
-into the Go program.  A typical command sequence when using the Go compiler of
-the Go distribution would look like this:
+SWIG can be used without cgo, via the <tt>-no-cgo</tt> option, but
+more steps are required.  This only works with Go versions before 1.5.
+When using Go version 1.2 or later, or when using gccgo, the code
+generated by SWIG can be linked directly into the Go program.  A
+typical command sequence when using the Go compiler of the Go
+distribution would look like this:
 </p>
 
 <div class="code"><pre>
-% swig -go example.i
+% swig -go -no-cgo example.i
 % gcc -c code.c    # The C library being wrapped.
 % gcc -c example_wrap.c
 % go tool 6g example.go
@@ -169,7 +169,7 @@
 </p>
 
 <div class="code"><pre>
-% swig -go -use-shlib example.i
+% swig -go -no-cgo -use-shlib example.i
 % gcc -c -fpic example.c
 % gcc -c -fpic example_wrap.c
 % gcc -shared example.o example_wrap.o -o example.so
@@ -200,10 +200,15 @@
 
 <tr>
 <td>-cgo</td>
-<td>Generate files to be used as input for the Go cgo tool.  This
-  option is required for Go 1.5 and later, and works for Go 1.2 and
-  later.  In the future this option will likely become the
-  default.</td>
+<td>Generate files to be used as input for the Go cgo tool.  This is
+  the default.</td>
+</tr>
+
+<tr>
+<td>-no-cgo</td>
+<td>Generate files that can be used directly, rather than via the Go
+  cgo tool.  This option does not work with Go 1.5 or later.  It is
+  required for versions of Go before 1.2.</td>
 </tr>
 
 <tr>
@@ -261,6 +266,13 @@
   ignored.</td>
 </tr>
 
+<tr>
+<td>-import-prefix &lt;prefix&gt;</td>
+<td>A prefix to add when turning a %import prefix in the SWIG
+  interface file into an import statement in the Go file.  For
+  example, with <code>-import-prefix mymodule</code>, a SWIG
+  interface file <code>%import mypackage</code> will become a Go
+  import statement <code>import "mymodule/mypackage"</code>.</td>
 </table>
 
 
@@ -268,11 +280,11 @@
 
 
 <p>There are two different approaches to generating wrapper files,
-  controlled by SWIG's <tt>-cgo</tt> option.  The <tt>-cgo</tt> option
-  works with Go version 1.2 or later.  It is required when using Go
-  version 1.5 or later.</p>
+  controlled by SWIG's <tt>-no-cgo</tt> option.  The <tt>-no-cgo</tt>
+  option only works with version of Go before 1.5.  It is required
+  when using versions of Go before 1.2.</p>
 
-<p>With or without the <tt>-cgo</tt> option, SWIG will generate the
+<p>With or without the <tt>-no-cgo</tt> option, SWIG will generate the
   following files when generating wrapper code:</p>
 
 <ul>
@@ -296,8 +308,8 @@
 </li>
 </ul>
 
-<p>When neither the <tt>-cgo</tt> nor the <tt>-gccgo</tt> option is
-  used, SWIG will also generate an additional file:</p>
+<p>When the <tt>-no-cgo</tt> option is used, and the <tt>-gccgo</tt>
+  option is not used, SWIG will also generate an additional file:</p>
 
 <ul>
 <li>
@@ -785,7 +797,9 @@
 <tt>NewDirectorClassName</tt> constructor functions receives a
 <tt>DirectorInterface</tt> argument.  The methods in the <tt>
 DirectorInterface</tt> are a subset of the public and protected virtual methods
-of the C++ class.  If the <tt>DirectorInterface</tt> contains a method with a
+of the C++ class.
+Virtual methods that have a final specifier are unsurprisingly excluded.
+If the <tt>DirectorInterface</tt> contains a method with a
 matching signature to a virtual method of the C++ class then the virtual C++
 method will be overwritten with the Go method.  As Go doesn't support protected
 methods all overridden protected virtual C++ methods will be public in Go.
@@ -1289,7 +1303,7 @@
 </pre>
 </div>
 <p>Since this is ugly, you may want to wrap the swig-generated API with
-some <a href="#Embedded_go_code">additional functions written in go</a> that
+some <a href="#Go_adding_additional_code">additional functions written in go</a> that
 hide the ugly details.</p>
 
 <p>There are no <code>char&nbsp;*OUTPUT</code> typemaps.  However you can
diff --git a/Doc/Manual/Introduction.html b/Doc/Manual/Introduction.html
index 1a2e26a..8d161b7 100644
--- a/Doc/Manual/Introduction.html
+++ b/Doc/Manual/Introduction.html
@@ -163,7 +163,7 @@
 
 <p>
 SWIG is very broadly composed of two components.
-A core component creates a parse tree from the input C/C++ and SWIG directives (extensions to C/C++).
+A core component creates a parse tree from the input ISO C/C++ and SWIG directives (extensions to the C/C++ standards).
 The parse tree is then passed to a second component, one of the target language modules for generating code specific to a higher level language.
 SWIG supports many different target languages.
 These target languages are given a status of either Supported or Experimental.
@@ -273,7 +273,7 @@
 </pre></div>
 
 <p>
-The interface file contains ANSI C function prototypes and variable
+The interface file contains ISO C function prototypes and variable
 declarations.  The <tt>%module</tt> directive defines the name of the
 module that will be created by SWIG.  The <tt>%{ %}</tt> block
 provides a location for inserting additional code, such as C header
@@ -400,7 +400,7 @@
 
 <ul>
 <li>Full C99 preprocessing.
-<li>All ANSI C and C++ datatypes.
+<li>All ISO C and C++ datatypes.
 <li>Functions, variables, and constants.
 <li>Classes.
 <li>Single and multiple inheritance.
@@ -464,7 +464,7 @@
 </p>
 
 <p>
-There is growing support for SWIG in some build tools, for example <a href="http://cmake.org">CMake</a>
+There is growing support for SWIG in some build tools, for example <a href="https://cmake.org">CMake</a>
 is a cross-platform, open-source build manager with built in support for SWIG. CMake can detect the SWIG executable
 and many of the target language libraries for linking against.
 CMake knows how to build shared libraries and loadable modules on many different operating systems.
@@ -531,7 +531,7 @@
 Ironically, the freedom that SWIG provides is countered by an
 extremely conservative approach to code generation. At its core, SWIG
 tries to distill even the most advanced C++ code down to a small
-well-defined set of interface building techniques based on ANSI C
+well-defined set of interface building techniques based on ISO C
 programming.  Because of this, you will find that SWIG interfaces can
 be easily compiled by virtually every C/C++ compiler and that they can
 be used on any platform.  Again, this is an important part of staying out 
diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html
index bf77c15..db5f041 100644
--- a/Doc/Manual/Java.html
+++ b/Doc/Manual/Java.html
@@ -477,7 +477,7 @@
 <p>
 where <tt>gcd</tt> is the missing JNI function that SWIG generated into the wrapper file.
 Also make sure you pass all of the required libraries to the linker.  
-The <tt>java -verbose:jni</tt> commandline switch is also a great way to get more information on unresolved symbols.
+The <tt>java -verbose:jni</tt> commandline option is also a great way to get more information on unresolved symbols.
 One last piece of advice is to beware of the common faux pas of having more than one native library version in your path.
 </p>
 
@@ -645,7 +645,7 @@
 <p>
 To build the DLL and compile the java code, run NMAKE (you may need to run <tt>vcvars32</tt> first). 
 This is a pretty simplistic Makefile, but hopefully its enough to get you started.
-Of course you may want to make changes for it to work for C++ by adding in the -c++ command line switch for swig and replacing .c with .cxx.
+Of course you may want to make changes for it to work for C++ by adding in the -c++ command line option for swig and replacing .c with .cxx.
 </p>
 
 
@@ -1113,11 +1113,10 @@
 However, there are limitations. For example, they cannot be used in switch statements and serialization is an issue.
 Please look at the following references for further information: 
 
-http://java.sun.com/developer/Books/shiftintojava/page1.html#replaceenums
 <a href="http://java.sun.com/developer/Books/shiftintojava/page1.html#replaceenums">Replace Enums with Classes</a> in <i>Effective Java Programming</i> on the Sun website,
-<a href="http://www.javaworld.com/javaworld/jw-07-1997/jw-07-enumerated.html">Create enumerated constants in Java</a> JavaWorld article,
-<a href="http://www.javaworld.com/javaworld/javatips/jw-javatip133.html">Java Tip 133: More on typesafe enums</a> and
-<a href="http://www.javaworld.com/javaworld/javatips/jw-javatip122.html">Java Tip 122: Beware of Java typesafe enumerations</a> JavaWorld tips.
+<a href="https://www.javaworld.com/article/2076970/create-enumerated-constants-in-java.html">Create enumerated constants in Java</a> JavaWorld article,
+<a href="https://www.javaworld.com/article/2077499/java-tip-133--more-on-typesafe-enums.html">Java Tip 133: More on typesafe enums</a> and
+<a href="https://www.javaworld.com/article/2077487/java-tip-122--beware-of-java-typesafe-enumerations.html">Java Tip 122: Beware of Java typesafe enumerations</a> JavaWorld tips.
 </p>
 
 <p>
@@ -2763,7 +2762,7 @@
 The idea is for <tt>delete()</tt> to be called when you have finished with the C/C++ object. 
 Ideally you need not call <tt>delete()</tt>, but rather leave it to the garbage collector to call it from the finalizer. 
 When a program exits, the garbage collector does not guarantee to call all finalizers. 
-An insight into the reasoning behind this can be obtained from <a href="http://www.hpl.hp.com/techreports/2002/HPL-2002-335.html">Hans Boehm's Destructors, Finalizers, and Synchronization</a> paper.
+An insight into the reasoning behind this can be obtained from <a href="https://www.hpl.hp.com/techreports/2002/HPL-2002-335.html">Hans Boehm's Destructors, Finalizers, and Synchronization</a> paper.
 Depending on what the finalizers do and which operating system you use, this may or may not be a problem. 
 </p>
 
@@ -2787,7 +2786,7 @@
 This method is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock.
 </i></div> 
 <p>In many cases you will be lucky and find that it works, but it is not to be advocated. 
-Have a look at <a href="http://www.oracle.com/technetwork/java/index.html">Java web site</a> and search for <tt>runFinalizersOnExit</tt>.
+Have a look at <a href="https://www.oracle.com/technetwork/java/index.html">Java web site</a> and search for <tt>runFinalizersOnExit</tt>.
 </p></li>
 
 <li><p>
@@ -3629,7 +3628,7 @@
 // generate directors for all classes that have virtual methods
 %feature("director");         
 
-// generate directors for all virtual methods in class Foo
+// generate directors for the virtual methods in class Foo
 %feature("director") Foo;      
 </pre>
 </div>
@@ -3647,7 +3646,7 @@
 </div>
 
 <p>
-will generate directors for all virtual methods of class Foo except bar().  
+will generate directors for the virtual methods of class Foo except bar().  
 </p>
 
 <p>
@@ -3683,7 +3682,8 @@
 <p>
 For simplicity let's ignore the <tt>Swig::Director</tt> class and refer to the original C++ class as the director's base class.
 By default, a director class extends all virtual methods in the inheritance chain of its base class (see the preceding section for how to modify this behavior).
-Thus all virtual method calls, whether they originate in C++ or in Java via proxy classes, eventually end up in at the implementation in the director class.
+Virtual methods that have a final specifier are unsurprisingly excluded.
+Thus the virtual method calls, whether they originate in C++ or in Java via proxy classes, eventually end up in at the implementation in the director class.
 The job of the director methods is to route these method calls to the appropriate place in the inheritance chain.
 By "appropriate place" we mean the method that would have been called if the C++ base class and its Java derived classes were seamlessly integrated.
 That seamless integration is exactly what the director classes provide, transparently skipping over all the messy JNI glue code that binds the two languages together.
@@ -5644,7 +5644,7 @@
 for various C/C++ datatypes using the <tt>%typemap</tt> directive.   
 You are advised to be familiar with the material in the "<a href="Typemaps.html#Typemaps">Typemaps</a>" chapter.
 While not absolutely essential knowledge, this section assumes some familiarity with the Java Native Interface (JNI). 
-JNI documentation can be consulted either online at <a href="http://java.sun.com">Sun's Java web site</a> or from a good JNI book. 
+JNI documentation can be consulted either online at <a href="https://www.oracle.com/technetwork/java/index.html">the Java web site</a> or from a good JNI book. 
 The following two books are recommended:</p>
 
 <ul>
@@ -6551,7 +6551,7 @@
 and offers nearly identical functionality.
 </div>
 
-<p><tt>%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized")</tt> <br></p>
+<p><tt>%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized", parameters="")</tt> <br></p>
 <div class="indent">
 destructor wrapper - the <tt>delete()</tt> method (proxy classes only),
 used for all proxy classes except those which have a base class
@@ -6562,9 +6562,10 @@
 The method modifiers are also configurable via the <tt>methodmodifiers</tt> attribute.
 If a <tt>%javamethodmodifiers</tt> is attached to the class' destructor,
 it will be used in preference to the <tt>methodmodifiers</tt> typemap attribute for the class.
+The <tt>delete</tt> method's parameters declaration can be provided in the optional <tt>parameters</tt> typemap attribute.
 </div>
 
-<p><tt>%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized")</tt></p>
+<p><tt>%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized", parameters="")</tt></p>
 <div class="indent">
 destructor wrapper - the <tt>delete()</tt> method (proxy classes only),
 same as "javadestruct" but only used for derived proxy classes
@@ -6575,6 +6576,7 @@
 The method modifiers are also configurable via the <tt>methodmodifiers</tt> attribute.
 If a <tt>%javamethodmodifiers</tt> is attached to the class' destructor,
 it will be used in preference to the <tt>methodmodifiers</tt> typemap attribute for the class.
+The <tt>delete</tt> method's parameters declaration can be provided in the optional <tt>parameters</tt> typemap attribute.
 </div>
 
 <p><tt>%typemap(javaimports)</tt></p>
diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html
index c328bbb..417ee45 100644
--- a/Doc/Manual/Javascript.html
+++ b/Doc/Manual/Javascript.html
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
-<link rel="stylesheet" type="text/css" href="./style.css">
+<link rel="stylesheet" type="text/css" href="style.css">
 <title></title>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 </head>
@@ -56,10 +56,10 @@
 
 
 <p>Javascript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. Its arguably the most popular language for web development.
-Javascript has gone beyond being a browser-based scripting language and with <a href="http://nodejs.org">node.js</a>, it is also used as a backend development language.</p>
+Javascript has gone beyond being a browser-based scripting language and with <a href="https://nodejs.org">node.js</a>, it is also used as a backend development language.</p>
 <p>Native Javascript extensions can be used for applications that embed a web-browser view or that embed a Javascript engine (such as <em>node.js</em>). Extending a general purpose web-browser is not possible as this would be a severe security issue.</p>
-<p>SWIG Javascript currently supports <strong>JavascriptCore</strong>, the Javascript engine used by <code>Safari/Webkit</code>, and <a href="https://developers.google.com/v8"><strong>v8</strong></a>, which is used by <code>Chromium</code> and <code>node.js</code>.</p>
-<p><a href="http://www.webkit.org/">WebKit</a> is a modern browser implementation available as open-source which can be embedded into an application.
+<p>SWIG Javascript currently supports <strong>JavascriptCore</strong>, the Javascript engine used by <code>Safari/Webkit</code>, and <a href="https://v8.dev/"><strong>v8</strong></a>, which is used by <code>Chromium</code> and <code>node.js</code>.</p>
+<p><a href="https://webkit.org/">WebKit</a> is a modern browser implementation available as open-source which can be embedded into an application.
 With <a href="https://github.com/rogerwang/node-webkit">node-webkit</a> there is a platform which uses Google's <code>Chromium</code> as Web-Browser widget and <code>node.js</code> for javascript extensions.
 </p>
 
@@ -289,7 +289,7 @@
 <H4><a name="Javascript_gtk">27.3.2.2 GTK</a></H4>
 
 
-<p>There is general information about programming GTK at <a href="https://developer.gnome.org/gtk2/">GTK documentation</a> and in the <a href="https://developer.gnome.org/gtk-tutorial">GTK tutorial</a>, and for Webkit there is a <a href="http://webkitgtk.org/reference/webkitgtk/stable/index.html">Webkit GTK+ API Reference</a>.</p>
+<p>There is general information about programming GTK at <a href="https://developer.gnome.org/gtk2/">GTK documentation</a> and in the <a href="https://developer.gnome.org/gtk-tutorial/">GTK tutorial</a>, and for Webkit there is a <a href="http://webkitgtk.org/reference/webkitgtk/stable/index.html">Webkit GTK+ API Reference</a>.</p>
 <p>An integration of a native extension 'example' would look like this:</p>
 <div class="code">
 <pre>
@@ -604,7 +604,7 @@
 at emitKey (readline.js:1095:12)</pre>
 </div>
 <p>
-<b>Note</b>: In ECMAScript 5 there is no concept for classes. Instead each function can be used as a constructor function which is executed by the 'new' operator. Furthermore, during construction the key property <code>prototype</code> of the constructor function is used to attach a prototype instance to the created object. A prototype is essentially an object itself that is the first-class delegate of a class used whenever the access to a property of an object fails. The very same prototype instance is shared among all instances of one type. Prototypal inheritance is explained in more detail on in <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain">Inheritance and the prototype chain</a>, for instance.
+<b>Note</b>: In ECMAScript 5 there is no concept for classes. Instead each function can be used as a constructor function which is executed by the 'new' operator. Furthermore, during construction the key property <code>prototype</code> of the constructor function is used to attach a prototype instance to the created object. A prototype is essentially an object itself that is the first-class delegate of a class used whenever the access to a property of an object fails. The very same prototype instance is shared among all instances of one type. Prototypal inheritance is explained in more detail on in <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain">Inheritance and the prototype chain</a>, for instance.
 </p>
 
 <H2><a name="Javascript_implementation">27.5 Implementation</a></H2>
diff --git a/Doc/Manual/Library.html b/Doc/Manual/Library.html
index 4ef6aeb..eeb2e5a 100644
--- a/Doc/Manual/Library.html
+++ b/Doc/Manual/Library.html
@@ -1365,7 +1365,7 @@
 </li>
 
 <li>If used in C++, this library uses <tt>new</tt> and <tt>delete []</tt> for memory
-allocation.  If using ANSI C, the library uses <tt>malloc()</tt> and <tt>free()</tt>.
+allocation.  If using C, the library uses <tt>malloc()</tt> and <tt>free()</tt>.
 </li>
 
 <li>Rather than manipulating <tt>char *</tt> directly, you might consider using a special string
diff --git a/Doc/Manual/Lua.html b/Doc/Manual/Lua.html
index 0fa1ecb..6633eaa 100644
--- a/Doc/Manual/Lua.html
+++ b/Doc/Manual/Lua.html
@@ -77,7 +77,7 @@
 
 
 <p>
-Lua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, light-weight configuration language for any program that needs one. Lua is implemented as a library, written in clean C (that is, in the common subset of ANSI C and C++). It's also a <em>really</em> tiny language, less than 6000 lines of code, which compiles to &lt;100 kilobytes of binary code. It can be found at <a href="http://www.lua.org">http://www.lua.org</a>
+Lua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, light-weight configuration language for any program that needs one. Lua is implemented as a library, written in clean C (that is, in the common subset of ISO C and C++). It's also a <em>really</em> tiny language, less than 6000 lines of code, which compiles to &lt;100 kilobytes of binary code. It can be found at <a href="http://www.lua.org">http://www.lua.org</a>
 </p>
 <p>
 eLua stands for Embedded Lua (can be thought of as a flavor of Lua) and offers the full implementation of the Lua programming language to the embedded world, extending it with specific features for efficient and portable software embedded development. eLua runs on smaller devices like microcontrollers and provides the full features of the regular Lua desktop version. More information on eLua can be found here: <a href="http://www.eluaproject.net">http://www.eluaproject.net</a>
diff --git a/Doc/Manual/Makefile b/Doc/Manual/Makefile
index ee9a0af..9505adb 100644
--- a/Doc/Manual/Makefile
+++ b/Doc/Manual/Makefile
@@ -89,3 +89,9 @@
 	cp *.png linkchecker-tmp
 	(cd linkchecker-tmp && linkchecker --config=../linkchecker.config -F text --no-warnings SWIGDocumentation.html)
 
+# Simple check for relative links (there shouldn't be any), they don't translate properly creating the .pdf doc
+# with wkhtmltopdf. For example, href="SWIG.html" needs to be href="SWIG.html#SWIG"
+linkchecker3:
+	@echo "The following list should just contain SWIGDocumentation.html and SWIGDocumentation.pdf,"
+	@echo "as all links should have an anchor (with a #) or be a full url beginning http."
+	grep 'href="' *.html | sed -e 's/.*href="\(.*\)">.*$$/\1/' | grep -v "#" | grep -v "^http" | grep -v "^style.css"
diff --git a/Doc/Manual/Mzscheme.html b/Doc/Manual/Mzscheme.html
index 860a5c4..aae181e 100644
--- a/Doc/Manual/Mzscheme.html
+++ b/Doc/Manual/Mzscheme.html
@@ -170,7 +170,7 @@
 
 
 <p>
-See the <a href="http://docs.racket-lang.org/inside/index.html">C API</a> for more description of using the mechanism for adding extensions. The main documentation is <a href="http://docs.racket-lang.org/">here</a>.
+See the <a href="https://docs.racket-lang.org/inside/index.html">C API</a> for more description of using the mechanism for adding extensions. The main documentation is <a href="https://docs.racket-lang.org/">here</a>.
 </p>
 
 <p>
diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html
index 5ce765c..766ccae 100644
--- a/Doc/Manual/Perl5.html
+++ b/Doc/Manual/Perl5.html
@@ -3070,7 +3070,7 @@
 // generate directors for all classes that have virtual methods
 %feature("director");         
 
-// generate directors for all virtual methods in class Foo
+// generate directors for the virtual methods in class Foo
 %feature("director") Foo;      
 </pre>
 </div>
@@ -3088,7 +3088,7 @@
 </div>
 
 <p>
-will generate directors for all virtual methods of class Foo except
+will generate directors for the virtual methods of class Foo except
 bar().  
 </p>
 
@@ -3153,7 +3153,8 @@
 original C++ class as the director's base class. By default, a director
 class extends all virtual methods in the inheritance chain of its base
 class (see the preceding section for how to modify this behavior).
-Thus all virtual method calls, whether they originate in C++ or in
+Virtual methods that have a final specifier are unsurprisingly excluded.
+Thus the virtual method calls, whether they originate in C++ or in
 Perl via proxy classes, eventually end up in at the implementation in
 the director class. The job of the director methods is to route these
 method calls to the appropriate place in the inheritance chain. By
diff --git a/Doc/Manual/Php.html b/Doc/Manual/Php.html
index 85732fd..d80731c 100644
--- a/Doc/Manual/Php.html
+++ b/Doc/Manual/Php.html
@@ -153,7 +153,7 @@
 
 <p>
 For some SAPIs (for example, the CLI SAPI) you can instead use the
-<a href="http://php.net/manual/en/function.dl.php">dl() function</a> to load
+<a href="https://www.php.net/manual/en/function.dl.php">dl() function</a> to load
 an extension at run time, by adding a line like this to the start of each
 PHP script which uses your extension:
 </p>
@@ -937,7 +937,7 @@
 // generate directors for all classes that have virtual methods
 %feature("director");         
 
-// generate directors for all virtual methods in class Foo
+// generate directors for the virtual methods in class Foo
 %feature("director") Foo;      
 </pre>
 </div>
@@ -955,7 +955,7 @@
 </div>
 
 <p>
-will generate directors for all virtual methods of class Foo except
+will generate directors for the virtual methods of class Foo except
 bar().  
 </p>
 
@@ -1020,7 +1020,8 @@
 original C++ class as the director's base class. By default, a director
 class extends all virtual methods in the inheritance chain of its base
 class (see the preceding section for how to modify this behavior).
-Thus all virtual method calls, whether they originate in C++ or in
+Virtual methods that have a final specifier are unsurprisingly excluded.
+Thus the virtual method calls, whether they originate in C++ or in
 PHP via proxy classes, eventually end up in at the implementation in the
 director class. The job of the director methods is to route these method
 calls to the appropriate place in the inheritance chain. By "appropriate
diff --git a/Doc/Manual/Preprocessor.html b/Doc/Manual/Preprocessor.html
index 1bf59e2..3d1bb45 100644
--- a/Doc/Manual/Preprocessor.html
+++ b/Doc/Manual/Preprocessor.html
@@ -138,7 +138,7 @@
 <pre>
 __LINE__                        Current line number
 __FILE__                        Current file name
-__STDC__                        Defined to indicate ANSI C
+__STDC__                        Defined to indicate ISO C
 __cplusplus                     Defined when -c++ option used
 </pre>
 </div>
@@ -180,9 +180,9 @@
 <pre>
 #define EXTERN extern
 #ifdef __STDC__
-#define _ANSI(args)   (args)
+#define ISOC_(args)   (args)
 #else
-#define _ANSI(args) ()
+#define ISOC_(args) ()
 #endif
 </pre>
 </div>
@@ -458,7 +458,7 @@
 
 <p>
 Like many compilers, SWIG supports a <tt>-E</tt> command line option to display the output from the preprocessor.
-When the <tt>-E</tt> switch is used, SWIG will not generate any wrappers.
+When the <tt>-E</tt> option is used, SWIG will not generate any wrappers.
 Instead the results after the preprocessor has run are displayed.
 This might be useful as an aid to debugging and viewing the results of macro expansions.
 </p>
diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html
index 6a174fd..5a3947d 100644
--- a/Doc/Manual/Python.html
+++ b/Doc/Manual/Python.html
@@ -301,7 +301,7 @@
 <p>
 The preferred approach to building an extension module for Python is to compile it with
 distutils, which comes with all recent versions of Python
-(<a href="https://docs.python.org/library/distutils.html">Distutils Docs</a>).
+(<a href="https://docs.python.org/3/library/distutils.html">Distutils Docs</a>).
 </p>
 
 <p>
@@ -2355,7 +2355,7 @@
 from the wrapped methods.  For more information about Python built-in extensions,
 please refer to the Python documentation:</p>
 
-<p><a href="http://docs.python.org/extending/newtypes.html">http://docs.python.org/extending/newtypes.html</a></p>
+<p><a href="https://docs.python.org/3/extending/newtypes.html">https://docs.python.org/3/extending/newtypes.html</a></p>
 
 <H4><a name="Python_builtin_limitations">32.4.2.1 Limitations</a></H4>
 
@@ -2574,7 +2574,7 @@
 
 <p>
 Read about all of the available Python slots here:
-<a href="http://docs.python.org/c-api/typeobj.html">http://docs.python.org/c-api/typeobj.html</a></p>
+<a href="https://docs.python.org/3/c-api/typeobj.html">https://docs.python.org/3/c-api/typeobj.html</a></p>
 
 <p>
 There are two ways to define a Python slot function: dispatch to a
@@ -2934,7 +2934,7 @@
 // generate directors for all classes that have virtual methods
 %feature("director");
 
-// generate directors for all virtual methods in class Foo
+// generate directors for the virtual methods in class Foo
 %feature("director") Foo;
 </pre>
 </div>
@@ -2952,7 +2952,7 @@
 </div>
 
 <p>
-will generate directors for all virtual methods of class Foo except
+will generate directors for the virtual methods of class Foo except
 bar().
 </p>
 
@@ -3018,7 +3018,8 @@
 original C++ class as the director's base class. By default, a director
 class extends all virtual methods in the inheritance chain of its base
 class (see the preceding section for how to modify this behavior).
-Thus all virtual method calls, whether they originate in C++ or in
+Virtual methods that have a final specifier are unsurprisingly excluded.
+Thus the virtual method calls, whether they originate in C++ or in
 Python via proxy classes, eventually end up in at the implementation in
 the director class. The job of the director methods is to route these
 method calls to the appropriate place in the inheritance chain. By
diff --git a/Doc/Manual/R.html b/Doc/Manual/R.html
index b9dba4f..45e5541 100644
--- a/Doc/Manual/R.html
+++ b/Doc/Manual/R.html
@@ -189,9 +189,49 @@
 
 
 <p>
-enumerations are characters which are then converted back and forth to
-ints before calling the C routines. All of the enumeration code is
-done in R.
+R doesn't have a native enumeration type. Enumerations are represented
+as character strings in R, with calls to R functions that convert back
+and forth between integers.
+
+The details of enumeration names and contents are stored in hidden R
+environments, which are named according the the enumeration name - for
+example, an enumeration colour:
+<div class="code"><pre>
+enum colour { red=-1, blue, green = 10 };
+</pre></div>
+
+will be initialized by the following call in R:
+<div class="code"><pre>
+defineEnumeration("_colour",
+ .values=c("red" = .Call('R_swig_colour_red_get',FALSE, PACKAGE='enum_thorough'),
+"blue" = .Call('R_swig_colour_blue_get',FALSE, PACKAGE='enum_thorough'),
+"green" = .Call('R_swig_colour_green_get',FALSE, PACKAGE='enum_thorough')))
+
+</pre></div>
+
+<p>
+which will create an environment named <tt>.__E___colour</tt>. The enumeration
+values are initialised via calls to C/C++ code, allowing complex
+values for enumerations to be used. Calls to the C/C++ code require
+the compiled library to be loaded, so a  <tt>delayedAssign</tt> is employed
+within <tt>defineEnumeration</tt> in order to allow the code to be easily used in R
+packages.
+
+The user typically does not need to access the enumeration lookup
+functions or know the name of the enumeration type used by
+R. Attributes containing the type information are attached by swig to
+functions requiring enumeration arguments or returning enumeration
+values, and those attributes are used to identify and access the
+appropriate environments and thus translate between characters
+and integers.
+
+The relevant functions, for debugging purposes, are <tt>enumToInteger</tt> and
+<tt>enumFromInteger</tt>.
+
+Anonymous enumerations are ignored by the binding generation process,
+leaving no way of accessing the value of anonymous enumerations from R
+code.
+
 </p>
 
 </body>
diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html
index 79d52ef..d1492d3 100644
--- a/Doc/Manual/SWIG.html
+++ b/Doc/Manual/SWIG.html
@@ -88,7 +88,7 @@
 
 <p>
 This chapter describes the basic operation of SWIG, the structure of its
-input files, and how it handles standard ANSI C declarations.  C++ support is
+input files, and how it handles standard ISO C declarations.  C++ support is
 described in the next chapter.  However, C++ programmers should still read this
 chapter to understand the basics.
 Specific details about each target language are described in later
@@ -252,7 +252,7 @@
 
 
 <p>
-As input, SWIG expects a file containing ANSI C/C++ declarations and
+As input, SWIG expects a file containing ISO C/C++ declarations and
 special SWIG directives.  More often than not, this is a special SWIG
 interface file which is usually denoted with a special <tt>.i</tt> or
 <tt>.swg</tt> suffix.  In certain cases, SWIG can be used directly on
@@ -270,7 +270,7 @@
 %{
 #include "myheader.h"
 %}
-// Now list ANSI C/C++ declarations
+// Now list ISO C/C++ declarations
 int foo;
 int bar(int x);
 ...
@@ -1826,7 +1826,7 @@
 When wrapping C++ code, simple use of simple identifiers/symbols with <tt>%rename</tt> might be too
 limiting when using C++ features such as function overloading, default arguments, namespaces, template specialization etc.
 If you are using the <tt>%rename</tt> directive and C++, make sure you read the
-<a href="SWIGPlus.html">SWIG and C++</a> chapter and in particular the section on
+<a href="SWIGPlus.html#SWIGPlus">SWIG and C++</a> chapter and in particular the section on
 <a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Renaming and ambiguity resolution</a>
 for method overloading and default arguments.
 </p>
@@ -2242,7 +2242,7 @@
 </pre></div>
 
 <p>
-Although the ANSI C standard does not allow default arguments, default
+Although the ISO C standard does not allow default arguments, default
 arguments specified in a SWIG interface work with both C and C++.
 </p>
 
@@ -2415,7 +2415,7 @@
 
 
 <p>
-This section describes the behavior of SWIG when processing ANSI C structures and union declarations.  Extensions to
+This section describes the behavior of SWIG when processing ISO C structures and union declarations.  Extensions to
 handle C++ are described in the next section.
 </p>
 
@@ -3469,7 +3469,7 @@
 SWIG's <tt>%include</tt> directive to process an entire C
 source/header file. 
 
-<li>Make sure everything in the interface file uses ANSI C/C++ syntax.
+<li>Make sure everything in the interface file uses ISO C/C++ syntax.
 
 <li>Make sure all necessary `<tt>typedef</tt>' declarations and
 type-information is available in the interface file. 
diff --git a/Doc/Manual/SWIGPlus.html b/Doc/Manual/SWIGPlus.html
index 8ad9dae..dc9ae0f 100644
--- a/Doc/Manual/SWIGPlus.html
+++ b/Doc/Manual/SWIGPlus.html
@@ -88,12 +88,12 @@
 This chapter describes SWIG's support for wrapping C++.
 It is mostly concerned about C++ as defined by the C++ 98 and 03 standards.
 For additions to the original C++ standard, please read the
-<a href="CPlusPlus11.html">SWIG and C++11</a>,
-<a href="CPlusPlus14.html">SWIG and C++14</a> and
-<a href="CPlusPlus17.html">SWIG and C++17</a> chapters.
+<a href="CPlusPlus11.html#CPlusPlus11">SWIG and C++11</a>,
+<a href="CPlusPlus14.html#CPlusPlus14">SWIG and C++14</a> and
+<a href="CPlusPlus17.html#CPlusPlus17">SWIG and C++17</a> chapters.
 As a prerequisite,
 you should first read the chapter <a href="SWIG.html#SWIG">SWIG Basics</a> to see
-how SWIG wraps ANSI C.  Support for C++ builds upon ANSI C
+how SWIG wraps ISO C.  Support for C++ builds upon ISO C
 wrapping and that material will be useful in understanding this chapter.
 </p>
 
@@ -144,7 +144,7 @@
 
 <p>
 To wrap C++, SWIG uses a layered approach to code generation.  
-At the lowest level, SWIG generates a collection of procedural ANSI-C style
+At the lowest level, SWIG generates a collection of procedural ISO C style
 wrappers.   These wrappers take care of basic type conversion,
 type checking, error handling, and other low-level details of the C++ binding.
 These wrappers are also sufficient to bind C++ into any target language
diff --git a/Doc/Manual/Scilab.html b/Doc/Manual/Scilab.html
index 29c4eac..88ab804 100644
--- a/Doc/Manual/Scilab.html
+++ b/Doc/Manual/Scilab.html
@@ -973,7 +973,7 @@
 </pre></div>
 
 <p>
-Note: the pointer to the struct works as described in <a href="Scilab_wrapping_pointers">Pointers</a>. For example, the type of the struct pointer can be get with <tt>typeof</tt>, as following:
+Note: the pointer to the struct works as described in <a href="#Scilab_wrapping_pointers">Pointers</a>. For example, the type of the struct pointer can be get with <tt>typeof</tt>, as following:
 </p>
 
 <div class="targetlang"><pre>
@@ -1037,7 +1037,7 @@
 </pre></div>
 
 <p>
-Note: like structs, class pointers are mapped as described in <a href="Scilab_wrapping_pointers">Pointers</a>. Let's give an example which shows that each class pointer type is a new type in Scilab that can be used for example (through <a href="https://help.scilab.org/docs/5.5.2/en_US/overloading.html">overloading</a>) to implement a custom print for the <tt>Point</tt> class:
+Note: like structs, class pointers are mapped as described in <a href="#Scilab_wrapping_pointers">Pointers</a>. Let's give an example which shows that each class pointer type is a new type in Scilab that can be used for example (through <a href="https://help.scilab.org/docs/5.5.2/en_US/overloading.html">overloading</a>) to implement a custom print for the <tt>Point</tt> class:
 </p>
 
 <div class="targetlang"><pre>
diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html
index f571085..2cb1d2b 100644
--- a/Doc/Manual/Sections.html
+++ b/Doc/Manual/Sections.html
@@ -8,7 +8,7 @@
 <H1><a name="Sections">SWIG-4.0 Documentation</a></H1>
 
 <p>
-Last update : SWIG-4.0.0 (in progress)
+Last update : SWIG-4.0.1 (in progress)
 </p>
 
 <H2><a name="Sections_Sections">Sections</a></H2>
diff --git a/Doc/Manual/Typemaps.html b/Doc/Manual/Typemaps.html
index d34bb28..8a31dbf 100644
--- a/Doc/Manual/Typemaps.html
+++ b/Doc/Manual/Typemaps.html
@@ -672,8 +672,8 @@
 
 
 <p>
-SWIG has parallels to <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect Oriented Software Development (AOP)</a>.
-The <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming#Terminology">AOP terminology</a> with respect to SWIG typemaps can be viewed as follows:
+SWIG has parallels to <a href="https://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect Oriented Software Development (AOP)</a>.
+The <a href="https://en.wikipedia.org/wiki/Aspect-oriented_programming#Terminology">AOP terminology</a> with respect to SWIG typemaps can be viewed as follows:
 </p>
 <ul>
   <li> <b>Cross-cutting concerns</b>: The cross-cutting concerns are the modularization of the functionality that the typemaps implement, which is primarily marshalling of types from/to the target language and C/C++.
diff --git a/Doc/Manual/Warnings.html b/Doc/Manual/Warnings.html
index bff2080..c63d7de 100644
--- a/Doc/Manual/Warnings.html
+++ b/Doc/Manual/Warnings.html
@@ -535,6 +535,7 @@
 <li>522. Use of an illegal constructor name '<em>name</em>' in %extend is deprecated, the constructor name should be '<em>name</em>'.
 <li>523. Use of an illegal destructor name '<em>name</em>' in %extend is deprecated, the destructor name should be '<em>name</em>'.
 <li>524. Experimental target language. Target language <em>language</em> specified by <em>lang</em> is an experimental language. Please read about SWIG experimental languages, <em>htmllink</em>.
+<li>525. Destructor <em>declaration</em> is final, <em>name</em> cannot be a director class.
 </ul>
 
 <H3><a name="Warnings_doxygen">18.9.6 Doxygen comments (560-599)</a></H3>
diff --git a/Doc/Manual/Windows.html b/Doc/Manual/Windows.html
index 01caf6c..800e2e4 100644
--- a/Doc/Manual/Windows.html
+++ b/Doc/Manual/Windows.html
@@ -68,7 +68,7 @@
 
 
 <p>
-The swigwin distribution contains the SWIG Windows executable, swig.exe, which will run on 32 bit versions of Windows, ie Windows 95 and later.
+The swigwin distribution contains the SWIG Windows 32-bit executable, swig.exe, which will run on both 32-bit and 64-bit versions of Windows.
 If you want to build your own swig.exe have a look at <a href="#Windows_swig_exe">Building swig.exe on Windows</a>.
 </p>
 
@@ -211,7 +211,7 @@
 
 
 <p>
-SWIG can also be compiled and run using <a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> which provides a Unix like front end to Windows and comes free with gcc, an ANSI C/C++ compiler. However, this is not a recommended approach as the prebuilt executable is supplied. 
+SWIG can also be compiled and run using <a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> which provides a Unix like front end to Windows and comes free with gcc, an ISO C/C++ compiler. However, this is not a recommended approach as the prebuilt executable is supplied. 
 </p>
 
 <H3><a name="Windows_swig_exe">3.3.1 Building swig.exe on Windows</a></H3>
@@ -249,7 +249,7 @@
 <ol>
   <li>
   Download the following packages from the <a href="http://www.mingw.org/download.shtml">MinGW download page</a>
-  or <a href="http://sourceforge.net/projects/mingw/files/">MinGW SourceForge download page</a>.
+  or <a href="https://sourceforge.net/projects/mingw/files/">MinGW SourceForge download page</a>.
   Note that at the time of writing, the majority of these are in the Current
   release list and some are in the Snapshot or Previous release list.
   <ul>
diff --git a/Examples/Makefile.in b/Examples/Makefile.in
index 7022166..98be787 100644
--- a/Examples/Makefile.in
+++ b/Examples/Makefile.in
@@ -858,31 +858,33 @@
 ##################################################################
 
 OCC=$(COMPILETOOL) @OCAMLC@
+OCC_WITH_PP=env TMPDIR=./localtmp $(OCC)
+# TMPDIR above is a workaround for some ocamlc versions, such as 4.05.0, which always create a temp file of the same name breaking parallel make (seemingly only when -pp is used)
 OCAMLDLGEN=$(COMPILETOOL) @OCAMLDLGEN@
 OCAMLFIND=$(COMPILETOOL) @OCAMLFIND@
 OCAMLMKTOP=$(COMPILETOOL) @OCAMLMKTOP@
 NOLINK ?= false
 OCAMLPP= -pp "camlp4o ./swigp4.cmo"
 OCAMLP4WHERE=`$(COMPILETOOL) @CAMLP4@ -where`
-OCAMLCORE=\
-	(test -f swig.mli   || $(SWIG) -ocaml -co swig.mli 2>/dev/null) &&  \
-	(test -f swig.ml    || $(SWIG) -ocaml -co swig.ml 2>/dev/null) &&  \
-	(test -f swigp4.ml  || $(SWIG) -ocaml -co swigp4.ml 2>/dev/null) &&  \
-	(test -f swig.cmi   || $(OCC) -c swig.mli) &&  \
-	(test -f swig.cmo   || $(OCC) -c swig.ml) &&  \
-	(test -f swigp4.cmi || $(OCC) -I $(OCAMLP4WHERE) -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml)
+
+ocaml_core:
+	mkdir -p ./localtmp
+	$(SWIG) -ocaml -co swig.mli 2>/dev/null
+	$(SWIG) -ocaml -co swig.ml 2>/dev/null
+	$(SWIG) -ocaml -co swigp4.ml 2>/dev/null
+	$(OCC) -c swig.mli
+	$(OCC) -c swig.ml
+	$(OCC_WITH_PP) -I $(OCAMLP4WHERE) -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml
 
 ocaml_static: $(SRCDIR_SRCS)
-	$(OCAMLCORE)
 	$(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
 	$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS)
 	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
 	$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
-	test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
+	test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
 	$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(RUNME) swig.cmo $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)"
 
 ocaml_dynamic: $(SRCDIR_SRCS)
-	$(OCAMLCORE)
 	$(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
 	$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS)
 	$(CXXSHARED) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(CCSHARED) -o $(INTERFACE:%.i=%@SO@) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) $(LIBS)
@@ -890,40 +892,36 @@
 	mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
 	rm $(INTERFACE:%.i=%.mli)
 	$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
-	test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
+	test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
 	$(NOLINK) || $(OCAMLFIND) $(OCC) -g -ccopt -g -cclib -g -custom -o $(RUNME) swig.cmo -package dl -linkpkg $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo)
 
 ocaml_static_toplevel: $(SRCDIR_SRCS)
-	$(OCAMLCORE)
 	$(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
 	$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS)
 	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
 	$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
-	test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
+	test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
 	$(NOLINK) || $(OCAMLMKTOP) swig.cmo -I $(OCAMLP4WHERE) dynlink.cma camlp4o.cma swigp4.cmo -cclib "$(LIBS)" -g -ccopt -g -cclib -g -custom -o $(RUNME)_top $(INTERFACE:%.i=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS)
 
 ocaml_static_cpp: $(SRCDIR_SRCS)
-	$(OCAMLCORE)
 	$(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
 	cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
 	$(OCC) -cc '$(CXX) $(CPPFLAGS)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
 	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
 	$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
-	test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
+	test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
 	$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(RUNME) swig.cmo $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)" -cc '$(CXX)'
 
 ocaml_static_cpp_toplevel: $(SRCDIR_SRCS)
-	$(OCAMLCORE)
 	$(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
 	cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
 	$(OCC) -cc '$(CXX) $(CPPFLAGS)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
 	$(OCC) -g -c $(INTERFACE:%.i=%.mli)
 	$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
-	test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
+	test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
 	$(NOLINK) || $(OCAMLMKTOP) -cc '$(CXX) $(CPPFLAGS)' swig.cmo -I $(OCAMLP4WHERE) dynlink.cma camlp4o.cma swigp4.cmo -cclib "$(LIBS)" -g -ccopt -g -cclib -g -custom -o $(RUNME)_top $(INTERFACE:%.i=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS)
 
 ocaml_dynamic_cpp: $(SRCDIR_SRCS)
-	$(OCAMLCORE)
 	$(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
 	cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
 	$(OCC) -cc '$(CXX) $(CPPFLAGS)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) -ccopt -fPIC
@@ -932,7 +930,7 @@
 	mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
 	rm $(INTERFACE:%.i=%.mli)
 	$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
-	test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
+	test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
 	$(NOLINK) || $(OCAMLFIND) swig.cmo $(OCC) -cclib -export-dynamic -g -ccopt -g -cclib -g -custom -o $(RUNME) -package dl -linkpkg $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) -cc '$(CXX)'
 
 # -----------------------------------------------------------------
@@ -957,6 +955,7 @@
 	rm -f *_wrap* *~ .~* *.cmo *.cmi *.mli $(TARGET).ml $(RUNME) $(RUNME)_top swig.ml swigp4.ml
 	rm -f core @EXTRA_CLEAN@
 	rm -f *.@OBJEXT@ *@SO@
+	rm -rf ./localtmp
 
 ##################################################################
 #####                       RUBY                            ######
@@ -1095,7 +1094,7 @@
 CSHARPFLAGS =
 CSHARPOPTIONS =
 CSHARPSO = @CSHARPSO@
-CSHARP_RUNME = $(CSHARPCILINTERPRETER) $(CSHARPCILINTERPRETER_FLAGS) ./$(RUNME).exe
+CSHARP_RUNME = ./$(RUNME).exe
 
 # ----------------------------------------------------------------
 # Build a CSharp dynamically loadable module (C)
@@ -1133,7 +1132,7 @@
 # -----------------------------------------------------------------
 
 csharp_run:
-	env LD_LIBRARY_PATH=$$PWD $(RUNTOOL) $(CSHARP_RUNME) $(RUNPIPE)
+	env LD_LIBRARY_PATH=$$PWD $(RUNTOOL) $(CSHARPCILINTERPRETER) $(CSHARPCILINTERPRETER_FLAGS) $(CSHARP_RUNME) $(RUNPIPE)
 
 # -----------------------------------------------------------------
 # Version display
@@ -1458,7 +1457,8 @@
 
 GOPACKAGE = $(notdir $(INTERFACE:.i=.a))
 
-GOPATHDIR = gopath/src/$(INTERFACE:.i=)
+GOPATHPARENTDIR = gopath/$(GOMOD)/src
+GOPATHDIR = $(GOPATHPARENTDIR)/$(INTERFACE:.i=)
 
 GOOBJEXT = `if $(GO15); then echo o; else echo $(GOC:c=); fi`
 GOGCOBJS = $(GOSRCS:.go=.$(GOOBJEXT))
@@ -1468,8 +1468,18 @@
 # Build a Go module (C)
 # ----------------------------------------------------------------
 
+$(GOPATHPARENTDIR)/go.mod:
+	@mkdir gopath 2>/dev/null || true
+	@mkdir gopath/$(GOMOD) 2>/dev/null || true
+	@mkdir gopath/$(GOMOD)/src 2>/dev/null || true
+	@mkdir $(GOPATHDIR) 2>/dev/null || true
+	echo "module swigtests" > $(GOPATHDIR)/go.mod
+	echo "" >> $(GOPATHDIR)/go.mod
+	echo "go 1.12" >> $(GOPATHDIR)/go.mod
+	mv -f $(GOPATHDIR)/go.mod $(GOPATHPARENTDIR)/go.mod
+
 go_nocgo: $(SRCDIR_SRCS)
-	$(SWIG) -go $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
+	$(SWIG) -go -no-cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
 	if $(GO12) || $(GO13) || $(GO15) || $(GOGCC); then \
 	  $(CC) -g -c $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \
 	else \
@@ -1504,11 +1514,12 @@
 	  fi; \
 	fi
 
-go: $(SRCDIR_SRCS)
-	$(SWIG) -go -cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
+go: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod
+	$(SWIG) -go -import-prefix swigtests $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
 	@mkdir gopath 2>/dev/null || true
-	@mkdir gopath/src 2>/dev/null || true
-	@mkdir gopath/src/$(INTERFACE:.i=) 2>/dev/null || true
+	@mkdir gopath/$(GOMOD) 2>/dev/null || true
+	@mkdir gopath/$(GOMOD)/src 2>/dev/null || true
+	@mkdir $(GOPATHDIR) 2>/dev/null || true
 	rm -f $(GOPATHDIR)/*
 	cp $(ISRCS) $(GOPATHDIR)/
 	if test -f $(IWRAP:.i=.h); then \
@@ -1518,7 +1529,7 @@
 	  cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \
 	fi
 	cp $(GOSRCS) $(GOPATHDIR)/
-	GOPATH=`pwd`/gopath; \
+	GOPATH=`pwd`/gopath/$(GOMOD); \
 	export GOPATH; \
 	CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
 	export CGO_CPPFLAGS; \
@@ -1527,17 +1538,16 @@
 	CGO_LDFLAGS="$(LDFLAGS) -lm"; \
 	export CGO_LDFLAGS; \
 	(cd $(GOPATHDIR)/ && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE))
-	cp $(GOPATHDIR)/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE)
 	if $(GOGCC); then \
-	  cp $(dir $(INTERFACE))/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE:.a=.gox); \
+	  cp $(GOPATHDIR)/$(GOPACKAGE) $(GOPATHDIR)/$(GOPACKAGE:.a=.gox); \
 	fi
 	if test -f $(SRCDIR)$(RUNME).go; then \
 	  if $(GOGCC) ; then \
-	    $(COMPILETOOL) $(GCCGO) -c -g $(SRCDIR)$(RUNME).go; \
-	    $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE); \
+	    $(COMPILETOOL) $(GCCGO) -c -g -I $(GOPATHDIR) $(SRCDIR)$(RUNME).go; \
+	    $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOPATHDIR)/$(GOPACKAGE); \
 	  elif $(GO12) || $(GO13) || $(GO15); then \
-	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
-	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
+	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I $(GOPATHDIR) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
+	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L $(GOPATHDIR) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
 	  else \
 	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
 	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \
@@ -1549,7 +1559,7 @@
 # ----------------------------------------------------------------
 
 go_cpp_nocgo: $(SRCDIR_SRCS)
-	$(SWIG) -go -c++ $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
+	$(SWIG) -go -c++ -no-cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
 	if $(GO12) || $(GO13) || $(GO15) || $(GOGCC); then \
 	  if test -n "$(SRCDIR_CXXSRCS)$(SRCDIR_SRCS)"; then \
 	    $(CXX) -g -c $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_CXXSRCS) $(SRCDIR_SRCS) $(INCLUDES); \
@@ -1596,11 +1606,12 @@
 	  fi; \
 	fi
 
-go_cpp: $(SRCDIR_SRCS)
-	$(SWIG) -go -c++ -cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
+go_cpp: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod
+	$(SWIG) -go -c++ -import-prefix swigtests $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
 	@mkdir gopath 2>/dev/null || true
-	@mkdir gopath/src 2>/dev/null || true
-	@mkdir gopath/src/$(INTERFACE:.i=) 2>/dev/null || true
+	@mkdir gopath/$(GOMOD) 2>/dev/null || true
+	@mkdir gopath/$(GOMOD)/src 2>/dev/null || true
+	@mkdir $(GOPATHDIR) 2>/dev/null || true
 	rm -f $(GOPATHDIR)/*
 	cp $(ICXXSRCS) $(GOPATHDIR)/
 	if test -f $(IWRAP:.i=.h); then \
@@ -1613,7 +1624,7 @@
 	  cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \
 	fi
 	cp $(GOSRCS) $(GOPATHDIR)/
-	GOPATH=`pwd`/gopath; \
+	GOPATH=`pwd`/gopath/$(GOMOD); \
 	export GOPATH; \
 	CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
 	export CGO_CPPFLAGS; \
@@ -1624,17 +1635,16 @@
 	CGO_LDFLAGS="$(LDFLAGS) -lm"; \
 	export CGO_LDFLAGS; \
 	(cd $(GOPATHDIR) && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE))
-	cp $(GOPATHDIR)/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE)
 	if $(GOGCC); then \
-	  cp $(dir $(INTERFACE))/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE:.a=.gox); \
+	  cp $(GOPATHDIR)/$(GOPACKAGE) $(GOPATHDIR)/$(GOPACKAGE:.a=.gox); \
 	fi
 	if test -f $(SRCDIR)$(RUNME).go; then \
 	  if $(GOGCC) ; then \
-	    $(COMPILETOOL) $(GCCGO) -g -c $(SRCDIR)$(RUNME).go; \
-	    $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE) -lstdc++; \
+	    $(COMPILETOOL) $(GCCGO) -g -c -I $(GOPATHDIR) $(SRCDIR)$(RUNME).go; \
+	    $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOPATHDIR)/$(GOPACKAGE) -lstdc++; \
 	  elif $(GO12) || $(GO13) || $(GO15); then \
-	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
-	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
+	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I $(GOPATHDIR) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
+	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L $(GOPATHDIR) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
 	  else \
 	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
 	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \
diff --git a/Examples/go/callback/runme.go b/Examples/go/callback/runme.go
index 03ab0c5..2c1d813 100644
--- a/Examples/go/callback/runme.go
+++ b/Examples/go/callback/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "example"
 )
 
 func main() {
diff --git a/Examples/go/class/runme.go b/Examples/go/class/runme.go
index 8d68afb..d2f292e 100644
--- a/Examples/go/class/runme.go
+++ b/Examples/go/class/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "example"
 )
 
 func main() {
diff --git a/Examples/go/constants/runme.go b/Examples/go/constants/runme.go
index 1427997..d56fd62 100644
--- a/Examples/go/constants/runme.go
+++ b/Examples/go/constants/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	"./example"
 	"fmt"
+
+	"example"
 )
 
 func main() {
diff --git a/Examples/go/director/runme.go b/Examples/go/director/runme.go
index 0d839bc..0e0da07 100644
--- a/Examples/go/director/runme.go
+++ b/Examples/go/director/runme.go
@@ -1,9 +1,10 @@
 package main
 
 import (
-	"./example"
 	"fmt"
 	"os"
+
+	"example"
 )
 
 func Compare(name string, got string, exp string) error {
diff --git a/Examples/go/enum/runme.go b/Examples/go/enum/runme.go
index 99d2651..5088705 100644
--- a/Examples/go/enum/runme.go
+++ b/Examples/go/enum/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "example"
 )
 
 func main() {
diff --git a/Examples/go/extend/runme.go b/Examples/go/extend/runme.go
index a569689..af64a6e 100644
--- a/Examples/go/extend/runme.go
+++ b/Examples/go/extend/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "example"
 )
 
 func main() {
diff --git a/Examples/go/funcptr/runme.go b/Examples/go/funcptr/runme.go
index 44dae3c..4b20db4 100644
--- a/Examples/go/funcptr/runme.go
+++ b/Examples/go/funcptr/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "example"
 )
 
 func main() {
diff --git a/Examples/go/multimap/runme.go b/Examples/go/multimap/runme.go
index 390205a..571fac7 100644
--- a/Examples/go/multimap/runme.go
+++ b/Examples/go/multimap/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "example"
 )
 
 func main() {
diff --git a/Examples/go/pointer/runme.go b/Examples/go/pointer/runme.go
index 1414d34..0cf340f 100644
--- a/Examples/go/pointer/runme.go
+++ b/Examples/go/pointer/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "example"
 )
 
 func main() {
diff --git a/Examples/go/reference/runme.go b/Examples/go/reference/runme.go
index 004a04c..9999733 100644
--- a/Examples/go/reference/runme.go
+++ b/Examples/go/reference/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "example"
 )
 
 func main() {
diff --git a/Examples/go/simple/runme.go b/Examples/go/simple/runme.go
index 9eb0ff4..0bd4657 100644
--- a/Examples/go/simple/runme.go
+++ b/Examples/go/simple/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	"./example"
 	"fmt"
+
+	"example"
 )
 
 func main() {
diff --git a/Examples/go/template/runme.go b/Examples/go/template/runme.go
index fca2f1b..3477953 100644
--- a/Examples/go/template/runme.go
+++ b/Examples/go/template/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "example"
 )
 
 func main() {
diff --git a/Examples/go/variables/runme.go b/Examples/go/variables/runme.go
index 3d9737f..e2dd0c6 100644
--- a/Examples/go/variables/runme.go
+++ b/Examples/go/variables/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	"./example"
 	"fmt"
+
+	"example"
 )
 
 func main() {
diff --git a/Examples/java/variables/runme.java b/Examples/java/variables/runme.java
index 361a30f..a53cc54 100644
--- a/Examples/java/variables/runme.java
+++ b/Examples/java/variables/runme.java
@@ -76,7 +76,7 @@
     System.out.println( "     Trying to set 'status'" );
     try {
         Method m = example.class.getDeclaredMethod("setStatus", new Class[] {Integer.class});
-        m.invoke(example.class, new Object[] {new Integer(0)} );
+        m.invoke(example.class, new Object[] {Integer.valueOf(0)} );
         System.out.println( "Hey, what's going on?!?! This shouldn't work" );
     }
     catch (NoSuchMethodException e) {
diff --git a/Examples/ocaml/argout_ref/Makefile b/Examples/ocaml/argout_ref/Makefile
index 234713d..0937094 100644
--- a/Examples/ocaml/argout_ref/Makefile
+++ b/Examples/ocaml/argout_ref/Makefile
@@ -15,6 +15,10 @@
 static:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
 	ocaml_static_cpp
diff --git a/Examples/ocaml/callback/Makefile b/Examples/ocaml/callback/Makefile
index 7344485..b81b5ac 100644
--- a/Examples/ocaml/callback/Makefile
+++ b/Examples/ocaml/callback/Makefile
@@ -16,6 +16,10 @@
 static:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
 	ocaml_static_cpp
diff --git a/Examples/ocaml/class/Makefile b/Examples/ocaml/class/Makefile
index 7344485..b81b5ac 100644
--- a/Examples/ocaml/class/Makefile
+++ b/Examples/ocaml/class/Makefile
@@ -16,6 +16,10 @@
 static:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
 	ocaml_static_cpp
diff --git a/Examples/ocaml/contract/Makefile b/Examples/ocaml/contract/Makefile
index 1f36642..8148de1 100644
--- a/Examples/ocaml/contract/Makefile
+++ b/Examples/ocaml/contract/Makefile
@@ -22,6 +22,10 @@
 static:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
 	ocaml_static
diff --git a/Examples/ocaml/scoped_enum/Makefile b/Examples/ocaml/scoped_enum/Makefile
index f0f5317..cfed474 100644
--- a/Examples/ocaml/scoped_enum/Makefile
+++ b/Examples/ocaml/scoped_enum/Makefile
@@ -22,6 +22,10 @@
 static:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
 	ocaml_static_cpp
diff --git a/Examples/ocaml/shapes/Makefile b/Examples/ocaml/shapes/Makefile
index bc269d6..eab86d2 100644
--- a/Examples/ocaml/shapes/Makefile
+++ b/Examples/ocaml/shapes/Makefile
@@ -16,11 +16,15 @@
 static:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
 	ocaml_static_cpp
 
-toplevel:
+toplevel: static
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
diff --git a/Examples/ocaml/simple/Makefile b/Examples/ocaml/simple/Makefile
index 3b24a6b..27fdb20 100644
--- a/Examples/ocaml/simple/Makefile
+++ b/Examples/ocaml/simple/Makefile
@@ -22,6 +22,10 @@
 static:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
 	ocaml_static
diff --git a/Examples/ocaml/std_string/Makefile b/Examples/ocaml/std_string/Makefile
index 099b1fc..6554656 100644
--- a/Examples/ocaml/std_string/Makefile
+++ b/Examples/ocaml/std_string/Makefile
@@ -15,6 +15,10 @@
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	ocaml_static_cpp
 
 dynamic:
diff --git a/Examples/ocaml/std_vector/Makefile b/Examples/ocaml/std_vector/Makefile
index 099b1fc..6554656 100644
--- a/Examples/ocaml/std_vector/Makefile
+++ b/Examples/ocaml/std_vector/Makefile
@@ -15,6 +15,10 @@
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	ocaml_static_cpp
 
 dynamic:
diff --git a/Examples/ocaml/stl/Makefile b/Examples/ocaml/stl/Makefile
index 683d34c..363311d 100644
--- a/Examples/ocaml/stl/Makefile
+++ b/Examples/ocaml/stl/Makefile
@@ -15,13 +15,17 @@
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	ocaml_static_cpp
 
 dynamic:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
-	ocaml_static_cpp
+	ocaml_dynamic_cpp
 
 toplevel:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
diff --git a/Examples/ocaml/string_from_ptr/Makefile b/Examples/ocaml/string_from_ptr/Makefile
index 0d3163e..5ab5c44 100644
--- a/Examples/ocaml/string_from_ptr/Makefile
+++ b/Examples/ocaml/string_from_ptr/Makefile
@@ -15,11 +15,15 @@
 static:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
 	ocaml_static
 
-toplevel:
+toplevel: static
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
diff --git a/Examples/ocaml/strings_test/Makefile b/Examples/ocaml/strings_test/Makefile
index bed8684..38cf234 100644
--- a/Examples/ocaml/strings_test/Makefile
+++ b/Examples/ocaml/strings_test/Makefile
@@ -15,15 +15,19 @@
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
+	ocaml_core
+	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
+	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 	ocaml_static_cpp
 
 dynamic:
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
-	ocaml_static_cpp
+	ocaml_dynamic_cpp
 
-toplevel:
+toplevel: static
 	$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
diff --git a/Examples/php/pragmas/example.i b/Examples/php/pragmas/example.i
index f9307a6..b72828b 100644
--- a/Examples/php/pragmas/example.i
+++ b/Examples/php/pragmas/example.i
@@ -21,7 +21,7 @@
   zend_printf("This was %%rshutdown\n");
 }
 
-%pragma(php) include="include.php";
+%pragma(php) include="./include.php";
 
 %pragma(php) code="
 # This code is inserted into example.php
diff --git a/Examples/test-suite/allprotected.i b/Examples/test-suite/allprotected.i
index 086cfb2..e9b4eb3 100644
--- a/Examples/test-suite/allprotected.i
+++ b/Examples/test-suite/allprotected.i
@@ -79,5 +79,9 @@
 };
 int ProtectedBase::staticMemberVariable = 10;
 
+class ProtectedDerived : public ProtectedBase {
+public:
+  ProtectedDerived(const char *s) : ProtectedBase(s) {}
+};
 %}
 
diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk
index 5a72ba7..67a6328 100644
--- a/Examples/test-suite/common.mk
+++ b/Examples/test-suite/common.mk
@@ -407,6 +407,7 @@
 	static_array_member \
 	static_const_member \
 	static_const_member_2 \
+	stl_no_default_constructor \
 	string_constants \
 	struct_initialization_cpp \
 	struct_value \
@@ -571,6 +572,7 @@
 	cpp11_director_enums \
 	cpp11_directors \
 	cpp11_explicit_conversion_operators \
+	cpp11_final_directors \
 	cpp11_final_override \
 	cpp11_function_objects \
 	cpp11_inheriting_constructors \
@@ -707,6 +709,7 @@
 	preproc \
 	preproc_constants_c \
 	preproc_defined \
+	preproc_gcc_output \
 	preproc_include \
 	preproc_line_file \
 	register_par \
diff --git a/Examples/test-suite/cpp11_alias_nested_template_scoping.i b/Examples/test-suite/cpp11_alias_nested_template_scoping.i
index 0cf5ea3..72814aa 100644
--- a/Examples/test-suite/cpp11_alias_nested_template_scoping.i
+++ b/Examples/test-suite/cpp11_alias_nested_template_scoping.i
@@ -19,17 +19,17 @@
     typedef T2 another_type;
   };
   value_type create1() const { return T(); }
-  Y::value_type create2() const { return T(); }
-  Y<T>::value_type create3() const { return T(); }
-  YY::value_type create4() const { return T(); }
-  Y<T>::YY::value_type create5() const { return T(); }
+  typename Y::value_type create2() const { return T(); }
+  typename Y<T>::value_type create3() const { return T(); }
+  typename YY::value_type create4() const { return T(); }
+  typename Y<T>::YY::value_type create5() const { return T(); }
   Y<T>::YYY<T>::value_type create6() const { return T(); }
   typename Y<T>::template ZZZ<T>::another_type create7() const { return T(); }
 
   // With global scope prefix
-  ::Y<T>::value_type create13() const { return T(); }
+  typename ::Y<T>::value_type create13() const { return T(); }
 
-  ::Y<T>::YY::value_type create15() const { return T(); }
+  typename ::Y<T>::YY::value_type create15() const { return T(); }
   ::Y<T>::YYY<T>::value_type create16() const { return T(); }
   typename ::Y<T>::template ZZZ<T>::another_type create17() const { return T(); }
 };
diff --git a/Examples/test-suite/cpp11_alignment.i b/Examples/test-suite/cpp11_alignment.i
index fb25c4e..135f636 100644
--- a/Examples/test-suite/cpp11_alignment.i
+++ b/Examples/test-suite/cpp11_alignment.i
@@ -4,7 +4,8 @@
 struct A {
   int member;
 };
-const int align1 = alignof(A::member);
+const int align1 = alignof(int);
+const int align2 = alignof(int *);
 %}
 
 %{
diff --git a/Examples/test-suite/cpp11_final_directors.i b/Examples/test-suite/cpp11_final_directors.i
new file mode 100644
index 0000000..b58111a
--- /dev/null
+++ b/Examples/test-suite/cpp11_final_directors.i
@@ -0,0 +1,33 @@
+%module(directors="1") cpp11_final_directors
+
+%director Derived;
+
+// Check SWIG will not wrap these classes as directors where the destructors are final
+%director BaseFinalDestructor;
+%director BaseFinalDestructor2;
+
+%warnfilter(SWIGWARN_LANG_DIRECTOR_FINAL) BaseFinalDestructor::~BaseFinalDestructor;
+%warnfilter(SWIGWARN_LANG_DIRECTOR_FINAL) BaseFinalDestructor2::~BaseFinalDestructor2;
+
+%inline %{
+struct Base {
+  virtual void basemeth() final {}
+  virtual ~Base() {}
+};
+
+struct Derived : Base {
+  virtual int derivedmeth() final { return 1; }
+  virtual int meth() { return 2; }
+  virtual ~Derived() {}
+};
+
+struct BaseFinalDestructor {
+  virtual void basefinalmeth() final {}
+  virtual ~BaseFinalDestructor() final {}
+};
+
+struct BaseFinalDestructor2 {
+  virtual void basefinalmeth() {}
+  virtual ~BaseFinalDestructor2() final {}
+};
+%}
diff --git a/Examples/test-suite/cpp11_lambda_functions.i b/Examples/test-suite/cpp11_lambda_functions.i
index fc02aad..3d7d76d 100644
--- a/Examples/test-suite/cpp11_lambda_functions.i
+++ b/Examples/test-suite/cpp11_lambda_functions.i
@@ -43,14 +43,17 @@
    single statement "return expr;". */
 auto lambda2 = [](int x, int y) { return x+y; };
 
-auto lambda3 = [&](int x, int y) { return x+y; };
-auto lambda4 = [=](int x, int y) { return x+y; };
 int thing = 0;
 #ifdef SWIG
-// Not strictly correct as captured variables should have non-automatic storage duration, ie shouldn't capture globals. gcc-4.7 warns about this, but we check that SWIG can parse this anyway.
+// This is not strictly legal: non-local lambda expression cannot have a capture-default
+// gcc-4.7 warns about this and gcc-9 gives an error, but we check that SWIG can parse this anyway.
+auto lambda3 = [&](int x, int y) { return x+y; };
+auto lambda4 = [=](int x, int y) { return x+y; };
 auto lambda5 = [=,&thing]() { return thing; };
 #else
-auto lambda5 = [=]() { return thing; };
+auto lambda3 = [](int x, int y) { return x+y; };
+auto lambda4 = [](int x, int y) { return x+y; };
+auto lambda5 = []() { return thing; };
 #endif
 
 void fn() {
@@ -115,6 +118,6 @@
 // TODO
 int(*lambda101notauto)(int, int) = [] (int a, int b) { return a + b; };
 int lambda102 = [] (int a, int b) mutable { return a + b; }(1, 2);
-void lambda_init(int = ([=]{ return 0; })());
+void lambda_init(int = ([]{ return 0; })());
 %}
 
diff --git a/Examples/test-suite/cpp11_std_unordered_map.i b/Examples/test-suite/cpp11_std_unordered_map.i
index b11d8f2..4bdec9c 100644
--- a/Examples/test-suite/cpp11_std_unordered_map.i
+++ b/Examples/test-suite/cpp11_std_unordered_map.i
@@ -5,3 +5,7 @@
 
 %template(UnorderedMapIntInt) std::unordered_map<int, int>;
 %template(UnorderedMapStringInt) std::unordered_map<std::string, int>;
+
+%inline %{
+std::unordered_map<std::string, int, std::hash< std::string >,std::equal_to< std::string >,std::allocator< std::pair< std::string const,int > > > inout(std::unordered_map<std::string, int> m) { return m; }
+%}
diff --git a/Examples/test-suite/cpp11_template_explicit.i b/Examples/test-suite/cpp11_template_explicit.i
index f8fca4f..71752f8 100644
--- a/Examples/test-suite/cpp11_template_explicit.i
+++ b/Examples/test-suite/cpp11_template_explicit.i
@@ -8,7 +8,8 @@
 
 %inline %{
 
-template<typename T> struct Temper {
+template<typename T> class Temper {
+public:
   T val;
 };
 
@@ -18,14 +19,20 @@
   int memberFunction() { return 100; }
 };
 
+class B {
+public:
+  short member;
+  short memberFunction() { return 100; }
+};
+
 template class Temper<A>;
-extern template class Temper<A>;
+extern template class Temper<B>;
 
 template class Temper<A*>;
-extern template class Temper<A*>;
+extern template class Temper<B*>;
 
 template class Temper<int>;
-extern template class Temper<int>;
+extern template class Temper<short>;
 %}
 
 %template(TemperInt) Temper<int>;
diff --git a/Examples/test-suite/cpp11_thread_local.i b/Examples/test-suite/cpp11_thread_local.i
index 6a10198..21f2185 100644
--- a/Examples/test-suite/cpp11_thread_local.i
+++ b/Examples/test-suite/cpp11_thread_local.i
@@ -20,8 +20,10 @@
 
 thread_local int ThreadLocals::stval = 11;
 thread_local int ThreadLocals::tsval = 22;
+#if !defined(_MSC_VER)
 thread_local const int ThreadLocals::stcval88;
 thread_local const int ThreadLocals::tscval99;
+#endif
 %}
 
 %{
diff --git a/Examples/test-suite/cpp_static.i b/Examples/test-suite/cpp_static.i
index 1f8ca12..9ffe558 100644
--- a/Examples/test-suite/cpp_static.i
+++ b/Examples/test-suite/cpp_static.i
@@ -10,6 +10,7 @@
 class StaticMemberTest {
 public:
   static int static_int;
+  static int grab_int() { return static_int; }
 };
 
 class StaticFunctionTest {
@@ -28,10 +29,12 @@
 %inline %{
 struct StaticBase {
   static int statty;
+  static int grab_statty_base() { return statty; }
   virtual ~StaticBase() {}
 };
 struct StaticDerived : StaticBase {
   static int statty;
+  static int grab_statty_derived() { return statty; }
 };
 %}
 
diff --git a/Examples/test-suite/csharp/Makefile.in b/Examples/test-suite/csharp/Makefile.in
index a4ae713..c9e48f8 100644
--- a/Examples/test-suite/csharp/Makefile.in
+++ b/Examples/test-suite/csharp/Makefile.in
@@ -26,7 +26,8 @@
 	enum_thorough_typesafe \
 	exception_partial_info \
 	intermediary_classname \
-	li_boost_intrusive_ptr
+	li_boost_intrusive_ptr \
+	li_std_list \
 
 CPP11_TEST_CASES = \
 	cpp11_shared_ptr_const \
diff --git a/Examples/test-suite/csharp/allprotected_runme.cs b/Examples/test-suite/csharp/allprotected_runme.cs
index 99a791d..6b04feb 100644
--- a/Examples/test-suite/csharp/allprotected_runme.cs
+++ b/Examples/test-suite/csharp/allprotected_runme.cs
@@ -13,6 +13,20 @@
   {
     MyProtectedBase mpb = new MyProtectedBase("MyProtectedBase");
     mpb.accessProtected();
+    try {
+      // C++ destructor is protected
+      mpb.Dispose();
+      throw new Exception("failed to catch MethodAccessException");
+    } catch (MethodAccessException) {
+      // Exception message: C++ destructor does not have public access
+    }
+    ProtectedDerived pd = new ProtectedDerived("ProtectedDerived");
+    // Destroying via the ProtectedDerived's destructor should work
+    pd.Dispose();
+
+    ProtectedBase pb = new ProtectedDerived("ProtectedDerived");
+    // ProtectedDerived's destructor should be called via the Dispose(disposing) virtual call
+    pb.Dispose();
   }
 }
 
diff --git a/Examples/test-suite/csharp/li_std_auto_ptr_runme.cs b/Examples/test-suite/csharp/li_std_auto_ptr_runme.cs
index 1f66042..863b867 100644
--- a/Examples/test-suite/csharp/li_std_auto_ptr_runme.cs
+++ b/Examples/test-suite/csharp/li_std_auto_ptr_runme.cs
@@ -19,6 +19,13 @@
         if (Klass.getTotal_count() != 2)
             throw new Exception("number of objects should be 2");
 
+        using (Klass k3 = li_std_auto_ptr.makeKlassAutoPtr("second")) {
+          if (Klass.getTotal_count() != 3)
+            throw new Exception("number of objects should be 3");
+        }
+        if (Klass.getTotal_count() != 2)
+            throw new Exception("number of objects should be 2");
+
         k1 = null;
         {
           int countdown = 500;
diff --git a/Examples/test-suite/csharp/li_std_list_runme.cs b/Examples/test-suite/csharp/li_std_list_runme.cs
new file mode 100644
index 0000000..1a5b156
--- /dev/null
+++ b/Examples/test-suite/csharp/li_std_list_runme.cs
@@ -0,0 +1,402 @@
+using System;
+using li_std_listNamespace;
+
+public class li_std_list_runme {
+  private static readonly int collectionSize = 20;
+
+  public static void Main() {
+    // Setup a list of int
+    IntList list = new IntList();
+    IntList.IntListNode node;
+
+    for (int i = 0; i < 20; i++) {
+      int nb = i * 10;
+      list.Add(nb);
+    }
+
+    // Count property test
+    if (list.Count != collectionSize)
+      throw new Exception("Count test failed");
+
+    // IsReadOnly property test
+    if (list.IsReadOnly)
+      throw new Exception("IsReadOnly test failed");
+
+    // Contains method test
+    if (!list.Contains(0))
+      throw new Exception("Contains method test 1 failed");
+    if (!list.Contains(2 * 10))
+      throw new Exception("Contains method test 2 failed");
+    if (!list.Contains(19 * 10))
+      throw new Exception("Contains method test 3 failed");
+    if (list.Contains(20 * 10))
+      throw new Exception("Contains method test 4 failed");
+
+    // Nodes comparison method overload
+    {
+      IntList.IntListNode temp = new IntList.IntListNode(3);
+      if (list.First == temp)
+        throw new Exception("== overload method test (1) failed");
+      temp = new IntList.IntListNode(0);
+      if (list.First == temp)
+        throw new Exception("== overload method test (2) failed");
+      IntList.IntListNode temp2 = new IntList.IntListNode(0);
+      if (temp == temp2)
+        throw new Exception("== overload method test (3) failed");
+      if (!(list.First == list.First))
+        throw new Exception("== overload method test (4) failed");
+      if (list.First != list.First)
+        throw new Exception("!= overload method test (1) failed");
+      if (!(temp != temp2))
+        throw new Exception("!= overload method test (2) failed");
+      if (list.First.Equals(temp))
+        throw new Exception("Equals method test failed");
+      if (list.First.GetHashCode() == temp.GetHashCode())
+        throw new Exception("GetHashCode method test (1) failed");
+      if (list.First.GetHashCode() == list.First.GetHashCode())
+        throw new Exception("GetHashCode method test (2) failed");
+
+    }
+
+    // Getter test
+    {
+      if (list.First == null)
+        throw new Exception("First getter test (1) failed");
+      if (list.Last == null)
+        throw new Exception("Last getter test (1) failed");
+      if (list.Last.Next != null)
+        throw new Exception("Next getter test (1) failed");
+      if (list.First.Next == null)
+        throw new Exception("Next getter test (2) failed");
+      if (list.First.Previous != null)
+        throw new Exception("Previous getter test (1) failed");
+       if (list.Last.Previous == null)
+        throw new Exception("Previous getter test (2) failed");
+    }
+
+    // AddFirst method test
+    node = list.AddFirst(34);
+    if (list.First.Value != 34 || node.Value != 34 || node != list.First)
+      throw new Exception("AddFirst method test failed");
+    try {
+      list.AddFirst(null);
+    } catch (ArgumentNullException) {
+      try {
+        list.AddFirst(list.First);
+      } catch (InvalidOperationException) {
+      }
+    }
+
+    // RemoveFirst method test
+    int tmp = list.First.Value;
+    list.RemoveFirst();
+    if (list.First.Value == tmp || list.First.Value != 0 * 10)
+      throw new Exception("RemoveFirst method test failed");
+
+    // AddLast method test
+    node = list.AddLast(8);
+    if (list.Last.Value != 8 || node.Value != 8 || node != list.Last)
+      throw new Exception("AddLast method test failed");
+    try {
+      list.AddLast(null);
+    } catch (ArgumentNullException) {
+      try {
+        list.AddLast(list.First);
+      } catch (InvalidOperationException) {
+      }
+    }
+
+    // RemoveLast method test
+    int tmp2 = list.Last.Value;
+    list.RemoveLast();
+    if (list.Last.Value == tmp2 || list.Last.Value != (list.Count - 1) * 10)
+      throw new Exception("RemoveLast method test failed");
+
+    // AddBefore method test
+    node = list.AddBefore(list.Last, 17);
+    if (list.Last.Previous.Value != 17 || node.Value != 17 || node != list.Last.Previous)
+      throw new Exception("AddBefore method test (1) failed");
+    try {
+      node = null;
+      list.AddBefore(list.Last, node);
+      throw new Exception("AddBefore method test (2) failed");
+    } catch (ArgumentNullException) {
+      try {
+        node = new IntList.IntListNode(1);
+        list.AddBefore(null, node);
+        throw new Exception("AddBefore method test (3) failed");
+      } catch (ArgumentNullException) {
+        try {
+          list.AddBefore(list.Last, list.First);
+        } catch (InvalidOperationException) {
+        }
+      }
+    }
+
+    // AddAfter method test
+    node = list.AddAfter(list.First, 47);
+    if (list.First.Next.Value != 47 || node.Value != 47 || node != list.First.Next)
+      throw new Exception("AddAfter method test (1) failed");
+    try {
+      node = null;
+      list.AddAfter(list.First.Next, node);
+      throw new Exception("AddAfter method test (2) failed");
+    } catch (ArgumentNullException) {
+      try {
+        list.AddAfter(list.First, list.Last);
+      } catch (InvalidOperationException) {
+      }
+    }
+
+    // Find method test
+    node = list.Find(0);
+    if (node == null || node.Value != 0)
+      throw new Exception("Find method test (1) failed");
+    node = list.Find(47);
+    if (node == null || node.Value != 47)
+      throw new Exception("Find method test (2) failed");
+    node = list.Find(190);
+    if (node == null || node.Value != 190)
+      throw new Exception("Find method test (3) failed");
+    node = list.Find(-3);
+    if (node != null)
+      throw new Exception("Find method test (4) failed");
+
+    // Remove method test
+    if (!list.Remove(17) || list.Contains(17) || list.Last.Previous.Value == 17)
+      throw new Exception("Remove method test (1) failed");
+    if (!list.Remove(47) || list.Contains(47) || list.First.Next.Value == 47)
+      throw new Exception("Remove method test (2) failed");
+    if (!list.Remove(0) || list.Contains(0) || list.First.Value == 0)
+      throw new Exception("Remove method test (3) failed");
+    if (!list.Remove(190) || list.Contains(190) || list.Last.Value == 190)
+      throw new Exception("Remove method test (4) failed");
+    try {
+      node = null;
+      list.Remove(node);
+      throw new Exception("Remove method test (5) failed");
+    } catch (ArgumentNullException) {
+      try {
+          node = new IntList.IntListNode(4);
+          list.Remove(node);         
+          throw new Exception("Remove method test (5) failed");
+      } catch (InvalidOperationException) {
+      }
+    }
+
+    // ICollection constructor test
+    {
+      int[] intArray = new int[] { 0, 11, 22, 33, 44, 55, 33 };
+      IntList il = new IntList(intArray);
+      if (intArray.Length != il.Count)
+        throw new Exception("ICollection constructor length check failed: " + intArray.Length + "-" + il.Count);
+      node = il.First;
+      for (int i = 0; i < intArray.Length; i++) {
+        if (intArray[i] != node.Value)
+          throw new Exception("ICollection constructor failed, index:" + i);
+        node = node.Next;
+      }
+      try {
+        new IntList((System.Collections.ICollection)null);
+        throw new Exception("ICollection constructor null test failed");
+      } catch (ArgumentNullException) {
+      }
+    }
+
+    // Enumerator test
+    {
+      node = list.First;
+      System.Collections.IEnumerator myEnumerator = list.GetEnumerator();
+      while (myEnumerator.MoveNext()) {
+        if ((int)myEnumerator.Current != node.Value)
+          throw new Exception("Enumerator (1) test failed");
+        node = node.Next;
+      }
+    }
+    {
+      node = list.First;
+      System.Collections.Generic.IEnumerator<int> myEnumerator = list.GetEnumerator();
+      while (myEnumerator.MoveNext()) {
+        if (myEnumerator.Current != node.Value)
+          throw new Exception("Enumerator (2) test failed");
+        node = node.Next;
+      }
+    }
+    {
+      node = list.First;
+      IntList.IntListEnumerator myEnumerator = list.GetEnumerator();
+      while (myEnumerator.MoveNext()) {
+        if (myEnumerator.Current != node.Value)
+          throw new Exception("Enumerator (3) test failed");
+        node = node.Next;
+      }
+    }
+    {
+      node = list.First;
+      foreach (var elem in list) {
+        if (elem != node.Value)
+          throw new Exception("Enumerator (4) test failed");
+        node = node.Next;
+      }
+    }
+    
+    // CopyTo method test
+    {
+      int[] outputarray = new int[collectionSize - 2];
+      list.CopyTo(outputarray, 0);
+      int index = 0;
+      IntList.IntListNode temp = list.First;
+      foreach (int val in outputarray) {
+        if (temp.Value != val) {
+          throw new Exception("CopyTo method test (1) failed, index:" + index);
+        }
+        index++;
+        temp = temp.Next;
+      }
+    }
+    {
+      DoubleList inputlist = new DoubleList();
+      int arrayLen = 10;
+      for (int i = 0; i < arrayLen; i++) {
+        double num = i * 10.1;
+        inputlist.Add(num);
+      }
+      double[] outputarray = new double[arrayLen];
+      inputlist.CopyTo(outputarray, 0);
+      DoubleList.DoubleListNode temp = inputlist.First;
+      for (int i = 0; i < arrayLen; i++) {
+        if (outputarray[i] != temp.Value)
+          throw new Exception("CopyTo method test (2) failed, index:" + i);
+        temp = temp.Next;
+      }
+    }
+    {
+      StructList inputlist = new StructList();
+      int arrayLen = 10;
+      for (int i = 0; i < arrayLen; i++)
+        inputlist.Add(new Struct(i / 10.0));
+      Struct[] outputarray = new Struct[arrayLen];
+      inputlist.CopyTo(outputarray, 0);
+      StructList.StructListNode temp = inputlist.First;
+      for (int i = 0; i < arrayLen; i++) {
+        if (outputarray[i].num != temp.Value.num)
+          throw new Exception("CopyTo method test (3) failed, index:" + i);
+        temp = temp.Next;
+      }
+      foreach (Struct s in inputlist) {
+        s.num += 20.0;
+      }
+      temp = inputlist.First;
+      for (int i = 0; i < arrayLen; i++) {
+        if (outputarray[i].num != temp.Value.num)
+          throw new Exception("CopyTo method test (4) failed, index:" + i);
+        temp = temp.Next;
+      }
+    }
+    try {
+      list.CopyTo(null, 0);
+      throw new Exception("CopyTo method test (5) failed");
+    } catch (ArgumentNullException) {
+    }
+     
+    // Clear() test
+    list.Clear();
+    if (list.Count != 0)
+      throw new Exception("Clear method failed");
+
+    // Finally test the methods being wrapped
+    {
+      IntList il = new IntList();
+      for (int i = 0; i < 4; i++) {
+        il.Add(i);
+      }
+
+      double x = li_std_list.average(il);
+      x += li_std_list.average(new IntList(new int[] { 1, 2, 3, 4 }));
+
+      DoubleList dlist = new DoubleList();
+      for (int i = 0; i < 10; i++) {
+        dlist.Add(i / 2.0);
+      }
+      li_std_list.halve_in_place(dlist);
+    }
+
+    // Dispose()
+    {
+      using (StructList ls = new StructList(new Struct[] { new Struct(0.0), new Struct(11.1) }))
+      using (DoubleList ld = new DoubleList(new double[] { 0.0, 11.1 })) {  }
+    }
+
+    // More wrapped methods
+    {
+      FloatList l0 = li_std_list.listreal(new FloatList());
+      float flo = 123.456f;
+      l0.Add(flo);
+      flo = l0.First.Value;
+
+      IntList l1 = li_std_list.listint(new IntList());
+      IntPtrList l2 = li_std_list.listintptr(new IntPtrList());
+      IntConstPtrList l3 = li_std_list.listintconstptr(new IntConstPtrList());
+
+      l1.Add(123);
+      l2.Clear();
+      l3.Clear();
+
+      StructList l4 = li_std_list.liststruct(new StructList());
+      StructPtrList l5 = li_std_list.liststructptr(new StructPtrList());
+      StructConstPtrList l6 = li_std_list.liststructconstptr(new StructConstPtrList());
+
+      l4.Add(new Struct(123));
+      l5.Add(new Struct(123));
+      l6.Add(new Struct(123));
+    }
+
+    // Test lists of pointers
+    {
+      StructPtrList inputlist = new StructPtrList();
+      int arrayLen = 10;
+      for (int i = 0; i < arrayLen; i++) {
+        inputlist.Add(new Struct(i / 10.0));
+      }
+      Struct[] outputarray = new Struct[arrayLen];
+      inputlist.CopyTo(outputarray, 0);
+      StructPtrList.StructPtrListNode temp = inputlist.First;
+      for (int i = 0; i < arrayLen; i++) {
+        if (outputarray[i].num != temp.Value.num)
+          throw new Exception("StructPtrList test (1) failed, i:" + i);
+        temp = temp.Next;
+      }
+      foreach (Struct s in inputlist) {
+        s.num += 20.0;
+      }
+      for (int i = 0; i < arrayLen; i++) {
+        if (outputarray[i].num != 20.0 + i / 10.0)
+          throw new Exception("StructPtrList test (2) failed (a deep copy was incorrectly made), i:" + i);
+      }
+    }
+
+    // Test lists of const pointers
+    {
+      StructConstPtrList inputlist = new StructConstPtrList();
+      int arrayLen = 10;
+      for (int i = 0; i < arrayLen; i++) {
+        inputlist.Add(new Struct(i / 10.0));
+      }
+      Struct[] outputarray = new Struct[arrayLen];
+      inputlist.CopyTo(outputarray, 0);
+      StructConstPtrList.StructConstPtrListNode temp = inputlist.First;
+      for (int i = 0; i < arrayLen; i++) {
+        if (outputarray[i].num != temp.Value.num)
+          throw new Exception("StructConstPtrList test (1) failed, i:" + i);
+        temp = temp.Next;
+      }
+      foreach (Struct s in inputlist) {
+        s.num += 20.0;
+      }
+      for (int i = 0; i < arrayLen; i++) {
+        if (outputarray[i].num != 20.0 + i / 10.0)
+          throw new Exception("StructConstPtrList test (2) failed (a deep copy was incorrectly made), i:" + i);
+      }
+    }
+  }
+}
diff --git a/Examples/test-suite/csharp/li_std_set_runme.cs b/Examples/test-suite/csharp/li_std_set_runme.cs
new file mode 100644
index 0000000..6519e8c
--- /dev/null
+++ b/Examples/test-suite/csharp/li_std_set_runme.cs
@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using li_std_setNamespace;
+
+public class runme
+{
+    static void checkThat(bool mustBeTrue, string message)
+    {
+        if (!mustBeTrue)
+            throw new Exception("Test that the set " + message + " failed");
+    }
+
+    static void Main()
+    {
+        StringSet ss = new StringSet();
+
+        // Check the interface methods first.
+        ISet<string> s = ss;
+
+        checkThat(s.Count == 0, "is initially empty");
+        checkThat(!s.Contains("key"), "doesn't contain inexistent element");
+        checkThat(!s.Remove("key"), "returns false when removing inexistent element");
+
+        checkThat(s.Add("key"), "returns true when adding a new element");
+        checkThat(!s.Add("key"), "returns false when adding an existing element");
+        checkThat(s.Contains("key"), "contains the just added element");
+        checkThat(s.Remove("key"), "returns true when removing an existing element");
+        checkThat(s.Count == 0, "is empty again");
+
+        checkThat(s.Add("key1"), "Add(key1) returns true");
+        checkThat(s.Add("key2"), "Add(key2) returns true");
+        checkThat(s.Add("key3"), "Add(key3) returns true");
+
+        // Also check a different interface, providing a different Add() (sic!).
+        ICollection<string> coll = ss;
+        coll.Add("key");
+        checkThat(ss.Count == 4, "contains 4 elements");
+
+        // Now use object-specific methods, mimicking HashSet<>.
+        string val;
+        checkThat(ss.TryGetValue("key1", out val), "could retrieve existing item");
+        checkThat(val.Equals("key1"), "value was returned correctly by TryGetValue()");
+        checkThat(!ss.TryGetValue("no-such-key", out val), "couldn't retrieve inexistent item");
+        checkThat(val == null, "value was reset after failed TryGetValue()");
+
+        IList<string> list = new List<string>();
+        foreach (string str in ss) {
+            list.Add(str);
+        }
+        checkThat(list.Count == 4, "copy contains 4 elements");
+
+        ss.Clear();
+        checkThat(ss.Count == 0, "is empty after Clear()");
+
+        // Check set-theoretic methods.
+        checkThat(new StringSet().SetEquals(new StringSet()), "SetEquals() works for empty sets");
+        checkThat(new StringSet{"foo"}.SetEquals(new StringSet{"foo"}), "SetEquals() works for non-empty sets");
+        checkThat(!new StringSet{"foo"}.SetEquals(new[] {"bar"}), "SetEquals() doesn't always return true");
+
+        ss = new StringSet{"foo", "bar", "baz"};
+        ss.ExceptWith(new[] {"baz", "quux"});
+        checkThat(ss.SetEquals(new[] {"foo", "bar"}), "ExceptWith works");
+
+        ss = new StringSet{"foo", "bar", "baz"};
+        ss.IntersectWith(new[] {"baz", "quux"});
+        checkThat(ss.SetEquals(new[] {"baz"}), "IntersectWith works");
+
+        checkThat(ss.IsProperSubsetOf(new[] {"bar", "baz"}), "IsProperSubsetOf works");
+        checkThat(!ss.IsProperSubsetOf(new[] {"baz"}), "!IsProperSubsetOf works");
+        checkThat(ss.IsSubsetOf(new[] {"bar", "baz"}), "IsSubsetOf works");
+        checkThat(!ss.IsSubsetOf(new[] {"bar"}), "!IsSubsetOf works");
+
+        ss = new StringSet{"foo", "bar", "baz"};
+        checkThat(ss.IsProperSupersetOf(new[] {"bar"}), "IsProperSupersetOf works");
+        checkThat(!ss.IsProperSupersetOf(new[] {"quux"}), "IsProperSupersetOf works");
+        checkThat(ss.IsSupersetOf(new[] {"foo", "bar", "baz"}), "IsProperSupersetOf works");
+        checkThat(!ss.IsSupersetOf(new[] {"foo", "bar", "baz", "quux"}), "IsProperSupersetOf works");
+
+        checkThat(ss.Overlaps(new[] {"foo"}), "Overlaps works");
+        checkThat(!ss.Overlaps(new[] {"moo"}), "!Overlaps works");
+
+        ss.SymmetricExceptWith(new[] {"baz", "quux"});
+        checkThat(ss.SetEquals(new[] {"foo", "bar", "quux"}), "SymmetricExceptWith works");
+
+        ss = new StringSet{"foo", "bar", "baz"};
+        ss.UnionWith(new[] {"baz", "quux"});
+        checkThat(ss.SetEquals(new[] {"foo", "bar", "baz", "quux"}), "UnionWith works");
+    }
+}
diff --git a/Examples/test-suite/doxygen_misc_constructs.i b/Examples/test-suite/doxygen_misc_constructs.i
index c95e856..c1b3eea 100644
--- a/Examples/test-suite/doxygen_misc_constructs.i
+++ b/Examples/test-suite/doxygen_misc_constructs.i
@@ -104,6 +104,9 @@
 
     };
 
+    /// @return This is a bad place for this tag, but it should be ignored.
+    struct StructWithReturnComment {};
+
     /**
         An example of a list in a documentation comment.
 
diff --git a/Examples/test-suite/doxygen_parsing_enums.i b/Examples/test-suite/doxygen_parsing_enums.i
index 5c48f48..b7a3987 100644
--- a/Examples/test-suite/doxygen_parsing_enums.i
+++ b/Examples/test-suite/doxygen_parsing_enums.i
@@ -32,4 +32,9 @@
 		SOME_ITEM_30  ///< Post comment for the third item
 	};
 
+	enum SomeEnumWithTrailingComma
+	{
+		SOME_ITEM_100, ///< Post comment after comma.
+		SOME_ITEM_200, ///< Post comment after last comma.
+	};
 %}
diff --git a/Examples/test-suite/doxygen_translate.i b/Examples/test-suite/doxygen_translate.i
index 348b2e9..bb0af1c 100644
--- a/Examples/test-suite/doxygen_translate.i
+++ b/Examples/test-suite/doxygen_translate.i
@@ -1,5 +1,9 @@
 %module doxygen_translate
 
+#if defined(SWIGJAVA)
+%javamethodmodifiers function "@Deprecated\npublic"
+#endif
+
 %inline %{
 
 /**
diff --git a/Examples/test-suite/doxygen_translate_all_tags.i b/Examples/test-suite/doxygen_translate_all_tags.i
index ba348fd..6e96a57 100644
--- a/Examples/test-suite/doxygen_translate_all_tags.i
+++ b/Examples/test-suite/doxygen_translate_all_tags.i
@@ -1,5 +1,9 @@
 %module doxygen_translate_all_tags
 
+#if defined(SWIGJAVA)
+%javamethodmodifiers func02 "@Deprecated\npublic"
+#endif
+
 %inline %{
 
 /**
diff --git a/Examples/test-suite/errors/Makefile.in b/Examples/test-suite/errors/Makefile.in
index c668409..10e5bdd 100644
--- a/Examples/test-suite/errors/Makefile.in
+++ b/Examples/test-suite/errors/Makefile.in
@@ -24,11 +24,11 @@
 SWIGINVOKE   = $(SWIG_LIB_SET) $(SWIGTOOL) $(SWIGEXE)
 
 # All .i files with prefix 'cpp_' will be treated as C++ input and remaining .i files as C input
-ALL_ERROR_TEST_CASES := $(patsubst %.i,%, $(notdir $(wildcard $(srcdir)/*.i)))
-CPP_ERROR_TEST_CASES := $(filter cpp_%, $(ALL_ERROR_TEST_CASES))
-C_ERROR_TEST_CASES := $(filter-out $(CPP_ERROR_TEST_CASES), $(ALL_ERROR_TEST_CASES))
-DOXYGEN_ERROR_TEST_CASES := $(filter doxygen_%, $(C_ERROR_TEST_CASES))
-C_ERROR_TEST_CASES := $(filter-out $(DOXYGEN_ERROR_TEST_CASES), $(C_ERROR_TEST_CASES))
+ALL_ERROR_TEST_CASES := $(sort $(patsubst %.i,%, $(notdir $(wildcard $(srcdir)/*.i))))
+CPP_ERROR_TEST_CASES := $(sort $(filter cpp_%, $(ALL_ERROR_TEST_CASES)))
+C_ERROR_TEST_CASES := $(sort $(filter-out $(CPP_ERROR_TEST_CASES), $(ALL_ERROR_TEST_CASES)))
+DOXYGEN_ERROR_TEST_CASES := $(sort $(filter doxygen_%, $(C_ERROR_TEST_CASES)))
+C_ERROR_TEST_CASES := $(sort $(filter-out $(DOXYGEN_ERROR_TEST_CASES), $(C_ERROR_TEST_CASES)))
 
 # Always use C++ for Doxygen tests, there doesn't seem to be any need to
 # distinguish between C and C++ Doxygen tests.
diff --git a/Examples/test-suite/errors/cpp_final_destructor.stderr b/Examples/test-suite/errors/cpp_final_destructor.stderr
new file mode 100644
index 0000000..d8c509d
--- /dev/null
+++ b/Examples/test-suite/errors/cpp_final_destructor.stderr
@@ -0,0 +1 @@
+cpp_final_destructor.i:7: Warning 525: Destructor BaseFinal::~BaseFinal() is final, BaseFinal cannot be a director class.
diff --git a/Examples/test-suite/errors/pp_unknowndirective3.i b/Examples/test-suite/errors/pp_unknowndirective3.i
new file mode 100644
index 0000000..77dfd5b
--- /dev/null
+++ b/Examples/test-suite/errors/pp_unknowndirective3.i
@@ -0,0 +1,14 @@
+%module xxx
+
+// Testing is_digits detecting gcc linemarkers
+
+// These are valid
+# 1 "/usr/include/stdc-predef.h" 1 3 4
+# 123 "header1.h"
+
+// These are invalid
+#a1 'a.h'
+#1b 'b.h'
+#1c1 'c.h'
+#d1d 'd.h'
+
diff --git a/Examples/test-suite/errors/pp_unknowndirective3.stderr b/Examples/test-suite/errors/pp_unknowndirective3.stderr
new file mode 100644
index 0000000..35bff8a
--- /dev/null
+++ b/Examples/test-suite/errors/pp_unknowndirective3.stderr
@@ -0,0 +1,4 @@
+pp_unknowndirective3.i:10: Error: Unknown SWIG preprocessor directive: a1 (if this is a block of target language code, delimit it with %{ and %})
+pp_unknowndirective3.i:11: Error: Unknown SWIG preprocessor directive: 1b (if this is a block of target language code, delimit it with %{ and %})
+pp_unknowndirective3.i:12: Error: Unknown SWIG preprocessor directive: 1c1 (if this is a block of target language code, delimit it with %{ and %})
+pp_unknowndirective3.i:13: Error: Unknown SWIG preprocessor directive: d1d (if this is a block of target language code, delimit it with %{ and %})
diff --git a/Examples/test-suite/go/Makefile.in b/Examples/test-suite/go/Makefile.in
index b7be554..d07a56b 100644
--- a/Examples/test-suite/go/Makefile.in
+++ b/Examples/test-suite/go/Makefile.in
@@ -73,7 +73,18 @@
 
 %.multicpptest:
 	$(setup)
-	+$(swig_and_compile_multi_cpp)
+	mkdir -p gopath/$*/src 2>/dev/null || true
+	if ! test -d gopath/$*/src/swigtests; then \
+	  (cd gopath/$*/src && ln -s . swigtests); \
+	fi
+	+for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
+	  $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
+	  SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
+	  LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
+	  TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \
+	  GOMOD="$*" \
+	  $(LANGUAGE)$(VARIANT)_cpp; \
+	done
 	$(run_multi_testcase)
 
 li_windows.cpptest:
@@ -82,50 +93,55 @@
 
 multi_import.multicpptest:
 	$(setup)
+	mkdir -p gopath/multi_import/src 2>/dev/null || true
+	if ! test -d gopath/multi_import/src/swigtests; then \
+	  (cd gopath/multi_import/src && ln -s . swigtests); \
+	fi
 	for f in multi_import_b multi_import_a; do \
 	  $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
 	  SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	  LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
 	  TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \
+	  GOMOD="multi_import" \
 	  $(LANGUAGE)$(VARIANT)_cpp; \
 	done
 	$(run_multi_testcase)
 
 go_subdir_import.multicpptest:
 	$(setup)
-	mkdir -p testdir/go_subdir_import/
-	mkdir -p gopath/src/testdir/go_subdir_import/
+	mkdir -p gopath/go_subdir_import/src 2>/dev/null || true
+	if ! test -d gopath/go_subdir_import/src/swigtests; then \
+	  (cd gopath/go_subdir_import/src && ln -s . swigtests); \
+	fi
+	mkdir -p testdir/go_subdir_import 2>/dev/null || true
+	mkdir -p gopath/go_subdir_import/src/testdir/go_subdir_import 2>/dev/null || true
 	$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
 	SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	LIBS='$(LIBS)' INTERFACEPATH='$(SRCDIR)$(INTERFACEDIR)go_subdir_import_b.i' \
 	INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT) -outdir .' NOLINK=true \
 	TARGET='$(TARGETPREFIX)go_subdir_import_b$(TARGETSUFFIX)' INTERFACEDIR='$(INTERFACEDIR)' \
 	INTERFACE='testdir/go_subdir_import/go_subdir_import_b.i' \
+	GOMOD="go_subdir_import" \
 	$(LANGUAGE)$(VARIANT)_cpp;
 	for f in testdir/go_subdir_import/go_subdir_import_c go_subdir_import_a ; do \
 	  $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
 	  SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
 	  LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
 	  TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \
+	  GOMOD="go_subdir_import" \
 	  $(LANGUAGE)$(VARIANT)_cpp; \
 	done
-	if $(GOGCC); then \
-	  cp gopath/src/testdir/go_subdir_import/go_subdir_import_b/go_subdir_import_b.a gopath/src/testdir/go_subdir_import/go_subdir_import_b.gox; \
-	  cp gopath/src/testdir/go_subdir_import/go_subdir_import_b/go_subdir_import_b.a .; \
-	  cp gopath/src/testdir/go_subdir_import/go_subdir_import_c/go_subdir_import_c.a gopath/src/testdir/go_subdir_import/go_subdir_import_c.gox; \
-	  cp gopath/src/testdir/go_subdir_import/go_subdir_import_c/go_subdir_import_c.a testdir/go_subdir_import/; \
-	fi
 	$(run_multi_testcase)
 
 # Runs the testcase.
 run_testcase = \
 	if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
 	  if $(GOGCC) ; then \
-	    $(COMPILETOOL) $(GCCGO) -c -g -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
-	    $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.a; \
+	    $(COMPILETOOL) $(GCCGO) -c -g -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
+	    $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ gopath/src/$*/$*.a; \
 	  elif $(GO12) || $(GO13) || $(GO15); then \
-	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
-	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld $(CC) -extldflags "$(CFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
+	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
+	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L gopath/src/$* -linkmode external -extld $(CC) -extldflags "$(CFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
 	  else \
 	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
 	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
@@ -136,11 +152,11 @@
 run_testcase_cpp = \
 	if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
 	  if $(GOGCC) ; then \
-	    $(COMPILETOOL) $(GCCGO) -c -g -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
-	    $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.a -lstdc++; \
+	    $(COMPILETOOL) $(GCCGO) -c -g -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
+	    $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ gopath/src/$*/$*.a -lstdc++; \
 	  elif $(GO12) || $(GO13) || $(GO15); then \
-	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
-	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
+	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
+	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L gopath/src/$* -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
 	  else \
 	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
 	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
@@ -150,18 +166,24 @@
 
 run_multi_testcase = \
 	if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
-	  if $(GOGCC) ; then \
-	    $(COMPILETOOL) $(GCCGO) -c -g -I . -I gopath/src $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
+	  if $(GO15) || $(GOGCC); then \
 	    files=`cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list`; \
-	    $(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ `for f in $$files; do echo $$f.a; done` -lstdc++; \
-	  elif $(GO12) || $(GO13) || $(GO15); then \
-	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
-	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
-	  else \
-	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
-	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
-	  fi && \
-	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \
+	    mkdir gopath/$*/src/$* 2>/dev/null || true; \
+	    cp $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) gopath/$*/src/$*; \
+	    GOPATH="`pwd`/gopath/$*"; \
+	    export GOPATH; \
+	    CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) `for f in $$files; do echo -I ../$$f; done`"; \
+	    export CGO_CPPFLAGS; \
+	    CGO_CFLAGS="$(CFLAGS)"; \
+	    export CGO_CFLAGS; \
+	    CGO_CXXFLAGS="$(CXXFLAGS)"; \
+	    export CGO_CXXFLAGS; \
+	    CGO_LDFLAGS="$(LDFLAGS) -lm"; \
+	    export CGO_LDFLAGS; \
+	    (cd gopath/$*/src/$* && \
+	      $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o ../../../../$*_runme) && \
+	    env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \
+	  fi; \
 	fi
 
 %.clean:
diff --git a/Examples/test-suite/go/abstract_access_runme.go b/Examples/test-suite/go/abstract_access_runme.go
index a2cfeda..5102236 100644
--- a/Examples/test-suite/go/abstract_access_runme.go
+++ b/Examples/test-suite/go/abstract_access_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./abstract_access"
+import "abstract_access"
 
 func main() {
 	d := abstract_access.NewD()
diff --git a/Examples/test-suite/go/abstract_typedef2_runme.go b/Examples/test-suite/go/abstract_typedef2_runme.go
index ef760e4..76a5fc8 100644
--- a/Examples/test-suite/go/abstract_typedef2_runme.go
+++ b/Examples/test-suite/go/abstract_typedef2_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./abstract_typedef2"
+import "abstract_typedef2"
 
 func main() {
 	abstract_typedef2.NewA_UF()
diff --git a/Examples/test-suite/go/abstract_typedef_runme.go b/Examples/test-suite/go/abstract_typedef_runme.go
index 99ff94d..56aaa61 100644
--- a/Examples/test-suite/go/abstract_typedef_runme.go
+++ b/Examples/test-suite/go/abstract_typedef_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./abstract_typedef"
+import "abstract_typedef"
 
 func main() {
 	e := abstract_typedef.NewEngine()
diff --git a/Examples/test-suite/go/abstract_virtual_runme.go b/Examples/test-suite/go/abstract_virtual_runme.go
index b87cf9b..e19eac2 100644
--- a/Examples/test-suite/go/abstract_virtual_runme.go
+++ b/Examples/test-suite/go/abstract_virtual_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./abstract_virtual"
+import "abstract_virtual"
 
 func main() {
 	abstract_virtual.NewD()
diff --git a/Examples/test-suite/go/argout_runme.go b/Examples/test-suite/go/argout_runme.go
index 5f7017e..bb8ab9e 100644
--- a/Examples/test-suite/go/argout_runme.go
+++ b/Examples/test-suite/go/argout_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import wrap "./argout"
+import wrap "argout"
 
 func main() {
 	ip := wrap.New_intp()
diff --git a/Examples/test-suite/go/array_member_runme.go b/Examples/test-suite/go/array_member_runme.go
index d8a8fac..4f029db 100644
--- a/Examples/test-suite/go/array_member_runme.go
+++ b/Examples/test-suite/go/array_member_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./array_member"
+import . "array_member"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/arrays_global_runme.go b/Examples/test-suite/go/arrays_global_runme.go
index 0ff4009..35b049d 100644
--- a/Examples/test-suite/go/arrays_global_runme.go
+++ b/Examples/test-suite/go/arrays_global_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./arrays_global"
+import . "arrays_global"
 
 func main() {
 	SetArray_i(GetArray_const_i())
diff --git a/Examples/test-suite/go/char_binary_runme.go b/Examples/test-suite/go/char_binary_runme.go
index 50f2e12..d47d616 100644
--- a/Examples/test-suite/go/char_binary_runme.go
+++ b/Examples/test-suite/go/char_binary_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./char_binary"
+import . "char_binary"
 
 func main() {
 	t := NewTest()
diff --git a/Examples/test-suite/go/class_ignore_runme.go b/Examples/test-suite/go/class_ignore_runme.go
index 82e52ef..24261c6 100644
--- a/Examples/test-suite/go/class_ignore_runme.go
+++ b/Examples/test-suite/go/class_ignore_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./class_ignore"
+import "class_ignore"
 
 func main() {
 	a := class_ignore.NewBar()
diff --git a/Examples/test-suite/go/class_scope_weird_runme.go b/Examples/test-suite/go/class_scope_weird_runme.go
index 332586f..a42bdad 100644
--- a/Examples/test-suite/go/class_scope_weird_runme.go
+++ b/Examples/test-suite/go/class_scope_weird_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./class_scope_weird"
+import "class_scope_weird"
 
 func main() {
 	f := class_scope_weird.NewFoo()
diff --git a/Examples/test-suite/go/compactdefaultargs_runme.go b/Examples/test-suite/go/compactdefaultargs_runme.go
index 46f3ff3..fe6224c 100644
--- a/Examples/test-suite/go/compactdefaultargs_runme.go
+++ b/Examples/test-suite/go/compactdefaultargs_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./compactdefaultargs"
+import . "compactdefaultargs"
 
 func main() {
 	defaults1 := NewDefaults1(1000)
diff --git a/Examples/test-suite/go/constover_runme.go b/Examples/test-suite/go/constover_runme.go
index f961e01..6c83709 100644
--- a/Examples/test-suite/go/constover_runme.go
+++ b/Examples/test-suite/go/constover_runme.go
@@ -1,9 +1,10 @@
 package main
 
 import (
-	"./constover"
 	"fmt"
 	"os"
+
+	"constover"
 )
 
 func main() {
diff --git a/Examples/test-suite/go/constructor_copy_runme.go b/Examples/test-suite/go/constructor_copy_runme.go
index d9b77a9..68c4288 100644
--- a/Examples/test-suite/go/constructor_copy_runme.go
+++ b/Examples/test-suite/go/constructor_copy_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./constructor_copy"
+import . "constructor_copy"
 
 func main() {
 	f1 := NewFoo1(3)
diff --git a/Examples/test-suite/go/contract_runme.go b/Examples/test-suite/go/contract_runme.go
index b20a1a6..b028855 100644
--- a/Examples/test-suite/go/contract_runme.go
+++ b/Examples/test-suite/go/contract_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./contract"
+import "contract"
 
 func main() {
 	contract.Test_preassert(1, 2)
diff --git a/Examples/test-suite/go/cpp11_strongly_typed_enumerations_runme.go b/Examples/test-suite/go/cpp11_strongly_typed_enumerations_runme.go
index f4b84b1..f9ca74a 100644
--- a/Examples/test-suite/go/cpp11_strongly_typed_enumerations_runme.go
+++ b/Examples/test-suite/go/cpp11_strongly_typed_enumerations_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import "fmt"
-import . "./cpp11_strongly_typed_enumerations"
+import . "cpp11_strongly_typed_enumerations"
 
 func enumCheck(actual int, expected int) int {
 	if actual != expected {
diff --git a/Examples/test-suite/go/cpp_enum_runme.go b/Examples/test-suite/go/cpp_enum_runme.go
index 7d7db95..8906dd4 100644
--- a/Examples/test-suite/go/cpp_enum_runme.go
+++ b/Examples/test-suite/go/cpp_enum_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./cpp_enum"
+import "cpp_enum"
 
 func main() {
 	f := cpp_enum.NewFoo()
diff --git a/Examples/test-suite/go/cpp_namespace_runme.go b/Examples/test-suite/go/cpp_namespace_runme.go
index 8482b04..aecdd95 100644
--- a/Examples/test-suite/go/cpp_namespace_runme.go
+++ b/Examples/test-suite/go/cpp_namespace_runme.go
@@ -1,7 +1,7 @@
 // Note: This example assumes that namespaces are flattened
 package main
 
-import "./cpp_namespace"
+import "cpp_namespace"
 
 func main() {
 	n := cpp_namespace.Fact(4)
diff --git a/Examples/test-suite/go/cpp_static_runme.go b/Examples/test-suite/go/cpp_static_runme.go
index ead4334..1ad981a6 100644
--- a/Examples/test-suite/go/cpp_static_runme.go
+++ b/Examples/test-suite/go/cpp_static_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./cpp_static"
+import . "cpp_static"
 
 func main() {
 	StaticFunctionTestStatic_func()
diff --git a/Examples/test-suite/go/default_args_runme.go b/Examples/test-suite/go/default_args_runme.go
index 38243ac..a39f957 100644
--- a/Examples/test-suite/go/default_args_runme.go
+++ b/Examples/test-suite/go/default_args_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./default_args"
+import "default_args"
 
 func main() {
 	if default_args.StaticsStaticmethod() != 60 {
diff --git a/Examples/test-suite/go/default_constructor_runme.go b/Examples/test-suite/go/default_constructor_runme.go
index 40a5a6e..eeac7ea 100644
--- a/Examples/test-suite/go/default_constructor_runme.go
+++ b/Examples/test-suite/go/default_constructor_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import dc "./default_constructor"
+import dc "default_constructor"
 
 func main() {
 	a := dc.NewA()
diff --git a/Examples/test-suite/go/director_alternating_runme.go b/Examples/test-suite/go/director_alternating_runme.go
index 10f6774..b4793aa 100644
--- a/Examples/test-suite/go/director_alternating_runme.go
+++ b/Examples/test-suite/go/director_alternating_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./director_alternating"
+import . "director_alternating"
 
 func main() {
 	id := GetBar().Id()
diff --git a/Examples/test-suite/go/director_basic_runme.go b/Examples/test-suite/go/director_basic_runme.go
index 0ce780b..360424d 100644
--- a/Examples/test-suite/go/director_basic_runme.go
+++ b/Examples/test-suite/go/director_basic_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./director_basic"
+import "director_basic"
 
 type GoFoo struct{}
 
diff --git a/Examples/test-suite/go/director_classic_runme.go b/Examples/test-suite/go/director_classic_runme.go
index 45e89ea..230c963 100644
--- a/Examples/test-suite/go/director_classic_runme.go
+++ b/Examples/test-suite/go/director_classic_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import "fmt"
-import . "./director_classic"
+import . "director_classic"
 
 type TargetLangPerson struct{} // From Person
 func (p *TargetLangPerson) Id() string {
diff --git a/Examples/test-suite/go/director_default_runme.go b/Examples/test-suite/go/director_default_runme.go
index 2f963b2..ac2aace 100644
--- a/Examples/test-suite/go/director_default_runme.go
+++ b/Examples/test-suite/go/director_default_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./director_default"
+import . "director_default"
 
 func main() {
 	NewFoo()
diff --git a/Examples/test-suite/go/director_detect_runme.go b/Examples/test-suite/go/director_detect_runme.go
index 9f1ad94..0c3c95f 100644
--- a/Examples/test-suite/go/director_detect_runme.go
+++ b/Examples/test-suite/go/director_detect_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./director_detect"
+import "director_detect"
 
 type MyBar struct {
 	val int
diff --git a/Examples/test-suite/go/director_enum_runme.go b/Examples/test-suite/go/director_enum_runme.go
index 5653fda..002d425 100644
--- a/Examples/test-suite/go/director_enum_runme.go
+++ b/Examples/test-suite/go/director_enum_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./director_enum"
+import "director_enum"
 
 type MyFoo struct{} // From director_enum.Foo
 func (p *MyFoo) Say_hi(val director_enum.EnumDirectorHello) director_enum.EnumDirectorHello {
diff --git a/Examples/test-suite/go/director_exception_runme.go b/Examples/test-suite/go/director_exception_runme.go
index 29df3e4..55231ff 100644
--- a/Examples/test-suite/go/director_exception_runme.go
+++ b/Examples/test-suite/go/director_exception_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./director_exception"
+import . "director_exception"
 
 type Exception struct {
 	msg string
diff --git a/Examples/test-suite/go/director_extend_runme.go b/Examples/test-suite/go/director_extend_runme.go
index 70e2ab4..27e55b9 100644
--- a/Examples/test-suite/go/director_extend_runme.go
+++ b/Examples/test-suite/go/director_extend_runme.go
@@ -5,7 +5,7 @@
 
 package main
 
-import . "./director_extend"
+import . "director_extend"
 
 func main() {
 	m := NewSpObject()
diff --git a/Examples/test-suite/go/director_finalizer_runme.go b/Examples/test-suite/go/director_finalizer_runme.go
index 96fcf86..d36a4ba 100644
--- a/Examples/test-suite/go/director_finalizer_runme.go
+++ b/Examples/test-suite/go/director_finalizer_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./director_finalizer"
+import . "director_finalizer"
 
 type MyFoo struct{} // From Foo
 func DeleteMyFoo(p Foo) {
diff --git a/Examples/test-suite/go/director_frob_runme.go b/Examples/test-suite/go/director_frob_runme.go
index a6afedf..3985eb1 100644
--- a/Examples/test-suite/go/director_frob_runme.go
+++ b/Examples/test-suite/go/director_frob_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./director_frob"
+import . "director_frob"
 
 func main() {
 	foo := NewBravo()
diff --git a/Examples/test-suite/go/director_nested_runme.go b/Examples/test-suite/go/director_nested_runme.go
index 2d3bc77..a1193ad 100644
--- a/Examples/test-suite/go/director_nested_runme.go
+++ b/Examples/test-suite/go/director_nested_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./director_nested"
+import . "director_nested"
 
 type A struct{} // From FooBar_int
 func (p *A) Do_step() string {
diff --git a/Examples/test-suite/go/director_profile_runme.go b/Examples/test-suite/go/director_profile_runme.go
index 87edcbe..a9bc793 100644
--- a/Examples/test-suite/go/director_profile_runme.go
+++ b/Examples/test-suite/go/director_profile_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import "fmt"
-import "./director_profile"
+import "director_profile"
 
 type MyB struct{} // From director_profile.B
 func (p *MyB) Vfi(a int) int {
diff --git a/Examples/test-suite/go/director_protected_runme.go b/Examples/test-suite/go/director_protected_runme.go
index 24adfe7..bfd50c6 100644
--- a/Examples/test-suite/go/director_protected_runme.go
+++ b/Examples/test-suite/go/director_protected_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./director_protected"
+import . "director_protected"
 
 type FooBar struct{} // From Bar
 func (p *FooBar) Ping() string {
diff --git a/Examples/test-suite/go/director_string_runme.go b/Examples/test-suite/go/director_string_runme.go
index c5201ab..f4f9cc1 100644
--- a/Examples/test-suite/go/director_string_runme.go
+++ b/Examples/test-suite/go/director_string_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./director_string"
+import . "director_string"
 
 type B struct { // From A
 	abi  A
diff --git a/Examples/test-suite/go/director_unroll_runme.go b/Examples/test-suite/go/director_unroll_runme.go
index 6d2894a..6a919f6 100644
--- a/Examples/test-suite/go/director_unroll_runme.go
+++ b/Examples/test-suite/go/director_unroll_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./director_unroll"
+import "director_unroll"
 
 type MyFoo struct{} // From director_unroll.Foo
 func (p *MyFoo) Ping() string {
diff --git a/Examples/test-suite/go/disown_runme.go b/Examples/test-suite/go/disown_runme.go
index 3e853de..4484515 100644
--- a/Examples/test-suite/go/disown_runme.go
+++ b/Examples/test-suite/go/disown_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./disown"
+import . "disown"
 
 func main() {
 	a := NewA()
diff --git a/Examples/test-suite/go/dynamic_cast_runme.go b/Examples/test-suite/go/dynamic_cast_runme.go
index 4767348..46ba236 100644
--- a/Examples/test-suite/go/dynamic_cast_runme.go
+++ b/Examples/test-suite/go/dynamic_cast_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./dynamic_cast"
+import "dynamic_cast"
 
 func main() {
 	f := dynamic_cast.NewFoo()
diff --git a/Examples/test-suite/go/empty_c_runme.go b/Examples/test-suite/go/empty_c_runme.go
index 831a561..1a1bd9c 100644
--- a/Examples/test-suite/go/empty_c_runme.go
+++ b/Examples/test-suite/go/empty_c_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import _ "./empty_c"
+import _ "empty_c"
 
 func main() {
 }
diff --git a/Examples/test-suite/go/empty_runme.go b/Examples/test-suite/go/empty_runme.go
index f74285c..681a6f3 100644
--- a/Examples/test-suite/go/empty_runme.go
+++ b/Examples/test-suite/go/empty_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import _ "./empty"
+import _ "empty"
 
 func main() {
 }
diff --git a/Examples/test-suite/go/enum_template_runme.go b/Examples/test-suite/go/enum_template_runme.go
index 269fe7d..c60a452 100644
--- a/Examples/test-suite/go/enum_template_runme.go
+++ b/Examples/test-suite/go/enum_template_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./enum_template"
+import "enum_template"
 
 func main() {
 	if enum_template.MakeETest() != 1 {
diff --git a/Examples/test-suite/go/enums_runme.go b/Examples/test-suite/go/enums_runme.go
index ab193f7..7a528b3 100644
--- a/Examples/test-suite/go/enums_runme.go
+++ b/Examples/test-suite/go/enums_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./enums"
+import "enums"
 
 func main() {
 	enums.Bar2(1)
diff --git a/Examples/test-suite/go/exception_order_runme.go b/Examples/test-suite/go/exception_order_runme.go
index 626a826..21dcff3 100644
--- a/Examples/test-suite/go/exception_order_runme.go
+++ b/Examples/test-suite/go/exception_order_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import "strings"
-import . "./exception_order"
+import . "exception_order"
 
 func main() {
 	a := NewA()
diff --git a/Examples/test-suite/go/extend_placement_runme.go b/Examples/test-suite/go/extend_placement_runme.go
index efa776e..253ec66 100644
--- a/Examples/test-suite/go/extend_placement_runme.go
+++ b/Examples/test-suite/go/extend_placement_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./extend_placement"
+import "extend_placement"
 
 func main() {
 	foo := extend_placement.NewFoo()
diff --git a/Examples/test-suite/go/extend_template_ns_runme.go b/Examples/test-suite/go/extend_template_ns_runme.go
index 164a31b..d005172 100644
--- a/Examples/test-suite/go/extend_template_ns_runme.go
+++ b/Examples/test-suite/go/extend_template_ns_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./extend_template_ns"
+import . "extend_template_ns"
 
 func main() {
 	f := NewFoo_One()
diff --git a/Examples/test-suite/go/extend_template_runme.go b/Examples/test-suite/go/extend_template_runme.go
index 5adb4b3..a5c4da4 100644
--- a/Examples/test-suite/go/extend_template_runme.go
+++ b/Examples/test-suite/go/extend_template_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./extend_template"
+import "extend_template"
 
 func main() {
 	f := extend_template.NewFoo_0()
diff --git a/Examples/test-suite/go/extend_variable_runme.go b/Examples/test-suite/go/extend_variable_runme.go
index c6428c4..9425aee 100644
--- a/Examples/test-suite/go/extend_variable_runme.go
+++ b/Examples/test-suite/go/extend_variable_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./extend_variable"
+import . "extend_variable"
 
 func main() {
 	if FooBar != 42 {
diff --git a/Examples/test-suite/go/extern_c_runme.go b/Examples/test-suite/go/extern_c_runme.go
index 0fb5b21..9bc2cd0 100644
--- a/Examples/test-suite/go/extern_c_runme.go
+++ b/Examples/test-suite/go/extern_c_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./extern_c"
+import "extern_c"
 
 func main() {
 	extern_c.RealFunction(2)
diff --git a/Examples/test-suite/go/friends_runme.go b/Examples/test-suite/go/friends_runme.go
index 9f223fc..2e34a4d 100644
--- a/Examples/test-suite/go/friends_runme.go
+++ b/Examples/test-suite/go/friends_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./friends"
+import "friends"
 
 func main() {
 	a := friends.NewA(2)
diff --git a/Examples/test-suite/go/fvirtual_runme.go b/Examples/test-suite/go/fvirtual_runme.go
index 8810d5c..86ef90f 100644
--- a/Examples/test-suite/go/fvirtual_runme.go
+++ b/Examples/test-suite/go/fvirtual_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./fvirtual"
+import . "fvirtual"
 
 func main() {
 	sw := NewNodeSwitch()
diff --git a/Examples/test-suite/go/global_ns_arg_runme.go b/Examples/test-suite/go/global_ns_arg_runme.go
index ece779c..e86aa67 100644
--- a/Examples/test-suite/go/global_ns_arg_runme.go
+++ b/Examples/test-suite/go/global_ns_arg_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./global_ns_arg"
+import . "global_ns_arg"
 
 func main() {
 	Foo(1)
diff --git a/Examples/test-suite/go/go_director_inout_runme.go b/Examples/test-suite/go/go_director_inout_runme.go
index 9b9df31..e6768a4 100644
--- a/Examples/test-suite/go/go_director_inout_runme.go
+++ b/Examples/test-suite/go/go_director_inout_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import (
-	wrap "./go_director_inout"
+	wrap "go_director_inout"
 )
 
 type GoMyClass struct {}
diff --git a/Examples/test-suite/go/go_inout_runme.go b/Examples/test-suite/go/go_inout_runme.go
index 9aa0cd0..4599aa1 100644
--- a/Examples/test-suite/go/go_inout_runme.go
+++ b/Examples/test-suite/go/go_inout_runme.go
@@ -5,7 +5,7 @@
 	"fmt"
 	"reflect"
 
-	"./go_inout"
+	"go_inout"
 )
 
 type S struct {
diff --git a/Examples/test-suite/go/go_subdir_import_runme.go b/Examples/test-suite/go/go_subdir_import_runme.go
index f90a6eb..a040c99 100644
--- a/Examples/test-suite/go/go_subdir_import_runme.go
+++ b/Examples/test-suite/go/go_subdir_import_runme.go
@@ -1,9 +1,9 @@
 package main
 
 import (
-	"go_subdir_import_a"
-	"testdir/go_subdir_import/go_subdir_import_b"
-	"testdir/go_subdir_import/go_subdir_import_c"
+	"swigtests/go_subdir_import_a"
+	"swigtests/testdir/go_subdir_import/go_subdir_import_b"
+	"swigtests/testdir/go_subdir_import/go_subdir_import_c"
 )
 
 func main() {
diff --git a/Examples/test-suite/go/grouping_runme.go b/Examples/test-suite/go/grouping_runme.go
index c63d6fb..f808e12 100644
--- a/Examples/test-suite/go/grouping_runme.go
+++ b/Examples/test-suite/go/grouping_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./grouping"
+import "grouping"
 
 func main() {
 	x := grouping.Test1(42)
diff --git a/Examples/test-suite/go/import_nomodule_runme.go b/Examples/test-suite/go/import_nomodule_runme.go
index a6bbd7d..48592df 100644
--- a/Examples/test-suite/go/import_nomodule_runme.go
+++ b/Examples/test-suite/go/import_nomodule_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./import_nomodule"
+import . "import_nomodule"
 
 func main() {
 	f := Create_Foo()
diff --git a/Examples/test-suite/go/imports_runme.go b/Examples/test-suite/go/imports_runme.go
index 896036c..a67ae40 100644
--- a/Examples/test-suite/go/imports_runme.go
+++ b/Examples/test-suite/go/imports_runme.go
@@ -2,8 +2,8 @@
 
 package main
 
-import "imports_b"
-import "imports_a"
+import "swigtests/imports_b"
+import "swigtests/imports_a"
 
 func main() {
 	x := imports_b.NewB()
diff --git a/Examples/test-suite/go/inctest_runme.go b/Examples/test-suite/go/inctest_runme.go
index f8a2c11..3148abc 100644
--- a/Examples/test-suite/go/inctest_runme.go
+++ b/Examples/test-suite/go/inctest_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./inctest"
+import "inctest"
 
 func main() {
 	inctest.NewA()
diff --git a/Examples/test-suite/go/inherit_member_runme.go b/Examples/test-suite/go/inherit_member_runme.go
index 599a0eb..6fd70cf 100644
--- a/Examples/test-suite/go/inherit_member_runme.go
+++ b/Examples/test-suite/go/inherit_member_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import wrap "./inherit_member"
+import wrap "inherit_member"
 
 func main() {
 	s := wrap.NewChild()
diff --git a/Examples/test-suite/go/inherit_missing_runme.go b/Examples/test-suite/go/inherit_missing_runme.go
index ba9a2a5..c70c483 100644
--- a/Examples/test-suite/go/inherit_missing_runme.go
+++ b/Examples/test-suite/go/inherit_missing_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./inherit_missing"
+import "inherit_missing"
 
 func main() {
 	a := inherit_missing.New_Foo()
diff --git a/Examples/test-suite/go/input_runme.go b/Examples/test-suite/go/input_runme.go
index 207bdaa..ddc2992 100644
--- a/Examples/test-suite/go/input_runme.go
+++ b/Examples/test-suite/go/input_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./input"
+import . "input"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/keyword_rename_c_runme.go b/Examples/test-suite/go/keyword_rename_c_runme.go
index 425e38a..26f2ea4 100644
--- a/Examples/test-suite/go/keyword_rename_c_runme.go
+++ b/Examples/test-suite/go/keyword_rename_c_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./keyword_rename_c"
+import "keyword_rename_c"
 
 func main() {
 	keyword_rename_c.Xgo(1)
diff --git a/Examples/test-suite/go/keyword_rename_runme.go b/Examples/test-suite/go/keyword_rename_runme.go
index e36bc59..7a40ff8 100644
--- a/Examples/test-suite/go/keyword_rename_runme.go
+++ b/Examples/test-suite/go/keyword_rename_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./keyword_rename"
+import "keyword_rename"
 
 func main() {
 	keyword_rename.Xgo(1)
diff --git a/Examples/test-suite/go/li_attribute_runme.go b/Examples/test-suite/go/li_attribute_runme.go
index 5d2c3d0..b502b8c 100644
--- a/Examples/test-suite/go/li_attribute_runme.go
+++ b/Examples/test-suite/go/li_attribute_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./li_attribute"
+import "li_attribute"
 
 func main() {
 	aa := li_attribute.NewA(1, 2, 3)
diff --git a/Examples/test-suite/go/li_carrays_cpp_runme.go b/Examples/test-suite/go/li_carrays_cpp_runme.go
index 7ee0a41..cfc1712 100644
--- a/Examples/test-suite/go/li_carrays_cpp_runme.go
+++ b/Examples/test-suite/go/li_carrays_cpp_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./li_carrays_cpp"
+import . "li_carrays_cpp"
 
 func main() {
 	d := NewDoubleArray(10)
diff --git a/Examples/test-suite/go/li_carrays_runme.go b/Examples/test-suite/go/li_carrays_runme.go
index 0cbe92c..9128bbf 100644
--- a/Examples/test-suite/go/li_carrays_runme.go
+++ b/Examples/test-suite/go/li_carrays_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./li_carrays"
+import . "li_carrays"
 
 func main() {
 	d := NewDoubleArray(10)
diff --git a/Examples/test-suite/go/li_cdata_cpp_runme.go b/Examples/test-suite/go/li_cdata_cpp_runme.go
index 42a0ebd..daa5384 100644
--- a/Examples/test-suite/go/li_cdata_cpp_runme.go
+++ b/Examples/test-suite/go/li_cdata_cpp_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./li_cdata_cpp"
+import . "li_cdata_cpp"
 
 func main() {
 	s := "ABC abc"
diff --git a/Examples/test-suite/go/li_cdata_runme.go b/Examples/test-suite/go/li_cdata_runme.go
index f71a3a2..9458dab 100644
--- a/Examples/test-suite/go/li_cdata_runme.go
+++ b/Examples/test-suite/go/li_cdata_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./li_cdata"
+import . "li_cdata"
 
 func main() {
 	s := "ABC abc"
diff --git a/Examples/test-suite/go/li_cmalloc_runme.go b/Examples/test-suite/go/li_cmalloc_runme.go
index 45f47b4..5b9f970 100644
--- a/Examples/test-suite/go/li_cmalloc_runme.go
+++ b/Examples/test-suite/go/li_cmalloc_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./li_cmalloc"
+import . "li_cmalloc"
 
 func main() {
 	p := Malloc_int()
diff --git a/Examples/test-suite/go/li_cpointer_cpp_runme.go b/Examples/test-suite/go/li_cpointer_cpp_runme.go
index e2f5a59..0de57c6 100644
--- a/Examples/test-suite/go/li_cpointer_cpp_runme.go
+++ b/Examples/test-suite/go/li_cpointer_cpp_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./li_cpointer_cpp"
+import . "li_cpointer_cpp"
 
 func main() {
 	p := New_intp()
diff --git a/Examples/test-suite/go/li_cpointer_runme.go b/Examples/test-suite/go/li_cpointer_runme.go
index 57493b1..0fe29e7 100644
--- a/Examples/test-suite/go/li_cpointer_runme.go
+++ b/Examples/test-suite/go/li_cpointer_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./li_cpointer"
+import . "li_cpointer"
 
 func main() {
 	p := New_intp()
diff --git a/Examples/test-suite/go/li_std_map_runme.go b/Examples/test-suite/go/li_std_map_runme.go
index 66e74dd..5c5cc2e 100644
--- a/Examples/test-suite/go/li_std_map_runme.go
+++ b/Examples/test-suite/go/li_std_map_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./li_std_map"
+import "li_std_map"
 
 func main() {
 	a1 := li_std_map.NewA(3)
diff --git a/Examples/test-suite/go/li_std_vector_ptr_runme.go b/Examples/test-suite/go/li_std_vector_ptr_runme.go
index a9f7fe9..d66ff19 100644
--- a/Examples/test-suite/go/li_std_vector_ptr_runme.go
+++ b/Examples/test-suite/go/li_std_vector_ptr_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./li_std_vector_ptr"
+import . "li_std_vector_ptr"
 import "fmt"
 
 func check(val1 int, val2 int) {
diff --git a/Examples/test-suite/go/member_pointer_runme.go b/Examples/test-suite/go/member_pointer_runme.go
index 9a55bc4..731526b 100644
--- a/Examples/test-suite/go/member_pointer_runme.go
+++ b/Examples/test-suite/go/member_pointer_runme.go
@@ -3,7 +3,7 @@
 package main
 
 import "fmt"
-import . "./member_pointer"
+import . "member_pointer"
 
 func check(what string, expected float64, actual float64) {
 	if expected != actual {
diff --git a/Examples/test-suite/go/memberin_extend_c_runme.go b/Examples/test-suite/go/memberin_extend_c_runme.go
index ec8b11e..0551acc 100644
--- a/Examples/test-suite/go/memberin_extend_c_runme.go
+++ b/Examples/test-suite/go/memberin_extend_c_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./memberin_extend_c"
+import "memberin_extend_c"
 
 func main() {
 	t := memberin_extend_c.NewPerson()
diff --git a/Examples/test-suite/go/minherit_runme.go b/Examples/test-suite/go/minherit_runme.go
index c69fe92..9b7873c 100644
--- a/Examples/test-suite/go/minherit_runme.go
+++ b/Examples/test-suite/go/minherit_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import "fmt"
-import "./minherit"
+import "minherit"
 
 func main() {
 	a := minherit.NewFoo()
diff --git a/Examples/test-suite/go/mod_runme.go b/Examples/test-suite/go/mod_runme.go
index 581c839..8d894db 100644
--- a/Examples/test-suite/go/mod_runme.go
+++ b/Examples/test-suite/go/mod_runme.go
@@ -1,7 +1,7 @@
 package main
 
-import "mod_a"
-import "mod_b"
+import "swigtests/mod_a"
+import "swigtests/mod_b"
 
 func main() {
 	c := mod_b.NewC()
diff --git a/Examples/test-suite/go/multi_import_runme.go b/Examples/test-suite/go/multi_import_runme.go
index 973af1e..f30913c 100644
--- a/Examples/test-suite/go/multi_import_runme.go
+++ b/Examples/test-suite/go/multi_import_runme.go
@@ -1,7 +1,7 @@
 package main
 
-import "multi_import_a"
-import "multi_import_b"
+import "swigtests/multi_import_a"
+import "swigtests/multi_import_b"
 
 func main() {
 	x := multi_import_b.NewXXX()
diff --git a/Examples/test-suite/go/namespace_class_runme.go b/Examples/test-suite/go/namespace_class_runme.go
index 2ed5567..4c240b6 100644
--- a/Examples/test-suite/go/namespace_class_runme.go
+++ b/Examples/test-suite/go/namespace_class_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./namespace_class"
+import . "namespace_class"
 
 func main() {
 	EulerT3DToFrame(1, 1, 1)
diff --git a/Examples/test-suite/go/namespace_typemap_runme.go b/Examples/test-suite/go/namespace_typemap_runme.go
index 056da15..47e2b64 100644
--- a/Examples/test-suite/go/namespace_typemap_runme.go
+++ b/Examples/test-suite/go/namespace_typemap_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./namespace_typemap"
+import . "namespace_typemap"
 
 func main() {
 	if Stest1("hello") != "hello" {
diff --git a/Examples/test-suite/go/namespace_virtual_method_runme.go b/Examples/test-suite/go/namespace_virtual_method_runme.go
index 3f8e774..a8cb38b 100644
--- a/Examples/test-suite/go/namespace_virtual_method_runme.go
+++ b/Examples/test-suite/go/namespace_virtual_method_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./namespace_virtual_method"
+import "namespace_virtual_method"
 
 func main() {
 	_ = namespace_virtual_method.NewSpam()
diff --git a/Examples/test-suite/go/naturalvar_runme.go b/Examples/test-suite/go/naturalvar_runme.go
index e3723e6..ed47e9d 100644
--- a/Examples/test-suite/go/naturalvar_runme.go
+++ b/Examples/test-suite/go/naturalvar_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./naturalvar"
+import . "naturalvar"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/nested_workaround_runme.go b/Examples/test-suite/go/nested_workaround_runme.go
index 5737aaa..8b31a7f 100644
--- a/Examples/test-suite/go/nested_workaround_runme.go
+++ b/Examples/test-suite/go/nested_workaround_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./nested_workaround"
+import . "nested_workaround"
 
 func main() {
 	inner := NewInner(5)
diff --git a/Examples/test-suite/go/overload_complicated_runme.go b/Examples/test-suite/go/overload_complicated_runme.go
index e3911c2..ce9d124 100644
--- a/Examples/test-suite/go/overload_complicated_runme.go
+++ b/Examples/test-suite/go/overload_complicated_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./overload_complicated"
+import . "overload_complicated"
 
 func main() {
 	var pInt *int
diff --git a/Examples/test-suite/go/overload_copy_runme.go b/Examples/test-suite/go/overload_copy_runme.go
index d35ff70..55ec4a3 100644
--- a/Examples/test-suite/go/overload_copy_runme.go
+++ b/Examples/test-suite/go/overload_copy_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./overload_copy"
+import . "overload_copy"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/overload_extend2_runme.go b/Examples/test-suite/go/overload_extend2_runme.go
index 1215067..db79098 100644
--- a/Examples/test-suite/go/overload_extend2_runme.go
+++ b/Examples/test-suite/go/overload_extend2_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./overload_extend2"
+import "overload_extend2"
 
 func main() {
 	f := overload_extend2.NewFoo()
diff --git a/Examples/test-suite/go/overload_extend_c_runme.go b/Examples/test-suite/go/overload_extend_c_runme.go
index e00f0b9..4d3b2b6 100644
--- a/Examples/test-suite/go/overload_extend_c_runme.go
+++ b/Examples/test-suite/go/overload_extend_c_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./overload_extend_c"
+import "overload_extend_c"
 
 func main() {
 	f := overload_extend_c.NewFoo()
diff --git a/Examples/test-suite/go/overload_extend_runme.go b/Examples/test-suite/go/overload_extend_runme.go
index 1ba541f..d73d6cf 100644
--- a/Examples/test-suite/go/overload_extend_runme.go
+++ b/Examples/test-suite/go/overload_extend_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./overload_extend"
+import "overload_extend"
 
 func main() {
 	f := overload_extend.NewFoo()
diff --git a/Examples/test-suite/go/overload_polymorphic_runme.go b/Examples/test-suite/go/overload_polymorphic_runme.go
index 46f837f..12b9777 100644
--- a/Examples/test-suite/go/overload_polymorphic_runme.go
+++ b/Examples/test-suite/go/overload_polymorphic_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./overload_polymorphic"
+import "overload_polymorphic"
 
 func main(){
 	t := overload_polymorphic.NewDerived()
diff --git a/Examples/test-suite/go/overload_rename_runme.go b/Examples/test-suite/go/overload_rename_runme.go
index dca5843..3bd4a69 100644
--- a/Examples/test-suite/go/overload_rename_runme.go
+++ b/Examples/test-suite/go/overload_rename_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./overload_rename"
+import "overload_rename"
 
 func main() {
 	_ = overload_rename.NewFoo(float32(1))
diff --git a/Examples/test-suite/go/overload_simple_runme.go b/Examples/test-suite/go/overload_simple_runme.go
index 5f6d055..3eb859b 100644
--- a/Examples/test-suite/go/overload_simple_runme.go
+++ b/Examples/test-suite/go/overload_simple_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./overload_simple"
+import . "overload_simple"
 
 func main() {
 	if Foo(3) != "foo:int" {
diff --git a/Examples/test-suite/go/overload_subtype_runme.go b/Examples/test-suite/go/overload_subtype_runme.go
index dc56d1c..45d5a02 100644
--- a/Examples/test-suite/go/overload_subtype_runme.go
+++ b/Examples/test-suite/go/overload_subtype_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./overload_subtype"
+import . "overload_subtype"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/overload_template_fast_runme.go b/Examples/test-suite/go/overload_template_fast_runme.go
index b80cb7d..63809c0 100644
--- a/Examples/test-suite/go/overload_template_fast_runme.go
+++ b/Examples/test-suite/go/overload_template_fast_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./overload_template_fast"
+import . "overload_template_fast"
 
 func main() {
 	_ = Foo()
diff --git a/Examples/test-suite/go/overload_template_runme.go b/Examples/test-suite/go/overload_template_runme.go
index 53e1def..f3a08ec 100644
--- a/Examples/test-suite/go/overload_template_runme.go
+++ b/Examples/test-suite/go/overload_template_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./overload_template"
+import . "overload_template"
 
 func main() {
 	_ = Foo()
diff --git a/Examples/test-suite/go/preproc_runme.go b/Examples/test-suite/go/preproc_runme.go
index a150622..3c55aae 100644
--- a/Examples/test-suite/go/preproc_runme.go
+++ b/Examples/test-suite/go/preproc_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./preproc"
+import "preproc"
 
 func main() {
 	if preproc.GetEndif() != 1 {
diff --git a/Examples/test-suite/go/primitive_ref_runme.go b/Examples/test-suite/go/primitive_ref_runme.go
index 9738069..a1de2f8 100644
--- a/Examples/test-suite/go/primitive_ref_runme.go
+++ b/Examples/test-suite/go/primitive_ref_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./primitive_ref"
+import . "primitive_ref"
 
 func main() {
 	if Ref_int(3) != 3 {
diff --git a/Examples/test-suite/go/profiletest_runme.go b/Examples/test-suite/go/profiletest_runme.go
index 30b6cee..c2b922b 100644
--- a/Examples/test-suite/go/profiletest_runme.go
+++ b/Examples/test-suite/go/profiletest_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import "fmt"
-import "./profiletest"
+import "profiletest"
 
 func main() {
 	a := profiletest.NewA()
diff --git a/Examples/test-suite/go/refcount_runme.go b/Examples/test-suite/go/refcount_runme.go
index fdb271c..07d4072 100644
--- a/Examples/test-suite/go/refcount_runme.go
+++ b/Examples/test-suite/go/refcount_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./refcount"
+import . "refcount"
 
 // very innocent example
 
diff --git a/Examples/test-suite/go/reference_global_vars_runme.go b/Examples/test-suite/go/reference_global_vars_runme.go
index b8cbb30..908358f 100644
--- a/Examples/test-suite/go/reference_global_vars_runme.go
+++ b/Examples/test-suite/go/reference_global_vars_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./reference_global_vars"
+import . "reference_global_vars"
 
 func main() {
 	// const class reference variable
diff --git a/Examples/test-suite/go/rename_scope_runme.go b/Examples/test-suite/go/rename_scope_runme.go
index 995f8c6..13bd3f1 100644
--- a/Examples/test-suite/go/rename_scope_runme.go
+++ b/Examples/test-suite/go/rename_scope_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./rename_scope"
+import . "rename_scope"
 
 func main() {
 	a := NewNatural_UP()
diff --git a/Examples/test-suite/go/rename_simple_runme.go b/Examples/test-suite/go/rename_simple_runme.go
index a63023b..bd559ef 100644
--- a/Examples/test-suite/go/rename_simple_runme.go
+++ b/Examples/test-suite/go/rename_simple_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import "fmt"
-import . "./rename_simple"
+import . "rename_simple"
 
 func main() {
 	s := NewNewStruct()
diff --git a/Examples/test-suite/go/rename_strip_encoder_runme.go b/Examples/test-suite/go/rename_strip_encoder_runme.go
index 1d0bcb6..ae67060 100644
--- a/Examples/test-suite/go/rename_strip_encoder_runme.go
+++ b/Examples/test-suite/go/rename_strip_encoder_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./rename_strip_encoder"
+import . "rename_strip_encoder"
 
 func main() {
 	_ = NewSomeWidget()
diff --git a/Examples/test-suite/go/ret_by_value_runme.go b/Examples/test-suite/go/ret_by_value_runme.go
index 44743d2..9659d21 100644
--- a/Examples/test-suite/go/ret_by_value_runme.go
+++ b/Examples/test-suite/go/ret_by_value_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./ret_by_value"
+import "ret_by_value"
 
 func main() {
 	a := ret_by_value.Get_test()
diff --git a/Examples/test-suite/go/return_const_value_runme.go b/Examples/test-suite/go/return_const_value_runme.go
index 790921b..aadb126 100644
--- a/Examples/test-suite/go/return_const_value_runme.go
+++ b/Examples/test-suite/go/return_const_value_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./return_const_value"
+import "return_const_value"
 
 func main() {
 	p := return_const_value.Foo_ptrGetPtr()
diff --git a/Examples/test-suite/go/smart_pointer_extend_runme.go b/Examples/test-suite/go/smart_pointer_extend_runme.go
index ee5ce05..a851e26 100644
--- a/Examples/test-suite/go/smart_pointer_extend_runme.go
+++ b/Examples/test-suite/go/smart_pointer_extend_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./smart_pointer_extend"
+import . "smart_pointer_extend"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/smart_pointer_member_runme.go b/Examples/test-suite/go/smart_pointer_member_runme.go
index bf09fe5..e7fe7c4 100644
--- a/Examples/test-suite/go/smart_pointer_member_runme.go
+++ b/Examples/test-suite/go/smart_pointer_member_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import "fmt"
-import . "./smart_pointer_member"
+import . "smart_pointer_member"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/smart_pointer_multi_runme.go b/Examples/test-suite/go/smart_pointer_multi_runme.go
index d1a5f92..7c76061 100644
--- a/Examples/test-suite/go/smart_pointer_multi_runme.go
+++ b/Examples/test-suite/go/smart_pointer_multi_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./smart_pointer_multi"
+import . "smart_pointer_multi"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go b/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go
index f71740b..e584cf7 100644
--- a/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go
+++ b/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./smart_pointer_multi_typedef"
+import . "smart_pointer_multi_typedef"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/smart_pointer_overload_runme.go b/Examples/test-suite/go/smart_pointer_overload_runme.go
index 5ffeae1..9481554 100644
--- a/Examples/test-suite/go/smart_pointer_overload_runme.go
+++ b/Examples/test-suite/go/smart_pointer_overload_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./smart_pointer_overload"
+import . "smart_pointer_overload"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/smart_pointer_rename_runme.go b/Examples/test-suite/go/smart_pointer_rename_runme.go
index 678c305..44841f5 100644
--- a/Examples/test-suite/go/smart_pointer_rename_runme.go
+++ b/Examples/test-suite/go/smart_pointer_rename_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./smart_pointer_rename"
+import . "smart_pointer_rename"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/smart_pointer_simple_runme.go b/Examples/test-suite/go/smart_pointer_simple_runme.go
index 3286542..b468bd2 100644
--- a/Examples/test-suite/go/smart_pointer_simple_runme.go
+++ b/Examples/test-suite/go/smart_pointer_simple_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./smart_pointer_simple"
+import . "smart_pointer_simple"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/smart_pointer_templatevariables_runme.go b/Examples/test-suite/go/smart_pointer_templatevariables_runme.go
index bf58ba5..6d4ea91 100644
--- a/Examples/test-suite/go/smart_pointer_templatevariables_runme.go
+++ b/Examples/test-suite/go/smart_pointer_templatevariables_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./smart_pointer_templatevariables"
+import . "smart_pointer_templatevariables"
 
 func main() {
 	d := NewDiffImContainerPtr_D(Create(1234, 5678))
diff --git a/Examples/test-suite/go/smart_pointer_typedef_runme.go b/Examples/test-suite/go/smart_pointer_typedef_runme.go
index a67a0cc..e89a8b1 100644
--- a/Examples/test-suite/go/smart_pointer_typedef_runme.go
+++ b/Examples/test-suite/go/smart_pointer_typedef_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./smart_pointer_typedef"
+import . "smart_pointer_typedef"
 
 func main() {
 	f := NewFoo()
diff --git a/Examples/test-suite/go/sneaky1_runme.go b/Examples/test-suite/go/sneaky1_runme.go
index ee38ae2..57c7797 100644
--- a/Examples/test-suite/go/sneaky1_runme.go
+++ b/Examples/test-suite/go/sneaky1_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./sneaky1"
+import "sneaky1"
 
 func main() {
 	_ = sneaky1.Add(3, 4)
diff --git a/Examples/test-suite/go/special_variable_macros_runme.go b/Examples/test-suite/go/special_variable_macros_runme.go
index c4f687e..9338e65 100644
--- a/Examples/test-suite/go/special_variable_macros_runme.go
+++ b/Examples/test-suite/go/special_variable_macros_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./special_variable_macros"
+import "special_variable_macros"
 
 func main() {
 	name := special_variable_macros.NewName()
diff --git a/Examples/test-suite/go/static_const_member_2_runme.go b/Examples/test-suite/go/static_const_member_2_runme.go
index 0d345c3..ff8cbbb 100644
--- a/Examples/test-suite/go/static_const_member_2_runme.go
+++ b/Examples/test-suite/go/static_const_member_2_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./static_const_member_2"
+import . "static_const_member_2"
 
 func main() {
 	_ = NewTest_int()
diff --git a/Examples/test-suite/go/struct_initialization_runme.go b/Examples/test-suite/go/struct_initialization_runme.go
index 58ac250..a815bd3 100644
--- a/Examples/test-suite/go/struct_initialization_runme.go
+++ b/Examples/test-suite/go/struct_initialization_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./struct_initialization"
+import . "struct_initialization"
 
 func main() {
 	if GetInstanceC1().GetX() != 10 {
diff --git a/Examples/test-suite/go/struct_rename_runme.go b/Examples/test-suite/go/struct_rename_runme.go
index 845dac5..de99fc3 100644
--- a/Examples/test-suite/go/struct_rename_runme.go
+++ b/Examples/test-suite/go/struct_rename_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./struct_rename"
+import "struct_rename"
 
 func main() {
 	_ = struct_rename.NewBar()
diff --git a/Examples/test-suite/go/struct_value_runme.go b/Examples/test-suite/go/struct_value_runme.go
index d0b60bd..3b5e5c1 100644
--- a/Examples/test-suite/go/struct_value_runme.go
+++ b/Examples/test-suite/go/struct_value_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./struct_value"
+import "struct_value"
 
 func main() {
 	b := struct_value.NewBar()
diff --git a/Examples/test-suite/go/template_default_arg_runme.go b/Examples/test-suite/go/template_default_arg_runme.go
index 3d9346b..d67e63f 100644
--- a/Examples/test-suite/go/template_default_arg_runme.go
+++ b/Examples/test-suite/go/template_default_arg_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./template_default_arg"
+import "template_default_arg"
 
 func main() {
 	helloInt := template_default_arg.NewHello_int()
diff --git a/Examples/test-suite/go/template_extend1_runme.go b/Examples/test-suite/go/template_extend1_runme.go
index 5d6d376..0912fa6 100644
--- a/Examples/test-suite/go/template_extend1_runme.go
+++ b/Examples/test-suite/go/template_extend1_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./template_extend1"
+import "template_extend1"
 
 func main() {
 	a := template_extend1.NewLBaz()
diff --git a/Examples/test-suite/go/template_extend2_runme.go b/Examples/test-suite/go/template_extend2_runme.go
index 312410e..ced3d93 100644
--- a/Examples/test-suite/go/template_extend2_runme.go
+++ b/Examples/test-suite/go/template_extend2_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./template_extend2"
+import "template_extend2"
 
 func main() {
 	a := template_extend2.NewLBaz()
diff --git a/Examples/test-suite/go/template_inherit_runme.go b/Examples/test-suite/go/template_inherit_runme.go
index c0aca77..a8d5126 100644
--- a/Examples/test-suite/go/template_inherit_runme.go
+++ b/Examples/test-suite/go/template_inherit_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./template_inherit"
+import . "template_inherit"
 
 func main() {
 	a := NewFooInt()
diff --git a/Examples/test-suite/go/template_ns4_runme.go b/Examples/test-suite/go/template_ns4_runme.go
index 4caf8f5..6c658ec 100644
--- a/Examples/test-suite/go/template_ns4_runme.go
+++ b/Examples/test-suite/go/template_ns4_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./template_ns4"
+import . "template_ns4"
 
 func main() {
 	d := Make_Class_DD()
diff --git a/Examples/test-suite/go/template_ns_runme.go b/Examples/test-suite/go/template_ns_runme.go
index 6385ecc..cfc56fa 100644
--- a/Examples/test-suite/go/template_ns_runme.go
+++ b/Examples/test-suite/go/template_ns_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./template_ns"
+import . "template_ns"
 
 func main() {
 	p1 := NewPairii(2, 3)
diff --git a/Examples/test-suite/go/template_opaque_runme.go b/Examples/test-suite/go/template_opaque_runme.go
index 201f7ba..71701df 100644
--- a/Examples/test-suite/go/template_opaque_runme.go
+++ b/Examples/test-suite/go/template_opaque_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./template_opaque"
+import "template_opaque"
 
 func main() {
 	v := template_opaque.NewOpaqueVectorType(int64(10))
diff --git a/Examples/test-suite/go/template_ref_type_runme.go b/Examples/test-suite/go/template_ref_type_runme.go
index e4bf626..a01ce3d 100644
--- a/Examples/test-suite/go/template_ref_type_runme.go
+++ b/Examples/test-suite/go/template_ref_type_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./template_ref_type"
+import "template_ref_type"
 
 func main() {
 	xr := template_ref_type.NewXC()
diff --git a/Examples/test-suite/go/template_rename_runme.go b/Examples/test-suite/go/template_rename_runme.go
index 757ac73..6e04f88 100644
--- a/Examples/test-suite/go/template_rename_runme.go
+++ b/Examples/test-suite/go/template_rename_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./template_rename"
+import "template_rename"
 
 func main() {
 	i := template_rename.NewIFoo()
diff --git a/Examples/test-suite/go/template_static_runme.go b/Examples/test-suite/go/template_static_runme.go
index 7fa5076..f10ea78 100644
--- a/Examples/test-suite/go/template_static_runme.go
+++ b/Examples/test-suite/go/template_static_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./template_static"
+import . "template_static"
 
 func main() {
 	FooBar_double(1)
diff --git a/Examples/test-suite/go/template_tbase_template_runme.go b/Examples/test-suite/go/template_tbase_template_runme.go
index 9a52e2f..e1c46aa 100644
--- a/Examples/test-suite/go/template_tbase_template_runme.go
+++ b/Examples/test-suite/go/template_tbase_template_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./template_tbase_template"
+import . "template_tbase_template"
 
 func main() {
 	a := Make_Class_dd()
diff --git a/Examples/test-suite/go/template_type_namespace_runme.go b/Examples/test-suite/go/template_type_namespace_runme.go
index a3712ff..1356f9b 100644
--- a/Examples/test-suite/go/template_type_namespace_runme.go
+++ b/Examples/test-suite/go/template_type_namespace_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./template_type_namespace"
+import . "template_type_namespace"
 
 func main() {
 	if Foo().Get(0) == "" {
diff --git a/Examples/test-suite/go/template_typedef_cplx3_runme.go b/Examples/test-suite/go/template_typedef_cplx3_runme.go
index d616777..0a2b313 100644
--- a/Examples/test-suite/go/template_typedef_cplx3_runme.go
+++ b/Examples/test-suite/go/template_typedef_cplx3_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./template_typedef_cplx3"
+import . "template_typedef_cplx3"
 
 func main() {
 	// this is OK
diff --git a/Examples/test-suite/go/template_typedef_cplx4_runme.go b/Examples/test-suite/go/template_typedef_cplx4_runme.go
index 3e536d6..d8952cf 100644
--- a/Examples/test-suite/go/template_typedef_cplx4_runme.go
+++ b/Examples/test-suite/go/template_typedef_cplx4_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./template_typedef_cplx4"
+import . "template_typedef_cplx4"
 
 func main() {
 	// this is OK
diff --git a/Examples/test-suite/go/threads_exception_runme.go b/Examples/test-suite/go/threads_exception_runme.go
index 742a827..e3da1dc 100644
--- a/Examples/test-suite/go/threads_exception_runme.go
+++ b/Examples/test-suite/go/threads_exception_runme.go
@@ -1,7 +1,7 @@
 package main
 
 import "strings"
-import "./threads_exception"
+import "threads_exception"
 
 func main() {
 	t := threads_exception.NewTest()
diff --git a/Examples/test-suite/go/typedef_class_runme.go b/Examples/test-suite/go/typedef_class_runme.go
index ec25162..d94126d 100644
--- a/Examples/test-suite/go/typedef_class_runme.go
+++ b/Examples/test-suite/go/typedef_class_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./typedef_class"
+import "typedef_class"
 
 func main() {
 	a := typedef_class.NewRealA()
diff --git a/Examples/test-suite/go/typedef_funcptr_runme.go b/Examples/test-suite/go/typedef_funcptr_runme.go
index 49d7086..9d55f3f 100644
--- a/Examples/test-suite/go/typedef_funcptr_runme.go
+++ b/Examples/test-suite/go/typedef_funcptr_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./typedef_funcptr"
+import . "typedef_funcptr"
 
 func main() {
 	a := 100
diff --git a/Examples/test-suite/go/typedef_inherit_runme.go b/Examples/test-suite/go/typedef_inherit_runme.go
index 4909799..7a65569 100644
--- a/Examples/test-suite/go/typedef_inherit_runme.go
+++ b/Examples/test-suite/go/typedef_inherit_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./typedef_inherit"
+import "typedef_inherit"
 
 func main() {
 	a := typedef_inherit.NewFoo()
diff --git a/Examples/test-suite/go/typedef_scope_runme.go b/Examples/test-suite/go/typedef_scope_runme.go
index 1c43144..af282b1 100644
--- a/Examples/test-suite/go/typedef_scope_runme.go
+++ b/Examples/test-suite/go/typedef_scope_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./typedef_scope"
+import "typedef_scope"
 
 func main() {
 	b := typedef_scope.NewBar()
diff --git a/Examples/test-suite/go/typemap_namespace_runme.go b/Examples/test-suite/go/typemap_namespace_runme.go
index 45184fd..a2880d4 100644
--- a/Examples/test-suite/go/typemap_namespace_runme.go
+++ b/Examples/test-suite/go/typemap_namespace_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./typemap_namespace"
+import . "typemap_namespace"
 
 func main() {
 	if Test1("hello") != "hello" {
diff --git a/Examples/test-suite/go/typemap_ns_using_runme.go b/Examples/test-suite/go/typemap_ns_using_runme.go
index 877e44b..c4c21cf 100644
--- a/Examples/test-suite/go/typemap_ns_using_runme.go
+++ b/Examples/test-suite/go/typemap_ns_using_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./typemap_ns_using"
+import "typemap_ns_using"
 
 func main() {
 	if typemap_ns_using.Spam(37) != 37 {
diff --git a/Examples/test-suite/go/typemap_out_optimal_runme.go b/Examples/test-suite/go/typemap_out_optimal_runme.go
index 7cbd0ad..7cc3b38 100644
--- a/Examples/test-suite/go/typemap_out_optimal_runme.go
+++ b/Examples/test-suite/go/typemap_out_optimal_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./typemap_out_optimal"
+import . "typemap_out_optimal"
 
 func main() {
 	SetXXDebug(false)
diff --git a/Examples/test-suite/go/typename_runme.go b/Examples/test-suite/go/typename_runme.go
index 0bc15f1..d166509 100644
--- a/Examples/test-suite/go/typename_runme.go
+++ b/Examples/test-suite/go/typename_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./typename"
+import "typename"
 
 func main() {
 	f := typename.NewFoo()
diff --git a/Examples/test-suite/go/unions_runme.go b/Examples/test-suite/go/unions_runme.go
index ba9c27b..b76ca5c 100644
--- a/Examples/test-suite/go/unions_runme.go
+++ b/Examples/test-suite/go/unions_runme.go
@@ -3,7 +3,7 @@
 
 package main
 
-import "./unions"
+import "unions"
 
 func main() {
 	// Create new instances of SmallStruct and BigStruct for later use
diff --git a/Examples/test-suite/go/using1_runme.go b/Examples/test-suite/go/using1_runme.go
index 8cc5712..a6a6fa7 100644
--- a/Examples/test-suite/go/using1_runme.go
+++ b/Examples/test-suite/go/using1_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./using1"
+import "using1"
 
 func main() {
 	if using1.Spam(37) != 37 {
diff --git a/Examples/test-suite/go/using2_runme.go b/Examples/test-suite/go/using2_runme.go
index f679b0c..f6b8d49 100644
--- a/Examples/test-suite/go/using2_runme.go
+++ b/Examples/test-suite/go/using2_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./using2"
+import "using2"
 
 func main() {
 	if using2.Spam(37) != 37 {
diff --git a/Examples/test-suite/go/using_composition_runme.go b/Examples/test-suite/go/using_composition_runme.go
index 47e2457..712d1fa 100644
--- a/Examples/test-suite/go/using_composition_runme.go
+++ b/Examples/test-suite/go/using_composition_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./using_composition"
+import . "using_composition"
 
 func main() {
 	f := NewFooBar()
diff --git a/Examples/test-suite/go/using_extend_runme.go b/Examples/test-suite/go/using_extend_runme.go
index 830c958..27d1ccc 100644
--- a/Examples/test-suite/go/using_extend_runme.go
+++ b/Examples/test-suite/go/using_extend_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./using_extend"
+import . "using_extend"
 
 func main() {
 	f := NewFooBar()
diff --git a/Examples/test-suite/go/using_inherit_runme.go b/Examples/test-suite/go/using_inherit_runme.go
index db29efb..a881718 100644
--- a/Examples/test-suite/go/using_inherit_runme.go
+++ b/Examples/test-suite/go/using_inherit_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./using_inherit"
+import . "using_inherit"
 
 func main() {
 	b := NewBar()
diff --git a/Examples/test-suite/go/using_private_runme.go b/Examples/test-suite/go/using_private_runme.go
index d683ef8..2da62dc 100644
--- a/Examples/test-suite/go/using_private_runme.go
+++ b/Examples/test-suite/go/using_private_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./using_private"
+import . "using_private"
 
 func main() {
 	f := NewFooBar()
diff --git a/Examples/test-suite/go/using_protected_runme.go b/Examples/test-suite/go/using_protected_runme.go
index 65edb50..3fd5029 100644
--- a/Examples/test-suite/go/using_protected_runme.go
+++ b/Examples/test-suite/go/using_protected_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./using_protected"
+import . "using_protected"
 
 func main() {
 	f := NewFooBar()
diff --git a/Examples/test-suite/go/varargs_overload_runme.go b/Examples/test-suite/go/varargs_overload_runme.go
index 52fc1b0..8ce580d 100644
--- a/Examples/test-suite/go/varargs_overload_runme.go
+++ b/Examples/test-suite/go/varargs_overload_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./varargs_overload"
+import "varargs_overload"
 
 func main() {
 	if varargs_overload.Vararg_over1("Hello") != "Hello" {
@@ -35,4 +35,40 @@
 	if varargs_overload.Vararg_over4("Hello", 123) != "Hello" {
 		panic(8)
 	}
+
+
+        // Same as above but non-vararg function declared first
+
+	if varargs_overload.Vararg_over6("Hello") != "Hello" {
+		panic(0)
+	}
+	if varargs_overload.Vararg_over6(2) != "2" {
+		panic(1)
+	}
+
+	if varargs_overload.Vararg_over7("Hello") != "Hello" {
+		panic(2)
+	}
+	if varargs_overload.Vararg_over7(2, 2.2) != "2 2.2" {
+		panic(3)
+	}
+
+	if varargs_overload.Vararg_over8("Hello") != "Hello" {
+		panic(4)
+	}
+	if varargs_overload.Vararg_over8(2, 2.2, "hey") != "2 2.2 hey" {
+		panic(5)
+	}
+
+	if varargs_overload.Vararg_over9("Hello") != "Hello" {
+		panic(6)
+	}
+
+	if varargs_overload.Vararg_over9(123) != "123" {
+		panic(7)
+	}
+
+	if varargs_overload.Vararg_over9("Hello", 123) != "Hello" {
+		panic(8)
+	}
 }
diff --git a/Examples/test-suite/go/varargs_runme.go b/Examples/test-suite/go/varargs_runme.go
index 4009c3e..60bd882 100644
--- a/Examples/test-suite/go/varargs_runme.go
+++ b/Examples/test-suite/go/varargs_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./varargs"
+import "varargs"
 
 func main() {
 	if varargs.Test("Hello") != "Hello" {
diff --git a/Examples/test-suite/go/virtual_derivation_runme.go b/Examples/test-suite/go/virtual_derivation_runme.go
index 48a7033..4e2c6e5 100644
--- a/Examples/test-suite/go/virtual_derivation_runme.go
+++ b/Examples/test-suite/go/virtual_derivation_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import . "./virtual_derivation"
+import . "virtual_derivation"
 
 // very innocent example
 
diff --git a/Examples/test-suite/go/virtual_poly_runme.go b/Examples/test-suite/go/virtual_poly_runme.go
index 487b371..32906b3 100644
--- a/Examples/test-suite/go/virtual_poly_runme.go
+++ b/Examples/test-suite/go/virtual_poly_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./virtual_poly"
+import "virtual_poly"
 
 func main() {
 	d := virtual_poly.NewNDouble(3.5)
diff --git a/Examples/test-suite/go/voidtest_runme.go b/Examples/test-suite/go/voidtest_runme.go
index 0a685f0..133545c 100644
--- a/Examples/test-suite/go/voidtest_runme.go
+++ b/Examples/test-suite/go/voidtest_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./voidtest"
+import "voidtest"
 
 func main() {
 	voidtest.Globalfunc()
diff --git a/Examples/test-suite/go/wrapmacro_runme.go b/Examples/test-suite/go/wrapmacro_runme.go
index dc7e7bf..a251a05 100644
--- a/Examples/test-suite/go/wrapmacro_runme.go
+++ b/Examples/test-suite/go/wrapmacro_runme.go
@@ -1,6 +1,6 @@
 package main
 
-import "./wrapmacro"
+import "wrapmacro"
 
 func main() {
 	a := 2
diff --git a/Examples/test-suite/go_subdir_import.list b/Examples/test-suite/go_subdir_import.list
index e117d32..074c795 100644
--- a/Examples/test-suite/go_subdir_import.list
+++ b/Examples/test-suite/go_subdir_import.list
@@ -1,3 +1,3 @@
 testdir/go_subdir_import/go_subdir_import_c
-go_subdir_import_b
+testdir/go_subdir_import/go_subdir_import_b
 go_subdir_import_a
diff --git a/Examples/test-suite/java/doxygen_misc_constructs_runme.java b/Examples/test-suite/java/doxygen_misc_constructs_runme.java
index 6d018b9..5d95bd5 100644
--- a/Examples/test-suite/java/doxygen_misc_constructs_runme.java
+++ b/Examples/test-suite/java/doxygen_misc_constructs_runme.java
@@ -117,6 +117,9 @@
     wantedComments.put("doxygen_misc_constructs.ClassWithNestedEnum.ENested.THREE",
     		" desc of three\n");
 
+    wantedComments.put("doxygen_misc_constructs.StructWithReturnComment",
+    		" @return This is a bad place for this tag, but it should be ignored.");
+
     wantedComments.put("doxygen_misc_constructs.doxygen_misc_constructs.showList()",
 "         An example of a list in a documentation comment.<br>\n" +
 " <br>\n" +
diff --git a/Examples/test-suite/java/doxygen_parsing_enums_proper_runme.java b/Examples/test-suite/java/doxygen_parsing_enums_proper_runme.java
index a8527e3..ef1f06a 100644
--- a/Examples/test-suite/java/doxygen_parsing_enums_proper_runme.java
+++ b/Examples/test-suite/java/doxygen_parsing_enums_proper_runme.java
@@ -55,6 +55,10 @@
     wantedComments.put("doxygen_parsing_enums_proper.SomeAnotherEnum2.SOME_ITEM_20",
     		"Post comment for the second item \n" +
     		"");
+    wantedComments.put("doxygen_parsing_enums_proper.SomeEnumWithTrailingComma.SOME_ITEM_100",
+    		"Post comment after comma.");
+    wantedComments.put("doxygen_parsing_enums_proper.SomeEnumWithTrailingComma.SOME_ITEM_200",
+    		"Post comment after last comma.");
     
     // and ask the parser to check comments for us
     System.exit(parser.check(wantedComments));
diff --git a/Examples/test-suite/java/doxygen_parsing_enums_simple_runme.java b/Examples/test-suite/java/doxygen_parsing_enums_simple_runme.java
index f68fff1..85ec0cb 100644
--- a/Examples/test-suite/java/doxygen_parsing_enums_simple_runme.java
+++ b/Examples/test-suite/java/doxygen_parsing_enums_simple_runme.java
@@ -47,6 +47,10 @@
     		" The comment for the first item \n" +
     		" \n" +
     		"");
+    wantedComments.put("doxygen_parsing_enums_simple.doxygen_parsing_enums_simpleConstants.SOME_ITEM_100",
+    		"Post comment after comma.");
+    wantedComments.put("doxygen_parsing_enums_simple.doxygen_parsing_enums_simpleConstants.SOME_ITEM_200",
+    		"Post comment after last comma.");
     
     // and ask the parser to check comments for us
     System.exit(parser.check(wantedComments));
diff --git a/Examples/test-suite/java/doxygen_parsing_enums_typesafe_runme.java b/Examples/test-suite/java/doxygen_parsing_enums_typesafe_runme.java
index 7c7f05c..4e5f4b4 100644
--- a/Examples/test-suite/java/doxygen_parsing_enums_typesafe_runme.java
+++ b/Examples/test-suite/java/doxygen_parsing_enums_typesafe_runme.java
@@ -55,6 +55,10 @@
     wantedComments.put("doxygen_parsing_enums_typesafe.SomeAnotherEnum2.SOME_ITEM_30",
     		"Post comment for the third item \n" +
     		"");
+    wantedComments.put("doxygen_parsing_enums_typesafe.SomeEnumWithTrailingComma.SOME_ITEM_100",
+    		"Post comment after comma.");
+    wantedComments.put("doxygen_parsing_enums_typesafe.SomeEnumWithTrailingComma.SOME_ITEM_200",
+    		"Post comment after last comma.");
 
     
     // and ask the parser to check comments for us
diff --git a/Examples/test-suite/java/doxygen_parsing_enums_typeunsafe_runme.java b/Examples/test-suite/java/doxygen_parsing_enums_typeunsafe_runme.java
index 8c7dfed..4286491 100644
--- a/Examples/test-suite/java/doxygen_parsing_enums_typeunsafe_runme.java
+++ b/Examples/test-suite/java/doxygen_parsing_enums_typeunsafe_runme.java
@@ -55,6 +55,10 @@
     wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeAnotherEnum2.SOME_ITEM_10",
     		"Post comment for the first item \n" +
     		"");
+    wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeEnumWithTrailingComma.SOME_ITEM_100",
+    		"Post comment after comma.");
+    wantedComments.put("doxygen_parsing_enums_typeunsafe.SomeEnumWithTrailingComma.SOME_ITEM_200",
+    		"Post comment after last comma.");
     
     // and ask the parser to check comments for us
     System.exit(parser.check(wantedComments));
diff --git a/Examples/test-suite/java/li_std_list_runme.java b/Examples/test-suite/java/li_std_list_runme.java
index e45b896..96412fd 100644
--- a/Examples/test-suite/java/li_std_list_runme.java
+++ b/Examples/test-suite/java/li_std_list_runme.java
@@ -47,13 +47,13 @@
     } catch (java.util.NoSuchElementException e) {
     }
 
-    if (v1.remove(new Integer(123))) throw new RuntimeException("v1 test (13) failed");
-    if (!v1.remove(new Integer(456))) throw new RuntimeException("v1 test (14) failed");
+    if (v1.remove(Integer.valueOf(123))) throw new RuntimeException("v1 test (13) failed");
+    if (!v1.remove(Integer.valueOf(456))) throw new RuntimeException("v1 test (14) failed");
     if (!v1.isEmpty()) throw new RuntimeException("v1 test (15) failed");
     if (v1.size() != 0) throw new RuntimeException("v1 test (16) failed");
-    if (v1.remove(new Integer(456))) throw new RuntimeException("v1 test (17) failed");
+    if (v1.remove(Integer.valueOf(456))) throw new RuntimeException("v1 test (17) failed");
 
-    if (new IntList(3).size() != 3) throw new RuntimeException("constructor initial size test failed");
+    if (new IntList(3, 0).size() != 3) throw new RuntimeException("constructor initial size test failed");
     for (int n : new IntList(10, 999))
       if (n != 999) throw new RuntimeException("constructor initialization with value failed");
     for (int n : new IntList(new IntList(10, 999)))
@@ -136,7 +136,7 @@
     v9.add(60);
     v9.add(70);
     if (v9.size() != 7) throw new RuntimeException("v9 test (1) failed");
-    if (!v9.remove(new Integer(60))) throw new RuntimeException("v9 test (2) failed");
+    if (!v9.remove(Integer.valueOf(60))) throw new RuntimeException("v9 test (2) failed");
     if (v9.size() != 6) throw new RuntimeException("v9 test (3) failed");
     v9.addFirst(-10);
     v9.addLast(80);
diff --git a/Examples/test-suite/java/li_std_vector_runme.java b/Examples/test-suite/java/li_std_vector_runme.java
index d23bbe7..fc8ba0f 100644
--- a/Examples/test-suite/java/li_std_vector_runme.java
+++ b/Examples/test-suite/java/li_std_vector_runme.java
@@ -48,13 +48,13 @@
     } catch (java.util.NoSuchElementException e) {
     }
 
-    if (v1.remove(new Integer(123))) throw new RuntimeException("v1 test (13) failed");
-    if (!v1.remove(new Integer(456))) throw new RuntimeException("v1 test (14) failed");
+    if (v1.remove(Integer.valueOf(123))) throw new RuntimeException("v1 test (13) failed");
+    if (!v1.remove(Integer.valueOf(456))) throw new RuntimeException("v1 test (14) failed");
     if (!v1.isEmpty()) throw new RuntimeException("v1 test (15) failed");
     if (v1.size() != 0) throw new RuntimeException("v1 test (16) failed");
-    if (v1.remove(new Integer(456))) throw new RuntimeException("v1 test (17) failed");
+    if (v1.remove(Integer.valueOf(456))) throw new RuntimeException("v1 test (17) failed");
 
-    if (new IntVector(3).size() != 3) throw new RuntimeException("constructor initial size test failed");
+    if (new IntVector(3, 0).size() != 3) throw new RuntimeException("constructor initial size test failed");
     for (int n : new IntVector(10, 999))
       if (n != 999) throw new RuntimeException("constructor initialization with value failed");
     for (int n : new IntVector(new IntVector(10, 999)))
@@ -137,7 +137,7 @@
     v9.add(60);
     v9.add(70);
     if (v9.size() != 7) throw new RuntimeException("v9 test (1) failed");
-    if (!v9.remove(new Integer(60))) throw new RuntimeException("v9 test (2) failed");
+    if (!v9.remove(Integer.valueOf(60))) throw new RuntimeException("v9 test (2) failed");
     if (v9.size() != 6) throw new RuntimeException("v9 test (3) failed");
 
     IntVector v10 = new IntVector(java.util.Arrays.asList(10, 20, 30, 40, 50));
diff --git a/Examples/test-suite/java/long_long_runme.java b/Examples/test-suite/java/long_long_runme.java
index 76aa070..65a0e79 100644
--- a/Examples/test-suite/java/long_long_runme.java
+++ b/Examples/test-suite/java/long_long_runme.java
@@ -84,14 +84,14 @@
 
     ArrayList<BigInteger> bigIntegers = new ArrayList<BigInteger>();
     for (int i=0; i<nums.length; ++i) {
-      BigInteger bi = new BigInteger(new Long(nums[i]).toString());
+      BigInteger bi = new BigInteger(Long.valueOf(nums[i]).toString());
       bigIntegers.add(bi);
     }
 
     {
-      BigInteger bi = new BigInteger(new Long(Long.MAX_VALUE).toString());
+      BigInteger bi = new BigInteger(Long.valueOf(Long.MAX_VALUE).toString());
       bigIntegers.add(bi.add(BigInteger.ONE));
-      bi = new BigInteger(new Long(Long.MIN_VALUE).toString());
+      bi = new BigInteger(Long.valueOf(Long.MIN_VALUE).toString());
       bigIntegers.add(bi.subtract(BigInteger.ONE));
     }
 
diff --git a/Examples/test-suite/java/rename1_runme.java b/Examples/test-suite/java/rename1_runme.java
index 058de41..c04baf8 100644
--- a/Examples/test-suite/java/rename1_runme.java
+++ b/Examples/test-suite/java/rename1_runme.java
@@ -24,7 +24,6 @@
       xyz.tMethod2(0);
       xyz.tMethodNotXYZ2(notxyz);
       xyz.opNotXYZ2();
-      xyz.opXYZ2();
     }
     {
       XYZDouble xyz = new XYZDouble();
@@ -36,7 +35,6 @@
       xyz.tMethod1(0);
       xyz.tMethodNotXYZ1(notxyz);
       xyz.opNotXYZ1();
-      xyz.opXYZ1();
     }
     {
       XYZKlass xyz = new XYZKlass();
@@ -48,7 +46,6 @@
       xyz.tMethod3(new Klass());
       xyz.tMethodNotXYZ3(notxyz);
       xyz.opNotXYZ3();
-      xyz.opXYZ3();
     }
     {
       XYZEnu xyz = new XYZEnu();
@@ -60,7 +57,6 @@
       xyz.tMethod4(Enu.En1);
       xyz.tMethodNotXYZ4(notxyz);
       xyz.opNotXYZ4();
-      xyz.opXYZ4();
     }
     {
       ABC abc = new ABC();
diff --git a/Examples/test-suite/java/rename2_runme.java b/Examples/test-suite/java/rename2_runme.java
index b6a62dd..b97cc59 100644
--- a/Examples/test-suite/java/rename2_runme.java
+++ b/Examples/test-suite/java/rename2_runme.java
@@ -24,7 +24,6 @@
       xyz.tMethod2(0);
       xyz.tMethodNotXYZ2(notxyz);
       xyz.opNotXYZ2();
-      xyz.opXYZ2();
     }
     {
       XYZDouble xyz = new XYZDouble();
@@ -36,7 +35,6 @@
       xyz.tMethod1(0);
       xyz.tMethodNotXYZ1(notxyz);
       xyz.opNotXYZ1();
-      xyz.opXYZ1();
     }
     {
       XYZKlass xyz = new XYZKlass();
@@ -48,7 +46,6 @@
       xyz.tMethod3(new Klass());
       xyz.tMethodNotXYZ3(notxyz);
       xyz.opNotXYZ3();
-      xyz.opXYZ3();
     }
     {
       XYZEnu xyz = new XYZEnu();
@@ -60,7 +57,6 @@
       xyz.tMethod4(Enu.En1);
       xyz.tMethodNotXYZ4(notxyz);
       xyz.opNotXYZ4();
-      xyz.opXYZ4();
     }
     {
       ABC abc = new ABC();
diff --git a/Examples/test-suite/java/rename3_runme.java b/Examples/test-suite/java/rename3_runme.java
index e1b090a..222d548 100644
--- a/Examples/test-suite/java/rename3_runme.java
+++ b/Examples/test-suite/java/rename3_runme.java
@@ -24,7 +24,6 @@
       xyz.tMethod2(0);
       xyz.tMethodNotXYZ2(notxyz);
       xyz.opNotXYZ2();
-      xyz.opXYZ2();
     }
     {
       XYZDouble xyz = new XYZDouble();
@@ -36,7 +35,6 @@
       xyz.tMethod1(0);
       xyz.tMethodNotXYZ1(notxyz);
       xyz.opNotXYZ1();
-      xyz.opXYZ1();
     }
     {
       XYZKlass xyz = new XYZKlass();
@@ -48,7 +46,6 @@
       xyz.tMethod3(new Klass());
       xyz.tMethodNotXYZ3(notxyz);
       xyz.opNotXYZ3();
-      xyz.opXYZ3();
     }
     {
       XYZEnu xyz = new XYZEnu();
@@ -60,7 +57,6 @@
       xyz.tMethod4(Enu.En1);
       xyz.tMethodNotXYZ4(notxyz);
       xyz.opNotXYZ4();
-      xyz.opXYZ4();
     }
     {
       ABC abc = new ABC();
diff --git a/Examples/test-suite/java/rename4_runme.java b/Examples/test-suite/java/rename4_runme.java
index 69f909e..ef92dd3 100644
--- a/Examples/test-suite/java/rename4_runme.java
+++ b/Examples/test-suite/java/rename4_runme.java
@@ -24,7 +24,6 @@
       xyz.tMethod2(0);
       xyz.tMethodNotXYZ2(notxyz);
       xyz.opNotXYZ2();
-      xyz.opXYZ2();
     }
     {
       XYZDouble xyz = new XYZDouble();
@@ -36,7 +35,6 @@
       xyz.tMethod1(0);
       xyz.tMethodNotXYZ1(notxyz);
       xyz.opNotXYZ1();
-      xyz.opXYZ1();
     }
     {
       XYZKlass xyz = new XYZKlass();
@@ -48,7 +46,6 @@
       xyz.tMethod3(new Klass());
       xyz.tMethodNotXYZ3(notxyz);
       xyz.opNotXYZ3();
-      xyz.opXYZ3();
     }
     {
       XYZEnu xyz = new XYZEnu();
@@ -60,7 +57,6 @@
       xyz.tMethod4(Enu.En1);
       xyz.tMethodNotXYZ4(notxyz);
       xyz.opNotXYZ4();
-      xyz.opXYZ4();
     }
     {
       ABC abc = new ABC();
diff --git a/Examples/test-suite/java_director.i b/Examples/test-suite/java_director.i
index 03d733d..6b2cb6d 100644
--- a/Examples/test-suite/java_director.i
+++ b/Examples/test-suite/java_director.i
@@ -7,6 +7,7 @@
 %module(directors="1") java_director
 
 %typemap(javafinalize) SWIGTYPE %{
+  @SuppressWarnings("deprecation")
   protected void finalize() {
 //    System.out.println("Finalizing " + this);
     delete();
diff --git a/Examples/test-suite/java_throws.i b/Examples/test-suite/java_throws.i
index 5dc353b..6cd47b4 100644
--- a/Examples/test-suite/java_throws.i
+++ b/Examples/test-suite/java_throws.i
@@ -183,6 +183,7 @@
 
 // Need to handle the checked exception in NoExceptTest.delete()
 %typemap(javafinalize) SWIGTYPE %{
+  @SuppressWarnings("deprecation")
   protected void finalize() {
     try {
       delete();
diff --git a/Examples/test-suite/javascript/rename1_runme.js b/Examples/test-suite/javascript/rename1_runme.js
index 68ecc11..7b2ac37 100644
--- a/Examples/test-suite/javascript/rename1_runme.js
+++ b/Examples/test-suite/javascript/rename1_runme.js
@@ -10,7 +10,6 @@
   xyz.tMethod2(0);
   xyz.tMethodNotXYZ2(notxyz);
   xyz.opNotXYZ2();
-  xyz.opXYZ2();
 }
 
 function part2() {
@@ -23,7 +22,6 @@
   xyz.tMethod1(0);
   xyz.tMethodNotXYZ1(notxyz);
   xyz.opNotXYZ1();
-  xyz.opXYZ1();
 }
 
 function part3(){
@@ -36,7 +34,6 @@
   xyz.tMethod3(new rename.Klass());
   xyz.tMethodNotXYZ3(notxyz);
   xyz.opNotXYZ3();
-  xyz.opXYZ3();
 }
 
 function part4() {
@@ -49,7 +46,6 @@
   xyz.tMethod4(rename.En1);
   xyz.tMethodNotXYZ4(notxyz);
   xyz.opNotXYZ4();
-  xyz.opXYZ4();
 }
 
 function part5() {
diff --git a/Examples/test-suite/javascript/rename2_runme.js b/Examples/test-suite/javascript/rename2_runme.js
index 99f4785..040c798 100644
--- a/Examples/test-suite/javascript/rename2_runme.js
+++ b/Examples/test-suite/javascript/rename2_runme.js
@@ -10,7 +10,6 @@
   xyz.tMethod2(0);
   xyz.tMethodNotXYZ2(notxyz);
   xyz.opNotXYZ2();
-  xyz.opXYZ2();
 }
 
 function part2() {
@@ -23,7 +22,6 @@
   xyz.tMethod1(0);
   xyz.tMethodNotXYZ1(notxyz);
   xyz.opNotXYZ1();
-  xyz.opXYZ1();
 }
 
 function part3(){
@@ -36,7 +34,6 @@
   xyz.tMethod3(new rename.Klass());
   xyz.tMethodNotXYZ3(notxyz);
   xyz.opNotXYZ3();
-  xyz.opXYZ3();
 }
 
 function part4() {
@@ -49,7 +46,6 @@
   xyz.tMethod4(rename.En1);
   xyz.tMethodNotXYZ4(notxyz);
   xyz.opNotXYZ4();
-  xyz.opXYZ4();
 }
 
 function part5() {
diff --git a/Examples/test-suite/javascript/rename3_runme.js b/Examples/test-suite/javascript/rename3_runme.js
index 237029f..fb9393b 100644
--- a/Examples/test-suite/javascript/rename3_runme.js
+++ b/Examples/test-suite/javascript/rename3_runme.js
@@ -10,7 +10,6 @@
   xyz.tMethod2(0);
   xyz.tMethodNotXYZ2(notxyz);
   xyz.opNotXYZ2();
-  xyz.opXYZ2();
 }
 
 function part2() {
@@ -23,7 +22,6 @@
   xyz.tMethod1(0);
   xyz.tMethodNotXYZ1(notxyz);
   xyz.opNotXYZ1();
-  xyz.opXYZ1();
 }
 
 function part3(){
@@ -36,7 +34,6 @@
   xyz.tMethod3(new rename.Klass());
   xyz.tMethodNotXYZ3(notxyz);
   xyz.opNotXYZ3();
-  xyz.opXYZ3();
 }
 
 function part4() {
@@ -49,7 +46,6 @@
   xyz.tMethod4(rename.En1);
   xyz.tMethodNotXYZ4(notxyz);
   xyz.opNotXYZ4();
-  xyz.opXYZ4();
 }
 
 function part5() {
diff --git a/Examples/test-suite/javascript/rename4_runme.js b/Examples/test-suite/javascript/rename4_runme.js
index fed50dc..1c3d8e7 100644
--- a/Examples/test-suite/javascript/rename4_runme.js
+++ b/Examples/test-suite/javascript/rename4_runme.js
@@ -10,7 +10,6 @@
   xyz.tMethod2(0);
   xyz.tMethodNotXYZ2(notxyz);
   xyz.opNotXYZ2();
-  xyz.opXYZ2();
 }
 
 function part2() {
@@ -23,7 +22,6 @@
   xyz.tMethod1(0);
   xyz.tMethodNotXYZ1(notxyz);
   xyz.opNotXYZ1();
-  xyz.opXYZ1();
 }
 
 function part3(){
@@ -36,7 +34,6 @@
   xyz.tMethod3(new rename.Klass());
   xyz.tMethodNotXYZ3(notxyz);
   xyz.opNotXYZ3();
-  xyz.opXYZ3();
 }
 
 function part4() {
@@ -49,7 +46,6 @@
   xyz.tMethod4(rename.En1);
   xyz.tMethodNotXYZ4(notxyz);
   xyz.opNotXYZ4();
-  xyz.opXYZ4();
 }
 
 function part5() {
diff --git a/Examples/test-suite/li_std_list.i b/Examples/test-suite/li_std_list.i
index d1ec4e7..9cc6220 100644
--- a/Examples/test-suite/li_std_list.i
+++ b/Examples/test-suite/li_std_list.i
@@ -38,13 +38,22 @@
   double num;
   Struct() : num(0.0) {}
   Struct(double d) : num(d) {}
-//  bool operator==(const Struct &other) { return (num == other.num); }
 };
 
 const std::list<Struct> & CopyContainerStruct(const std::list<Struct> & container) { return container; }
 const std::list<Struct *> & CopyContainerStructPtr(const std::list<Struct *> & container) { return container; }
 const std::list<const Struct *> & CopyContainerStructConstPtr(const std::list<const Struct *> & container) { return container; }
 
+const std::list<float> & listreal(const std::list<float> & list) { return list; }
+           
+const std::list<int> & listint(const std::list<int> & list) { return list; }
+const std::list<int *> & listintptr(const std::list<int *> & list) { return list; }
+const std::list<const int *> & listintconstptr(const std::list<const int *> & list) { return list; }
+           
+const std::list<Struct> & liststruct(const std::list<Struct> & list) { return list; }
+const std::list<Struct *> & liststructptr(const std::list<Struct *> & list) { return list; }
+const std::list<const Struct *> & liststructconstptr(const std::list<const Struct *> & list) { return list; }
+
 enum Fruit {
   APPLE,
   BANANNA,
@@ -53,8 +62,11 @@
 };
 %}
 
+#if !defined(SWIGR)
+%template(IntPtrList) std::list<int *>;
+%template(IntConstPtrList) std::list<const int *>;
+#endif
 %template(StructList) std::list<Struct>;
-%template(StructPtrList) std::list<Struct*>;
+%template(StructPtrList) std::list<Struct *>;
 %template(StructConstPtrList) std::list<const Struct *>;
-
 %template(FruitList) std::list<enum Fruit>;
diff --git a/Examples/test-suite/li_std_set.i b/Examples/test-suite/li_std_set.i
index fc9db42..bb952cd 100644
--- a/Examples/test-suite/li_std_set.i
+++ b/Examples/test-suite/li_std_set.i
@@ -15,15 +15,15 @@
 %include <std_set.i>
 %include <std_vector.i>
 
-// Use language macros since Java doesn't have multiset support (yet)
+// Use language macros since Java and C# don't have multiset support (yet)
 // and uses different naming conventions.
 #if defined(SWIGRUBY) || defined(SWIGPYTHON)
     %include <std_multiset.i>
     %template(set_int) std::multiset<int>;
     %template(v_int) std::vector<int>;
     %template(set_string) std::set<std::string>;
-#elif defined(SWIGJAVA)
-	%template(StringSet) std::set<std::string>;
+#elif defined(SWIGJAVA) || defined(SWIGCSHARP)
+    %template(StringSet) std::set<std::string>;
 #endif
 
 #if defined(SWIGRUBY)
diff --git a/Examples/test-suite/minherit2.i b/Examples/test-suite/minherit2.i
index 7d470d3..2baea64 100644
--- a/Examples/test-suite/minherit2.i
+++ b/Examples/test-suite/minherit2.i
@@ -17,8 +17,8 @@
 #if defined(SWIGCSHARP)
 #define javaclassmodifiers   csclassmodifiers
 #define javabody             csbody
-#define javafinalize         csfinalize
-#define javadestruct         csdestruct
+#define javafinalize         csdispose
+#define javadestruct         csdisposing
 #define javaout              csout
 #define javainterfaces       csinterfaces
 #define javabase             csbase
diff --git a/Examples/test-suite/nested_in_template.i b/Examples/test-suite/nested_in_template.i
index 2e79fa5..81d5b62 100644
--- a/Examples/test-suite/nested_in_template.i
+++ b/Examples/test-suite/nested_in_template.i
@@ -19,7 +19,7 @@
 
   struct ConcreteDerived : AbstractBase
   {
-    ConcreteDerived() : m_value(0.) {}
+    ConcreteDerived() : m_value(0) {}
     explicit ConcreteDerived(int value) : m_value(value) {}
 
     virtual bool IsSameAs(const AbstractBase& other) const {
diff --git a/Examples/test-suite/ocaml/varargs_overload_runme.ml b/Examples/test-suite/ocaml/varargs_overload_runme.ml
index 3085e62..418f881 100644
--- a/Examples/test-suite/ocaml/varargs_overload_runme.ml
+++ b/Examples/test-suite/ocaml/varargs_overload_runme.ml
@@ -11,5 +11,19 @@
   assert (_vararg_over3 '(2, 2.2, "hey") as string = "2 2.2 hey");
   assert (_vararg_over4 '("Hello") as string = "Hello");
   assert (_vararg_over4 '(123) as string = "123");
-  assert (_vararg_over4 '("Hello", 123) as string = "Hello")
+  assert (_vararg_over4 '("Hello", 123) as string = "Hello");
+
+
+  (* Same as above but non-vararg function declared first *)
+
+  assert (_vararg_over6 '("Hello") as string = "Hello");
+  assert (_vararg_over6 '(2) as string = "2");
+  assert (_vararg_over7 '("Hello") as string = "Hello");
+  assert (_vararg_over7 '(2, 2.2) as string = "2 2.2");
+
+  assert (_vararg_over8 '("Hello") as string = "Hello");
+  assert (_vararg_over8 '(2, 2.2, "hey") as string = "2 2.2 hey");
+  assert (_vararg_over9 '("Hello") as string = "Hello");
+  assert (_vararg_over9 '(123) as string = "123");
+  assert (_vararg_over9 '("Hello", 123) as string = "Hello");
 ;;
diff --git a/Examples/test-suite/php/cpp_static_runme.php b/Examples/test-suite/php/cpp_static_runme.php
index 1d581bd..20b50dd 100644
--- a/Examples/test-suite/php/cpp_static_runme.php
+++ b/Examples/test-suite/php/cpp_static_runme.php
@@ -4,7 +4,7 @@
 require "cpp_static.php";
 
 // New functions
-check::functions(array('staticfunctiontest_static_func','staticfunctiontest_static_func_2','staticfunctiontest_static_func_3','is_python_builtin'));
+check::functions(array('staticfunctiontest_static_func','staticfunctiontest_static_func_2','staticfunctiontest_static_func_3','is_python_builtin','staticmembertest_grab_int','staticbase_grab_statty_base','staticderived_grab_statty_derived'));
 // New classes
 check::classes(array('StaticMemberTest','StaticFunctionTest','cpp_static','StaticBase','StaticDerived'));
 // New vars
diff --git a/Examples/test-suite/preproc_gcc_output.h b/Examples/test-suite/preproc_gcc_output.h
new file mode 100644
index 0000000..cc5065d
--- /dev/null
+++ b/Examples/test-suite/preproc_gcc_output.h
@@ -0,0 +1,13 @@
+# 1 "header1.h"
+# 1 "<built-in>"
+# 1 "<command-line>"
+# 1 "/usr/include/stdc-predef.h" 1 3 4
+# 1 "<command-line>" 2
+# 1 "header1.h"
+# 18 "header1.h"
+void header1_function_a(int a);
+# 1 "header2.h" 1
+# 13 "header2.h"
+void header2_function(int x);
+# 20 "header1.h" 2
+void header1_function_b(int b);
diff --git a/Examples/test-suite/preproc_gcc_output.i b/Examples/test-suite/preproc_gcc_output.i
new file mode 100644
index 0000000..b4db9e7
--- /dev/null
+++ b/Examples/test-suite/preproc_gcc_output.i
@@ -0,0 +1,12 @@
+%module preproc_gcc_output
+// Testcase for Github issue #1475 using the output of gcc -E
+
+// The file below was generated using 'gcc -E header1.h'
+// where header1.h included header2.h
+%include "preproc_gcc_output.h"
+
+%{
+void header1_function_a(int a) {}
+void header2_function(int x) {}
+void header1_function_b(int b) {}
+%}
diff --git a/Examples/test-suite/primitive_types.i b/Examples/test-suite/primitive_types.i
index 6379343..a71f62a 100644
--- a/Examples/test-suite/primitive_types.i
+++ b/Examples/test-suite/primitive_types.i
@@ -630,6 +630,10 @@
     float val_float(float x) {
       return x;
     } 
+
+    float val_float_3(float f = 0e1f, float f2 = 020e0f, float f3 = 0.3e4f) {
+      return f + f2 + f3;
+    }
 %}
 
 
diff --git a/Examples/test-suite/python/Makefile.in b/Examples/test-suite/python/Makefile.in
index 1402239..0151f59 100644
--- a/Examples/test-suite/python/Makefile.in
+++ b/Examples/test-suite/python/Makefile.in
@@ -45,6 +45,7 @@
 	li_factory \
 	li_implicit \
 	li_std_containers_int \
+	li_std_list \
 	li_std_map_member \
 	li_std_multimap \
 	li_std_pair_extra \
diff --git a/Examples/test-suite/python/cpp11_final_directors_runme.py b/Examples/test-suite/python/cpp11_final_directors_runme.py
new file mode 100644
index 0000000..2e5f8af
--- /dev/null
+++ b/Examples/test-suite/python/cpp11_final_directors_runme.py
@@ -0,0 +1,11 @@
+import cpp11_final_directors
+
+class Derived2(cpp11_final_directors.Derived):
+
+    def meth(self):
+        return 3
+
+
+b = Derived2()
+if b.meth() != 3:
+    raise RuntimeError
diff --git a/Examples/test-suite/python/cpp_static_runme.py b/Examples/test-suite/python/cpp_static_runme.py
index e8c8cf6..cd7398f 100644
--- a/Examples/test-suite/python/cpp_static_runme.py
+++ b/Examples/test-suite/python/cpp_static_runme.py
@@ -8,15 +8,21 @@
 
 if is_python_builtin():
   if not StaticMemberTest.static_int == 99: raise RuntimeError("static_int not 99")
+  if not StaticMemberTest.grab_int() == 99: raise RuntimeError("static_int not 99")
   StaticMemberTest.static_int = 10
   if not StaticMemberTest.static_int == 10: raise RuntimeError("static_int not 10")
+  if not StaticMemberTest.grab_int() == 10: raise RuntimeError("static_int not 10")
 
   if not StaticBase.statty == 11: raise RuntimeError("statty not 11")
+  if not StaticBase.grab_statty_base() == 11: raise RuntimeError("statty not 11")
   if not StaticDerived.statty == 111: raise RuntimeError("statty not 111")
+  if not StaticDerived.grab_statty_derived() == 111: raise RuntimeError("statty not 111")
   StaticBase.statty = 22
   StaticDerived.statty = 222
   if not StaticBase.statty == 22: raise RuntimeError("statty not 22")
+  if not StaticBase.grab_statty_base() == 22: raise RuntimeError("statty not 22")
   if not StaticDerived.statty == 222: raise RuntimeError("statty not 222")
+  if not StaticDerived.grab_statty_derived() == 222: raise RuntimeError("statty not 222")
 
   # Restore
   StaticMemberTest.static_int = 99
@@ -24,12 +30,43 @@
   StaticDerived.statty = 111
 
 if not cvar.StaticMemberTest_static_int == 99: raise RuntimeError("cvar static_int not 99")
+if not StaticMemberTest.grab_int() == 99: raise RuntimeError("cvar static_int not 99")
 cvar.StaticMemberTest_static_int = 10
 if not cvar.StaticMemberTest_static_int == 10: raise RuntimeError("cvar static_int not 10")
+if not StaticMemberTest.grab_int() == 10: raise RuntimeError("cvar static_int not 10")
 
 if not cvar.StaticBase_statty == 11: raise RuntimeError("cvar statty not 11")
+if not StaticBase.grab_statty_base() == 11: raise RuntimeError("cvar statty not 11")
 if not cvar.StaticDerived_statty == 111: raise RuntimeError("cvar statty not 111")
+if not StaticDerived.grab_statty_derived() == 111: raise RuntimeError("cvar statty not 111")
 cvar.StaticBase_statty = 22
 cvar.StaticDerived_statty = 222
 if not cvar.StaticBase_statty == 22: raise RuntimeError("cvar statty not 22")
+if not StaticBase.grab_statty_base() == 22: raise RuntimeError("cvar statty not 22")
 if not cvar.StaticDerived_statty == 222: raise RuntimeError("cvar statty not 222")
+if not StaticDerived.grab_statty_derived() == 222: raise RuntimeError("cvar statty not 222")
+
+# Restore
+cvar.StaticMemberTest_static_int = 99
+cvar.StaticBase_statty = 11
+cvar.StaticDerived_statty = 111
+
+# Low-level layer testing
+if not is_python_builtin():
+    from cpp_static import _cpp_static
+    if not _cpp_static.StaticMemberTest_static_int_get() == 99: raise RuntimeError("low-level static_int not 99")
+    if not StaticMemberTest.grab_int() == 99: raise RuntimeError("low-level static_int not 99")
+    _cpp_static.StaticMemberTest_static_int_set(10)
+    if not _cpp_static.StaticMemberTest_static_int_get() == 10: raise RuntimeError("low-level static_int not 10")
+    if not StaticMemberTest.grab_int() == 10: raise RuntimeError("low-level static_int not 10")
+
+    if not _cpp_static.StaticBase_statty_get() == 11: raise RuntimeError("low-level statty not 11")
+    if not StaticBase.grab_statty_base() == 11: raise RuntimeError("low-level statty not 11")
+    if not _cpp_static.StaticDerived_statty_get() == 111: raise RuntimeError("low-level statty not 111")
+    if not StaticDerived.grab_statty_derived() == 111: raise RuntimeError("low-level statty not 111")
+    _cpp_static.StaticBase_statty_set(22)
+    _cpp_static.StaticDerived_statty_set(222)
+    if not _cpp_static.StaticBase_statty_get() == 22: raise RuntimeError("low-level statty not 22")
+    if not StaticBase.grab_statty_base() == 22: raise RuntimeError("low-level statty not 22")
+    if not _cpp_static.StaticDerived_statty_get() == 222: raise RuntimeError("low-level statty not 222")
+    if not StaticDerived.grab_statty_derived() == 222: raise RuntimeError("low-level statty not 222")
diff --git a/Examples/test-suite/python/preproc_gcc_output_runme.py b/Examples/test-suite/python/preproc_gcc_output_runme.py
new file mode 100644
index 0000000..66ff7d2
--- /dev/null
+++ b/Examples/test-suite/python/preproc_gcc_output_runme.py
@@ -0,0 +1,5 @@
+import preproc_gcc_output
+
+preproc_gcc_output.header1_function_a(99)
+preproc_gcc_output.header1_function_b(99)
+preproc_gcc_output.header2_function(99)
diff --git a/Examples/test-suite/python/varargs_overload_runme.py b/Examples/test-suite/python/varargs_overload_runme.py
index 3795862..6f5a702 100644
--- a/Examples/test-suite/python/varargs_overload_runme.py
+++ b/Examples/test-suite/python/varargs_overload_runme.py
@@ -28,3 +28,35 @@
 
 if varargs_overload.vararg_over4("Hello", 123) != "Hello":
     raise RuntimeError, "Failed"
+
+
+# Same as above but non-vararg function declared first
+
+if varargs_overload.vararg_over6("Hello") != "Hello":
+    raise RuntimeError, "Failed"
+
+if varargs_overload.vararg_over6(2) != "2":
+    raise RuntimeError, "Failed"
+
+
+if varargs_overload.vararg_over7("Hello") != "Hello":
+    raise RuntimeError, "Failed"
+
+if varargs_overload.vararg_over7(2, 2.2) != "2 2.2":
+    raise RuntimeError, "Failed"
+
+
+if varargs_overload.vararg_over8("Hello") != "Hello":
+    raise RuntimeError, "Failed"
+
+if varargs_overload.vararg_over8(2, 2.2, "hey") != "2 2.2 hey":
+    raise RuntimeError, "Failed"
+
+if varargs_overload.vararg_over9("Hello") != "Hello":
+    raise RuntimeError, "Failed"
+
+if varargs_overload.vararg_over9(123) != "123":
+    raise RuntimeError, "Failed"
+
+if varargs_overload.vararg_over9("Hello", 123) != "Hello":
+    raise RuntimeError, "Failed"
diff --git a/Examples/test-suite/python_pybuffer.i b/Examples/test-suite/python_pybuffer.i
index b46d8c3..bff72bf 100644
--- a/Examples/test-suite/python_pybuffer.i
+++ b/Examples/test-suite/python_pybuffer.i
@@ -28,7 +28,7 @@
         ++count;
     return count;
   }
-  int func4(const char *buf4)
+  size_t func4(const char *buf4)
   {
     return strlen(buf4);
   }  
diff --git a/Examples/test-suite/r/Makefile.in b/Examples/test-suite/r/Makefile.in
index 13fd365..33e9d90 100644
--- a/Examples/test-suite/r/Makefile.in
+++ b/Examples/test-suite/r/Makefile.in
@@ -27,7 +27,6 @@
 # arithmetic expressions
 
 FAILING_CPP_TESTS = \
-	enum_thorough \
 	preproc_constants
 
 FAILING_C_TESTS = \
@@ -64,7 +63,7 @@
 # check for syntactic correctness
 run_testcase = \
 	if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
-	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) || (cat $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)out ; false); \
+	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) || (cat ./$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)out ; false); \
 	else \
 	  $(RUNTOOL) $(RUNR) ./$(SCRIPTPREFIX)$*$(WRAPSUFFIX) || (cat ./$(SCRIPTPREFIX)$*$(WRAPSUFFIX)out ; false); \
 	fi
@@ -72,7 +71,7 @@
 run_multitestcase = \
 	for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
 	if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX) ]; then \
-	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX) || (cat $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX)out ; false); \
+	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PATH=.:"$$PATH" $(RUNTOOL) $(RUNR) $(SCRIPTDIR)/$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX) || (cat ./$(SCRIPTPREFIX)$${f}$(SCRIPTSUFFIX)out ; false); \
 	else \
 	  $(RUNTOOL) $(RUNR) ./$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX) || (cat ./$(SCRIPTPREFIX)$${f}$(WRAPSUFFIX)out ; false); \
 	fi; \
diff --git a/Examples/test-suite/r/enum_thorough_runme.R b/Examples/test-suite/r/enum_thorough_runme.R
new file mode 100644
index 0000000..a0f1270
--- /dev/null
+++ b/Examples/test-suite/r/enum_thorough_runme.R
@@ -0,0 +1,452 @@
+clargs <- commandArgs(trailing=TRUE)
+source(file.path(clargs[1], "unittest.R"))
+
+dyn.load(paste("enum_thorough", .Platform$dynlib.ext, sep=""))
+source("enum_thorough.R")
+cacheMetaData(1)
+
+## Anonymous enums are not wrapped by the R module
+##
+
+# Colours - string interface, various function signatures
+unittest('red', colourTest1('red'))
+unittest('blue', colourTest1('blue'))
+unittest('green', colourTest1('green'))
+
+
+unittest('red', colourTest2('red'))
+unittest('blue', colourTest2('blue'))
+unittest('green', colourTest2('green'))
+
+unittest('red', colourTest3('red'))
+unittest('blue', colourTest3('blue'))
+unittest('green', colourTest3('green'))
+
+unittest('red', colourTest4('red'))
+unittest('blue', colourTest4('blue'))
+unittest('green', colourTest4('green'))
+
+## Colours - underlying integers
+unittest(-1, enumToInteger('red', '_colour'))
+unittest(0, enumToInteger('blue', '_colour'))
+unittest(10, enumToInteger('green', '_colour'))
+
+########
+## enum variable, wrapped as a function
+## Is initialization to 0 a "standard"
+myColour()
+
+## Test setting and retrieving
+myColour('green')
+unittest('green', myColour())
+
+########
+## SpeedClass
+
+s <- SpeedClass()
+v <- "medium"
+unittest(v, s$speedTest1(v))
+unittest(v, s$speedTest2(v))
+unittest(v, s$speedTest3(v))
+unittest(v, s$speedTest4(v))
+unittest(v, s$speedTest5(v))
+unittest(v, s$speedTest6(v))
+unittest(v, s$speedTest7(v))
+unittest(v, s$speedTest8(v))
+
+## speedTest methods not in the class
+
+unittest(v, speedTest1(v))
+unittest(v, speedTest2(v))
+unittest(v, speedTest3(v))
+unittest(v, speedTest4(v))
+# enum reference
+unittest(v, speedTest5(v))
+
+## member access
+s <- SpeedClass()
+unittest("slow", s$mySpeedtd1)
+# check integer value
+unittest(10, enumToInteger(s$mySpeedtd1, "_SpeedClass__speed"))
+# set and check
+s$mySpeedtd1 <- "lightning"
+unittest("lightning", s$mySpeedtd1)
+unittest(31, enumToInteger(s$mySpeedtd1, "_SpeedClass__speed"))
+
+## Named anon - not wrapped nicely, but can be retrieved:
+
+
+unittest("NamedAnon2", namedanon_NamedAnon2_get())
+unittest(0, enumToInteger(namedanon_NamedAnon1_get(), "_namedanon"))
+unittest(1, enumToInteger(namedanon_NamedAnon2_get(), "_namedanon"))
+
+## Twonames
+v <- "TwoNames1"
+unittest(v, twonamesTest1(v))
+unittest(v, twonamesTest2(v))
+unittest(v, twonamesTest3(v))
+unittest(33, enumToInteger("TwoNames3", "_twonamestag"))
+
+tt <- TwoNamesStruct()
+v <- "TwoNamesStruct1"
+unittest(v, tt$twonamesTest1(v))
+unittest(v, tt$twonamesTest2(v))
+unittest(v, tt$twonamesTest3(v))
+## Try the wrong name
+unittest(TRUE, is.na(tt$twonamesTest3("TwoNames1")))
+
+## Namedanonspace
+## can get the values
+
+v <- namedanonspace_NamedAnonSpace2_get()
+unittest(v, namedanonspaceTest1(v))
+unittest(v, namedanonspaceTest2(v))
+unittest(v, namedanonspaceTest3(v))
+unittest(v, namedanonspaceTest4(v))
+
+## scientists
+
+tt <- TemplateClassInt()
+
+g <- "galileo"
+unittest(g, tt$scientistsTest1(g))
+unittest(g, tt$scientistsTest2(g))
+unittest(g, tt$scientistsTest3(g))
+unittest(g, tt$scientistsTest4(g))
+unittest(g, tt$scientistsTest5(g))
+unittest(g, tt$scientistsTest6(g))
+unittest(g, tt$scientistsTest7(g))
+unittest(g, tt$scientistsTest8(g))
+unittest(g, tt$scientistsTest9(g))
+
+## This one is commented out in csharp too
+## unittest(g, tt$scientistsTestA(g))
+unittest(g, tt$scientistsTestB(g))
+## This one is commented out in csharp too
+## unittest(g, tt$scientistsTestC(g))
+unittest(g, tt$scientistsTestD(g))
+unittest(g, tt$scientistsTestE(g))
+unittest(g, tt$scientistsTestF(g))
+unittest(g, tt$scientistsTestG(g))
+unittest(g, tt$scientistsTestH(g))
+unittest(g, tt$scientistsTestI(g))
+# enum reference
+unittest(g, tt$scientistsTestJ(g))
+
+
+unittest(g, scientistsTest1(g))
+unittest(g, scientistsTest2(g))
+unittest(g, scientistsTest3(g))
+unittest(g, scientistsTest4(g))
+unittest(g, scientistsTest5(g))
+unittest(g, scientistsTest6(g))
+unittest(g, scientistsTest7(g))
+## enum reference
+unittest(g, scientistsTest8(g))
+
+tt <- TClassInt()
+b <- "bell"
+unittest(b, tt$scientistsNameTest1(b))
+unittest(b, tt$scientistsNameTest2(b))
+unittest(b, tt$scientistsNameTest3(b))
+unittest(b, tt$scientistsNameTest4(b))
+unittest(b, tt$scientistsNameTest5(b))
+unittest(b, tt$scientistsNameTest6(b))
+unittest(b, tt$scientistsNameTest7(b))
+unittest(b, tt$scientistsNameTest8(b))
+unittest(b, tt$scientistsNameTest9(b))
+
+## This one is commented out in csharp too
+## unittest(b, tt$scientistsNameTestA(b))
+unittest(b, tt$scientistsNameTestB(b))
+## This one is commented out in csharp too
+## unittest(b, tt$scientistsNameTestC(b))
+unittest(b, tt$scientistsNameTestD(b))
+unittest(b, tt$scientistsNameTestE(b))
+unittest(b, tt$scientistsNameTestF(b))
+unittest(b, tt$scientistsNameTestG(b))
+unittest(b, tt$scientistsNameTestH(b))
+unittest(b, tt$scientistsNameTestI(b))
+
+
+unittest(b, tt$scientistsNameSpaceTest1(b))
+unittest(b, tt$scientistsNameSpaceTest2(b))
+unittest(b, tt$scientistsNameSpaceTest3(b))
+unittest(b, tt$scientistsNameSpaceTest4(b))
+unittest(b, tt$scientistsNameSpaceTest5(b))
+unittest(b, tt$scientistsNameSpaceTest6(b))
+unittest(b, tt$scientistsNameSpaceTest7(b))
+
+unittest(g, tt$scientistsOtherTest1(g))
+unittest(g, tt$scientistsOtherTest2(g))
+unittest(g, tt$scientistsOtherTest3(g))
+unittest(g, tt$scientistsOtherTest4(g))
+unittest(g, tt$scientistsOtherTest5(g))
+unittest(g, tt$scientistsOtherTest6(g))
+unittest(g, tt$scientistsOtherTest7(g))
+
+## Global 
+unittest(b, scientistsNameTest1(b))
+unittest(b, scientistsNameTest2(b))
+unittest(b, scientistsNameTest3(b))
+unittest(b, scientistsNameTest4(b))
+unittest(b, scientistsNameTest5(b))
+unittest(b, scientistsNameTest6(b))
+unittest(b, scientistsNameTest7(b))
+
+unittest(b, scientistsNameSpaceTest1(b))
+unittest(b, scientistsNameSpaceTest2(b))
+unittest(b, scientistsNameSpaceTest3(b))
+unittest(b, scientistsNameSpaceTest4(b))
+unittest(b, scientistsNameSpaceTest5(b))
+unittest(b, scientistsNameSpaceTest6(b))
+unittest(b, scientistsNameSpaceTest7(b))
+
+unittest(b, scientistsNameSpaceTest8(b))
+unittest(b, scientistsNameSpaceTest9(b))
+unittest(b, scientistsNameSpaceTestA(b))
+unittest(b, scientistsNameSpaceTestB(b))
+unittest(b, scientistsNameSpaceTestC(b))
+unittest(b, scientistsNameSpaceTestD(b))
+unittest(b, scientistsNameSpaceTestE(b))
+unittest(b, scientistsNameSpaceTestF(b))
+unittest(b, scientistsNameSpaceTestG(b))
+unittest(b, scientistsNameSpaceTestH(b))
+unittest(b, scientistsNameSpaceTestI(b))
+unittest(b, scientistsNameSpaceTestJ(b))
+unittest(b, scientistsNameSpaceTestK(b))
+unittest(b, scientistsNameSpaceTestL(b))
+
+## rename test
+v <- "eek"
+unittest(v, renameTest1(v))
+unittest(v, renameTest2(v))
+
+## NewName
+N <- NewNameStruct()
+## Only half works:
+unittest("kerboom", NewNameStruct_bang_get())
+## Can't put in "bang" in the call
+## confirm with:
+## get(".__E___OldNameStruct__enumeration")
+
+## TreeClass
+
+T <- TreesClass()
+p <- "pine"
+
+unittest(p, T$treesTest1(p))
+unittest(p, T$treesTest2(p))
+unittest(p, T$treesTest3(p))
+unittest(p, T$treesTest4(p))
+unittest(p, T$treesTest5(p))
+unittest(p, T$treesTest6(p))
+unittest(p, T$treesTest7(p))
+unittest(p, T$treesTest8(p))
+unittest(p, T$treesTest9(p))
+unittest(p, T$treesTestA(p))
+unittest(p, T$treesTestB(p))
+unittest(p, T$treesTestC(p))
+unittest(p, T$treesTestD(p))
+unittest(p, T$treesTestE(p))
+unittest(p, T$treesTestF(p))
+unittest(p, T$treesTestG(p))
+unittest(p, T$treesTestH(p))
+unittest(p, T$treesTestI(p))
+unittest(p, T$treesTestJ(p))
+unittest(p, T$treesTestK(p))
+unittest(p, T$treesTestL(p))
+unittest(p, T$treesTestM(p))
+unittest(p, T$treesTestN(p))
+unittest(p, T$treesTestO(p))
+
+unittest(p, treesTest1(p))
+unittest(p, treesTest2(p))
+unittest(p, treesTest3(p))
+unittest(p, treesTest4(p))
+unittest(p, treesTest5(p))
+unittest(p, treesTest6(p))
+unittest(p, treesTest7(p))
+unittest(p, treesTest8(p))
+unittest(p, treesTest9(p))
+unittest(p, treesTestA(p))
+unittest(p, treesTestB(p))
+unittest(p, treesTestC(p))
+unittest(p, treesTestD(p))
+unittest(p, treesTestE(p))
+unittest(p, treesTestF(p))
+unittest(p, treesTestG(p))
+unittest(p, treesTestH(p))
+unittest(p, treesTestI(p))
+unittest(p, treesTestJ(p))
+unittest(p, treesTestK(p))
+unittest(p, treesTestL(p))
+unittest(p, treesTestM(p))
+unittest(p, treesTestO(p))
+unittest(p, treesTestP(p))
+unittest(p, treesTestQ(p))
+unittest(p, treesTestR(p))
+
+## Hair
+h <- HairStruct()
+g <- "ginger"
+unittest(g, h$hairTest1(g))
+unittest(g, h$hairTest2(g))
+unittest(g, h$hairTest3(g))
+unittest(g, h$hairTest4(g))
+unittest(g, h$hairTest5(g))
+unittest(g, h$hairTest6(g))
+unittest(g, h$hairTest7(g))
+unittest(g, h$hairTest8(g))
+unittest(g, h$hairTest9(g))
+unittest(g, h$hairTestA(g))
+unittest(g, h$hairTestB(g))
+
+r <- "red"
+unittest(r, h$colourTest1(r))
+unittest(r, h$colourTest2(r))
+
+nmA <- "NamedAnon1"
+unittest(nmA, h$namedanonTest1(nmA))
+unittest("NamedAnonSpace2", h$namedanonspaceTest1("NamedAnonSpace2"))
+
+f <- "fir"
+
+unittest(f, h$treesGlobalTest1(f))
+unittest(f, h$treesGlobalTest2(f))
+unittest(f, h$treesGlobalTest3(f))
+unittest(f, h$treesGlobalTest4(f))
+
+b <- "blonde"
+unittest(b, hairTest1(b))
+unittest(b, hairTest2(b))
+unittest(b, hairTest3(b))
+unittest(b, hairTest4(b))
+unittest(b, hairTest5(b))
+unittest(b, hairTest6(b))
+unittest(b, hairTest7(b))
+unittest(b, hairTest8(b))
+unittest(b, hairTest9(b))
+unittest(b, hairTestA(b))
+unittest(b, hairTestB(b))
+## enum reference
+unittest(b, hairTestC(b))
+unittest(b, hairTestA1(b))
+unittest(b, hairTestA2(b))
+unittest(b, hairTestA3(b))
+unittest(b, hairTestA4(b))
+unittest(b, hairTestA5(b))
+unittest(b, hairTestA6(b))
+unittest(b, hairTestA7(b))
+unittest(b, hairTestA8(b))
+unittest(b, hairTestA9(b))
+unittest(b, hairTestAA(b))
+unittest(b, hairTestAB(b))
+## enum reference
+unittest(b, hairTestAC(b))
+
+unittest(b, hairTestB1(b))
+unittest(b, hairTestB2(b))
+unittest(b, hairTestB3(b))
+unittest(b, hairTestB4(b))
+unittest(b, hairTestB5(b))
+unittest(b, hairTestB6(b))
+unittest(b, hairTestB7(b))
+unittest(b, hairTestB8(b))
+unittest(b, hairTestB9(b))
+unittest(b, hairTestBA(b))
+unittest(b, hairTestBB(b))
+## enum reference
+unittest(b, hairTestBC(b))
+
+f <- FirStruct()
+b <- "blonde"
+
+unittest(b, f$hairTestFir1(b))
+unittest(b, f$hairTestFir2(b))
+unittest(b, f$hairTestFir3(b))
+unittest(b, f$hairTestFir4(b))
+unittest(b, f$hairTestFir5(b))
+unittest(b, f$hairTestFir6(b))
+unittest(b, f$hairTestFir7(b))
+unittest(b, f$hairTestFir8(b))
+unittest(b, f$hairTestFir9(b))
+unittest(b, f$hairTestFirA(b))
+
+## Unnamed enum instance doesn't work
+## Wrapper set/get exists, but there's
+## no mapping between strings and integers
+GlobalInstance(1)
+unittest(1, GlobalInstance())
+
+ii <- Instances()
+ii$MemberInstance <- 1
+unittest(1, ii$MemberInstance)
+
+ii <- IgnoreTest()
+
+## Testing integer values
+unittest(0, enumToInteger(IgnoreTest_ignoreA_zero_get(), "_IgnoreTest__IgnoreA"))
+unittest(3, enumToInteger(IgnoreTest_ignoreA_three_get(), "_IgnoreTest__IgnoreA"))
+unittest(10, enumToInteger(IgnoreTest_ignoreA_ten_get(), "_IgnoreTest__IgnoreA"))
+
+unittest(11, enumToInteger(IgnoreTest_ignoreA_eleven_get(), "_IgnoreTest__IgnoreA"))
+unittest(14, enumToInteger(IgnoreTest_ignoreA_fourteen_get(), "_IgnoreTest__IgnoreA"))
+unittest(20, enumToInteger(IgnoreTest_ignoreA_twenty_get(), "_IgnoreTest__IgnoreA"))
+unittest(30, enumToInteger(IgnoreTest_ignoreA_thirty_get(), "_IgnoreTest__IgnoreA"))
+unittest(32, enumToInteger(IgnoreTest_ignoreA_thirty_two_get(), "_IgnoreTest__IgnoreA"))
+unittest(33, enumToInteger(IgnoreTest_ignoreA_thirty_three_get(), "_IgnoreTest__IgnoreA"))
+
+unittest(11, enumToInteger(IgnoreTest_ignoreB_eleven_get(), "_IgnoreTest__IgnoreB"))
+unittest(12, enumToInteger(IgnoreTest_ignoreB_twelve_get(), "_IgnoreTest__IgnoreB"))
+unittest(31, enumToInteger(IgnoreTest_ignoreB_thirty_one_get(), "_IgnoreTest__IgnoreB"))
+unittest(32, enumToInteger(IgnoreTest_ignoreB_thirty_two_get(), "_IgnoreTest__IgnoreB"))
+unittest(41, enumToInteger(IgnoreTest_ignoreB_forty_one_get(), "_IgnoreTest__IgnoreB"))
+unittest(42, enumToInteger(IgnoreTest_ignoreB_forty_two_get(), "_IgnoreTest__IgnoreB"))
+
+unittest(10, enumToInteger(IgnoreTest_ignoreC_ten_get(), "_IgnoreTest__IgnoreC"))
+unittest(12, enumToInteger(IgnoreTest_ignoreC_twelve_get(), "_IgnoreTest__IgnoreC"))
+unittest(30, enumToInteger(IgnoreTest_ignoreC_thirty_get(), "_IgnoreTest__IgnoreC"))
+unittest(32, enumToInteger(IgnoreTest_ignoreC_thirty_two_get(), "_IgnoreTest__IgnoreC"))
+unittest(40, enumToInteger(IgnoreTest_ignoreC_forty_get(), "_IgnoreTest__IgnoreC"))
+unittest(42, enumToInteger(IgnoreTest_ignoreC_forty_two_get(), "_IgnoreTest__IgnoreC"))
+
+unittest(21, enumToInteger(IgnoreTest_ignoreD_twenty_one_get(), "_IgnoreTest__IgnoreD"))
+unittest(22, enumToInteger(IgnoreTest_ignoreD_twenty_two_get(), "_IgnoreTest__IgnoreD"))
+
+unittest(0, enumToInteger(IgnoreTest_ignoreE_zero_get(), "_IgnoreTest__IgnoreE"))
+unittest(21, enumToInteger(IgnoreTest_ignoreE_twenty_one_get(), "_IgnoreTest__IgnoreE"))
+unittest(22, enumToInteger(IgnoreTest_ignoreE_twenty_two_get(), "_IgnoreTest__IgnoreE"))
+
+## confirm that an ignore directive is followed:
+unittest(TRUE, is.na(ignoreCTest("ignoreC_eleven")))
+
+
+## repeat test
+unittest(1, enumToInteger(repeatTest("one"), "_RepeatSpace__repeat"))
+unittest(1, enumToInteger(repeatTest("initial"), "_RepeatSpace__repeat"))
+unittest(2, enumToInteger(repeatTest("two"), "_RepeatSpace__repeat"))
+unittest(3, enumToInteger(repeatTest("three"), "_RepeatSpace__repeat"))
+unittest(3, enumToInteger(repeatTest("llast"), "_RepeatSpace__repeat"))
+unittest(3, enumToInteger(repeatTest("end"), "_RepeatSpace__repeat"))
+
+## Macro test - nothing in csharp
+## Note - this enum is set up with both entries the same
+## This means that mapping back from the integer value to the
+## string value isn't unique, so asking for "ABCD2" will return
+## a string of "ABCD"
+unittest("ABCD", enumWithMacroTest("ABCD"))
+
+## Different types
+unittest(10, enumToInteger(differentTypesTest("typeint"), "_DifferentSpace__DifferentTypes"))
+unittest(0, enumToInteger(differentTypesTest("typeboolfalse"), "_DifferentSpace__DifferentTypes"))
+unittest(1, enumToInteger(differentTypesTest("typebooltrue"), "_DifferentSpace__DifferentTypes"))
+unittest(2, enumToInteger(differentTypesTest("typebooltwo"), "_DifferentSpace__DifferentTypes"))
+unittest(utf8ToInt('C'), enumToInteger(differentTypesTest("typechar"), "_DifferentSpace__DifferentTypes"))
+unittest(utf8ToInt('D'), enumToInteger(differentTypesTest("typedefaultint"), "_DifferentSpace__DifferentTypes"))
+unittest(utf8ToInt('A') + 1, enumToInteger(differentTypesTest("typecharcompound"), "_DifferentSpace__DifferentTypes"))
+
+
+## Global different types
+## Test uses an anonymous type so the string mapping
+## framework doesn't exist.
diff --git a/Examples/test-suite/rename.h b/Examples/test-suite/rename.h
index c8199ee..3f10c58 100644
--- a/Examples/test-suite/rename.h
+++ b/Examples/test-suite/rename.h
@@ -27,7 +27,6 @@
     void templateXYZ(XYZ<T> i) {}
     operator T() { return m_t; }
     operator NotXYZ<T>() const { return m_notxyz; }
-    operator XYZ<T>() const { XYZ<T> xyz = XYZ<T>(); return xyz; }
   };
 }
 
@@ -48,10 +47,7 @@
   public:
     void method(ABC a) const {}
     void method(Klass k) const {}
-#if !defined(__clang__)
-    // Workaround for: warning: conversion function converting 'Space::ABC' to itself will never be used
-    operator ABC() const { ABC a; return a; }
-#endif
+    operator ABC*() const { return new ABC(); }
     operator Klass() const { Klass k; return k; }
 };
 }
diff --git a/Examples/test-suite/rename1.i b/Examples/test-suite/rename1.i
index 38af2b3..92e6b34 100644
--- a/Examples/test-suite/rename1.i
+++ b/Examples/test-suite/rename1.i
@@ -35,14 +35,9 @@
 %rename(opNotXYZ3) Space::XYZ<Space::Klass>::operator NotXYZ<Space::Klass>() const;
 %rename(opNotXYZ4) Space::XYZ<Space::Enu>::operator NotXYZ<Space::Enu>() const;
 
-%rename(opXYZ1) Space::XYZ::operator XYZ<T>() const;
-%rename(opXYZ2) Space::XYZ<int>::operator XYZ<int>() const;
-%rename(opXYZ3) Space::XYZ<Space::Klass>::operator XYZ<Space::Klass>() const;
-%rename(opXYZ4) Space::XYZ<Space::Enu>::operator XYZ<Space::Enu>() const;
-
 
 %rename(methodABC) Space::ABC::method(ABC a) const;
-%rename(opABC) Space::ABC::operator ABC() const;
+%rename(opABC) Space::ABC::operator ABC*() const;
 %rename(methodKlass) Space::ABC::method(Klass k) const;
 %rename(opKlass) Space::ABC::operator Klass() const;
 
diff --git a/Examples/test-suite/rename2.i b/Examples/test-suite/rename2.i
index 6a9c22e..93b82dd 100644
--- a/Examples/test-suite/rename2.i
+++ b/Examples/test-suite/rename2.i
@@ -43,7 +43,7 @@
 
 
 %rename(methodABC) ABC::method(ABC a) const;
-%rename(opABC) ABC::operator ABC() const;
+%rename(opABC) ABC::operator ABC*() const;
 %rename(methodKlass) ABC::method(Klass k) const;
 %rename(opKlass) ABC::operator Klass() const;
 }
diff --git a/Examples/test-suite/rename3.i b/Examples/test-suite/rename3.i
index b39979f..5b613d7 100644
--- a/Examples/test-suite/rename3.i
+++ b/Examples/test-suite/rename3.i
@@ -52,7 +52,7 @@
 
   %extend ABC {
     %rename(methodABC) method(ABC a) const;
-    %rename(opABC) operator ABC() const;
+    %rename(opABC) operator ABC*() const;
     %rename(methodKlass) method(Klass k) const;
     %rename(opKlass) operator Klass() const;
   }
diff --git a/Examples/test-suite/rename4.i b/Examples/test-suite/rename4.i
index 9ddff36..75f01ca 100644
--- a/Examples/test-suite/rename4.i
+++ b/Examples/test-suite/rename4.i
@@ -29,21 +29,18 @@
 %rename(tMethodXYZ2) templateXYZ(XYZ<int>);
 %rename(opT2) operator int();
 %rename(opNotXYZ2) operator NotXYZ<int>() const;
-%rename(opXYZ2) operator XYZ<int>() const;
 
 %rename(tMethod3) templateT(Space::Klass i);
 %rename(tMethodNotXYZ3) templateNotXYZ(NotXYZ<Space::Klass>);
 %rename(tMethodXYZ3) templateXYZ(XYZ<Space::Klass>);
 %rename(opT3) operator Space::Klass();
 %rename(opNotXYZ3) operator NotXYZ<Space::Klass>() const;
-%rename(opXYZ3) operator XYZ<Space::Klass>() const;
 
 %rename(tMethod4) templateT(Space::Enu i);
 %rename(tMethodNotXYZ4) templateNotXYZ(NotXYZ<Space::Enu>);
 %rename(tMethodXYZ4) templateXYZ(XYZ<Space::Enu>);
 %rename(opT4) operator Space::Enu();
 %rename(opNotXYZ4) operator NotXYZ<Space::Enu>() const;
-%rename(opXYZ4) operator XYZ<Space::Enu>() const;
 
 namespace Space {
   using namespace AnotherSpace;
@@ -60,7 +57,6 @@
     %rename(tMethodXYZ1) templateXYZ(XYZ<T>);
     %rename(opT1) operator T();
     %rename(opNotXYZ1) operator NotXYZ<T>() const;
-    %rename(opXYZ1) operator XYZ<T>() const;
 
     NotXYZ<int> *m_int;
     T m_t;
@@ -74,7 +70,6 @@
     void templateXYZ(XYZ<T> i) {}
     operator T() { return m_t; }
     operator NotXYZ<T>() const { return m_notxyz; }
-    operator XYZ<T>() const { XYZ<T> xyz; return xyz; }
   };
 }
 
@@ -93,16 +88,13 @@
   public:
 
     %rename(methodABC) method(ABC a) const;
-    %rename(opABC) operator ABC() const;
+    %rename(opABC) operator ABC*() const;
     %rename(methodKlass) method(Klass k) const;
     %rename(opKlass) operator Klass() const;
 
     void method(ABC a) const {}
     void method(Klass k) const {}
-#if !defined(__clang__)
-    // Workaround for: warning: conversion function converting 'Space::ABC' to itself will never be used
-    operator ABC() const { ABC a; return a; }
-#endif
+    operator ABC*() const { return new ABC(); }
     operator Klass() const { Klass k; return k; }
 };
 }
diff --git a/Examples/test-suite/ruby/Makefile.in b/Examples/test-suite/ruby/Makefile.in
index add65fe..6393026 100644
--- a/Examples/test-suite/ruby/Makefile.in
+++ b/Examples/test-suite/ruby/Makefile.in
@@ -26,6 +26,7 @@
 	ruby_keywords \
 	ruby_minherit_shared_ptr \
 	ruby_naming \
+	ruby_rdata \
 	ruby_track_objects \
 	ruby_track_objects_directors \
 	std_containers \
diff --git a/Examples/test-suite/ruby/ruby_rdata_runme.rb b/Examples/test-suite/ruby/ruby_rdata_runme.rb
new file mode 100644
index 0000000..b7f2930
--- /dev/null
+++ b/Examples/test-suite/ruby/ruby_rdata_runme.rb
@@ -0,0 +1,7 @@
+require 'swig_assert'
+require 'ruby_rdata'
+
+include Ruby_rdata
+
+swig_assert_equal_simple(1, take_proc_or_cpp_obj_and_ret_1(Proc.new{}))
+swig_assert_equal_simple(1, take_proc_or_cpp_obj_and_ret_1(C.new))
diff --git a/Examples/test-suite/ruby_rdata.i b/Examples/test-suite/ruby_rdata.i
new file mode 100644
index 0000000..06af06f
--- /dev/null
+++ b/Examples/test-suite/ruby_rdata.i
@@ -0,0 +1,20 @@
+%module ruby_rdata
+
+%{
+
+  class C {};
+
+  int take_proc_or_cpp_obj_and_ret_1(VALUE obj) {
+    return 1;
+  }
+
+  int take_proc_or_cpp_obj_and_ret_1(C c) {
+    return 1;
+  }
+
+%}
+
+class C {};
+
+int take_proc_or_cpp_obj_and_ret_1(VALUE);
+int take_proc_or_cpp_obj_and_ret_1(C);
diff --git a/Examples/test-suite/scilab/varargs_overload_runme.sci b/Examples/test-suite/scilab/varargs_overload_runme.sci
index 7603b66..7426e81 100644
--- a/Examples/test-suite/scilab/varargs_overload_runme.sci
+++ b/Examples/test-suite/scilab/varargs_overload_runme.sci
@@ -4,7 +4,7 @@
 
 checkequal(vararg_over1(2), "2", "vararg_over1(2)");
 
-checkequal(vararg_over2("Hello"), "Hello", "vararg_over1(""Hello"")");
+checkequal(vararg_over2("Hello"), "Hello", "vararg_over2(""Hello"")");
 
 checkequal(vararg_over2(2, 2.2), "2 2.2", "vararg_over2(2, 2.2)")
 
@@ -18,4 +18,24 @@
 
 checkequal(vararg_over4("Hello", 123), "Hello", "vararg_over4(""Hello"", 123)");
 
+
+// Same as above but non-vararg function declared first
+
+checkequal(vararg_over6("Hello"), "Hello", "vararg_over6(""Hello"")");
+
+checkequal(vararg_over6(2), "2", "vararg_over6(2)");
+
+checkequal(vararg_over7("Hello"), "Hello", "vararg_over7(""Hello"")");
+
+checkequal(vararg_over7(2, 2.2), "2 2.2", "vararg_over7(2, 2.2)")
+
+checkequal(vararg_over8("Hello"), "Hello", "vararg_over8(""Hello"")");
+
+checkequal(vararg_over8(2, 2.2, "hey"), "2 2.2 hey", "vararg_over8(2, 2.2, ""hey"")");
+
+checkequal(vararg_over9("Hello"), "Hello", "vararg_over9(""Hello"")");
+
+checkequal(vararg_over9(123), "123", "vararg_over9(123)");
+
+checkequal(vararg_over9("Hello", 123), "Hello", "vararg_over9(""Hello"", 123)");
 exec("swigtest.quit", -1);
diff --git a/Examples/test-suite/stl_no_default_constructor.i b/Examples/test-suite/stl_no_default_constructor.i
new file mode 100644
index 0000000..32aff2b
--- /dev/null
+++ b/Examples/test-suite/stl_no_default_constructor.i
@@ -0,0 +1,19 @@
+%module stl_no_default_constructor
+
+%include <stl.i>
+
+%inline %{
+struct NoDefaultCtor {
+  int value;
+  NoDefaultCtor(int i) : value(i) {}
+};
+%}
+
+#if defined(SWIGCSHARP) || defined(SWIGJAVA) || defined(SWIGD)
+%template(VectorNoDefaultCtor) std::vector<NoDefaultCtor>;
+#endif
+
+#if defined(SWIGJAVA) || defined(SWIGJAVA)
+%include <std_list.i>
+%template(ListNoDefaultCtor) std::list<NoDefaultCtor>;
+#endif
diff --git a/Examples/test-suite/template_opaque.i b/Examples/test-suite/template_opaque.i
index b910e47..7aafd62 100644
--- a/Examples/test-suite/template_opaque.i
+++ b/Examples/test-suite/template_opaque.i
@@ -36,7 +36,4 @@
 }
 }
 
-#ifndef SWIGCSHARP
-// C# vector typemaps only ready for simple cases right now
 %template(OpaqueVectorType) std::vector<A::OpaqueType>; 
-#endif
diff --git a/Examples/test-suite/varargs_overload.i b/Examples/test-suite/varargs_overload.i
index 9a24e15..eb9dcaa 100644
--- a/Examples/test-suite/varargs_overload.i
+++ b/Examples/test-suite/varargs_overload.i
@@ -44,3 +44,47 @@
   return buffer;
 }
 %}
+
+
+// Same as above but non-vararg function declared first
+
+%inline %{
+const char *vararg_over6(int i) {
+  static char buffer[256];
+  sprintf(buffer, "%d", i);
+  return buffer;
+}
+const char *vararg_over6(const char *fmt, ...) {
+  return fmt;
+}
+
+const char *vararg_over7(int i, double j) {
+  static char buffer[256];
+  sprintf(buffer, "%d %g", i, j);
+  return buffer;
+}
+const char *vararg_over7(const char *fmt, ...) {
+  return fmt;
+}
+
+const char *vararg_over8(int i, double j, const char *s) {
+  static char buffer[256];
+  sprintf(buffer, "%d %g %s", i, j, s);
+  return buffer;
+}
+const char *vararg_over8(const char *fmt, ...) {
+  return fmt;
+}
+%}
+
+%varargs(int mode = 0) vararg_over9;
+%inline %{
+const char *vararg_over9(int i) {
+  static char buffer[256];
+  sprintf(buffer, "%d", i);
+  return buffer;
+}
+const char *vararg_over9(const char *fmt, ...) {
+  return fmt;
+}
+%}
diff --git a/Lib/chicken/chickenrun.swg b/Lib/chicken/chickenrun.swg
index d4255c3..bb14b4b 100644
--- a/Lib/chicken/chickenrun.swg
+++ b/Lib/chicken/chickenrun.swg
@@ -7,7 +7,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
+#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__BORLANDC__) || defined(_WATCOM)
 # ifndef snprintf
 #  define snprintf _snprintf
 # endif
diff --git a/Lib/csharp/boost_intrusive_ptr.i b/Lib/csharp/boost_intrusive_ptr.i
index 6b0392d..fa3f53a 100644
--- a/Lib/csharp/boost_intrusive_ptr.i
+++ b/Lib/csharp/boost_intrusive_ptr.i
@@ -314,7 +314,7 @@
   }
 %}
 
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") TYPE {
+%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE {
     lock(this) {
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwnBase) {
@@ -323,11 +323,10 @@
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
-      global::System.GC.SuppressFinalize(this);
     }
   }
 
-%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE {
+%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE {
     lock(this) {
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwnDerived) {
@@ -336,8 +335,7 @@
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
-      global::System.GC.SuppressFinalize(this);
-      base.Dispose();
+      base.Dispose(disposing);
     }
   }
 
@@ -473,7 +471,7 @@
   }
 %}
 
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") TYPE {
+%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE {
     lock(this) {
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwnBase) {
@@ -482,11 +480,10 @@
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
-      global::System.GC.SuppressFinalize(this);
     }
   }
 
-%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE {
+%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE {
     lock(this) {
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwnDerived) {
@@ -495,8 +492,7 @@
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
-      global::System.GC.SuppressFinalize(this);
-      base.Dispose();
+      base.Dispose(disposing);
     }
   }
 
diff --git a/Lib/csharp/boost_shared_ptr.i b/Lib/csharp/boost_shared_ptr.i
index 73212dd..508c0ec 100644
--- a/Lib/csharp/boost_shared_ptr.i
+++ b/Lib/csharp/boost_shared_ptr.i
@@ -282,7 +282,7 @@
   }
 %}
 
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") TYPE {
+%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE {
     lock(this) {
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwnBase) {
@@ -291,11 +291,10 @@
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
-      global::System.GC.SuppressFinalize(this);
     }
   }
 
-%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE {
+%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") TYPE {
     lock(this) {
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwnDerived) {
@@ -304,8 +303,7 @@
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
-      global::System.GC.SuppressFinalize(this);
-      base.Dispose();
+      base.Dispose(disposing);
     }
   }
 
diff --git a/Lib/csharp/csharp.swg b/Lib/csharp/csharp.swg
index e1554dc..8322063 100644
--- a/Lib/csharp/csharp.swg
+++ b/Lib/csharp/csharp.swg
@@ -959,17 +959,24 @@
 SWIG_CSBODY_PROXY(internal, internal, SWIGTYPE)
 SWIG_CSBODY_TYPEWRAPPER(internal, protected, internal, SWIGTYPE)
 
-%typemap(csfinalize) SWIGTYPE %{
+%typemap(csdispose) SWIGTYPE %{
   ~$csclassname() {
-    Dispose();
+    Dispose(false);
+  }
+
+  public void Dispose() {
+    Dispose(true);
+    global::System.GC.SuppressFinalize(this);
   }
 %}
 
+%typemap(csdispose_derived) SWIGTYPE ""
+
 %typemap(csconstruct, excode=SWIGEXCODE,directorconnect="\n    SwigDirectorConnect();") SWIGTYPE %{: this($imcall, true) {$excode$directorconnect
   }
 %}
 
-%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") SWIGTYPE {
+%typemap(csdisposing, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE {
     lock(this) {
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwn) {
@@ -978,11 +985,10 @@
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
-      global::System.GC.SuppressFinalize(this);
     }
   }
 
-%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") SWIGTYPE {
+%typemap(csdisposing_derived, methodname="Dispose", methodmodifiers="protected", parameters="bool disposing") SWIGTYPE {
     lock(this) {
       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
         if (swigCMemOwn) {
@@ -991,8 +997,7 @@
         }
         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
       }
-      global::System.GC.SuppressFinalize(this);
-      base.Dispose();
+      base.Dispose(disposing);
     }
   }
 
diff --git a/Lib/csharp/csharphead.swg b/Lib/csharp/csharphead.swg
index 0b55635..7db4c0e 100644
--- a/Lib/csharp/csharphead.swg
+++ b/Lib/csharp/csharphead.swg
@@ -244,6 +244,7 @@
     [global::System.ThreadStatic]
     private static global::System.Exception pendingException = null;
     private static int numExceptionsPending = 0;
+    private static global::System.Object exceptionsLock = null;
 
     public static bool Pending {
       get {
@@ -259,7 +260,7 @@
       if (pendingException != null)
         throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e);
       pendingException = e;
-      lock(typeof($imclassname)) {
+      lock(exceptionsLock) {
         numExceptionsPending++;
       }
     }
@@ -270,13 +271,17 @@
         if (pendingException != null) {
           e = pendingException;
           pendingException = null;
-          lock(typeof($imclassname)) {
+          lock(exceptionsLock) {
             numExceptionsPending--;
           }
         }
       }
       return e;
     }
+
+    static SWIGPendingException() {
+      exceptionsLock = new global::System.Object();
+    }
   }
 %}
 #endif // SWIG_CSHARP_NO_EXCEPTION_HELPER
diff --git a/Lib/csharp/std_array.i b/Lib/csharp/std_array.i
index e7d392b..a4f0f96 100644
--- a/Lib/csharp/std_array.i
+++ b/Lib/csharp/std_array.i
@@ -192,9 +192,9 @@
         else
           throw std::out_of_range("index");
       }
-      void setitem(int index, const_reference value) throw (std::out_of_range) {
+      void setitem(int index, const_reference val) throw (std::out_of_range) {
         if (index>=0 && index<(int)$self->size())
-          (*$self)[index] = value;
+          (*$self)[index] = val;
         else
           throw std::out_of_range("index");
       }
diff --git a/Lib/csharp/std_list.i b/Lib/csharp/std_list.i
new file mode 100644
index 0000000..674aba0
--- /dev/null
+++ b/Lib/csharp/std_list.i
@@ -0,0 +1,519 @@
+/* -----------------------------------------------------------------------------
+ * std_list.i
+ *
+ * SWIG typemaps for std::list<T>
+ * C# implementation
+ * The C# wrapper is made to look and feel like a C# System.Collections.Generic.LinkedList<> collection.
+ *
+ * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with
+ * C++ std::list wrappers. The ICollection<> interface is also implemented to provide enhanced functionality
+ * whenever we are confident that the required C++ operator== is available. This is the case for when
+ * T is a primitive type or a pointer. If T does define an operator==, then use the SWIG_STD_LIST_ENHANCED
+ * macro to obtain this enhanced functionality, for example:
+ *
+ *   SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass)
+ *   %template(ListKlass) std::list<SomeNamespace::Klass>;
+ * ----------------------------------------------------------------------------- */
+
+%include <std_common.i>
+
+// MACRO for use within the std::list class body
+%define SWIG_STD_LIST_MINIMUM_INTERNAL(CSINTERFACE, CTYPE...)
+%typemap(csinterfaces) std::list< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n";
+
+%apply void *VOID_INT_PTR { std::list< CTYPE >::iterator * };
+
+%proxycode %{
+  public $csclassname(global::System.Collections.IEnumerable c) : this() {
+    if (c == null)
+      throw new global::System.ArgumentNullException("c");
+    foreach ($typemap(cstype, CTYPE) element in c) {
+      this.AddLast(element);
+    }
+  }
+
+  public bool IsReadOnly {
+    get {
+      return false;
+    }
+  }
+
+  public int Count {
+    get {
+      return (int)size();
+    }
+  }
+
+  public $csclassnameNode First {
+    get {
+      if (Count == 0)
+        return null;
+      return new $csclassnameNode(getFirstIter(), this);
+    }
+  }
+
+  public $csclassnameNode Last {
+    get {
+      if (Count == 0)
+        return null;
+      return new $csclassnameNode(getLastIter(), this);
+    }
+  }
+
+  public $csclassnameNode AddFirst($typemap(cstype, CTYPE) value) {
+    push_front(value);
+    return new $csclassnameNode(getFirstIter(), this);
+  }
+
+  public void AddFirst($csclassnameNode newNode) {
+    ValidateNewNode(newNode);
+    if (!newNode.inlist) {
+      push_front(newNode.csharpvalue);
+      newNode.iter = getFirstIter();
+      newNode.inlist = true;
+    } else {
+      throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name);
+    }
+  }
+
+  public $csclassnameNode AddLast($typemap(cstype, CTYPE) value) {
+    push_back(value);
+    return new $csclassnameNode(getLastIter(), this);
+  }
+
+  public void AddLast($csclassnameNode newNode) {
+    ValidateNewNode(newNode);
+    if (!newNode.inlist) {
+      push_back(newNode.csharpvalue);
+      newNode.iter = getLastIter();
+      newNode.inlist = true;
+    } else {
+      throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name);
+    }
+  }
+
+  public $csclassnameNode AddBefore($csclassnameNode node, $typemap(cstype, CTYPE) value) {
+    return new $csclassnameNode(insertNode(node.iter, value), this);
+  }
+
+  public void AddBefore($csclassnameNode node, $csclassnameNode newNode) {
+    ValidateNode(node);
+    ValidateNewNode(newNode);
+    if (!newNode.inlist) {
+      newNode.iter = insertNode(node.iter, newNode.csharpvalue);
+      newNode.inlist = true;
+    } else {
+      throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name);
+    }
+  }
+
+  public $csclassnameNode AddAfter($csclassnameNode node, $typemap(cstype, CTYPE) value) {
+    node = node.Next;
+    return new $csclassnameNode(insertNode(node.iter, value), this);
+  }
+
+  public void AddAfter($csclassnameNode node, $csclassnameNode newNode) {
+    ValidateNode(node);
+    ValidateNewNode(newNode);
+    if (!newNode.inlist) {
+      if (node == this.Last)
+        AddLast(newNode);
+      else
+      {
+        node = node.Next;
+        newNode.iter = insertNode(node.iter, newNode.csharpvalue);
+        newNode.inlist = true;
+      }
+    } else {
+      throw new global::System.InvalidOperationException("The " + newNode.GetType().Name + " node already belongs to a " + this.GetType().Name);
+    }
+  }
+
+  public void Add($typemap(cstype, CTYPE) value) {
+    AddLast(value);
+  }
+
+  public void Remove($csclassnameNode node) {
+    ValidateNode(node);
+    eraseIter(node.iter);
+  }
+
+  public void CopyTo($typemap(cstype, CTYPE)[] array, int index) {
+    if (array == null)
+      throw new global::System.ArgumentNullException("array");
+    if (index < 0 || index > array.Length)
+      throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
+    if (array.Rank > 1)
+      throw new global::System.ArgumentException("Multi dimensional array.", "array");
+    $csclassnameNode node = this.First;
+    if (node != null) {
+      do {
+        array[index++] = node.Value;
+        node = node.Next;
+      } while (node != null);
+    }
+  }
+
+  internal void ValidateNode($csclassnameNode node) {
+    if (node == null) {
+      throw new System.ArgumentNullException("node");
+    }
+    if (!node.inlist || node.list != this) {
+      throw new System.InvalidOperationException("node");
+    }
+  }
+
+  internal void ValidateNewNode($csclassnameNode node) {
+    if (node == null) {
+      throw new System.ArgumentNullException("node");
+    }
+  }
+
+  global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() {
+    return new $csclassnameEnumerator(this);
+  }
+
+  global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
+    return new $csclassnameEnumerator(this);
+  }
+
+  public $csclassnameEnumerator GetEnumerator() {
+    return new $csclassnameEnumerator(this);
+  }
+
+  public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator,
+    global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)>
+  {
+    private $csclassname collectionRef;
+    private $csclassnameNode currentNode;
+    private int currentIndex;
+    private object currentObject;
+    private int currentSize;
+
+    public $csclassnameEnumerator($csclassname collection) {
+      collectionRef = collection;
+      currentNode = collection.First;
+      currentIndex = 0;
+      currentObject = null;
+      currentSize = collectionRef.Count;
+    }
+
+    // Type-safe iterator Current
+    public $typemap(cstype, CTYPE) Current {
+      get {
+        if (currentIndex == -1)
+          throw new global::System.InvalidOperationException("Enumeration not started.");
+        if (currentIndex > currentSize)
+          throw new global::System.InvalidOperationException("Enumeration finished.");
+        if (currentObject == null)
+          throw new global::System.InvalidOperationException("Collection modified.");
+        return ($typemap(cstype, CTYPE))currentObject;
+      }
+    }
+
+    // Type-unsafe IEnumerator.Current
+    object global::System.Collections.IEnumerator.Current {
+      get {
+        return Current;
+      }
+    }
+
+    public bool MoveNext() {
+      if (currentNode == null) {
+        currentIndex = collectionRef.Count + 1;
+        return false;
+      }
+      ++currentIndex;
+      currentObject = currentNode.Value;
+      currentNode = currentNode.Next;
+      return true;
+    }
+
+    public void Reset() {
+      currentIndex = -1;
+      currentObject = null;
+      if (collectionRef.Count != currentSize) {
+        throw new global::System.InvalidOperationException("Collection modified.");
+      }
+    }
+
+    public void Dispose() {
+      currentIndex = -1;
+      currentObject = null;
+    }
+  }
+
+  public sealed class $csclassnameNode {
+    internal $csclassname list;
+    internal System.IntPtr iter;
+    internal $typemap(cstype, CTYPE) csharpvalue;
+    internal bool inlist;
+
+    public $csclassnameNode($typemap(cstype, CTYPE) value) {
+      csharpvalue = value;
+      inlist = false;
+    }
+
+    internal $csclassnameNode(System.IntPtr iter, $csclassname list) {
+      this.list = list;
+      this.iter = iter;
+      inlist = true;
+    }
+
+    public $csclassname List {
+      get {
+        return this.list;
+      }
+    }
+
+    public $csclassnameNode Next {
+      get {
+        if (list.getNextIter(iter) == System.IntPtr.Zero)
+          return null;
+        return new $csclassnameNode(list.getNextIter(iter), list);
+      }
+    }
+
+    public $csclassnameNode Previous {
+      get {
+        if (list.getPrevIter(iter) == System.IntPtr.Zero)
+          return null;
+        return new $csclassnameNode(list.getPrevIter(iter), list);
+      }
+    }
+
+    public $typemap(cstype, CTYPE) Value {
+      get {
+        return list.getItem(this.iter);
+      }
+      set {
+        list.setItem(this.iter, value);
+      }
+    }
+
+    public static bool operator==($csclassnameNode node1, $csclassnameNode node2) {
+      if (object.ReferenceEquals(node1, null) && object.ReferenceEquals(node2, null))
+        return true;
+      if (object.ReferenceEquals(node1, null) || object.ReferenceEquals(node2, null))
+        return false;
+      return node1.Equals(node2);
+    }
+
+    public static bool operator!=($csclassnameNode node1, $csclassnameNode node2) {
+      if (node1 == null && node2 == null)
+        return false;
+      if (node1 == null || node2 == null)
+        return true;
+      return !node1.Equals(node2);
+    }
+
+    public bool Equals($csclassnameNode node) {
+      if (node == null)
+        return false;
+      if (!node.inlist || !this.inlist)
+        return object.ReferenceEquals(this, node);
+      return list.equals(this.iter, node.iter);
+    }
+
+    public override bool Equals(object node) {
+      return Equals(($csclassnameNode)node);
+    }
+
+    public override int GetHashCode() {
+      int hash = 13;
+      if (inlist) {
+        hash = (hash * 7) + this.list.GetHashCode();
+        hash = (hash * 7) + this.Value.GetHashCode();
+        hash = (hash * 7) + this.list.getNextIter(this.iter).GetHashCode();
+        hash = (hash * 7) + this.list.getPrevIter(this.iter).GetHashCode();
+      } else {
+        hash = (hash * 7) + this.csharpvalue.GetHashCode();
+      }
+      return hash;
+    }
+
+    public void Dispose() {
+      list.deleteIter(this.iter);
+    }
+  }
+%}
+
+public:
+  typedef size_t size_type;
+  typedef ptrdiff_t difference_type;
+  typedef CTYPE value_type;
+  typedef value_type* pointer;
+  typedef const value_type* const_pointer;
+  typedef value_type& reference;
+  typedef const value_type& const_reference;
+
+  class iterator;
+
+  void push_front(CTYPE const& x);
+  void push_back(CTYPE const& x);
+  %rename(RemoveFirst) pop_front;
+  void pop_front();
+  %rename(RemoveLast) pop_back;
+  void pop_back();
+  size_type size() const;
+  %rename(Clear) clear;
+  void clear();
+  %extend {
+    const_reference getItem(iterator *iter) {
+      return **iter;
+    }
+
+    void setItem(iterator *iter, CTYPE const& val) {
+      *(*iter) = val;
+    }
+
+    iterator *getFirstIter() {
+      if ($self->size() == 0)
+        return NULL;
+      return new std::list< CTYPE >::iterator($self->begin());
+    }
+
+    iterator *getLastIter() {
+      if ($self->size() == 0)
+        return NULL;
+      return new std::list< CTYPE >::iterator(--$self->end());
+    }
+
+    iterator *getNextIter(iterator *iter) {
+      std::list< CTYPE >::iterator it = *iter;
+      if (std::distance(it, --$self->end()) != 0) {
+        std::list< CTYPE >::iterator* itnext = new std::list< CTYPE >::iterator(++it);
+        return itnext;
+      }
+      return NULL;
+    }
+
+    iterator *getPrevIter(iterator *iter) {
+      std::list< CTYPE >::iterator it = *iter;
+      if (std::distance($self->begin(), it) != 0) {
+        std::list< CTYPE >::iterator* itprev = new std::list< CTYPE >::iterator(--it);
+        return itprev;
+      }
+      return NULL;
+    }
+
+    iterator *insertNode(iterator *iter, CTYPE const& value) {
+      std::list< CTYPE >::iterator it = $self->insert(*iter, value);
+      return new std::list< CTYPE >::iterator(it);
+    }
+
+    void eraseIter(iterator *iter) {
+      std::list< CTYPE >::iterator it = *iter;
+      $self->erase(it);
+    }
+
+    void deleteIter(iterator *iter) {
+      delete iter;
+    }
+
+    bool equals(iterator *iter1, iterator *iter2) {
+      if (iter1 == NULL && iter2 == NULL)
+        return true;
+      std::list< CTYPE >::iterator it1 = *iter1;
+      std::list< CTYPE >::iterator it2 = *iter2;
+      return it1 == it2;
+    }
+  }
+%enddef
+
+// Extra methods added to the collection class if operator== is defined for the class being wrapped
+// The class will then implement ICollection<>, which adds extra functionality
+%define SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE...)
+  %extend {
+    bool Contains(CTYPE const& value) {
+      return std::find($self->begin(), $self->end(), value) != $self->end();
+    }
+
+    bool Remove(CTYPE const& value) {
+      std::list< CTYPE >::iterator it = std::find($self->begin(), $self->end(), value);
+      if (it != $self->end()) {
+        $self->erase(it);
+        return true;
+      }
+      return false;
+    }
+
+    iterator *find(CTYPE const& value) {
+      if (std::find($self->begin(), $self->end(), value) != $self->end()) {
+        return new std::list< CTYPE >::iterator(std::find($self->begin(), $self->end(), value));
+      }
+      return NULL;
+    }
+  }
+%proxycode %{
+  public $csclassnameNode Find($typemap(cstype, CTYPE) value) {
+    System.IntPtr tmp = find(value);
+    if (tmp != System.IntPtr.Zero) {
+      return new $csclassnameNode(tmp, this);
+    }
+    return null;
+  }
+%}
+%enddef
+
+// Macros for std::list class specializations/enhancements
+%define SWIG_STD_LIST_ENHANCED(CTYPE...)
+namespace std {
+  template<> class list< CTYPE > {
+    SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, %arg(CTYPE));
+    SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(CTYPE)
+  };
+}
+%enddef
+
+
+%{
+#include <list>
+#include <algorithm>
+#include <stdexcept>
+%}
+
+%csmethodmodifiers std::list::size "private"
+%csmethodmodifiers std::list::getItem "private"
+%csmethodmodifiers std::list::setItem "private"
+%csmethodmodifiers std::list::push_front "private"
+%csmethodmodifiers std::list::push_back "private"
+%csmethodmodifiers std::list::getFirstIter "private"
+%csmethodmodifiers std::list::getNextIter "private"
+%csmethodmodifiers std::list::getPrevIter "private"
+%csmethodmodifiers std::list::getLastIter "private"
+%csmethodmodifiers std::list::find "private"
+%csmethodmodifiers std::list::deleteIter "private"
+
+namespace std {
+  // primary (unspecialized) class template for std::list
+  // does not require operator== to be defined
+  template<class T>
+  class list {
+    SWIG_STD_LIST_MINIMUM_INTERNAL(IEnumerable, T)
+  };
+  // specialization for pointers
+  template<class T>
+  class list<T *> {
+    SWIG_STD_LIST_MINIMUM_INTERNAL(ICollection, T *)
+    SWIG_STD_LIST_EXTRA_OP_EQUALS_EQUALS(T *)
+  };
+}
+
+// template specializations for std::list
+// these provide extra collections methods as operator== is defined
+SWIG_STD_LIST_ENHANCED(char)
+SWIG_STD_LIST_ENHANCED(signed char)
+SWIG_STD_LIST_ENHANCED(unsigned char)
+SWIG_STD_LIST_ENHANCED(short)
+SWIG_STD_LIST_ENHANCED(unsigned short)
+SWIG_STD_LIST_ENHANCED(int)
+SWIG_STD_LIST_ENHANCED(unsigned int)
+SWIG_STD_LIST_ENHANCED(long)
+SWIG_STD_LIST_ENHANCED(unsigned long)
+SWIG_STD_LIST_ENHANCED(long long)
+SWIG_STD_LIST_ENHANCED(unsigned long long)
+SWIG_STD_LIST_ENHANCED(float)
+SWIG_STD_LIST_ENHANCED(double)
+SWIG_STD_LIST_ENHANCED(std::string) // also requires a %include <std_string.i>
+SWIG_STD_LIST_ENHANCED(std::wstring) // also requires a %include <std_wstring.i>
diff --git a/Lib/csharp/std_set.i b/Lib/csharp/std_set.i
new file mode 100644
index 0000000..3b2492e
--- /dev/null
+++ b/Lib/csharp/std_set.i
@@ -0,0 +1,311 @@
+/* -----------------------------------------------------------------------------
+ * std_set.i
+ *
+ * SWIG typemaps for std::set<T>.
+ *
+ * Note that ISet<> used here requires .NET 4 or later.
+ *
+ * The C# wrapper implements ISet<> interface and shares performance
+ * characteristics of C# System.Collections.Generic.SortedSet<> class, but
+ * doesn't provide quite all of its methods.
+ * ----------------------------------------------------------------------------- */
+
+%{
+#include <set>
+#include <algorithm>
+#include <stdexcept>
+%}
+
+%csmethodmodifiers std::set::size "private"
+%csmethodmodifiers std::set::getitem "private"
+%csmethodmodifiers std::set::create_iterator_begin "private"
+%csmethodmodifiers std::set::get_next "private"
+%csmethodmodifiers std::set::destroy_iterator "private"
+
+namespace std {
+
+// TODO: Add support for comparator and allocator template parameters.
+template <class T>
+class set {
+
+%typemap(csinterfaces) std::set<T> "global::System.IDisposable, global::System.Collections.Generic.ISet<$typemap(cstype, T)>\n";
+%proxycode %{
+  void global::System.Collections.Generic.ICollection<$typemap(cstype, T)>.Add(string item) {
+      ((global::System.Collections.Generic.ISet<$typemap(cstype, T)>)this).Add(item);
+  }
+
+  public bool TryGetValue($typemap(cstype, T) equalValue, out $typemap(cstype, T) actualValue) {
+    try {
+      actualValue = getitem(equalValue);
+      return true;
+    } catch {
+      actualValue = default($typemap(cstype, T));
+      return false;
+    }
+  }
+
+  public int Count {
+    get {
+      return (int)size();
+    }
+  }
+
+  public bool IsReadOnly {
+    get {
+      return false;
+    }
+  }
+
+  public void CopyTo($typemap(cstype, T)[] array) {
+    CopyTo(array, 0);
+  }
+
+  public void CopyTo($typemap(cstype, T)[] array, int arrayIndex) {
+    if (array == null)
+      throw new global::System.ArgumentNullException("array");
+    if (arrayIndex < 0)
+      throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
+    if (array.Rank > 1)
+      throw new global::System.ArgumentException("Multi dimensional array.", "array");
+    if (arrayIndex+this.Count > array.Length)
+      throw new global::System.ArgumentException("Number of elements to copy is too large.");
+
+    foreach ($typemap(cstype, T) item in this) {
+      array.SetValue(item, arrayIndex++);
+    }
+  }
+
+  public void ExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    foreach ($typemap(cstype, T) item in other) {
+      Remove(item);
+    }
+  }
+
+  public void IntersectWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    $csclassname old = new $csclassname(this);
+
+    Clear();
+    foreach ($typemap(cstype, T) item in other) {
+      if (old.Contains(item))
+        Add(item);
+    }
+  }
+
+  private static int count_enum(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    int count = 0;
+    foreach ($typemap(cstype, T) item in other) {
+      count++;
+    }
+
+    return count;
+  }
+
+  public bool IsProperSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    return IsSubsetOf(other) && Count < count_enum(other);
+  }
+
+  public bool IsProperSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    return IsSupersetOf(other) && Count > count_enum(other);
+  }
+
+  public bool IsSubsetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    int countContained = 0;
+
+    foreach ($typemap(cstype, T) item in other) {
+      if (Contains(item))
+        countContained++;
+    }
+
+    return countContained == Count;
+  }
+
+  public bool IsSupersetOf(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    foreach ($typemap(cstype, T) item in other) {
+      if (!Contains(item))
+        return false;
+    }
+
+    return true;
+  }
+
+  public bool Overlaps(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    foreach ($typemap(cstype, T) item in other) {
+      if (Contains(item))
+        return true;
+    }
+
+    return false;
+  }
+
+  public bool SetEquals(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    return IsSupersetOf(other) && Count == count_enum(other);
+  }
+
+  public void SymmetricExceptWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    foreach ($typemap(cstype, T) item in other) {
+      if (!Remove(item))
+        Add(item);
+    }
+  }
+
+  public void UnionWith(global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)> other) {
+    foreach ($typemap(cstype, T) item in other) {
+      Add(item);
+    }
+  }
+
+  private global::System.Collections.Generic.ICollection<$typemap(cstype, T)> Items {
+    get {
+      global::System.Collections.Generic.ICollection<$typemap(cstype, T)> items = new global::System.Collections.Generic.List<$typemap(cstype, T)>();
+      int size = this.Count;
+      if (size > 0) {
+        global::System.IntPtr iter = create_iterator_begin();
+        for (int i = 0; i < size; i++) {
+          items.Add(get_next(iter));
+        }
+        destroy_iterator(iter);
+      }
+      return items;
+    }
+  }
+
+  global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, T)>.GetEnumerator() {
+    return new $csclassnameEnumerator(this);
+  }
+
+  global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
+    return new $csclassnameEnumerator(this);
+  }
+
+  public $csclassnameEnumerator GetEnumerator() {
+    return new $csclassnameEnumerator(this);
+  }
+
+  // Type-safe enumerator
+  /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
+  /// whenever the collection is modified. This has been done for changes in the size of the
+  /// collection but not when one of the elements of the collection is modified as it is a bit
+  /// tricky to detect unmanaged code that modifies the collection under our feet.
+  public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator,
+      global::System.Collections.Generic.IEnumerator<$typemap(cstype, T)>
+  {
+    private $csclassname collectionRef;
+    private global::System.Collections.Generic.IList<$typemap(cstype, T)> ItemsCollection;
+    private int currentIndex;
+    private $typemap(cstype, T) currentObject;
+    private int currentSize;
+
+    public $csclassnameEnumerator($csclassname collection) {
+      collectionRef = collection;
+      ItemsCollection = new global::System.Collections.Generic.List<$typemap(cstype, T)>(collection.Items);
+      currentIndex = -1;
+      currentObject = null;
+      currentSize = collectionRef.Count;
+    }
+
+    // Type-safe iterator Current
+    public $typemap(cstype, T) Current {
+      get {
+        if (currentIndex == -1)
+          throw new global::System.InvalidOperationException("Enumeration not started.");
+        if (currentIndex > currentSize - 1)
+          throw new global::System.InvalidOperationException("Enumeration finished.");
+        if (currentObject == null)
+          throw new global::System.InvalidOperationException("Collection modified.");
+        return currentObject;
+      }
+    }
+
+    // Type-unsafe IEnumerator.Current
+    object global::System.Collections.IEnumerator.Current {
+      get {
+        return Current;
+      }
+    }
+
+    public bool MoveNext() {
+      int size = collectionRef.Count;
+      bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
+      if (moveOkay) {
+        currentIndex++;
+        currentObject = ItemsCollection[currentIndex];
+      } else {
+        currentObject = null;
+      }
+      return moveOkay;
+    }
+
+    public void Reset() {
+      currentIndex = -1;
+      currentObject = null;
+      if (collectionRef.Count != currentSize) {
+        throw new global::System.InvalidOperationException("Collection modified.");
+      }
+    }
+
+    public void Dispose() {
+      currentIndex = -1;
+      currentObject = null;
+    }
+  }
+
+%}
+
+  public:
+    typedef size_t size_type;
+    typedef ptrdiff_t difference_type;
+    typedef T key_type;
+    typedef T value_type;
+    typedef value_type* pointer;
+    typedef const value_type* const_pointer;
+    typedef value_type& reference;
+    typedef const value_type& const_reference;
+
+    set();
+    set(const set& other);
+    size_type size() const;
+    bool empty() const;
+    %rename(Clear) clear;
+    void clear();
+    %extend {
+      bool Add(const value_type& item) {
+        return $self->insert(item).second;
+      }
+
+      bool Contains(const value_type& item) {
+        return $self->count(item) != 0;
+      }
+
+      bool Remove(const value_type& item) {
+        return $self->erase(item) != 0;
+      }
+
+      const value_type& getitem(const value_type& item) throw (std::out_of_range) {
+        std::set<T>::iterator iter = $self->find(item);
+        if (iter == $self->end())
+          throw std::out_of_range("item not found");
+
+        return *iter;
+      }
+
+      // create_iterator_begin(), get_next() and destroy_iterator work together to provide a collection of items to C#
+      %apply void *VOID_INT_PTR { std::set<T>::iterator *create_iterator_begin }
+      %apply void *VOID_INT_PTR { std::set<T>::iterator *swigiterator }
+
+      std::set<T>::iterator *create_iterator_begin() {
+        return new std::set<T>::iterator($self->begin());
+      }
+
+      const key_type& get_next(std::set<T>::iterator *swigiterator) {
+        std::set<T>::iterator iter = *swigiterator;
+        (*swigiterator)++;
+        return *iter;
+      }
+
+      void destroy_iterator(std::set<T>::iterator *swigiterator) {
+        delete swigiterator;
+      }
+    }
+};
+
+}
diff --git a/Lib/csharp/std_vector.i b/Lib/csharp/std_vector.i
index b1e8da9..e281129 100644
--- a/Lib/csharp/std_vector.i
+++ b/Lib/csharp/std_vector.i
@@ -13,18 +13,13 @@
  *
  *   SWIG_STD_VECTOR_ENHANCED(SomeNamespace::Klass)
  *   %template(VectKlass) std::vector<SomeNamespace::Klass>;
- *
- * Warning: heavy macro usage in this file. Use swig -E to get a sane view on the real file contents!
  * ----------------------------------------------------------------------------- */
 
-// Warning: Use the typemaps here in the expectation that the macros they are in will change name.
-
-
 %include <std_common.i>
 
 // MACRO for use within the std::vector class body
 %define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CSINTERFACE, CONST_REFERENCE, CTYPE...)
-%typemap(csinterfaces) std::vector< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable\n    , global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n";
+%typemap(csinterfaces) std::vector< CTYPE > "global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n";
 %proxycode %{
   public $csclassname(global::System.Collections.IEnumerable c) : this() {
     if (c == null)
@@ -244,9 +239,9 @@
         else
           throw std::out_of_range("index");
       }
-      void setitem(int index, CTYPE const& value) throw (std::out_of_range) {
+      void setitem(int index, CTYPE const& val) throw (std::out_of_range) {
         if (index>=0 && index<(int)$self->size())
-          (*$self)[index] = value;
+          (*$self)[index] = val;
         else
           throw std::out_of_range("index");
       }
@@ -356,7 +351,7 @@
 %define SWIG_STD_VECTOR_ENHANCED(CTYPE...)
 namespace std {
   template<> class vector< CTYPE > {
-    SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, %arg(CTYPE const&), %arg(CTYPE))
+    SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, %arg(CTYPE))
     SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE)
   };
 }
@@ -389,11 +384,11 @@
   // primary (unspecialized) class template for std::vector
   // does not require operator== to be defined
   template<class T> class vector {
-    SWIG_STD_VECTOR_MINIMUM_INTERNAL(IEnumerable, T const&, T)
+    SWIG_STD_VECTOR_MINIMUM_INTERNAL(IEnumerable, const value_type&, T)
   };
   // specialization for pointers
   template<class T> class vector<T *> {
-    SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, T *const&, T *)
+    SWIG_STD_VECTOR_MINIMUM_INTERNAL(IList, const value_type&, T *)
     SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *)
   };
   // bool is specialized in the C++ standard - const_reference in particular
diff --git a/Lib/d/dclassgen.swg b/Lib/d/dclassgen.swg
index 68910b4..84fa03a 100644
--- a/Lib/d/dclassgen.swg
+++ b/Lib/d/dclassgen.swg
@@ -33,7 +33,7 @@
 // We do not use »override« attribute for generated dispose() methods to stay
 // somewhat compatible to Phobos and older Tango versions where Object.dispose()
 // does not exist.
-%typemap(ddispose, methodname="dispose", methodmodifiers="public") SWIGTYPE {
+%typemap(ddispose, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE {
   synchronized(this) {
     if (swigCPtr !is null) {
       if (swigCMemOwn) {
@@ -45,7 +45,7 @@
   }
 }
 
-%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public") SWIGTYPE {
+%typemap(ddispose_derived, methodname="dispose", methodmodifiers="public", parameters="") SWIGTYPE {
   synchronized(this) {
     if (swigCPtr !is null) {
       if (swigCMemOwn) {
diff --git a/Lib/d/std_vector.i b/Lib/d/std_vector.i
index 9dcb184..fb8f7d2 100644
--- a/Lib/d/std_vector.i
+++ b/Lib/d/std_vector.i
@@ -135,7 +135,7 @@
         return $self->capacity() - $self->size();
       }
 
-      CONST_REFERENCE remove() throw (std::out_of_range) {
+      const_reference remove() throw (std::out_of_range) {
         if ($self->empty()) {
           throw std::out_of_range("Tried to remove last element from empty vector.");
         }
@@ -145,7 +145,7 @@
         return value;
       }
 
-      CONST_REFERENCE remove(size_type index) throw (std::out_of_range) {
+      const_reference remove(size_type index) throw (std::out_of_range) {
         if (index >= $self->size()) {
           throw std::out_of_range("Tried to remove element with invalid index.");
         }
@@ -160,7 +160,7 @@
     // Wrappers for setting/getting items with the possibly thrown exception
     // specified (important for SWIG wrapper generation).
     %extend {
-      CONST_REFERENCE getElement(size_type index) throw (std::out_of_range) {
+      const_reference getElement(size_type index) throw (std::out_of_range) {
         if ((index < 0) || ($self->size() <= index)) {
           throw std::out_of_range("Tried to get value of element with invalid index.");
         }
@@ -172,11 +172,11 @@
     // generation issue when using const pointers as vector elements (like
     // std::vector< const int* >).
     %extend {
-      void setElement(size_type index, CTYPE const& value) throw (std::out_of_range) {
+      void setElement(size_type index, CTYPE const& val) throw (std::out_of_range) {
         if ((index < 0) || ($self->size() <= index)) {
           throw std::out_of_range("Tried to set value of element with invalid index.");
         }
-        (*$self)[index] = value;
+        (*$self)[index] = val;
       }
     }
 
@@ -478,7 +478,7 @@
         return pv;
       }
 
-      CONST_REFERENCE remove() throw (std::out_of_range) {
+      const_reference remove() throw (std::out_of_range) {
         if ($self->empty()) {
           throw std::out_of_range("Tried to remove last element from empty vector.");
         }
@@ -488,7 +488,7 @@
         return value;
       }
 
-      CONST_REFERENCE remove(size_type index) throw (std::out_of_range) {
+      const_reference remove(size_type index) throw (std::out_of_range) {
         if (index >= $self->size()) {
           throw std::out_of_range("Tried to remove element with invalid index.");
         }
@@ -520,7 +520,7 @@
     // Wrappers for setting/getting items with the possibly thrown exception
     // specified (important for SWIG wrapper generation).
     %extend {
-      CONST_REFERENCE getElement(size_type index) throw (std::out_of_range) {
+      const_reference getElement(size_type index) throw (std::out_of_range) {
         if ((index < 0) || ($self->size() <= index)) {
           throw std::out_of_range("Tried to get value of element with invalid index.");
         }
@@ -531,11 +531,11 @@
     // generation issue when using const pointers as vector elements (like
     // std::vector< const int* >).
     %extend {
-      void setElement(size_type index, CTYPE const& value) throw (std::out_of_range) {
+      void setElement(size_type index, CTYPE const& val) throw (std::out_of_range) {
         if ((index < 0) || ($self->size() <= index)) {
           throw std::out_of_range("Tried to set value of element with invalid index.");
         }
-        (*$self)[index] = value;
+        (*$self)[index] = val;
       }
     }
 
@@ -558,7 +558,7 @@
 %define SWIG_STD_VECTOR_ENHANCED(CTYPE...)
 namespace std {
   template<> class vector<CTYPE > {
-    SWIG_STD_VECTOR_MINIMUM_INTERNAL(%arg(CTYPE const&), %arg(CTYPE))
+    SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, %arg(CTYPE))
     SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(CTYPE)
   };
 }
@@ -573,11 +573,11 @@
   // primary (unspecialized) class template for std::vector
   // does not require operator== to be defined
   template<class T> class vector {
-    SWIG_STD_VECTOR_MINIMUM_INTERNAL(T const&, T)
+    SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T)
   };
   // specializations for pointers
   template<class T> class vector<T *> {
-    SWIG_STD_VECTOR_MINIMUM_INTERNAL(T *const&, T *)
+    SWIG_STD_VECTOR_MINIMUM_INTERNAL(const value_type&, T *)
     SWIG_STD_VECTOR_EXTRA_OP_EQUALS_EQUALS(T *)
   };
   // bool is a bit different in the C++ standard - const_reference in particular
diff --git a/Lib/java/java.swg b/Lib/java/java.swg
index 19e597b..e930933 100644
--- a/Lib/java/java.swg
+++ b/Lib/java/java.swg
@@ -160,7 +160,7 @@
 %typemap(jtype) jfloat        "float"
 %typemap(jtype) jdouble       "double"
 %typemap(jtype) jstring       "String"
-%typemap(jtype) jobject       "Object"
+%typemap(jtype) jobject       "java.lang.Object"
 %typemap(jtype) jbooleanArray "boolean[]"
 %typemap(jtype) jcharArray    "char[]"
 %typemap(jtype) jbyteArray    "byte[]"
@@ -169,7 +169,7 @@
 %typemap(jtype) jlongArray    "long[]"
 %typemap(jtype) jfloatArray   "float[]"
 %typemap(jtype) jdoubleArray  "double[]"
-%typemap(jtype) jobjectArray  "Object[]"
+%typemap(jtype) jobjectArray  "java.lang.Object[]"
 
 %typemap(jstype) jboolean      "boolean"
 %typemap(jstype) jchar         "char"
@@ -180,7 +180,7 @@
 %typemap(jstype) jfloat        "float"
 %typemap(jstype) jdouble       "double"
 %typemap(jstype) jstring       "String"
-%typemap(jstype) jobject       "Object"
+%typemap(jstype) jobject       "java.lang.Object"
 %typemap(jstype) jbooleanArray "boolean[]"
 %typemap(jstype) jcharArray    "char[]"
 %typemap(jstype) jbyteArray    "byte[]"
@@ -189,7 +189,7 @@
 %typemap(jstype) jlongArray    "long[]"
 %typemap(jstype) jfloatArray   "float[]"
 %typemap(jstype) jdoubleArray  "double[]"
-%typemap(jstype) jobjectArray  "Object[]"
+%typemap(jstype) jobjectArray  "java.lang.Object[]"
 
 /* Non primitive types */
 %typemap(jni) SWIGTYPE "jlong"
@@ -1273,6 +1273,7 @@
 SWIG_JAVABODY_TYPEWRAPPER(protected, protected, protected, SWIGTYPE)
 
 %typemap(javafinalize) SWIGTYPE %{
+  @SuppressWarnings("deprecation")
   protected void finalize() {
     delete();
   }
@@ -1312,7 +1313,7 @@
 // Set the default for SWIGTYPE: Java owns the C/C++ object.
 SWIG_PROXY_CONSTRUCTOR(true, true, SWIGTYPE)
 
-%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE {
+%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE {
     if (swigCPtr != 0) {
       if (swigCMemOwn) {
         swigCMemOwn = false;
@@ -1322,7 +1323,7 @@
     }
   }
 
-%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized") SWIGTYPE {
+%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized", parameters="") SWIGTYPE {
     if (swigCPtr != 0) {
       if (swigCMemOwn) {
         swigCMemOwn = false;
@@ -1382,12 +1383,12 @@
 %apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
 
 /* String & length */
-%typemap(jni)     (char *STRING, size_t LENGTH) "jbyteArray"
-%typemap(jtype)   (char *STRING, size_t LENGTH) "byte[]"
-%typemap(jstype)  (char *STRING, size_t LENGTH) "byte[]"
-%typemap(javain)  (char *STRING, size_t LENGTH) "$javainput"
-%typemap(freearg) (char *STRING, size_t LENGTH) ""
-%typemap(in)      (char *STRING, size_t LENGTH) {
+%typemap(jni)     (const char *STRING, size_t LENGTH) "jbyteArray"
+%typemap(jtype)   (const char *STRING, size_t LENGTH) "byte[]"
+%typemap(jstype)  (const char *STRING, size_t LENGTH) "byte[]"
+%typemap(javain)  (const char *STRING, size_t LENGTH) "$javainput"
+%typemap(freearg) (const char *STRING, size_t LENGTH) ""
+%typemap(in)      (const char *STRING, size_t LENGTH) {
   if ($input) {
     $1 = ($1_ltype) JCALL2(GetByteArrayElements, jenv, $input, 0);
     $2 = ($2_type) JCALL1(GetArrayLength, jenv, $input);
@@ -1396,10 +1397,10 @@
     $2 = 0;
   }
 }
-%typemap(argout)  (char *STRING, size_t LENGTH) {
-  if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
+%typemap(argout)  (const char *STRING, size_t LENGTH) {
+  if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, JNI_ABORT);
 }
-%typemap(directorin, descriptor="[B", noblock=1) (char *STRING, size_t LENGTH) {
+%typemap(directorin, descriptor="[B", noblock=1) (const char *STRING, size_t LENGTH) {
   $input = 0;
   if ($1) {
     $input = JCALL1(NewByteArray, jenv, (jsize)$2);
@@ -1408,9 +1409,14 @@
   }
   Swig::LocalRefGuard $1_refguard(jenv, $input);
 }
+%typemap(javadirectorin, descriptor="[B") (const char *STRING, size_t LENGTH) "$jniinput"
+%apply (const char *STRING, size_t LENGTH) { (char *STRING, size_t LENGTH) }
+/* Enable write-back for non-const version */
+%typemap(argout)  (char *STRING, size_t LENGTH) {
+  if ($input) JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
+}
 %typemap(directorargout, noblock=1) (char *STRING, size_t LENGTH)
 { if ($input && $1) JCALL4(GetByteArrayRegion, jenv, $input, 0, (jsize)$2, (jbyte *)$1); }
-%typemap(javadirectorin, descriptor="[B") (char *STRING, size_t LENGTH) "$jniinput"
 %apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) }
 
 /* java keywords */
diff --git a/Lib/java/std_array.i b/Lib/java/std_array.i
index f67b18d..d3436cc 100644
--- a/Lib/java/std_array.i
+++ b/Lib/java/std_array.i
@@ -31,10 +31,10 @@
         else
           throw std::out_of_range("array index out of range");
       }
-      void set(int i, const value_type& value) throw (std::out_of_range) {
+      void set(int i, const value_type& val) throw (std::out_of_range) {
         int size = int(self->size());
         if (i>=0 && i<size)
-          (*self)[i] = value;
+          (*self)[i] = val;
         else
           throw std::out_of_range("array index out of range");
       }
diff --git a/Lib/java/std_list.i b/Lib/java/std_list.i
index 3ad6511..1077bd0 100644
--- a/Lib/java/std_list.i
+++ b/Lib/java/std_list.i
@@ -43,7 +43,7 @@
     this();
     java.util.ListIterator<$typemap(jboxtype, T)> it = listIterator(0);
     // Special case the "copy constructor" here to avoid lots of cross-language calls
-    for (Object o : c) {
+    for (java.lang.Object o : c) {
       it.add(($typemap(jboxtype, T))o);
     }
   }
@@ -198,11 +198,6 @@
 
     %extend {
       %fragment("SWIG_ListSize");
-      list(jint count) throw (std::out_of_range) {
-        if (count < 0)
-          throw std::out_of_range("list count must be positive");
-        return new std::list<T>(static_cast<std::list<T>::size_type>(count));
-      }
 
       list(jint count, const T &value) throw (std::out_of_range) {
         if (count < 0)
diff --git a/Lib/java/std_map.i b/Lib/java/std_map.i
index 4b891e7..6d5ca1a 100644
--- a/Lib/java/std_map.i
+++ b/Lib/java/std_map.i
@@ -57,7 +57,7 @@
     return sizeImpl();
   }
 
-  public boolean containsKey(Object key) {
+  public boolean containsKey(java.lang.Object key) {
     if (!(key instanceof $typemap(jboxtype, K))) {
       return false;
     }
@@ -65,7 +65,7 @@
     return containsImpl(($typemap(jboxtype, K))key);
   }
 
-  public $typemap(jboxtype, T) get(Object key) {
+  public $typemap(jboxtype, T) get(java.lang.Object key) {
     if (!(key instanceof $typemap(jboxtype, K))) {
       return null;
     }
@@ -90,7 +90,7 @@
     }
   }
 
-  public $typemap(jboxtype, T) remove(Object key) {
+  public $typemap(jboxtype, T) remove(java.lang.Object key) {
     if (!(key instanceof $typemap(jboxtype, K))) {
       return null;
     }
diff --git a/Lib/java/std_set.i b/Lib/java/std_set.i
index 06c5a63..04658f7 100644
--- a/Lib/java/std_set.i
+++ b/Lib/java/std_set.i
@@ -59,7 +59,7 @@
 
   public boolean addAll(java.util.Collection<? extends $typemap(jboxtype, T)> collection) {
     boolean didAddElement = false;
-    for (Object object : collection) {
+    for (java.lang.Object object : collection) {
       didAddElement |= add(($typemap(jboxtype, T))object);
     }
 
@@ -96,7 +96,7 @@
   }
 
   public boolean containsAll(java.util.Collection<?> collection) {
-    for (Object object : collection) {
+    for (java.lang.Object object : collection) {
       if (!contains(object)) {
         return false;
       }
@@ -105,7 +105,7 @@
     return true;
   }
 
-  public boolean contains(Object object) {
+  public boolean contains(java.lang.Object object) {
     if (!(object instanceof $typemap(jboxtype, T))) {
       return false;
     }
@@ -115,14 +115,14 @@
 
   public boolean removeAll(java.util.Collection<?> collection) {
     boolean didRemoveElement = false;
-    for (Object object : collection) {
+    for (java.lang.Object object : collection) {
       didRemoveElement |= remove(object);
     }
 
     return didRemoveElement;
   }
 
-  public boolean remove(Object object) {
+  public boolean remove(java.lang.Object object) {
     if (!(object instanceof $typemap(jboxtype, T))) {
       return false;
     }
@@ -152,8 +152,8 @@
 
     typedef size_t size_type;
     typedef ptrdiff_t difference_type;
-    typedef T value_type;
     typedef T key_type;
+    typedef T value_type;
     typedef value_type* pointer;
     typedef const value_type* const_pointer;
     typedef value_type& reference;
diff --git a/Lib/java/std_unordered_map.i b/Lib/java/std_unordered_map.i
index 8f62d72..283a9b4 100644
--- a/Lib/java/std_unordered_map.i
+++ b/Lib/java/std_unordered_map.i
@@ -57,7 +57,7 @@
     return sizeImpl();
   }
 
-  public boolean containsKey(Object key) {
+  public boolean containsKey(java.lang.Object key) {
     if (!(key instanceof $typemap(jboxtype, K))) {
       return false;
     }
@@ -65,7 +65,7 @@
     return containsImpl(($typemap(jboxtype, K))key);
   }
 
-  public $typemap(jboxtype, T) get(Object key) {
+  public $typemap(jboxtype, T) get(java.lang.Object key) {
     if (!(key instanceof $typemap(jboxtype, K))) {
       return null;
     }
@@ -90,7 +90,7 @@
     }
   }
 
-  public $typemap(jboxtype, T) remove(Object key) {
+  public $typemap(jboxtype, T) remove(java.lang.Object key) {
     if (!(key instanceof $typemap(jboxtype, K))) {
       return null;
     }
diff --git a/Lib/java/std_unordered_set.i b/Lib/java/std_unordered_set.i
index cdc116e..59726e9 100644
--- a/Lib/java/std_unordered_set.i
+++ b/Lib/java/std_unordered_set.i
@@ -43,12 +43,12 @@
 
 namespace std {
 
-template <class T>
+template <class Key>
 class unordered_set {
 
-%typemap(javabase) std::unordered_set<T> "java.util.AbstractSet<$typemap(jboxtype, T)>"
+%typemap(javabase) std::unordered_set<Key> "java.util.AbstractSet<$typemap(jboxtype, Key)>"
 %proxycode %{
-  public $javaclassname(java.util.Collection<? extends $typemap(jboxtype, T)> collection) {
+  public $javaclassname(java.util.Collection<? extends $typemap(jboxtype, Key)> collection) {
     this();
     addAll(collection);
   }
@@ -57,34 +57,34 @@
     return sizeImpl();
   }
 
-  public boolean addAll(java.util.Collection<? extends $typemap(jboxtype, T)> collection) {
+  public boolean addAll(java.util.Collection<? extends $typemap(jboxtype, Key)> collection) {
     boolean didAddElement = false;
-    for (Object object : collection) {
-      didAddElement |= add(($typemap(jboxtype, T))object);
+    for (java.lang.Object object : collection) {
+      didAddElement |= add(($typemap(jboxtype, Key))object);
     }
 
     return didAddElement;
   }
 
-  public java.util.Iterator<$typemap(jboxtype, T)> iterator() {
-    return new java.util.Iterator<$typemap(jboxtype, T)>() {
+  public java.util.Iterator<$typemap(jboxtype, Key)> iterator() {
+    return new java.util.Iterator<$typemap(jboxtype, Key)>() {
       private Iterator curr;
       private Iterator end;
 
-      private java.util.Iterator<$typemap(jboxtype, T)> init() {
+      private java.util.Iterator<$typemap(jboxtype, Key)> init() {
         curr = $javaclassname.this.begin();
         end = $javaclassname.this.end();
         return this;
       }
 
-      public $typemap(jboxtype, T) next() {
+      public $typemap(jboxtype, Key) next() {
         if (!hasNext()) {
           throw new java.util.NoSuchElementException();
         }
 
         // Save the current position, increment it,
         // then return the value at the position before the increment.
-        final $typemap(jboxtype, T) currValue = curr.derefUnchecked();
+        final $typemap(jboxtype, Key) currValue = curr.derefUnchecked();
         curr.incrementUnchecked();
         return currValue;
       }
@@ -96,7 +96,7 @@
   }
 
   public boolean containsAll(java.util.Collection<?> collection) {
-    for (Object object : collection) {
+    for (java.lang.Object object : collection) {
       if (!contains(object)) {
         return false;
       }
@@ -105,29 +105,29 @@
     return true;
   }
 
-  public boolean contains(Object object) {
-    if (!(object instanceof $typemap(jboxtype, T))) {
+  public boolean contains(java.lang.Object object) {
+    if (!(object instanceof $typemap(jboxtype, Key))) {
       return false;
     }
 
-    return containsImpl(($typemap(jboxtype, T))object);
+    return containsImpl(($typemap(jboxtype, Key))object);
   }
 
   public boolean removeAll(java.util.Collection<?> collection) {
     boolean didRemoveElement = false;
-    for (Object object : collection) {
+    for (java.lang.Object object : collection) {
       didRemoveElement |= remove(object);
     }
 
     return didRemoveElement;
   }
 
-  public boolean remove(Object object) {
-    if (!(object instanceof $typemap(jboxtype, T))) {
+  public boolean remove(java.lang.Object object) {
+    if (!(object instanceof $typemap(jboxtype, Key))) {
       return false;
     }
 
-    return removeImpl(($typemap(jboxtype, T))object);
+    return removeImpl(($typemap(jboxtype, Key))object);
   }
 %}
 
@@ -140,7 +140,7 @@
           ++(*$self);
         }
 
-        T derefUnchecked() const {
+        Key derefUnchecked() const {
           return **$self;
         }
 
@@ -152,8 +152,8 @@
 
     typedef size_t size_type;
     typedef ptrdiff_t difference_type;
-    typedef T value_type;
-    typedef T key_type;
+    typedef Key value_type;
+    typedef Key key_type;
     typedef value_type* pointer;
     typedef const value_type* const_pointer;
     typedef value_type& reference;
@@ -172,17 +172,17 @@
       %fragment("SWIG_UnorderedSetSize");
 
       // Returns whether item was inserted.
-      bool add(const T& key) {
+      bool add(const Key& key) {
         return self->insert(key).second;
       }
 
       // Returns whether set contains key.
-      bool containsImpl(const T& key) {
+      bool containsImpl(const Key& key) {
         return (self->count(key) > 0);
       }
 
       // Returns whether the item was erased.
-      bool removeImpl(const T& key) {
+      bool removeImpl(const Key& key) {
         return (self->erase(key) > 0);
       }
 
diff --git a/Lib/java/std_vector.i b/Lib/java/std_vector.i
index f621e89..955e20c 100644
--- a/Lib/java/std_vector.i
+++ b/Lib/java/std_vector.i
@@ -94,11 +94,6 @@
     void clear();
     %extend {
       %fragment("SWIG_VectorSize");
-      vector(jint count) throw (std::out_of_range) {
-        if (count < 0)
-          throw std::out_of_range("vector count must be positive");
-        return new std::vector< CTYPE >(static_cast<std::vector< CTYPE >::size_type>(count));
-      }
 
       vector(jint count, const CTYPE &value) throw (std::out_of_range) {
         if (count < 0)
@@ -110,14 +105,14 @@
         return SWIG_VectorSize(self->size());
       }
 
-      void doAdd(const value_type& value) {
-        self->push_back(value);
+      void doAdd(const value_type& x) {
+        self->push_back(x);
       }
 
-      void doAdd(jint index, const value_type& value) throw (std::out_of_range) {
+      void doAdd(jint index, const value_type& x) throw (std::out_of_range) {
         jint size = static_cast<jint>(self->size());
         if (0 <= index && index <= size) {
-          self->insert(self->begin() + index, value);
+          self->insert(self->begin() + index, x);
         } else {
           throw std::out_of_range("vector index out of range");
         }
@@ -142,11 +137,11 @@
           throw std::out_of_range("vector index out of range");
       }
 
-      value_type doSet(jint index, const value_type& value) throw (std::out_of_range) {
+      value_type doSet(jint index, const value_type& val) throw (std::out_of_range) {
         jint size = static_cast<jint>(self->size());
         if (index >= 0 && index < size) {
           CTYPE const old_value = (*self)[index];
-          (*self)[index] = value;
+          (*self)[index] = val;
           return old_value;
         }
         else
@@ -174,7 +169,7 @@
 namespace std {
 
     template<class T> class vector {
-        SWIG_STD_VECTOR_MINIMUM_INTERNAL(T, const T&)
+        SWIG_STD_VECTOR_MINIMUM_INTERNAL(T, const value_type&)
     };
 
     // bool specialization
diff --git a/Lib/javascript/v8/javascripthelpers.swg b/Lib/javascript/v8/javascripthelpers.swg
index 7b8a5ec..80fbd7a 100644
--- a/Lib/javascript/v8/javascripthelpers.swg
+++ b/Lib/javascript/v8/javascripthelpers.swg
@@ -93,7 +93,7 @@
 #else
     v8::Local<v8::String> sproperty;
     if (property->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocal(&sproperty)) {
-      sproperty->WriteUtf8(buffer, 256);
+      SWIGV8_WRITE_UTF8(sproperty, buffer, 256);
       res = sprintf(msg, "Tried to write read-only variable: %s.", buffer);
     }
     else {
diff --git a/Lib/javascript/v8/javascriptprimtypes.swg b/Lib/javascript/v8/javascriptprimtypes.swg
index c0055c4..f76be98 100644
--- a/Lib/javascript/v8/javascriptprimtypes.swg
+++ b/Lib/javascript/v8/javascriptprimtypes.swg
@@ -22,7 +22,7 @@
     return SWIG_ERROR;
   }
 
-  if (val) *val = obj->BooleanValue();
+  if (val) *val = SWIGV8_BOOLEAN_VALUE(obj);
   return SWIG_OK;
 }
 }
@@ -44,7 +44,7 @@
   if (!valRef->IsNumber()) {
     return SWIG_TypeError;
   }
-  if(val) *val = valRef->IntegerValue();
+  if(val) *val = SWIGV8_INTEGER_VALUE(valRef);
 
   return SWIG_OK;
 }
@@ -68,7 +68,7 @@
   if (!obj->IsNumber()) {
     return SWIG_TypeError;
   }
-  if(val) *val = (long) obj->IntegerValue();
+  if(val) *val = (long) SWIGV8_INTEGER_VALUE(obj);
 
   return SWIG_OK;
 }
@@ -95,7 +95,7 @@
     return SWIG_TypeError;
   }
 
-  long longVal = (long) obj->NumberValue();
+  long longVal = (long) SWIGV8_NUMBER_VALUE(obj);
 
   if(longVal < 0) {
       return SWIG_OverflowError;
@@ -133,7 +133,7 @@
   if (!obj->IsNumber()) {
     return SWIG_TypeError;
   }
-  if(val) *val = (long long) obj->IntegerValue();
+  if(val) *val = (long long) SWIGV8_INTEGER_VALUE(obj);
 
   return SWIG_OK;
 }
@@ -168,7 +168,7 @@
     return SWIG_TypeError;
   }
 
-  long long longVal = (long long) obj->NumberValue();
+  long long longVal = (long long) SWIGV8_NUMBER_VALUE(obj);
 
   if(longVal < 0) {
       return SWIG_OverflowError;
@@ -198,7 +198,7 @@
   if(!obj->IsNumber()) {
     return SWIG_TypeError;
   }
-  if(val) *val = obj->NumberValue();
+  if(val) *val = SWIGV8_NUMBER_VALUE(obj);
 
   return SWIG_OK;
 }
diff --git a/Lib/javascript/v8/javascriptrun.swg b/Lib/javascript/v8/javascriptrun.swg
index 84bd4cc..2452f40 100644
--- a/Lib/javascript/v8/javascriptrun.swg
+++ b/Lib/javascript/v8/javascriptrun.swg
@@ -91,6 +91,32 @@
 #define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ.Reset(v8::Isolate::GetCurrent(), class);
 #endif
 
+#ifdef NODE_VERSION
+#if NODE_VERSION_AT_LEAST(10, 12, 0)
+#define SWIG_NODE_AT_LEAST_1012
+#endif
+#endif
+
+//Necessary to check Node.js version because V8 API changes are backported in Node.js
+#if (defined(NODE_VERSION) && !defined(SWIG_NODE_AT_LEAST_1012)) || \
+    (!defined(NODE_VERSION) && (V8_MAJOR_VERSION-0) < 7)
+#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject()
+#define SWIGV8_TO_STRING(handle) (handle)->ToString()
+#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue()
+#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue()
+#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue()
+#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(buffer, len)
+#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length()
+#else
+#define SWIGV8_TO_OBJECT(handle) (handle)->ToObject(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked()
+#define SWIGV8_TO_STRING(handle) (handle)->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocalChecked()
+#define SWIGV8_NUMBER_VALUE(handle) (handle)->NumberValue(SWIGV8_CURRENT_CONTEXT()).ToChecked()
+#define SWIGV8_INTEGER_VALUE(handle) (handle)->IntegerValue(SWIGV8_CURRENT_CONTEXT()).ToChecked()
+#define SWIGV8_BOOLEAN_VALUE(handle) (handle)->BooleanValue(SWIGV8_CURRENT_CONTEXT()).ToChecked()
+#define SWIGV8_WRITE_UTF8(handle, buffer, len) (handle)->WriteUtf8(v8::Isolate::GetCurrent(), buffer, len)
+#define SWIGV8_UTF8_LENGTH(handle) (handle)->Utf8Length(v8::Isolate::GetCurrent())
+#endif
+
 /* ---------------------------------------------------------------------------
  * Error handling
  *
@@ -258,7 +284,7 @@
   if(!valRef->IsObject()) {
     return SWIG_TypeError;
   }
-  v8::Handle<v8::Object> objRef = valRef->ToObject();
+  v8::Handle<v8::Object> objRef = SWIGV8_TO_OBJECT(valRef);
 
   if(objRef->InternalFieldCount() < 1) return SWIG_ERROR;
 
@@ -352,7 +378,7 @@
   if(!valRef->IsObject()) {
     return SWIG_TypeError;
   }
-  v8::Handle<v8::Object> objRef = valRef->ToObject();
+  v8::Handle<v8::Object> objRef = SWIGV8_TO_OBJECT(valRef);
   return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags);
 }
 
@@ -479,7 +505,7 @@
 int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
   SWIGV8_HANDLESCOPE();
   
-  v8::Handle<v8::Object> objRef = valRef->ToObject();
+  v8::Handle<v8::Object> objRef = SWIGV8_TO_OBJECT(valRef);
   if(objRef->InternalFieldCount() < 1) return false;
 #if (V8_MAJOR_VERSION-0) < 5
   v8::Handle<v8::Value> flag = objRef->GetHiddenValue(SWIGV8_STRING_NEW("__swig__packed_data__"));
@@ -489,7 +515,7 @@
   if (!objRef->GetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey).ToLocal(&flag))
     return false;
 #endif
-  return (flag->IsBoolean() && flag->BooleanValue());
+  return (flag->IsBoolean() && SWIGV8_BOOLEAN_VALUE(flag));
 }
 
 SWIGRUNTIME
@@ -499,7 +525,7 @@
     
     SwigV8PackedData *sobj;
 
-    v8::Handle<v8::Object> objRef = valRef->ToObject();
+    v8::Handle<v8::Object> objRef = SWIGV8_TO_OBJECT(valRef);
 
 #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511)
     v8::Handle<v8::Value> cdataRef = objRef->GetInternalField(0);
diff --git a/Lib/javascript/v8/javascriptruntime.swg b/Lib/javascript/v8/javascriptruntime.swg
index 0e40593..c78e04e 100644
--- a/Lib/javascript/v8/javascriptruntime.swg
+++ b/Lib/javascript/v8/javascriptruntime.swg
@@ -44,6 +44,8 @@
 #ifdef BUILDING_NODE_EXTENSION
 %insert("runtime") %{
 #include <node.h>
+//Older version of node.h does not include this
+#include <node_version.h>
 %}
 #endif
 
diff --git a/Lib/javascript/v8/javascriptstrings.swg b/Lib/javascript/v8/javascriptstrings.swg
index 65ba20e..e767a6d 100644
--- a/Lib/javascript/v8/javascriptstrings.swg
+++ b/Lib/javascript/v8/javascriptstrings.swg
@@ -7,11 +7,11 @@
 SWIG_AsCharPtrAndSize(v8::Handle<v8::Value> valRef, char** cptr, size_t* psize, int *alloc)
 {
   if(valRef->IsString()) {
-    v8::Handle<v8::String> js_str = valRef->ToString();
+    v8::Handle<v8::String> js_str = SWIGV8_TO_STRING(valRef);
 
-    size_t len = js_str->Utf8Length() + 1;
+    size_t len = SWIGV8_UTF8_LENGTH(js_str) + 1;
     char* cstr = new char[len];
-    js_str->WriteUtf8(cstr, len);
+    SWIGV8_WRITE_UTF8(js_str, cstr, len);
     
     if(alloc) *alloc = SWIG_NEWOBJ;
     if(psize) *psize = len;
@@ -20,7 +20,7 @@
     return SWIG_OK;
   } else {
     if(valRef->IsObject()) {
-      v8::Handle<v8::Object> obj = valRef->ToObject();
+      v8::Handle<v8::Object> obj = SWIGV8_TO_OBJECT(valRef);
       // try if the object is a wrapped char[]
       swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
       if (pchar_descriptor) {
diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg
index 3012331..ff614e6 100644
--- a/Lib/octave/octrun.swg
+++ b/Lib/octave/octrun.swg
@@ -51,7 +51,7 @@
   octave_value type(SWIG_ErrorType(code));
   std::string r = msg;
   r += " (" + type.string_value() + ")";
-  error(r.c_str());
+  error("%s", r.c_str());
   return octave_value(r);
 }
 
@@ -840,7 +840,7 @@
       const std::string opname = std::string("__") + octave_base_value::get_umap_name(umap) + std::string("__");
       octave_value ret;
       if (!dispatch_unary_op(opname, ret)) {
-        error((opname + std::string(" method not found")).c_str());
+        error("%s", (opname + std::string(" method not found")).c_str());
         return octave_value();
       }
       return ret;
diff --git a/Lib/python/pycontainer.swg b/Lib/python/pycontainer.swg
index 5c2a981..ef2f725 100644
--- a/Lib/python/pycontainer.swg
+++ b/Lib/python/pycontainer.swg
@@ -43,7 +43,7 @@
 
 %fragment("reference_container_owner", "header", fragment="container_owner_attribute_init") {
 namespace swig {
-  PyObject* container_owner_attribute() {
+  static PyObject* container_owner_attribute() {
     static PyObject* attr = SWIG_Python_str_FromChar("__swig_container");
     return attr;
   }
diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg
index f5be6d5..dfbf40b 100644
--- a/Lib/python/pyinit.swg
+++ b/Lib/python/pyinit.swg
@@ -8,6 +8,22 @@
 %fragment("<stddef.h>"); // For offsetof
 #endif
 
+%insert(runtime) %{
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Method creation and docstring support functions */
+
+SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
+SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
+SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
+
+#ifdef __cplusplus
+}
+#endif
+%}
+
 %init %{
 
 #ifdef __cplusplus
diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg
index 693cd6d..ad1b819 100644
--- a/Lib/python/pyrun.swg
+++ b/Lib/python/pyrun.swg
@@ -213,12 +213,6 @@
 extern "C" {
 #endif
 
-/* Method creation and docstring support functions */
-
-SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
-SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
-SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
-
 /* The python void return value */
 
 SWIGRUNTIMEINLINE PyObject * 
diff --git a/Lib/python/std_unordered_map.i b/Lib/python/std_unordered_map.i
index 79882b2..042d5b6 100644
--- a/Lib/python/std_unordered_map.i
+++ b/Lib/python/std_unordered_map.i
@@ -56,26 +56,26 @@
 %fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits")
 {
   namespace swig {
-    template <class SwigPySeq, class K, class T >
+    template <class SwigPySeq, class K, class T, class Hash, class Compare, class Alloc>
     inline void
-    assign(const SwigPySeq& swigpyseq, std::unordered_map<K,T > *unordered_map) {
-      typedef typename std::unordered_map<K,T>::value_type value_type;
+    assign(const SwigPySeq& swigpyseq, std::unordered_map<K,T,Hash,Compare,Alloc> *unordered_map) {
+      typedef typename std::unordered_map<K,T,Hash,Compare,Alloc>::value_type value_type;
       typename SwigPySeq::const_iterator it = swigpyseq.begin();
       for (;it != swigpyseq.end(); ++it) {
 	unordered_map->insert(value_type(it->first, it->second));
       }
     }
 
-    template <class K, class T>
-    struct traits_reserve<std::unordered_map<K,T> > {
-      static void reserve(std::unordered_map<K,T> &seq, typename std::unordered_map<K,T>::size_type n) {
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_reserve<std::unordered_map<K,T,Hash,Compare,Alloc> > {
+      static void reserve(std::unordered_map<K,T,Hash,Compare,Alloc> &seq, typename std::unordered_map<K,T,Hash,Compare,Alloc>::size_type n) {
         seq.reserve(n);
       }
     };
 
-    template <class K, class T>
-    struct traits_asptr<std::unordered_map<K,T> >  {
-      typedef std::unordered_map<K,T> unordered_map_type;
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_asptr<std::unordered_map<K,T,Hash,Compare,Alloc> >  {
+      typedef std::unordered_map<K,T,Hash,Compare,Alloc> unordered_map_type;
       static int asptr(PyObject *obj, unordered_map_type **val) {
 	int res = SWIG_ERROR;
 	SWIG_PYTHON_THREAD_BEGIN_BLOCK;
@@ -85,7 +85,7 @@
           /* In Python 3.x the ".items()" method returns a dict_items object */
           items = PySequence_Fast(items, ".items() didn't return a sequence!");
 %#endif
-	  res = traits_asptr_stdseq<std::unordered_map<K,T>, std::pair<K, T> >::asptr(items, val);
+	  res = traits_asptr_stdseq<std::unordered_map<K,T,Hash,Compare,Alloc>, std::pair<K, T> >::asptr(items, val);
 	} else {
 	  unordered_map_type *p;
 	  swig_type_info *descriptor = swig::type_info<unordered_map_type>();
@@ -97,9 +97,9 @@
       }      
     };
       
-    template <class K, class T >
-    struct traits_from<std::unordered_map<K,T> >  {
-      typedef std::unordered_map<K,T> unordered_map_type;
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_from<std::unordered_map<K,T,Hash,Compare,Alloc> >  {
+      typedef std::unordered_map<K,T,Hash,Compare,Alloc> unordered_map_type;
       typedef typename unordered_map_type::const_iterator const_iterator;
       typedef typename unordered_map_type::size_type size_type;
 
diff --git a/Lib/python/std_unordered_multimap.i b/Lib/python/std_unordered_multimap.i
index aa29a7c..2811404 100644
--- a/Lib/python/std_unordered_multimap.i
+++ b/Lib/python/std_unordered_multimap.i
@@ -6,27 +6,27 @@
 %fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits",fragment="StdUnorderedMapForwardIteratorTraits")
 {
   namespace swig {
-    template <class SwigPySeq, class K, class T >
+    template <class SwigPySeq, class K, class T, class Hash, class Compare, class Alloc>
     inline void 
-    assign(const SwigPySeq& swigpyseq, std::unordered_multimap<K,T > *unordered_multimap) {
-      typedef typename std::unordered_multimap<K,T>::value_type value_type;
+    assign(const SwigPySeq& swigpyseq, std::unordered_multimap<K,T,Hash,Compare,Alloc> *unordered_multimap) {
+      typedef typename std::unordered_multimap<K,T,Hash,Compare,Alloc>::value_type value_type;
       typename SwigPySeq::const_iterator it = swigpyseq.begin();
       for (;it != swigpyseq.end(); ++it) {
 	unordered_multimap->insert(value_type(it->first, it->second));
       }
     }
 
-    template <class K, class T>
-    struct traits_reserve<std::unordered_multimap<K,T> >  {
-      static void reserve(std::unordered_multimap<K,T> &seq, typename std::unordered_multimap<K,T>::size_type n) {
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_reserve<std::unordered_multimap<K,T,Hash,Compare,Alloc> >  {
+      static void reserve(std::unordered_multimap<K,T,Hash,Compare,Alloc> &seq, typename std::unordered_multimap<K,T,Hash,Compare,Alloc>::size_type n) {
         seq.reserve(n);
       }
     };
 
-    template <class K, class T>
-    struct traits_asptr<std::unordered_multimap<K,T> >  {
-      typedef std::unordered_multimap<K,T> unordered_multimap_type;
-      static int asptr(PyObject *obj, std::unordered_multimap<K,T> **val) {
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_asptr<std::unordered_multimap<K,T,Hash,Compare,Alloc> >  {
+      typedef std::unordered_multimap<K,T,Hash,Compare,Alloc> unordered_multimap_type;
+      static int asptr(PyObject *obj, std::unordered_multimap<K,T,Hash,Compare,Alloc> **val) {
 	int res = SWIG_ERROR;
 	if (PyDict_Check(obj)) {
 	  SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL);
@@ -34,7 +34,7 @@
           /* In Python 3.x the ".items()" method returns a dict_items object */
           items = PySequence_Fast(items, ".items() didn't return a sequence!");
 %#endif
-	  res = traits_asptr_stdseq<std::unordered_multimap<K,T>, std::pair<K, T> >::asptr(items, val);
+	  res = traits_asptr_stdseq<std::unordered_multimap<K,T,Hash,Compare,Alloc>, std::pair<K, T> >::asptr(items, val);
 	} else {
 	  unordered_multimap_type *p;
 	  swig_type_info *descriptor = swig::type_info<unordered_multimap_type>();
@@ -45,9 +45,9 @@
       }
     };
       
-    template <class K, class T >
-    struct traits_from<std::unordered_multimap<K,T> >  {
-      typedef std::unordered_multimap<K,T> unordered_multimap_type;
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_from<std::unordered_multimap<K,T,Hash,Compare,Alloc> >  {
+      typedef std::unordered_multimap<K,T,Hash,Compare,Alloc> unordered_multimap_type;
       typedef typename unordered_multimap_type::const_iterator const_iterator;
       typedef typename unordered_multimap_type::size_type size_type;
             
diff --git a/Lib/python/std_unordered_multiset.i b/Lib/python/std_unordered_multiset.i
index d90a97b..b0f3f09 100644
--- a/Lib/python/std_unordered_multiset.i
+++ b/Lib/python/std_unordered_multiset.i
@@ -7,9 +7,9 @@
 %fragment("StdUnorderedMultisetTraits","header",fragment="StdSequenceTraits")
 %{
   namespace swig {
-    template <class SwigPySeq, class T> 
+    template <class SwigPySeq, class Key, class Hash, class Compare, class Alloc>
     inline void
-    assign(const SwigPySeq& swigpyseq, std::unordered_multiset<T>* seq) {
+    assign(const SwigPySeq& swigpyseq, std::unordered_multiset<Key,Hash,Compare,Alloc>* seq) {
       // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
       typedef typename SwigPySeq::value_type value_type;
       typename SwigPySeq::const_iterator it = swigpyseq.begin();
@@ -18,24 +18,24 @@
       }
     }
 
-    template <class T>
-    struct traits_reserve<std::unordered_multiset<T> >  {
-      static void reserve(std::unordered_multiset<T> &seq, typename std::unordered_multiset<T>::size_type n) {
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_reserve<std::unordered_multiset<Key,Hash,Compare,Alloc> >  {
+      static void reserve(std::unordered_multiset<Key,Hash,Compare,Alloc> &seq, typename std::unordered_multiset<Key,Hash,Compare,Alloc>::size_type n) {
         seq.reserve(n);
       }
     };
 
-    template <class T>
-    struct traits_asptr<std::unordered_multiset<T> >  {
-      static int asptr(PyObject *obj, std::unordered_multiset<T> **m) {
-	return traits_asptr_stdseq<std::unordered_multiset<T> >::asptr(obj, m);
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_asptr<std::unordered_multiset<Key,Hash,Compare,Alloc> >  {
+      static int asptr(PyObject *obj, std::unordered_multiset<Key,Hash,Compare,Alloc> **m) {
+	return traits_asptr_stdseq<std::unordered_multiset<Key,Hash,Compare,Alloc> >::asptr(obj, m);
       }
     };
 
-    template <class T>
-    struct traits_from<std::unordered_multiset<T> > {
-      static PyObject *from(const std::unordered_multiset<T>& vec) {
-	return traits_from_stdseq<std::unordered_multiset<T> >::from(vec);
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_from<std::unordered_multiset<Key,Hash,Compare,Alloc> > {
+      static PyObject *from(const std::unordered_multiset<Key,Hash,Compare,Alloc>& vec) {
+	return traits_from_stdseq<std::unordered_multiset<Key,Hash,Compare,Alloc> >::from(vec);
       }
     };
   }
diff --git a/Lib/python/std_unordered_set.i b/Lib/python/std_unordered_set.i
index 8736cb1..79fca6c 100644
--- a/Lib/python/std_unordered_set.i
+++ b/Lib/python/std_unordered_set.i
@@ -5,9 +5,9 @@
 %fragment("StdUnorderedSetTraits","header",fragment="StdSequenceTraits")
 %{
   namespace swig {
-    template <class SwigPySeq, class T> 
+    template <class SwigPySeq, class Key, class Hash, class Compare, class Alloc>
     inline void 
-    assign(const SwigPySeq& swigpyseq, std::unordered_set<T>* seq) {
+    assign(const SwigPySeq& swigpyseq, std::unordered_set<Key,Hash,Compare,Alloc>* seq) {
       // seq->insert(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
       typedef typename SwigPySeq::value_type value_type;
       typename SwigPySeq::const_iterator it = swigpyseq.begin();
@@ -16,24 +16,24 @@
       }
     }
 
-    template <class T>
-    struct traits_reserve<std::unordered_set<T> >  {
-      static void reserve(std::unordered_set<T> &seq, typename std::unordered_set<T>::size_type n) {
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_reserve<std::unordered_set<Key,Hash,Compare,Alloc> >  {
+      static void reserve(std::unordered_set<Key,Hash,Compare,Alloc> &seq, typename std::unordered_set<Key,Hash,Compare,Alloc>::size_type n) {
         seq.reserve(n);
       }
     };
 
-    template <class T>
-    struct traits_asptr<std::unordered_set<T> >  {
-      static int asptr(PyObject *obj, std::unordered_set<T> **s) {
-	return traits_asptr_stdseq<std::unordered_set<T> >::asptr(obj, s);
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_asptr<std::unordered_set<Key,Hash,Compare,Alloc> >  {
+      static int asptr(PyObject *obj, std::unordered_set<Key,Hash,Compare,Alloc> **s) {
+	return traits_asptr_stdseq<std::unordered_set<Key,Hash,Compare,Alloc> >::asptr(obj, s);
       }
     };
 
-    template <class T>
-    struct traits_from<std::unordered_set<T> > {
-      static PyObject *from(const std::unordered_set<T>& vec) {
-	return traits_from_stdseq<std::unordered_set<T> >::from(vec);
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_from<std::unordered_set<Key,Hash,Compare,Alloc> > {
+      static PyObject *from(const std::unordered_set<Key,Hash,Compare,Alloc>& vec) {
+	return traits_from_stdseq<std::unordered_set<Key,Hash,Compare,Alloc> >::from(vec);
       }
     };
   }
diff --git a/Lib/r/r.swg b/Lib/r/r.swg
index a903533..8cf8cdf 100644
--- a/Lib/r/r.swg
+++ b/Lib/r/r.swg
@@ -192,6 +192,11 @@
     free($1);
 }
 
+%typemap(in) const enum SWIGTYPE & ($*1_ltype temp)
+%{ temp = ($*1_ltype)INTEGER($input)[0];
+   $1 = &temp; %}
+
+%typemap(out) const enum SWIGTYPE & %{ $result = Rf_ScalarInteger((int)*$1); %}
 
 %typemap(memberin) char[] %{
 if ($input) strcpy($1, $input);
diff --git a/Lib/r/rtype.swg b/Lib/r/rtype.swg
index c55c703..bdc48c2 100644
--- a/Lib/r/rtype.swg
+++ b/Lib/r/rtype.swg
@@ -16,6 +16,7 @@
 %typemap("rtype") enum SWIGTYPE *   "character";
 %typemap("rtype") enum SWIGTYPE *const   "character";
 %typemap("rtype") enum SWIGTYPE &  "character";
+%typemap("rtype") const enum SWIGTYPE &  "character";
 %typemap("rtype") enum SWIGTYPE &&  "character";
 %typemap("rtype") SWIGTYPE * "$R_class";
 %typemap("rtype") SWIGTYPE *const "$R_class";
@@ -86,9 +87,7 @@
 %typemap(scoercein) enum SWIGTYPE 
   %{  $input = enumToInteger($input, "$R_class"); %}
 %typemap(scoercein) enum SWIGTYPE &
-  %{  $input = enumToInteger($input, "$R_class"); %}
-%typemap(scoercein) enum SWIGTYPE &&
-  %{  $input = enumToInteger($input, "$R_class"); %}
+  %{  $input = enumToInteger($input, "$*R_class"); %}
 %typemap(scoercein) enum SWIGTYPE *
   %{  $input = enumToInteger($input, "$R_class"); %}
 %typemap(scoercein) enum SWIGTYPE *const
@@ -138,7 +137,7 @@
   %{  $result = enumFromInteger($result, "$R_class"); %}
 
 %typemap(scoerceout) enum SWIGTYPE &
-  %{  $result = enumFromInteger($result, "$R_class"); %}
+  %{  $result = enumFromInteger($result, "$*R_class"); %}
 
 %typemap(scoerceout) enum SWIGTYPE &&
   %{  $result = enumFromInteger($result, "$R_class"); %}
diff --git a/Lib/r/srun.swg b/Lib/r/srun.swg
index d07218a..2e8eda1 100644
--- a/Lib/r/srun.swg
+++ b/Lib/r/srun.swg
@@ -73,7 +73,7 @@
 {
    # Mirror the class definitions via the E analogous to .__C__
   defName = paste(".__E__", name, sep = "")
-  assign(defName,  .values,  envir = where)
+  delayedAssign(defName,  .values, assign.env = where)
 
   if(nchar(suffix))
     name = paste(name, suffix, sep = "")
diff --git a/Lib/ruby/rubyhead.swg b/Lib/ruby/rubyhead.swg
index 9960087..90f07cf 100644
--- a/Lib/ruby/rubyhead.swg
+++ b/Lib/ruby/rubyhead.swg
@@ -91,6 +91,9 @@
 #ifndef RSTRUCT_PTR
 # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
 #endif
+#ifndef RTYPEDDATA_P
+# define RTYPEDDATA_P(x) (TYPE(x) != T_DATA)
+#endif
 
 
 
diff --git a/Lib/ruby/rubyrun.swg b/Lib/ruby/rubyrun.swg
index b4dd9dd..4b2ffe4 100644
--- a/Lib/ruby/rubyrun.swg
+++ b/Lib/ruby/rubyrun.swg
@@ -247,7 +247,7 @@
 SWIGRUNTIME swig_ruby_owntype
 SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) {
   swig_ruby_owntype oldown = {0, 0};
-  if (TYPE(obj) == T_DATA) {
+  if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) {
     oldown.datafree = RDATA(obj)->dfree;
     RDATA(obj)->dfree = own.datafree;
   }
@@ -268,7 +268,7 @@
       *ptr = 0;
     return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
   } else {
-    if (TYPE(obj) != T_DATA) {
+    if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) {
       return SWIG_ERROR;
     }
     Data_Get_Struct(obj, void, vptr);
diff --git a/Lib/ruby/std_unordered_map.i b/Lib/ruby/std_unordered_map.i
index c3f60bb..48c8752 100644
--- a/Lib/ruby/std_unordered_map.i
+++ b/Lib/ruby/std_unordered_map.i
@@ -6,25 +6,25 @@
 %fragment("StdUnorderedMapTraits","header",fragment="StdMapCommonTraits")
 {
   namespace swig {
-    template <class RubySeq, class K, class T >
+    template <class RubySeq, class K, class T, class Hash, class Compare, class Alloc>
     inline void
-    assign(const RubySeq& rubyseq, std::unordered_map<K,T > *map) {
-      typedef typename std::unordered_map<K,T>::value_type value_type;
+    assign(const RubySeq& rubyseq, std::unordered_map<K,T,Hash,Compare,Alloc> *map) {
+      typedef typename std::unordered_map<K,T,Hash,Compare,Alloc>::value_type value_type;
       typename RubySeq::const_iterator it = rubyseq.begin();
       for (;it != rubyseq.end(); ++it) {
 	map->insert(value_type(it->first, it->second));
       }
     }
 
-    template <class K, class T>
-    struct traits_asptr<std::unordered_map<K,T> >  {
-      typedef std::unordered_map<K,T> map_type;
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_asptr<std::unordered_map<K,T,Hash,Compare,Alloc> >  {
+      typedef std::unordered_map<K,T,Hash,Compare,Alloc> map_type;
       static int asptr(VALUE obj, map_type **val) {
 	int res = SWIG_ERROR;
 	if (TYPE(obj) == T_HASH) {
 	  static ID id_to_a = rb_intern("to_a");
 	  VALUE items = rb_funcall(obj, id_to_a, 0);
-	  res = traits_asptr_stdseq<std::unordered_map<K,T>, std::pair<K, T> >::asptr(items, val);
+	  res = traits_asptr_stdseq<std::unordered_map<K,T,Hash,Compare,Alloc>, std::pair<K, T> >::asptr(items, val);
 	} else {
 	  map_type *p;
 	  swig_type_info *descriptor = swig::type_info<map_type>();
@@ -35,9 +35,9 @@
       }
     };
 
-    template <class K, class T >
-    struct traits_from<std::unordered_map<K,T> >  {
-      typedef std::unordered_map<K,T> map_type;
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_from<std::unordered_map<K,T,Hash,Compare,Alloc> >  {
+      typedef std::unordered_map<K,T,Hash,Compare,Alloc> map_type;
       typedef typename map_type::const_iterator const_iterator;
       typedef typename map_type::size_type size_type;
 
diff --git a/Lib/ruby/std_unordered_multimap.i b/Lib/ruby/std_unordered_multimap.i
index b663c12..ebc53b5 100644
--- a/Lib/ruby/std_unordered_multimap.i
+++ b/Lib/ruby/std_unordered_multimap.i
@@ -6,25 +6,25 @@
 %fragment("StdUnorderedMultimapTraits","header",fragment="StdMapCommonTraits")
 {
   namespace swig {
-    template <class RubySeq, class K, class T >
+    template <class RubySeq, class K, class T, class Hash, class Compare, class Alloc>
     inline void
-    assign(const RubySeq& rubyseq, std::unordered_multimap<K,T > *multimap) {
-      typedef typename std::unordered_multimap<K,T>::value_type value_type;
+    assign(const RubySeq& rubyseq, std::unordered_multimap<K,T,Hash,Compare,Alloc> *multimap) {
+      typedef typename std::unordered_multimap<K,T,Hash,Compare,Alloc>::value_type value_type;
       typename RubySeq::const_iterator it = rubyseq.begin();
       for (;it != rubyseq.end(); ++it) {
 	multimap->insert(value_type(it->first, it->second));
       }
     }
 
-    template <class K, class T>
-    struct traits_asptr<std::unordered_multimap<K,T> >  {
-      typedef std::unordered_multimap<K,T> multimap_type;
-      static int asptr(VALUE obj, std::unordered_multimap<K,T> **val) {
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_asptr<std::unordered_multimap<K,T,Hash,Compare,Alloc> >  {
+      typedef std::unordered_multimap<K,T,Hash,Compare,Alloc> multimap_type;
+      static int asptr(VALUE obj, std::unordered_multimap<K,T,Hash,Compare,Alloc> **val) {
 	int res = SWIG_ERROR;
 	if ( TYPE(obj) == T_HASH ) {
 	  static ID id_to_a = rb_intern("to_a");
 	  VALUE items = rb_funcall(obj, id_to_a, 0);
-	  return traits_asptr_stdseq<std::unordered_multimap<K,T>, std::pair<K, T> >::asptr(items, val);
+	  return traits_asptr_stdseq<std::unordered_multimap<K,T,Hash,Compare,Alloc>, std::pair<K, T> >::asptr(items, val);
 	} else {
 	  multimap_type *p;
 	  res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<multimap_type>(),0);
@@ -34,9 +34,9 @@
       }
     };
 
-    template <class K, class T >
-    struct traits_from<std::unordered_multimap<K,T> >  {
-      typedef std::unordered_multimap<K,T> multimap_type;
+    template <class K, class T, class Hash, class Compare, class Alloc>
+    struct traits_from<std::unordered_multimap<K,T,Hash,Compare,Alloc> >  {
+      typedef std::unordered_multimap<K,T,Hash,Compare,Alloc> multimap_type;
       typedef typename multimap_type::const_iterator const_iterator;
       typedef typename multimap_type::size_type size_type;
 
diff --git a/Lib/ruby/std_unordered_multiset.i b/Lib/ruby/std_unordered_multiset.i
index 181aa21..dae13ee 100644
--- a/Lib/ruby/std_unordered_multiset.i
+++ b/Lib/ruby/std_unordered_multiset.i
@@ -7,9 +7,9 @@
 %fragment("StdUnorderedMultisetTraits","header",fragment="StdUnorderedSetTraits")
 %{
   namespace swig {
-    template <class RubySeq, class T>
+    template <class RubySeq, class Key, class Hash, class Compare, class Alloc>
     inline void
-    assign(const RubySeq& rubyseq, std::unordered_multiset<T>* seq) {
+    assign(const RubySeq& rubyseq, std::unordered_multiset<Key,Hash,Compare,Alloc>* seq) {
       // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented
       typedef typename RubySeq::value_type value_type;
       typename RubySeq::const_iterator it = rubyseq.begin();
@@ -18,17 +18,17 @@
       }
     }
 
-    template <class T>
-    struct traits_asptr<std::unordered_multiset<T> >  {
-      static int asptr(VALUE obj, std::unordered_multiset<T> **m) {
-	return traits_asptr_stdseq<std::unordered_multiset<T> >::asptr(obj, m);
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_asptr<std::unordered_multiset<Key,Hash,Compare,Alloc> >  {
+      static int asptr(VALUE obj, std::unordered_multiset<Key,Hash,Compare,Alloc> **m) {
+	return traits_asptr_stdseq<std::unordered_multiset<Key,Hash,Compare,Alloc> >::asptr(obj, m);
       }
     };
 
-    template <class T>
-    struct traits_from<std::unordered_multiset<T> > {
-      static VALUE from(const std::unordered_multiset<T>& vec) {
-	return traits_from_stdseq<std::unordered_multiset<T> >::from(vec);
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_from<std::unordered_multiset<Key,Hash,Compare,Alloc> > {
+      static VALUE from(const std::unordered_multiset<Key,Hash,Compare,Alloc>& vec) {
+	return traits_from_stdseq<std::unordered_multiset<Key,Hash,Compare,Alloc> >::from(vec);
       }
     };
   }
diff --git a/Lib/ruby/std_unordered_set.i b/Lib/ruby/std_unordered_set.i
index 3d44943..e8e1b08 100644
--- a/Lib/ruby/std_unordered_set.i
+++ b/Lib/ruby/std_unordered_set.i
@@ -7,9 +7,9 @@
 %fragment("StdUnorderedSetTraits","header",fragment="<stddef.h>",fragment="StdSetTraits")
 %{
   namespace swig {
-    template <class RubySeq, class T>
+    template <class RubySeq, class Key, class Hash, class Compare, class Alloc>
     inline void
-    assign(const RubySeq& rubyseq, std::unordered_set<T>* seq) {
+    assign(const RubySeq& rubyseq, std::unordered_set<Key,Hash,Compare,Alloc>* seq) {
       // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented
       typedef typename RubySeq::value_type value_type;
       typename RubySeq::const_iterator it = rubyseq.begin();
@@ -18,17 +18,17 @@
       }
     }
 
-    template <class T>
-    struct traits_asptr<std::unordered_set<T> >  {
-      static int asptr(VALUE obj, std::unordered_set<T> **s) {
-	return traits_asptr_stdseq<std::unordered_set<T> >::asptr(obj, s);
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_asptr<std::unordered_set<Key,Hash,Compare,Alloc> >  {
+      static int asptr(VALUE obj, std::unordered_set<Key,Hash,Compare,Alloc> **s) {
+	return traits_asptr_stdseq<std::unordered_set<Key,Hash,Compare,Alloc> >::asptr(obj, s);
       }
     };
 
-    template <class T>
-    struct traits_from<std::unordered_set<T> > {
-      static VALUE from(const std::unordered_set<T>& vec) {
-	return traits_from_stdseq<std::unordered_set<T> >::from(vec);
+    template <class Key, class Hash, class Compare, class Alloc>
+    struct traits_from<std::unordered_set<Key,Hash,Compare,Alloc> > {
+      static VALUE from(const std::unordered_set<Key,Hash,Compare,Alloc>& vec) {
+	return traits_from_stdseq<std::unordered_set<Key,Hash,Compare,Alloc> >::from(vec);
       }
     };
   }
diff --git a/Lib/std/std_unordered_map.i b/Lib/std/std_unordered_map.i
index 723c023..1fd1eb9 100644
--- a/Lib/std/std_unordered_map.i
+++ b/Lib/std/std_unordered_map.i
@@ -75,6 +75,8 @@
     typedef const value_type* const_pointer;
     typedef value_type& reference;
     typedef const value_type& const_reference;
+    typedef _Hash hasher;
+    typedef _Compare key_equal;
     typedef _Alloc allocator_type;
 
     %traits_swigtype(_Key);
diff --git a/Lib/std/std_unordered_multimap.i b/Lib/std/std_unordered_multimap.i
index f285534..4be6aa4 100644
--- a/Lib/std/std_unordered_multimap.i
+++ b/Lib/std/std_unordered_multimap.i
@@ -53,6 +53,8 @@
     typedef const value_type* const_pointer;
     typedef value_type& reference;
     typedef const value_type& const_reference;
+    typedef _Hash hasher;
+    typedef _Compare key_equal;
     typedef _Alloc allocator_type;
 
     %traits_swigtype(_Key);
diff --git a/Lib/std/std_unordered_multiset.i b/Lib/std/std_unordered_multiset.i
index 1817fc2..2910fb6 100644
--- a/Lib/std/std_unordered_multiset.i
+++ b/Lib/std/std_unordered_multiset.i
@@ -17,19 +17,19 @@
 // const declarations are used to guess the intent of the function being
 // exported; therefore, the following rationale is applied:
 // 
-//   -- f(std::unordered_multiset<T>), f(const std::unordered_multiset<T>&):
+//   -- f(std::unordered_multiset<Key>), f(const std::unordered_multiset<Key>&):
 //      the parameter being read-only, either a sequence or a
-//      previously wrapped std::unordered_multiset<T> can be passed.
-//   -- f(std::unordered_multiset<T>&), f(std::unordered_multiset<T>*):
+//      previously wrapped std::unordered_multiset<Key> can be passed.
+//   -- f(std::unordered_multiset<Key>&), f(std::unordered_multiset<Key>*):
 //      the parameter may be modified; therefore, only a wrapped std::unordered_multiset
 //      can be passed.
-//   -- std::unordered_multiset<T> f(), const std::unordered_multiset<T>& f():
-//      the set is returned by copy; therefore, a sequence of T:s 
+//   -- std::unordered_multiset<Key> f(), const std::unordered_multiset<Key>& f():
+//      the set is returned by copy; therefore, a sequence of Key:s 
 //      is returned which is most easily used in other functions
-//   -- std::unordered_multiset<T>& f(), std::unordered_multiset<T>* f():
+//   -- std::unordered_multiset<Key>& f(), std::unordered_multiset<Key>* f():
 //      the set is returned by reference; therefore, a wrapped std::unordered_multiset
 //      is returned
-//   -- const std::unordered_multiset<T>* f(), f(const std::unordered_multiset<T>*):
+//   -- const std::unordered_multiset<Key>* f(), f(const std::unordered_multiset<Key>*):
 //      for consistency, they expect and return a plain set pointer.
 // ------------------------------------------------------------------------
 
@@ -40,9 +40,10 @@
 
   //unordered_multiset
 
-  template <class _Key, class _Hash = std::hash< _Key >,
+  template <class _Key,
+            class _Hash = std::hash< _Key >,
             class _Compare = std::equal_to< _Key >,
-	    class _Alloc = allocator< _Key > >
+            class _Alloc = allocator< _Key > >
   class unordered_multiset {
   public:
     typedef size_t size_type;
@@ -53,6 +54,8 @@
     typedef const value_type* const_pointer;
     typedef value_type& reference;
     typedef const value_type& const_reference;
+    typedef _Hash hasher;
+    typedef _Compare key_equal;
     typedef _Alloc allocator_type;
 
     %traits_swigtype(_Key);
diff --git a/Lib/std/std_unordered_set.i b/Lib/std/std_unordered_set.i
index 133246d..91e8074 100644
--- a/Lib/std/std_unordered_set.i
+++ b/Lib/std/std_unordered_set.i
@@ -50,19 +50,19 @@
 // const declarations are used to guess the intent of the function being
 // exported; therefore, the following rationale is applied:
 // 
-//   -- f(std::unordered_set<T>), f(const std::unordered_set<T>&):
+//   -- f(std::unordered_set<Key>), f(const std::unordered_set<Key>&):
 //      the parameter being read-only, either a sequence or a
-//      previously wrapped std::unordered_set<T> can be passed.
-//   -- f(std::unordered_set<T>&), f(std::unordered_set<T>*):
+//      previously wrapped std::unordered_set<Key> can be passed.
+//   -- f(std::unordered_set<Key>&), f(std::unordered_set<Key>*):
 //      the parameter may be modified; therefore, only a wrapped std::unordered_set
 //      can be passed.
-//   -- std::unordered_set<T> f(), const std::unordered_set<T>& f():
-//      the unordered_set is returned by copy; therefore, a sequence of T:s 
+//   -- std::unordered_set<Key> f(), const std::unordered_set<Key>& f():
+//      the unordered_set is returned by copy; therefore, a sequence of Key:s 
 //      is returned which is most easily used in other functions
-//   -- std::unordered_set<T>& f(), std::unordered_set<T>* f():
+//   -- std::unordered_set<Key>& f(), std::unordered_set<Key>* f():
 //      the unordered_set is returned by reference; therefore, a wrapped std::unordered_set
 //      is returned
-//   -- const std::unordered_set<T>* f(), f(const std::unordered_set<T>*):
+//   -- const std::unordered_set<Key>* f(), f(const std::unordered_set<Key>*):
 //      for consistency, they expect and return a plain unordered_set pointer.
 // ------------------------------------------------------------------------
 
@@ -74,20 +74,22 @@
 
 namespace std {
 
-  template <class _Key, class _Hash = std::hash< _Key >,
+  template <class _Key,
+            class _Hash = std::hash< _Key >,
             class _Compare = std::equal_to< _Key >,
-	    class _Alloc = allocator< _Key > >
+            class _Alloc = allocator< _Key > >
   class unordered_set {
   public:
     typedef size_t size_type;
     typedef ptrdiff_t difference_type;
-    typedef _Hash hasher;
     typedef _Key value_type;
     typedef _Key key_type;
     typedef value_type* pointer;
     typedef const value_type* const_pointer;
     typedef value_type& reference;
     typedef const value_type& const_reference;
+    typedef _Hash hasher;
+    typedef _Compare key_equal;
     typedef _Alloc allocator_type;
 
     %traits_swigtype(_Key);
diff --git a/Lib/swigfragments.swg b/Lib/swigfragments.swg
index 63bb6c8..2cbef7c 100644
--- a/Lib/swigfragments.swg
+++ b/Lib/swigfragments.swg
@@ -35,7 +35,7 @@
 
 %fragment("<stdio.h>", "header") %{
 #include <stdio.h>
-#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
+#if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__BORLANDC__) || defined(_WATCOM)
 # ifndef snprintf
 #  define snprintf _snprintf
 # endif
diff --git a/README b/README
index db468d8..165098c 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 SWIG (Simplified Wrapper and Interface Generator)
 
-Version: 4.0.0 (in progress)
+Version: 4.0.1 (in progress)
 
 Tagline: SWIG is a compiler that integrates C and C++ with languages
          including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua,
diff --git a/RELEASENOTES b/RELEASENOTES
index 5f6560c..3fe78f2 100644
--- a/RELEASENOTES
+++ b/RELEASENOTES
@@ -7,6 +7,35 @@
 Detailed release notes are available with the release and are also
 published on the SWIG web site at http://swig.org/release.html.
 
+SWIG-4.0.0 summary:
+- Support for Doxygen documentation comments which are parsed and
+  converted into JavaDoc or PyDoc comments.
+- STL wrappers improved for C#, Java and Ruby.
+- C++11 STL containers added for Java, Python and Ruby.
+- Improved support for parsing C++11 and C++14 code.
+- Various fixes for shared_ptr.
+- Various C preprocessor corner case fixes.
+- Corner case fixes for member function pointers.
+- Python module overhaul by simplifying the generated code and turning
+  most optimizations on by default.
+- %template improvements wrt scoping to align with C++ explicit
+  template instantiations.
+- Added support for a command-line options file (sometimes called a
+  response file).
+- Numerous enhancements and fixes for all supported target languages.
+- SWIG now classifies the status of target languages into either
+  'Experimental' or 'Supported' to indicate the expected maturity
+  level.
+- Support for CFFI, Allegrocl, Chicken, CLISP, S-EXP, UFFI, Pike,
+  Modula3 has been removed.
+- Octave 4.4-5.1 support added.
+- PHP5 support removed, PHP7 is now the supported PHP version.
+- Minimum Python version required is now 2.7, 3.2-3.7 are the only
+  other versions supported.
+- Added support for Javascript NodeJS versions 2-10.
+- OCaml support is much improved and updated, minimum OCaml version
+  required is now 3.12.0.
+
 SWIG-3.0.12 summary:
 - Add support for Octave-4.2.
 - Enhance %extend to support template functions.
diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y
index f20f1db..b526da9 100644
--- a/Source/CParse/parser.y
+++ b/Source/CParse/parser.y
@@ -1552,6 +1552,7 @@
     Parm   *throws;
     String *throwf;
     String *nexcept;
+    String *final;
   } dtype;
   struct {
     const char *type;
@@ -1567,6 +1568,7 @@
     ParmList  *throws;
     String    *throwf;
     String    *nexcept;
+    String    *final;
   } decl;
   Parm         *tparms;
   struct {
@@ -1648,7 +1650,7 @@
 
 /* C declarations */
 %type <node>     c_declaration c_decl c_decl_tail c_enum_key c_enum_inherit c_enum_decl c_enum_forward_decl c_constructor_decl;
-%type <node>     enumlist enumlist_tail enumlist_item edecl_with_dox edecl;
+%type <node>     enumlist enumlist_item edecl_with_dox edecl;
 
 /* C++ declarations */
 %type <node>     cpp_declaration cpp_class_decl cpp_forward_class_decl cpp_template_decl cpp_alternate_rettype;
@@ -3189,6 +3191,7 @@
 	      Setattr($$,"throws",$4.throws);
 	      Setattr($$,"throw",$4.throwf);
 	      Setattr($$,"noexcept",$4.nexcept);
+	      Setattr($$,"final",$4.final);
 	      if ($5.val && $5.type) {
 		/* store initializer type as it might be different to the declared type */
 		SwigType *valuetype = NewSwigType($5.type);
@@ -3266,6 +3269,7 @@
 	      Setattr($$,"throws",$4.throws);
 	      Setattr($$,"throw",$4.throwf);
 	      Setattr($$,"noexcept",$4.nexcept);
+	      Setattr($$,"final",$4.final);
 	      if (!$9) {
 		if (Len(scanner_ccode)) {
 		  String *code = Copy(scanner_ccode);
@@ -3330,6 +3334,7 @@
 		 Setattr($$,"throws",$3.throws);
 		 Setattr($$,"throw",$3.throwf);
 		 Setattr($$,"noexcept",$3.nexcept);
+		 Setattr($$,"final",$3.final);
 		 if ($4.bitfield) {
 		   Setattr($$,"bitfield", $4.bitfield);
 		 }
@@ -3638,6 +3643,7 @@
 			Setattr($$,"throws",$6.throws);
 			Setattr($$,"throw",$6.throwf);
 			Setattr($$,"noexcept",$6.nexcept);
+			Setattr($$,"final",$6.final);
 			err = 0;
 		      }
 		    }
@@ -4704,6 +4710,7 @@
 		Setattr($$,"throws",$6.throws);
 		Setattr($$,"throw",$6.throwf);
 		Setattr($$,"noexcept",$6.nexcept);
+		Setattr($$,"final",$6.final);
 		if (Len(scanner_ccode)) {
 		  String *code = Copy(scanner_ccode);
 		  Setattr($$,"code",code);
@@ -4740,6 +4747,7 @@
 	       Setattr($$,"throws",$6.throws);
 	       Setattr($$,"throw",$6.throwf);
 	       Setattr($$,"noexcept",$6.nexcept);
+	       Setattr($$,"final",$6.final);
 	       if ($6.val)
 	         Setattr($$,"value",$6.val);
 	       if ($6.qualifier)
@@ -4760,6 +4768,7 @@
 		Setattr($$,"throws",$7.throws);
 		Setattr($$,"throw",$7.throwf);
 		Setattr($$,"noexcept",$7.nexcept);
+		Setattr($$,"final",$7.final);
 		if ($7.val)
 		  Setattr($$,"value",$7.val);
 		if (Len(scanner_ccode)) {
@@ -4941,6 +4950,7 @@
 		    $$.throws = $1.throws;
 		    $$.throwf = $1.throwf;
 		    $$.nexcept = $1.nexcept;
+		    $$.final = $1.final;
                }
                | cpp_const EQUAL default_delete SEMI {
 	            Clear(scanner_ccode);
@@ -4951,6 +4961,7 @@
 		    $$.throws = $1.throws;
 		    $$.throwf = $1.throwf;
 		    $$.nexcept = $1.nexcept;
+		    $$.final = $1.final;
                }
                | cpp_const LBRACE { 
 		    skip_balanced('{','}'); 
@@ -4961,6 +4972,7 @@
 		    $$.throws = $1.throws;
 		    $$.throwf = $1.throwf;
 		    $$.nexcept = $1.nexcept;
+		    $$.final = $1.final;
 	       }
                ;
 
@@ -4973,6 +4985,7 @@
                      $$.throws = $1.throws;
                      $$.throwf = $1.throwf;
                      $$.nexcept = $1.nexcept;
+                     $$.final = $1.final;
                 }
                | cpp_const EQUAL definetype SEMI { 
                      Clear(scanner_ccode);
@@ -4982,7 +4995,8 @@
                      $$.bitfield = 0;
                      $$.throws = $1.throws; 
                      $$.throwf = $1.throwf; 
-                     $$.nexcept = $1.nexcept; 
+                     $$.nexcept = $1.nexcept;
+                     $$.final = $1.final;
                }
                | cpp_const LBRACE { 
                      skip_balanced('{','}');
@@ -4992,7 +5006,8 @@
                      $$.bitfield = 0;
                      $$.throws = $1.throws; 
                      $$.throwf = $1.throwf; 
-                     $$.nexcept = $1.nexcept; 
+                     $$.nexcept = $1.nexcept;
+                     $$.final = $1.final;
                }
                ;
 
@@ -5210,6 +5225,7 @@
 		    $$.throws = 0;
 		    $$.throwf = 0;
 		    $$.nexcept = 0;
+		    $$.final = 0;
 		  }
                }
                | EQUAL definetype LBRACKET expr RBRACKET { 
@@ -5223,6 +5239,7 @@
 		    $$.throws = 0;
 		    $$.throwf = 0;
 		    $$.nexcept = 0;
+		    $$.final = 0;
 		  } else {
 		    $$.val = NewStringf("%s[%s]",$2.val,$4.val); 
 		  }		  
@@ -5236,6 +5253,7 @@
 		 $$.throws = 0;
 		 $$.throwf = 0;
 		 $$.nexcept = 0;
+		 $$.final = 0;
 	       }
                | COLON expr { 
 		 $$.val = 0;
@@ -5245,6 +5263,7 @@
 		 $$.throws = 0;
 		 $$.throwf = 0;
 		 $$.nexcept = 0;
+		 $$.final = 0;
 	       }
                | empty {
                  $$.val = 0;
@@ -5254,6 +5273,7 @@
 		 $$.throws = 0;
 		 $$.throwf = 0;
 		 $$.nexcept = 0;
+		 $$.final = 0;
                }
                ;
 
@@ -6293,6 +6313,7 @@
 		   $$.throws = 0;
 		   $$.throwf = 0;
 		   $$.nexcept = 0;
+		   $$.final = 0;
 		   scanner_ignore_typedef();
                 }
                 | default_delete {
@@ -6319,6 +6340,7 @@
 		  $$.throws = 0;
 		  $$.throwf = 0;
 		  $$.nexcept = 0;
+		  $$.final = 0;
 		}
 		;
 
@@ -6333,6 +6355,7 @@
 		  $$.throws = 0;
 		  $$.throwf = 0;
 		  $$.nexcept = 0;
+		  $$.final = 0;
 		}
 		;
 
@@ -6351,21 +6374,31 @@
 		| empty
 		;
 
-optional_ignored_define_after_comma
-		: empty
-		| COMMA
-		| COMMA constant_directive
-		;
-
 /* Enum lists - any #define macros (constant directives) within the enum list are ignored. Trailing commas accepted. */
-enumlist	: enumlist_item optional_ignored_define_after_comma {
+enumlist	: enumlist_item {
 		  Setattr($1,"_last",$1);
 		  $$ = $1;
 		}
-		| enumlist_item enumlist_tail optional_ignored_define_after_comma {
-		  set_nextSibling($1, $2);
-		  Setattr($1,"_last",Getattr($2,"_last"));
-		  Setattr($2,"_last",NULL);
+		| enumlist_item DOXYGENPOSTSTRING {
+		  Setattr($1,"_last",$1);
+		  set_comment($1, $2);
+		  $$ = $1;
+		}
+		| enumlist_item COMMA enumlist {
+		  if ($3) {
+		    set_nextSibling($1, $3);
+		    Setattr($1,"_last",Getattr($3,"_last"));
+		    Setattr($3,"_last",NULL);
+		  }
+		  $$ = $1;
+		}
+		| enumlist_item COMMA DOXYGENPOSTSTRING enumlist {
+		  if ($4) {
+		    set_nextSibling($1, $4);
+		    Setattr($1,"_last",Getattr($4,"_last"));
+		    Setattr($4,"_last",NULL);
+		  }
+		  set_comment($1, $3);
 		  $$ = $1;
 		}
 		| optional_ignored_defines {
@@ -6373,17 +6406,6 @@
 		}
 		;
 
-enumlist_tail	: COMMA enumlist_item {
-		  Setattr($2,"_last",$2);
-		  $$ = $2;
-		}
-		| enumlist_tail COMMA enumlist_item {
-		  set_nextSibling(Getattr($1,"_last"), $3);
-		  Setattr($1,"_last",$3);
-		  $$ = $1;
-		}
-		;
-
 enumlist_item	: optional_ignored_defines edecl_with_dox optional_ignored_defines {
 		  $$ = $2;
 		}
@@ -6396,19 +6418,6 @@
 		  $$ = $2;
 		  set_comment($2, $1);
 		}
-		| edecl DOXYGENPOSTSTRING {
-		  $$ = $1;
-		  set_comment($1, $2);
-		}
-		| DOXYGENPOSTSTRING edecl {
-		  $$ = $2;
-		  set_comment(previousNode, $1);
-		}
-		| DOXYGENPOSTSTRING edecl DOXYGENPOSTSTRING {
-		  $$ = $2;
-		  set_comment(previousNode, $1);
-		  set_comment($2, $3);
-		}
 		;
 
 edecl          :  identifier {
@@ -6525,6 +6534,7 @@
 		  $$.throws = 0;
 		  $$.throwf = 0;
 		  $$.nexcept = 0;
+		  $$.final = 0;
 	       }
                | WCHARCONST {
 		  $$.val = NewString($1);
@@ -6538,6 +6548,7 @@
 		  $$.throws = 0;
 		  $$.throwf = 0;
 		  $$.nexcept = 0;
+		  $$.final = 0;
 	       }
 
 /* grouping */
@@ -6892,18 +6903,18 @@
                    $$ = 0;
 	       }
 	       | FINAL {
-                   $$ = 0;
+                   $$ = NewString("1");
 	       }
 	       | FINAL OVERRIDE {
-                   $$ = 0;
+                   $$ = NewString("1");
 	       }
 	       | OVERRIDE FINAL {
-                   $$ = 0;
+                   $$ = NewString("1");
 	       }
                ;
 
 virt_specifier_seq_opt : virt_specifier_seq {
-                   $$ = 0;
+                   $$ = $1;
                }
                | empty {
                    $$ = 0;
@@ -6914,31 +6925,37 @@
                     $$.throws = $3;
                     $$.throwf = NewString("1");
                     $$.nexcept = 0;
+                    $$.final = 0;
 	       }
 	       | NOEXCEPT {
                     $$.throws = 0;
                     $$.throwf = 0;
                     $$.nexcept = NewString("true");
+                    $$.final = 0;
 	       }
 	       | virt_specifier_seq {
                     $$.throws = 0;
                     $$.throwf = 0;
                     $$.nexcept = 0;
+                    $$.final = $1;
 	       }
 	       | THROW LPAREN parms RPAREN virt_specifier_seq {
                     $$.throws = $3;
                     $$.throwf = NewString("1");
                     $$.nexcept = 0;
+                    $$.final = $5;
 	       }
 	       | NOEXCEPT virt_specifier_seq {
                     $$.throws = 0;
                     $$.throwf = 0;
                     $$.nexcept = NewString("true");
+                    $$.final = $2;
 	       }
 	       | NOEXCEPT LPAREN expr RPAREN {
                     $$.throws = 0;
                     $$.throwf = 0;
                     $$.nexcept = $3.val;
+                    $$.final = 0;
 	       }
 	       ;	
 
@@ -6946,6 +6963,7 @@
                     $$.throws = 0;
                     $$.throwf = 0;
                     $$.nexcept = 0;
+                    $$.final = 0;
                     $$.qualifier = $1.qualifier;
                     $$.refqualifier = $1.refqualifier;
                }
@@ -6968,6 +6986,7 @@
                     $$.throws = 0;
                     $$.throwf = 0;
                     $$.nexcept = 0;
+                    $$.final = 0;
                     $$.qualifier = 0;
                     $$.refqualifier = 0;
                }
@@ -6980,6 +6999,7 @@
 		    $$.throws = $1.throws;
 		    $$.throwf = $1.throwf;
 		    $$.nexcept = $1.nexcept;
+		    $$.final = $1.final;
                     if ($1.qualifier)
                       Swig_error(cparse_file, cparse_line, "Constructor cannot have a qualifier.\n");
                }
@@ -6990,6 +7010,7 @@
                     $$.throws = $1.throws;
                     $$.throwf = $1.throwf;
                     $$.nexcept = $1.nexcept;
+                    $$.final = $1.final;
                     if ($1.qualifier)
                       Swig_error(cparse_file, cparse_line, "Constructor cannot have a qualifier.\n");
                }
@@ -7001,6 +7022,7 @@
 		    $$.throws = 0;
 		    $$.throwf = 0;
 		    $$.nexcept = 0;
+		    $$.final = 0;
                }
                | LPAREN parms RPAREN LBRACE {
                     skip_balanced('{','}'); 
@@ -7010,6 +7032,7 @@
                     $$.throws = 0;
                     $$.throwf = 0;
                     $$.nexcept = 0;
+                    $$.final = 0;
                }
                | EQUAL definetype SEMI { 
                     $$.have_parms = 0; 
@@ -7017,6 +7040,7 @@
                     $$.throws = 0;
                     $$.throwf = 0;
                     $$.nexcept = 0;
+                    $$.final = 0;
                }
                | exception_specification EQUAL default_delete SEMI {
                     $$.have_parms = 0;
@@ -7024,6 +7048,7 @@
                     $$.throws = $1.throws;
                     $$.throwf = $1.throwf;
                     $$.nexcept = $1.nexcept;
+                    $$.final = $1.final;
                     if ($1.qualifier)
                       Swig_error(cparse_file, cparse_line, "Constructor cannot have a qualifier.\n");
                }
diff --git a/Source/Doxygen/pydoc.cxx b/Source/Doxygen/pydoc.cxx
index 8c30900..fc3b0ea 100644
--- a/Source/Doxygen/pydoc.cxx
+++ b/Source/Doxygen/pydoc.cxx
@@ -336,8 +336,13 @@
   std::string type;
 
   String *s = Swig_typemap_lookup("doctype", n, lname, 0);
+  if (!s) {
+    if (String *t = Getattr(n, "type"))
+      s = SwigType_str(t, "");
+  }
+
   if (!s)
-    s = SwigType_str(Getattr(n, "type"), "");
+    return type;
 
   if (Language::classLookup(s)) {
     // In Python C++ namespaces are flattened, so remove all but last component
diff --git a/Source/Include/swigwarn.h b/Source/Include/swigwarn.h
index fde82bd..fbcea4d 100644
--- a/Source/Include/swigwarn.h
+++ b/Source/Include/swigwarn.h
@@ -211,6 +211,7 @@
 #define WARN_LANG_EXTEND_CONSTRUCTOR  522
 #define WARN_LANG_EXTEND_DESTRUCTOR   523
 #define WARN_LANG_EXPERIMENTAL        524
+#define WARN_LANG_DIRECTOR_FINAL      525
 
 /* -- Doxygen comments -- */
 
diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx
index bd00ffa..ff73c30 100644
--- a/Source/Modules/csharp.cxx
+++ b/Source/Modules/csharp.cxx
@@ -1873,38 +1873,56 @@
 	   typemapLookup(n, "csbody", typemap_lookup_type, WARN_CSHARP_TYPEMAP_CSBODY_UNDEF),	// main body of class
 	   NIL);
 
-    // C++ destructor is wrapped by the Dispose method
-    // Note that the method name is specified in a typemap attribute called methodname
+    // C++ destructor is wrapped by the Finalize and Dispose methods
+
+    const char *tmap_method = derived ? "csdestruct_derived" : "csdestruct";
+    const String *tm = typemapExists(n, tmap_method, typemap_lookup_type);
+    if (tm) {
+      Swig_error(Getfile(tm), Getline(tm),
+	  "A deprecated %s typemap was found for %s, please remove it and replace all csdestruct, csdestruct_derived and csfinalize typemaps by the csdispose, csdispose_derived, csdisposing and csdisposing_derived typemaps.\n",
+	  tmap_method, proxy_class_name);
+    }
+    tmap_method = "csfinalize";
+    tm = typemapExists(n, tmap_method, typemap_lookup_type);
+    if (tm) {
+      Swig_error(Getfile(tm), Getline(tm),
+	  "A deprecated %s typemap was found for %s, please remove it and replace all csdestruct, csdestruct_derived and csfinalize typemaps by the csdispose, csdispose_derived, csdisposing and csdisposing_derived typemaps.\n",
+	  tmap_method, proxy_class_name);
+    }
+
+    tmap_method = derived ? "csdisposing_derived" : "csdisposing";
     String *destruct = NewString("");
-    const String *tm = NULL;
     attributes = NewHash();
-    String *destruct_methodname = NULL;
-    String *destruct_methodmodifiers = NULL;
+    const String *destruct_methodname = NULL;
+    const String *destruct_methodmodifiers = NULL;
+    const String *destruct_parameters = NULL;
     if (derived) {
-      tm = typemapLookup(n, "csdestruct_derived", typemap_lookup_type, WARN_NONE, attributes);
-      destruct_methodname = Getattr(attributes, "tmap:csdestruct_derived:methodname");
-      destruct_methodmodifiers = Getattr(attributes, "tmap:csdestruct_derived:methodmodifiers");
+      tm = typemapLookup(n, "csdisposing_derived", typemap_lookup_type, WARN_NONE, attributes);
+      destruct_methodname = Getattr(attributes, "tmap:csdisposing_derived:methodname");
+      destruct_methodmodifiers = Getattr(attributes, "tmap:csdisposing_derived:methodmodifiers");
+      destruct_parameters = Getattr(attributes, "tmap:csdisposing_derived:parameters");
     } else {
-      tm = typemapLookup(n, "csdestruct", typemap_lookup_type, WARN_NONE, attributes);
-      destruct_methodname = Getattr(attributes, "tmap:csdestruct:methodname");
-      destruct_methodmodifiers = Getattr(attributes, "tmap:csdestruct:methodmodifiers");
+      tm = typemapLookup(n, "csdisposing", typemap_lookup_type, WARN_NONE, attributes);
+      destruct_methodname = Getattr(attributes, "tmap:csdisposing:methodname");
+      destruct_methodmodifiers = Getattr(attributes, "tmap:csdisposing:methodmodifiers");
+      destruct_parameters = Getattr(attributes, "tmap:csdisposing:parameters");
     }
     if (tm && *Char(tm)) {
       if (!destruct_methodname) {
-	Swig_error(Getfile(n), Getline(n), "No methodname attribute defined in csdestruct%s typemap for %s\n", (derived ? "_derived" : ""), proxy_class_name);
+	Swig_error(Getfile(n), Getline(n), "No methodname attribute defined in %s typemap for %s\n", tmap_method, proxy_class_name);
       }
       if (!destruct_methodmodifiers) {
 	Swig_error(Getfile(n), Getline(n),
-		   "No methodmodifiers attribute defined in csdestruct%s typemap for %s.\n", (derived ? "_derived" : ""), proxy_class_name);
+		   "No methodmodifiers attribute defined in %s typemap for %s.\n", tmap_method, proxy_class_name);
       }
+      if (!destruct_parameters)
+	destruct_parameters = empty_string;
     }
     // Emit the Finalize and Dispose methods
     if (tm) {
-      // Finalize method
-      if (*Char(destructor_call)) {
-	Printv(proxy_class_def, typemapLookup(n, "csfinalize", typemap_lookup_type, WARN_NONE), NIL);
-      }
-      // Dispose method
+      // Finalize and Dispose methods
+      Printv(proxy_class_def, typemapLookup(n, derived ? "csdispose_derived" : "csdispose", typemap_lookup_type, WARN_NONE), NIL);
+      // Dispose(bool disposing) method
       Printv(destruct, tm, NIL);
       if (*Char(destructor_call))
 	Replaceall(destruct, "$imcall", destructor_call);
@@ -1917,7 +1935,7 @@
 	  Printv(proxy_class_def, methodmods, NIL);
 	else
 	  Printv(proxy_class_def, destruct_methodmodifiers, " ", derived ? "override" : "virtual", NIL);
-	Printv(proxy_class_def, " void ", destruct_methodname, "() ", destruct, "\n", NIL);
+	Printv(proxy_class_def, " void ", destruct_methodname, "(", destruct_parameters, ") ", destruct, "\n", NIL);
       }
     }
     if (*Char(interface_upcasts))
@@ -3553,6 +3571,24 @@
   }
 
   /* -----------------------------------------------------------------------------
+   * typemapExists()
+   * n - for input only and must contain info for Getfile(n) and Getline(n) to work
+   * tmap_method - typemap method name
+   * type - typemap type to lookup
+   * returns found typemap or NULL if not found
+   * ----------------------------------------------------------------------------- */
+
+  const String *typemapExists(Node *n, const_String_or_char_ptr tmap_method, SwigType *type) {
+    Node *node = NewHash();
+    Setattr(node, "type", type);
+    Setfile(node, Getfile(n));
+    Setline(node, Getline(n));
+    const String *tm = Swig_typemap_lookup(tmap_method, node, "", 0);
+    Delete(node);
+    return tm;
+  }
+
+  /* -----------------------------------------------------------------------------
    * canThrow()
    * Determine whether the code in the typemap can throw a C# exception.
    * If so, note it for later when excodeSubstitute() is called.
diff --git a/Source/Modules/d.cxx b/Source/Modules/d.cxx
index 4fa30dd..5e82dfd 100644
--- a/Source/Modules/d.cxx
+++ b/Source/Modules/d.cxx
@@ -3274,17 +3274,20 @@
     // attribute called »methodname«.
     const String *tm = NULL;
 
-    String *dispose_methodname;
-    String *dispose_methodmodifiers;
+    const String *dispose_methodname;
+    const String *dispose_methodmodifiers;
+    const String *dispose_parameters;
     attributes = NewHash();
     if (derived) {
       tm = lookupCodeTypemap(n, "ddispose_derived", typemap_lookup_type, WARN_NONE, attributes);
       dispose_methodname = Getattr(attributes, "tmap:ddispose_derived:methodname");
       dispose_methodmodifiers = Getattr(attributes, "tmap:ddispose_derived:methodmodifiers");
+      dispose_parameters = Getattr(attributes, "tmap:ddispose_derived:parameters");
     } else {
       tm = lookupCodeTypemap(n, "ddispose", typemap_lookup_type, WARN_NONE, attributes);
       dispose_methodname = Getattr(attributes, "tmap:ddispose:methodname");
       dispose_methodmodifiers = Getattr(attributes, "tmap:ddispose:methodmodifiers");
+      dispose_parameters = Getattr(attributes, "tmap:ddispose:parameters");
     }
 
     if (tm && *Char(tm)) {
@@ -3298,6 +3301,8 @@
 	  "No methodmodifiers attribute defined in ddispose%s typemap for %s.\n",
 	  (derived ? "_derived" : ""), proxy_class_name);
       }
+      if (!dispose_parameters)
+	dispose_parameters = empty_string;
     }
 
     if (tm) {
@@ -3324,7 +3329,7 @@
 	  Printv(body, methodmods, NIL);
 	else
 	  Printv(body, dispose_methodmodifiers, (derived ? " override" : ""), NIL);
-	Printv(body, " void ", dispose_methodname, "() ", dispose_code, "\n", NIL);
+	Printv(body, " void ", dispose_methodname, "(", dispose_parameters, ") ", dispose_code, "\n", NIL);
       }
     }
 
diff --git a/Source/Modules/emit.cxx b/Source/Modules/emit.cxx
index 43f87db..7a4c2dc 100644
--- a/Source/Modules/emit.cxx
+++ b/Source/Modules/emit.cxx
@@ -188,7 +188,9 @@
       p = lp;
       while (p) {
 	if (SwigType_isvarargs(Getattr(p, "type"))) {
+	  // Mark the head of the ParmList that it has varargs
 	  Setattr(l, "emit:varargs", lp);
+//Printf(stdout, "setting emit:varargs %s ... %s +++ %s\n", Getattr(l, "emit:varargs"), Getattr(l, "type"), Getattr(p, "type"));
 	  break;
 	}
 	p = nextSibling(p);
@@ -329,7 +331,8 @@
 /* -----------------------------------------------------------------------------
  * emit_isvarargs()
  *
- * Checks if a function is a varargs function
+ * Checks if a ParmList is a parameter list containing varargs.
+ * This function requires emit_attach_parmmaps to have been called beforehand.
  * ----------------------------------------------------------------------------- */
 
 int emit_isvarargs(ParmList *p) {
@@ -341,6 +344,28 @@
 }
 
 /* -----------------------------------------------------------------------------
+ * emit_isvarargs_function()
+ *
+ * Checks for varargs in a function/constructor (can be overloaded)
+ * ----------------------------------------------------------------------------- */
+
+bool emit_isvarargs_function(Node *n) {
+  bool has_varargs = false;
+  Node *over = Getattr(n, "sym:overloaded");
+  if (over) {
+    for (Node *sibling = over; sibling; sibling = Getattr(sibling, "sym:nextSibling")) {
+      if (ParmList_has_varargs(Getattr(sibling, "parms"))) {
+	has_varargs = true;
+	break;
+      }
+    }
+  } else {
+    has_varargs = ParmList_has_varargs(Getattr(n, "parms")) ? true : false;
+  }
+  return has_varargs;
+}
+
+/* -----------------------------------------------------------------------------
  * void emit_mark_vararg_parms()
  *
  * Marks the vararg parameters which are to be ignored.
diff --git a/Source/Modules/go.cxx b/Source/Modules/go.cxx
index 41e8f7d..0163f71 100644
--- a/Source/Modules/go.cxx
+++ b/Source/Modules/go.cxx
@@ -125,6 +125,8 @@
   String *prefix_option;
   // -fgo-pkgpath option.
   String *pkgpath_option;
+  // Prefix for translating %import directive to import statements.
+  String *import_prefix;
   // Whether to use a shared library.
   bool use_shlib;
   // Name of shared library to import.
@@ -199,11 +201,12 @@
 public:
   GO():package(NULL),
      module(NULL),
-     cgo_flag(false),
+     cgo_flag(true),
      gccgo_flag(false),
      go_prefix(NULL),
      prefix_option(NULL),
      pkgpath_option(NULL),
+     import_prefix(NULL),
      use_shlib(false),
      soname(NULL),
      intgo_type_size(0),
@@ -269,6 +272,9 @@
 	} else if (strcmp(argv[i], "-cgo") == 0) {
 	  Swig_mark_arg(i);
 	  cgo_flag = true;
+	} else if (strcmp(argv[i], "-no-cgo") == 0) {
+	  Swig_mark_arg(i);
+	  cgo_flag = false;
 	} else if (strcmp(argv[i], "-gccgo") == 0) {
 	  Swig_mark_arg(i);
 	  gccgo_flag = true;
@@ -290,6 +296,15 @@
 	  } else {
 	    Swig_arg_error();
 	  }
+	} else if (strcmp(argv[i], "-import-prefix") == 0) {
+	  if (argv[i + 1]) {
+	    import_prefix = NewString(argv[i + 1]);
+	    Swig_mark_arg(i);
+	    Swig_mark_arg(i + 1);
+	    i++;
+	  } else {
+	    Swig_arg_error();
+	  }
 	} else if (strcmp(argv[i], "-use-shlib") == 0) {
 	  Swig_mark_arg(i);
 	  use_shlib = true;
@@ -740,7 +755,11 @@
     if (modname) {
       if (!Getattr(go_imports, modname)) {
         Setattr(go_imports, modname, modname);
-        Printv(f_go_imports, "import \"", modname, "\"\n", NULL);
+        Printv(f_go_imports, "import \"", NULL);
+	if (import_prefix) {
+	  Printv(f_go_imports, import_prefix, "/", NULL);
+	}
+	Printv(f_go_imports, modname, "\"\n", NULL);
       }
       imported_package = modname;
       saw_import = true;
@@ -6979,9 +6998,11 @@
 const char * const GO::usage = "\
 Go Options (available with -go)\n\
      -cgo                - Generate cgo input files\n\
-     -gccgo              - Generate code for gccgo rather than 6g/8g\n\
+     -no-cgo             - Do not generate cgo input files\n\
+     -gccgo              - Generate code for gccgo rather than gc\n\
      -go-pkgpath <p>     - Like gccgo -fgo-pkgpath option\n\
      -go-prefix <p>      - Like gccgo -fgo-prefix option\n\
+     -import-prefix <p>  - Prefix to add to %import directives\n\
      -intgosize <s>      - Set size of Go int type--32 or 64 bits\n\
      -package <name>     - Set name of the Go package to <name>\n\
      -use-shlib          - Force use of a shared library\n\
diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx
index ac845cb..cb41781 100644
--- a/Source/Modules/java.cxx
+++ b/Source/Modules/java.cxx
@@ -2035,16 +2035,19 @@
     String *destruct = NewString("");
     const String *tm = NULL;
     attributes = NewHash();
-    String *destruct_methodname = NULL;
-    String *destruct_methodmodifiers = NULL;
+    const String *destruct_methodname = NULL;
+    const String *destruct_methodmodifiers = NULL;
+    const String *destruct_parameters = NULL;
     if (derived) {
       tm = typemapLookup(n, "javadestruct_derived", typemap_lookup_type, WARN_NONE, attributes);
       destruct_methodname = Getattr(attributes, "tmap:javadestruct_derived:methodname");
       destruct_methodmodifiers = Getattr(attributes, "tmap:javadestruct_derived:methodmodifiers");
+      destruct_parameters = Getattr(attributes, "tmap:javadestruct_derived:parameters");
     } else {
       tm = typemapLookup(n, "javadestruct", typemap_lookup_type, WARN_NONE, attributes);
       destruct_methodname = Getattr(attributes, "tmap:javadestruct:methodname");
       destruct_methodmodifiers = Getattr(attributes, "tmap:javadestruct:methodmodifiers");
+      destruct_parameters = Getattr(attributes, "tmap:javadestruct:parameters");
     }
     if (tm && *Char(tm)) {
       if (!destruct_methodname) {
@@ -2053,6 +2056,8 @@
       if (!destruct_methodmodifiers) {
 	Swig_error(Getfile(n), Getline(n), "No methodmodifiers attribute defined in javadestruct%s typemap for %s.\n", (derived ? "_derived" : ""), proxy_class_name);
       }
+      if (!destruct_parameters)
+	destruct_parameters = empty_string;
     }
     // Emit the finalize and delete methods
     if (tm) {
@@ -2073,7 +2078,7 @@
 	  Printv(proxy_class_def, methodmods, NIL);
 	else
 	  Printv(proxy_class_def, destruct_methodmodifiers, NIL);
-	Printv(proxy_class_def, " void ", destruct_methodname, "()", destructor_throws_clause, " ", destruct, "\n", NIL);
+	Printv(proxy_class_def, " void ", destruct_methodname, "(", destruct_parameters, ")", destructor_throws_clause, " ", destruct, "\n", NIL);
       }
     }
     if (*Char(interface_upcasts))
diff --git a/Source/Modules/lang.cxx b/Source/Modules/lang.cxx
index f9af972..f7979b6 100644
--- a/Source/Modules/lang.cxx
+++ b/Source/Modules/lang.cxx
@@ -1894,6 +1894,8 @@
     }
     if (!checkAttribute(nn, "storage", "virtual"))
       continue;
+    if (GetFlag(nn, "final"))
+      continue;
     /* we need to add methods(cdecl) and destructor (to check for throw decl) */
     int is_destructor = (Cmp(nodeType, "destructor") == 0);
     if ((Cmp(nodeType, "cdecl") == 0) || is_destructor) {
@@ -2109,7 +2111,7 @@
     Node *item = Getitem(vtable, i);
     String *method = Getattr(item, "methodNode");
     String *fqdname = Getattr(item, "fqdname");
-    if (GetFlag(method, "feature:nodirector"))
+    if (GetFlag(method, "feature:nodirector") || GetFlag(method, "final"))
       continue;
 
     String *wrn = Getattr(method, "feature:warnfilter");
@@ -2198,6 +2200,16 @@
   String *using_protected_members_code = NewString("");
   for (ni = Getattr(n, "firstChild"); ni; ni = nextSibling(ni)) {
     Node *nodeType = Getattr(ni, "nodeType");
+    if (Cmp(nodeType, "destructor") == 0 && GetFlag(ni, "final")) {
+      String *classtype = Getattr(n, "classtype");
+      SWIG_WARN_NODE_BEGIN(ni);
+      Swig_warning(WARN_LANG_DIRECTOR_FINAL, input_file, line_number, "Destructor %s is final, %s cannot be a director class.\n", Swig_name_decl(ni), classtype);
+      SWIG_WARN_NODE_END(ni);
+      SetFlag(n, "feature:nodirector");
+      Delete(vtable);
+      Delete(using_protected_members_code);
+      return SWIG_OK;
+    }
     bool cdeclaration = (Cmp(nodeType, "cdecl") == 0);
     if (cdeclaration && !GetFlag(ni, "feature:ignore")) {
       if (isNonVirtualProtectedAccess(ni)) {
diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
index 0b615ce..c6bd148 100644
--- a/Source/Modules/main.cxx
+++ b/Source/Modules/main.cxx
@@ -970,11 +970,6 @@
     SWIG_exit(EXIT_SUCCESS);	// Exit if we're in help mode
   }
 
-  if (!tlm) {
-    Printf(stderr, "No target language specified\n");
-    return 1;
-  }
-
   // Check all of the options to make sure we're cool.
   // Don't check for an input file if -external-runtime is passed
   Swig_check_options(external_runtime ? 0 : 1);
@@ -1070,7 +1065,7 @@
 	  char *cfile = Char(input_file);
 	  if (cfile && cfile[0] == '-') {
 	    Printf(stderr, "Unable to find option or file '%s', ", input_file);
-	    Printf(stderr, "use 'swig -help' for more information.\n");
+	    Printf(stderr, "Use 'swig -help' for more information.\n");
 	  } else {
 	    Printf(stderr, "Unable to find file '%s'.\n", input_file);
 	  }
@@ -1079,6 +1074,13 @@
 	  Swig_warning(WARN_DEPRECATED_INPUT_FILE, "SWIG", 1, "Use of the include path to find the input file is deprecated and will not work with ccache. Please include the path when specifying the input file.\n"); // so that behaviour is like c/c++ compilers
 	}
       }
+
+      if (!tlm) {
+	Printf(stderr, "No target language specified.\n");
+	Printf(stderr, "Use 'swig -help' for more information.\n");
+	SWIG_exit(EXIT_FAILURE);
+      }
+
       if (!no_cpp) {
 	fclose(df);
 	Printf(fs, "%%include <swig.swg>\n");
diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx
index 27a001f..ad9c948 100644
--- a/Source/Modules/ocaml.cxx
+++ b/Source/Modules/ocaml.cxx
@@ -752,7 +752,7 @@
 	Printv(df->code,
 	       "argv = (CAML_VALUE *)malloc( argc * sizeof( CAML_VALUE ) );\n"
 	       "for( i = 0; i < argc; i++ ) {\n" "  argv[i] = caml_list_nth(args,i);\n" "}\n", NIL);
-	Printv(df->code, dispatch, "\n", NIL);
+	Printv(df->code, dispatch, "\nfree(argv);\n", NIL);
 	Node *sibl = n;
 	while (Getattr(sibl, "sym:previousSibling"))
 	  sibl = Getattr(sibl, "sym:previousSibling");
diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx
index 3c1767d..b849335 100755
--- a/Source/Modules/python.cxx
+++ b/Source/Modules/python.cxx
@@ -2187,7 +2187,7 @@
    * is_real_overloaded()
    *
    * Check if the function is overloaded, but not just have some
-   * siblings generated due to the original function have 
+   * siblings generated due to the original function having
    * default arguments.
    * ------------------------------------------------------------ */
   bool is_real_overloaded(Node *n) {
@@ -2224,7 +2224,7 @@
       n = nn;
 
     Parm *parms = Getattr(n, "parms");
-    bool varargs = parms ? emit_isvarargs(parms) : 0;
+    int varargs = parms ? emit_isvarargs(parms) : 0;
 
     /* We prefer to explicitly list all parameters of the C function in the
        generated Python code as this makes the function more convenient to use,
@@ -2426,7 +2426,7 @@
   void add_method(String *name, String *function, int kw, Node *n = 0, int funpack = 0, int num_required = -1, int num_arguments = -1) {
     String * meth_str = NewString("");
     if (!kw) {
-      if (n && funpack) {
+      if (funpack) {
 	if (num_required == 0 && num_arguments == 0) {
 	  Printf(meth_str, "\t { \"%s\", %s, METH_NOARGS, ", name, function);
 	} else if (num_required == 1 && num_arguments == 1) {
@@ -2689,7 +2689,6 @@
     bool add_self = builtin_self && (!builtin_ctor || director_class);
     bool builtin_getter = (builtin && GetFlag(n, "memberget"));
     bool builtin_setter = (builtin && GetFlag(n, "memberset") && !builtin_getter);
-    bool over_varargs = false;
     char const *self_param = builtin ? "self" : "SWIGUNUSEDPARM(self)";
     char const *wrap_return = builtin_ctor ? "int " : "PyObject *";
     String *linkage = NewString("SWIGINTERN ");
@@ -2765,22 +2764,7 @@
       }
     }
 
-    if (overname) {
-      String *over_varargs_attr = Getattr(n, "python:overvarargs");
-      if (!over_varargs_attr) {
-	for (Node *sibling = n; sibling; sibling = Getattr(sibling, "sym:nextSibling")) {
-	  if (emit_isvarargs(Getattr(sibling, "parms"))) {
-	    over_varargs = true;
-	    break;
-	  }
-	}
-	over_varargs_attr = NewString(over_varargs ? "1" : "0");
-	for (Node *sibling = n; sibling; sibling = Getattr(sibling, "sym:nextSibling"))
-	  Setattr(sibling, "python:overvarargs", over_varargs_attr);
-      }
-      if (Strcmp(over_varargs_attr, "0") != 0)
-	over_varargs = true;
-    }
+    bool over_varargs = emit_isvarargs_function(n);
 
     int funpack = fastunpack && !varargs && !over_varargs && !allow_kwargs;
     int noargs = funpack && (tuple_required == 0 && tuple_arguments == 0);
@@ -3608,11 +3592,7 @@
         Printf(f_wrappers, "SWIGINTERN PyObject *%s_swigconstant(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {\n", iname);
         Printf(f_wrappers, tab2 "PyObject *module;\n", tm);
         Printf(f_wrappers, tab2 "PyObject *d;\n");
-	if (fastunpack) {
-	  Printf(f_wrappers, tab2 "if (!SWIG_Python_UnpackTuple(args, \"swigconstant\", 1, 1, &module)) return NULL;\n");
-	} else {
-	  Printf(f_wrappers, tab2 "if (!PyArg_UnpackTuple(args, \"swigconstant\", 1, 1, &module)) return NULL;\n");
-	}
+	Printf(f_wrappers, tab2 "if (!SWIG_Python_UnpackTuple(args, \"swigconstant\", 1, 1, &module)) return NULL;\n");
         Printf(f_wrappers, tab2 "d = PyModule_GetDict(module);\n");
         Printf(f_wrappers, tab2 "if (!d) return NULL;\n");
         Printf(f_wrappers, tab2 "%s\n", tm);
@@ -3621,7 +3601,7 @@
 
         // Register the method in SwigMethods array
 	String *cname = NewStringf("%s_swigconstant", iname);
-	add_method(cname, cname, 0);
+	add_method(cname, cname, 0, 0, 1, 1, 1);
 	Delete(cname);
       } else {
         Printf(f_init, "%s\n", tm);
@@ -4526,16 +4506,12 @@
       } else {
 	Printv(f_wrappers, "SWIGINTERN PyObject *", class_name, "_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {\n", NIL);
 	Printv(f_wrappers, "  PyObject *obj;\n", NIL);
-	if (fastunpack) {
-	  Printv(f_wrappers, "  if (!SWIG_Python_UnpackTuple(args, \"swigregister\", 1, 1, &obj)) return NULL;\n", NIL);
-	} else {
-	  Printv(f_wrappers, "  if (!PyArg_UnpackTuple(args, \"swigregister\", 1, 1, &obj)) return NULL;\n", NIL);
-	}
+	Printv(f_wrappers, "  if (!SWIG_Python_UnpackTuple(args, \"swigregister\", 1, 1, &obj)) return NULL;\n", NIL);
 
 	Printv(f_wrappers,
 	       "  SWIG_TypeNewClientData(SWIGTYPE", SwigType_manglestr(ct), ", SWIG_NewClientData(obj));\n", "  return SWIG_Py_Void();\n", "}\n\n", NIL);
 	String *cname = NewStringf("%s_swigregister", class_name);
-	add_method(cname, cname, 0);
+	add_method(cname, cname, 0, 0, 1, 1, 1);
 	Delete(cname);
       }
       Delete(smart);
diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx
index 019d5dd..bb43dad 100644
--- a/Source/Modules/r.cxx
+++ b/Source/Modules/r.cxx
@@ -65,77 +65,38 @@
   */
 }
 
-/*********************
- Tries to get the name of the R class corresponding  to the given type
-  e.g. struct A * is ARef,  struct A**  is  ARefRef.
-  Now handles arrays, i.e. struct A[2]
-****************/
+/* --------------------------------------------------------------
+ * Tries to get the resolved name, with options of adding
+ * or removing a layer of references. Take care not
+ * to request both
+ * --------------------------------------------------------------*/
 
-static String *getRClassName(String *retType, int /*addRef*/ = 1, int upRef=0) {
-  String *tmp = NewString("");
+static String *getRClassName(String *retType, int deRef=0, int upRef=0) {
   SwigType *resolved = SwigType_typedef_resolve_all(retType);
-  char *retName = Char(SwigType_manglestr(resolved));
+  int ispointer = SwigType_ispointer(resolved);
+  int isreference = SwigType_isreference(resolved);
   if (upRef) {
-    Printf(tmp, "_p%s", retName);
-  } else{
-    Insert(tmp, 0, retName);
+    SwigType_add_pointer(resolved);
   }
-
-  return tmp;
-/*
-#if 1
-  List *l = SwigType_split(retType);
-  int n = Len(l);
-  if(!l || n == 0) {
-#ifdef R_SWIG_VERBOSE
-    if (debugMode)
-      Printf(stdout, "SwigType_split return an empty list for %s\n",
-             retType);
-#endif
-    return(tmp);
-  }
-
-
-  String *el = Getitem(l, n-1);
-  char *ptr = Char(el);
-  if(strncmp(ptr, "struct ", 7) == 0)
-    ptr += 7;
-
-  Printf(tmp, "%s", ptr);
-
-  if(addRef) {
-    for(int i = 0; i < n; i++) {
-      if(Strcmp(Getitem(l, i), "p.") == 0 ||
-         Strncmp(Getitem(l, i), "a(", 2) == 0)
-        Printf(tmp, "Ref");
+  if (deRef) {
+    if (ispointer) {
+      SwigType_del_pointer(resolved);
     }
-  }
-
-#else
-  char *retName = Char(SwigType_manglestr(retType));
-  if(!retName)
-    return(tmp);
-
-  if(addRef) {
-    while(retName && strlen(retName) > 1 && strncmp(retName, "_p", 2) == 0)  {
-      retName += 2;
-      Printf(tmp, "Ref");
+    if (isreference) {
+      SwigType_del_reference(resolved);
     }
-  }
-  if(retName[0] == '_')
-    retName ++;
-  Insert(tmp, 0, retName);
-#endif
-
-  return tmp;
-*/
+  } 
+  String *tmp = NewString("");
+  Insert(tmp, 0, Char(SwigType_manglestr(resolved)));
+  return(tmp);
 }
 
-/*********************
- Tries to get the name of the R class corresponding  to the given type
-  e.g. struct A * is ARef,  struct A**  is  ARefRef.
-  Now handles arrays, i.e. struct A[2]
-****************/
+/* --------------------------------------------------------------
+ * Tries to get the name of the R class corresponding  to the given type
+ * e.g. struct A * is ARef,  struct A**  is  ARefRef.
+ * Now handles arrays, i.e. struct A[2]
+ * --------------------------------------------------------------*/
+
 
 static String * getRClassNameCopyStruct(String *retType, int addRef) {
   String *tmp = NewString("");
@@ -188,12 +149,13 @@
 }
 
 
-/*********************************
-  Write the elements of a list to the File*, one element per line.
-  If quote  is true, surround the element with "element".
-  This takes care of inserting a tab in front of each line and also
-  a comma after each element, except the last one.
-**********************************/
+/* -------------------------------------------------------------
+ * Write the elements of a list to the File*, one element per line.
+ * If quote  is true, surround the element with "element".
+ * This takes care of inserting a tab in front of each line and also
+ * a comma after each element, except the last one.
+ * --------------------------------------------------------------*/
+
 
 static void writeListByLine(List *l, File *out, bool quote = 0) {
   int i, n = Len(l);
@@ -222,9 +184,10 @@
 
 
 
-/************
- Display the help for this module on the screen/console.
-*************/
+/* -------------------------------------------------------------
+ * Display the help for this module on the screen/console.
+ * --------------------------------------------------------------*/
+
 static void showUsage() {
   fputs(usage, stdout);
 }
@@ -238,10 +201,11 @@
 }
 
 
-/*****
-      Determine whether  we should add a .copy argument to the S function
-      that wraps/interfaces to the routine that returns the given type.
-*****/
+/* -------------------------------------------------------------
+ * Determine whether  we should add a .copy argument to the S function
+ * that wraps/interfaces to the routine that returns the given type.
+ * --------------------------------------------------------------*/
+
 static int addCopyParameter(SwigType *type) {
   int ok = 0;
   ok = Strncmp(type, "struct ", 7) == 0 || Strncmp(type, "p.struct ", 9) == 0;
@@ -253,27 +217,15 @@
 }
 
 static void replaceRClass(String *tm, SwigType *type) {
-  String *tmp = getRClassName(type);
-  String *tmp_base = getRClassName(type, 0);
-  String *tmp_ref = getRClassName(type, 1, 1);
+  String *tmp = getRClassName(type, 0, 0);
+  String *tmp_base = getRClassName(type, 1, 0);
+  String *tmp_ref = getRClassName(type, 0, 1);
   Replaceall(tm, "$R_class", tmp);
   Replaceall(tm, "$*R_class", tmp_base);
   Replaceall(tm, "$&R_class", tmp_ref);
   Delete(tmp); Delete(tmp_base); Delete(tmp_ref);
 }
 
-static bool getNumber(String *value, int* result) {
-  if(Char(value)) {
-    // Check the conversion processed the whole of value by having %c at
-    // the end of the format, and checking that only the first value is
-    // converted.  We don't want to convert "3+7" -> 3.
-    char dummy;
-    if (sscanf(Char(value), "%i%c", result, &dummy) == 1)
-      return true;
-  }
-  return false;
-}
-
 class R : public Language {
 public:
   R();
@@ -288,7 +240,8 @@
 
   int classDeclaration(Node *n);
   int enumDeclaration(Node *n);
-
+  String *enumValue(Node *n);
+  virtual int enumvalueDeclaration(Node *n);
   int membervariableHandler(Node *n);
 
   int typedefHandler(Node *n);
@@ -392,6 +345,8 @@
 
   // Strings into which we cumulate the generated code that is to be written
   //vto the files.
+  String *enum_values;
+  String *enum_def_calls;
   String *sfile;
   String *f_init;
   String *s_classes;
@@ -456,6 +411,8 @@
   copyStruct(false),
   memoryProfile(false),
   aggressiveGc(false),
+  enum_values(0),
+  enum_def_calls(0),
   sfile(0),
   f_init(0),
   s_classes(0),
@@ -535,9 +492,10 @@
   }
 }
 
-/*
-  Returns the name of the new routine.
-*/
+/* ----------------------------------------
+ * Returns the name of the new routine.
+ * ------------------------------------------ */
+
 String * R::createFunctionPointerHandler(SwigType *t, Node *n, int *numArgs) {
   String *funName = SwigType_manglestr(t);
 
@@ -574,7 +532,6 @@
   for (i = 0; p; p = nextSibling(p), ++i) {
     String *arg = Getattr(p, "name");
     String *lname;
-
     if (!arg && Cmp(Getattr(p, "type"), "void")) {
       lname = NewStringf("arg%d", i+1);
       Setattr(p, "name", lname);
@@ -635,6 +592,9 @@
       }
       Replaceall(tm, "$1", name);
       Replaceall(tm, "$result", "r_tmp");
+      if (debugMode) {
+        Printf(stdout, "Calling Replace A: %s\n", Getattr(p,"type"));
+      }
       replaceRClass(tm, Getattr(p,"type"));
       Replaceall(tm,"$owner", "0");
       Delete(lstr);
@@ -756,6 +716,7 @@
   s_classes = NewString("");
   s_init = NewString("");
   s_init_routine = NewString("");
+  enum_def_calls = NewString("");
 }
 
 
@@ -771,14 +732,19 @@
 #endif
 
 
-/**
-   Method from Language that is called to start the entire
-   processing off, i.e. the generation of the code.
-   It is called after the input has been read and parsed.
-   Here we open the output streams and generate the code.
-***/
+/* -------------------------------------------------------------
+ *  Method from Language that is called to start the entire
+ *  processing off, i.e. the generation of the code.
+ *  It is called after the input has been read and parsed.
+ *  Here we open the output streams and generate the code.
+ * ------------------------------------------------------------- */
 int R::top(Node *n) {
   String *module = Getattr(n, "name");
+
+  if (debugMode) {
+    Printf(stdout, "<Top> %s\n", module);
+  }
+
   if(!Rpackage)
     Rpackage = Copy(module);
   if(!DllName)
@@ -853,9 +819,9 @@
 }
 
 
-/*****************************************************
-  Write the generated code  to the .S and the .c files.
-****************************************************/
+/* -------------------------------------------------------------
+ * Write the generated code  to the .S and the .c files.
+ * ------------------------------------------------------------- */
 int R::DumpCode(Node *n) {
   String *output_filename = NewString("");
 
@@ -878,6 +844,7 @@
   Printf(scode, "%s\n\n", s_init);
   Printf(scode, "%s\n\n", s_classes);
   Printf(scode, "%s\n", sfile);
+  Printf(scode, "%s\n", enum_def_calls);
 
   Delete(scode);
   String *outfile = Getattr(n,"outfile");
@@ -922,22 +889,23 @@
 
 
 
-/*
-  We may need to do more.... so this is left as a
-  stub for the moment.
-*/
+/* -------------------------------------------------------------
+ * We may need to do more.... so this is left as a
+ * stub for the moment.
+ * -------------------------------------------------------------*/
 int R::OutputClassAccessInfo(Hash *tb, File *out) {
   int n = OutputClassMemberTable(tb, out);
   OutputClassMethodsTable(out);
   return n;
 }
 
-/************************************************************************
-  Currently this just writes the information collected about the
-  different methods of the C++ classes that have been processed
-  to the console.
-  This will be used later to define S4 generics and methods.
-**************************************************************************/
+/* -------------------------------------------------------------
+ * Currently this just writes the information collected about the
+ * different methods of the C++ classes that have been processed
+ * to the console.
+ * This will be used later to define S4 generics and methods.
+ * --------------------------------------------------------------*/
+
 int R::OutputClassMethodsTable(File *) {
   Hash *tb = ClassMethodsTable;
 
@@ -966,20 +934,21 @@
 }
 
 
-/*
-  Iterate over the <class name>_set and <>_get
-  elements and generate the $ and $<- functions
-  that provide constrained access to the member
-  fields in these elements.
+/* --------------------------------------------------------------
+ * Iterate over the <class name>_set and <>_get
+ * elements and generate the $ and $<- functions
+ * that provide constrained access to the member
+ * fields in these elements.
 
-  tb - a hash table that is built up in functionWrapper
-  as we process each membervalueHandler.
-  The entries are indexed by <class name>_set and
-  <class_name>_get. Each entry is a List *.
+ * tb - a hash table that is built up in functionWrapper
+ * as we process each membervalueHandler.
+ * The entries are indexed by <class name>_set and
+ * <class_name>_get. Each entry is a List *.
 
-  out - the stram where the code is to be written. This is the S
-  code stream as we generate only S code here..
-*/
+ * out - the stram where the code is to be written. This is the S
+ * code stream as we generate only S code here.
+ * --------------------------------------------------------------*/
+
 int R::OutputClassMemberTable(Hash *tb, File *out) {
   List *keys = Keys(tb), *el;
 
@@ -1019,17 +988,18 @@
   return n;
 }
 
-/*******************************************************************
- Write the methods for $ or $<- for accessing a member field in an
- struct or union (or class).
- className - the name of the struct or union (e.g. Bar for struct Bar)
- isSet - a logical value indicating whether the method is for
-	   modifying ($<-) or accessing ($) the member field.
- el - a list of length  2 * # accessible member elements  + 1.
-      The first element is the name of the class.
-      The other pairs are  member name and the name of the R function to access it.
- out - the stream where we write the code.
-********************************************************************/
+/* --------------------------------------------------------------
+ * Write the methods for $ or $<- for accessing a member field in an
+ * struct or union (or class).
+ * className - the name of the struct or union (e.g. Bar for struct Bar)
+ * isSet - a logical value indicating whether the method is for
+ *	   modifying ($<-) or accessing ($) the member field.
+ * el - a list of length  2 * # accessible member elements  + 1.
+ *     The first element is the name of the class.
+ *     The other pairs are  member name and the name of the R function to access it.
+ * out - the stream where we write the code.
+ * --------------------------------------------------------------*/
+
 int R::OutputMemberReferenceMethod(String *className, int isSet,
 				   List *el, File *out) {
   int numMems = Len(el), j;
@@ -1153,15 +1123,16 @@
   return SWIG_OK;
 }
 
-/*******************************************************************
- Write the methods for [ or [<- for accessing a member field in an
- struct or union (or class).
- className - the name of the struct or union (e.g. Bar for struct Bar)
- el - a list of length  2 * # accessible member elements  + 1.
-      The first element is the name of the class.
-      The other pairs are  member name and the name of the R function to access it.
- out - the stream where we write the code.
-********************************************************************/
+/* -------------------------------------------------------------
+ * Write the methods for [ or [<- for accessing a member field in an
+ * struct or union (or class).
+ * className - the name of the struct or union (e.g. Bar for struct Bar)
+ * el - a list of length  2 * # accessible member elements  + 1.
+ *     The first element is the name of the class.
+ *     The other pairs are  member name and the name of the R function to access it.
+ * out - the stream where we write the code.
+ * --------------------------------------------------------------*/
+
 int R::OutputArrayMethod(String *className, List *el, File *out) {
   int numMems = Len(el), j;
 
@@ -1192,103 +1163,153 @@
 }
 
 
-/************************************************************
- Called when a enumeration is to be processed.
- We want to call the R function defineEnumeration().
- tdname is the typedef of the enumeration, i.e. giving its name.
-*************************************************************/
+/* -------------------------------------------------------------
+ * Called when a enumeration is to be processed.
+ * We want to call the R function defineEnumeration().
+ * tdname is the typedef of the enumeration, i.e. giving its name.
+ * --------------------------------------------------------------*/
+
 int R::enumDeclaration(Node *n) {
-  if (getCurrentClass() && (cplus_mode != PUBLIC))
-    return SWIG_NOWRAP;
+  if (!ImportMode) {
+    if (getCurrentClass() && (cplus_mode != PUBLIC))
+      return SWIG_NOWRAP;
 
-  String *name = Getattr(n, "name");
-  String *tdname = Getattr(n, "tdname");
+    String *symname = Getattr(n, "sym:name");
 
-  /* Using name if tdname is empty. */
+    // TODO - deal with anonymous enumerations
+    // Previous enum code for R didn't wrap them
+    if (!symname || Getattr(n, "unnamedinstance"))
+      return SWIG_NOWRAP;
 
-  if(Len(tdname) == 0)
-    tdname = name;
+    // create mangled name for the enum
+    // This will have content if the %nspace feature is set on
+    // the input file
+    String *nspace = Getattr(n, "sym:nspace"); // NSpace/getNSpace() only works during Language::enumDeclaration call
+    String *ename;
 
-
-  if(!tdname || Strcmp(tdname, "") == 0) {
+    String *name = Getattr(n, "name");
+    ename = getRClassName(name); 
+    if (debugMode) {
+      Node *current_class = getCurrentClass();
+      String *cl = NewString("");
+      if (current_class) {
+        cl = getEnumClassPrefix();
+      }
+      Printf(stdout, "enumDeclaration: %s, %s, %s, %s, %s\n", name, symname, nspace, ename, cl);
+    }
+    Delete(name);
+    // set up a call to create the R enum structure. The list of
+    // individual elements will be built in enum_code
+    enum_values = 0;
+    // Emit each enum item
     Language::enumDeclaration(n);
-    return SWIG_OK;
+      
+    Printf(enum_def_calls, "defineEnumeration(\"%s\",\n .values=c(%s))\n\n", ename, enum_values);
+    Delete(enum_values);
+    Delete(ename);
+    //Delete(symname);
+  }
+  return SWIG_OK;
+}
+
+/* -------------------------------------------------------------
+* --------------------------------------------------------------*/
+
+int R::enumvalueDeclaration(Node *n) {
+  if (getCurrentClass() && (cplus_mode != PUBLIC)) {
+    Printf(stdout, "evd: Not public\n");
+    return SWIG_NOWRAP;
   }
 
-  String *mangled_tdname = SwigType_manglestr(tdname);
-  String *scode = NewString("");
+  Swig_require("enumvalueDeclaration", n, "*name", "?value", NIL);
+  String *symname = Getattr(n, "sym:name");
+  String *value = Getattr(n, "value");
+  String *name = Getattr(n, "name");
+  Node *parent = parentNode(n);
+  String *parent_name = Getattr(parent, "name");
+  String *newsymname = 0;
+  String *tmpValue;
 
-  Printv(scode, "defineEnumeration('", mangled_tdname, "'",
-	 ",\n",  tab8, tab8, tab4, ".values = c(\n", NIL);
-
-  Node *c;
-  int value = -1; // First number is zero
-  for (c = firstChild(n); c; c = nextSibling(c)) {
-    //      const char *tag = Char(nodeType(c));
-    //      if (Strcmp(tag,"cdecl") == 0) {
-    name = Getattr(c, "name");
-    String *val = Getattr(c, "enumvalue");
-    if(val && Char(val)) {
-      int inval;
-      if (!getNumber(val, &inval)) {
-	// Conversion failed - use the string value in val.
-      } else {
-	val = NULL;
-	value = inval;
-      }
-    } else {
-      val = NULL;
-      value++;
-    }
-
-    if (val != NULL) {
-      // This won't work in general, but will at least handle cases like (3)
-      // and 3+7, and when it doesn't work, it'll fail noisly rather than
-      // quietly using the wrong enum value like we used to.
-      if (!Strcmp(val, "true")) {
-	Printf(scode, "%s%s%s'%s' = %s%s\n", tab8, tab8, tab8, name, "TRUE",
-	       nextSibling(c) ? ", " : "");
-      } else if (!Strcmp(val, "false")) {
-	Printf(scode, "%s%s%s'%s' = %s%s\n", tab8, tab8, tab8, name, "FALSE",
-	       nextSibling(c) ? ", " : "");
-      } else {
-	Printf(scode, "%s%s%s'%s' = %s%s\n", tab8, tab8, tab8, name, val,
-	       nextSibling(c) ? ", " : "");
-      }
-    } else {
-      Printf(scode, "%s%s%s'%s' = %d%s\n", tab8, tab8, tab8, name, value,
-	     nextSibling(c) ? ", " : "");
-    }
-    //      }
+  // Strange hack from parent method
+  if (value)
+    tmpValue = NewString(value);
+  else
+    tmpValue = NewString(name);
+  // Note that this is used in enumValue() amongst other places
+  Setattr(n, "value", tmpValue);
+  
+  // Deal with enum values that are not int
+  int swigtype = SwigType_type(Getattr(n, "type"));
+  if (swigtype == T_BOOL) {
+    const char *val = Equal(Getattr(n, "enumvalue"), "true") ? "1" : "0";
+    Setattr(n, "enumvalue", val);
+  } else if (swigtype == T_CHAR) {
+    String *val = NewStringf("'%s'", Getattr(n, "enumvalue"));
+    Setattr(n, "enumvalue", val);
+    Delete(val);
   }
 
-  Printv(scode, "))", NIL);
-  Printf(sfile, "%s\n", scode);
+  if (GetFlag(parent, "scopedenum")) {
+    newsymname = Swig_name_member(0, Getattr(parent, "sym:name"), symname);
+    symname = newsymname;
+  }
 
-  Delete(scode);
-  Delete(mangled_tdname);
+  {
+    // Wrap C/C++ enums with constant integers or use the typesafe enum pattern
+    SwigType *typemap_lookup_type = parent_name ? parent_name : NewString("enum ");
+    if (debugMode) {
+      Printf(stdout, "Setting type: %s\n", Copy(typemap_lookup_type));
+    }
+    Setattr(n, "type", typemap_lookup_type);
+    
+    // Simple integer constants
+    // Note these are always generated for anonymous enums, no matter what enum_feature is specified
+    // Code generated is the same for SimpleEnum and TypeunsafeEnum -> the class it is generated into is determined later
+
+    String *value = enumValue(n);
+    if (enum_values) {
+      Printf(enum_values, ",\n\"%s\" = %s", name, value);
+    } else {
+      enum_values = NewString("");
+      Printf(enum_values, "\"%s\" = %s", name, value);
+    }
+
+    Delete(value);
+  }
 
   return SWIG_OK;
 }
 
 
-/*************************************************************
-**************************************************************/
+/* -------------------------------------------------------------
+ * Create accessor functions for variables.
+ * Does not create equivalent wrappers for enumerations,
+ * which are handled differently
+ * --------------------------------------------------------------*/
+
 int R::variableWrapper(Node *n) {
   String *name = Getattr(n, "sym:name");
-
+  if (debugMode) {
+    Printf(stdout, "variableWrapper %s\n", n);
+  }
   processing_variable = 1;
   Language::variableWrapper(n); // Force the emission of the _set and _get function wrappers.
   processing_variable = 0;
 
 
   SwigType *ty = Getattr(n, "type");
+  String *nodeType = nodeType(n);
   int addCopyParam = addCopyParameter(ty);
 
   //XXX
   processType(ty, n);
 
-  if(!SwigType_isconst(ty)) {
+  if (nodeType && !Strcmp(nodeType, "enumitem")) {
+    /* special wrapper for enums - don't want the R _set, _get functions*/
+    if (debugMode) {
+      Printf(stdout, "variableWrapper enum branch\n");
+    }
+  } else if(!SwigType_isconst(ty)) {
     Wrapper *f = NewWrapper();
     Printf(f->def, "%s = \nfunction(value%s)\n{\n",
 	   name, addCopyParam ? ", .copy = FALSE" : "");
@@ -1306,6 +1327,12 @@
   return SWIG_OK;
 }
 
+/* -------------------------------------------------------------
+ * Creates accessor functions for class members.
+
+ * ToDo - this version depends on naming conventions and needs
+ * to be replaced.
+ * --------------------------------------------------------------*/
 
 void R::addAccessor(String *memberName, Wrapper *wrapper, String *name,
 		    int isSet) {
@@ -1708,9 +1735,10 @@
   DelWrapper(f);
 }
 
-/******************************************************************
+/*--------------------------------------------------------------
 
-*******************************************************************/
+* --------------------------------------------------------------*/
+
 int R::functionWrapper(Node *n) {
   String *fname = Getattr(n, "name");
   String *iname = Getattr(n, "sym:name");
@@ -1752,6 +1780,9 @@
       SwigType *resolved =
 	SwigType_typedef_resolve_all(resultType);
       if (expandTypedef(resolved)) {
+        if (debugMode) {
+          Printf(stdout, "Setting type: %s\n", resolved);
+        }
 	Setattr(p, "type", Copy(resolved));
       }
     }
@@ -1764,18 +1795,18 @@
       SwigType_istypedef(type)) {
     SwigType *resolved =
       SwigType_typedef_resolve_all(type);
+    if (debugMode)
+      Printf(stdout, "<functionWrapper> resolved %s\n", Copy(unresolved_return_type));
     if (expandTypedef(resolved)) {
       type = Copy(resolved);
       Setattr(n, "type", type);
     }
   }
   if (debugMode)
-    Printf(stdout, "<functionWrapper> unresolved_return_type %s\n",
-	   unresolved_return_type);
+    Printf(stdout, "<functionWrapper> unresolved_return_type %s\n", unresolved_return_type);
   if(processing_member_access_function) {
     if (debugMode)
-      Printf(stdout, "<functionWrapper memberAccess> '%s' '%s' '%s' '%s'\n",
-	     fname, iname, member_name, class_name);
+      Printf(stdout, "<functionWrapper memberAccess> '%s' '%s' '%s' '%s'\n", fname, iname, member_name, class_name);
 
     if(opaqueClassDeclaration)
       return SWIG_OK;
@@ -2067,14 +2098,12 @@
   /* Deal with the explicit return value. */
   if ((tm = Swig_typemap_lookup_out("out", n, Swig_cresult_name(), f, actioncode))) {
     SwigType *retType = Getattr(n, "type");
-    //Printf(stdout, "Return Value for %s, array? %s\n", retType, SwigType_isarray(retType) ? "yes" : "no");
-    /*      if(SwigType_isarray(retType)) {
-	    defineArrayAccessors(retType);
-	    } */
-
-
+    
     Replaceall(tm,"$1", Swig_cresult_name());
     Replaceall(tm,"$result", "r_ans");
+    if (debugMode){
+      Printf(stdout, "Calling replace D: %s, %s, %s\n", retType, n, tm);
+    }
     replaceRClass(tm, retType);
 
     if (GetFlag(n,"feature:new")) {
@@ -2161,6 +2190,9 @@
 	Delete(smartname);
       }
     }
+    if (debugMode) {
+      Printf(stdout, "Calling replace B: %s, %s, %s\n", Getattr(n, "type"), Getattr(n, "sym:name"), getNSpace());
+    }
     replaceRClass(tm, Getattr(n, "type"));
     Chop(tm);
   }
@@ -2196,6 +2228,9 @@
   tm = Swig_typemap_lookup("rtype", n, "", 0);
   if(tm) {
     SwigType *retType = Getattr(n, "type");
+    if (debugMode) {
+      Printf(stdout, "Calling replace C: %s\n", Copy(retType));
+    }
     replaceRClass(tm, retType);
   }
 
@@ -2254,15 +2289,16 @@
   return SWIG_OK;
 }
 
-/*****************************************************
- Add the specified routine name to the collection of
- generated routines that are called from R functions.
- This is used to register the routines with R for
- resolving symbols.
+/*--------------------------------------------------------------
+ * Add the specified routine name to the collection of
+ * generated routines that are called from R functions.
+ * This is used to register the routines with R for
+ * resolving symbols.
 
- rname - the name of the routine
- nargs - the number of arguments it expects.
-******************************************************/
+ * rname - the name of the routine
+ * nargs - the number of arguments it expects.
+ * --------------------------------------------------------------*/
+
 int R::addRegistrationRoutine(String *rname, int nargs) {
   if(!registrationTable)
     registrationTable = NewHash();
@@ -2275,11 +2311,12 @@
   return SWIG_OK;
 }
 
-/*****************************************************
- Write the registration information to an array and
- create the initialization routine for registering
- these.
-******************************************************/
+/* -------------------------------------------------------------
+ * Write the registration information to an array and
+ * create the initialization routine for registering
+ * these.
+ * --------------------------------------------------------------*/
+
 int R::outputRegistrationRoutines(File *out) {
   int i, n;
   if(!registrationTable)
@@ -2322,11 +2359,11 @@
 
 
 
-/****************************************************************************
-  Process a struct, union or class declaration in the source code,
-  or an anonymous typedef struct
+/* -------------------------------------------------------------
+ * Process a struct, union or class declaration in the source code,
+ * or an anonymous typedef struct
+ * --------------------------------------------------------------*/
 
-*****************************************************************************/
 //XXX What do we need to do here -
 // Define an S4 class to refer to this.
 
@@ -2433,9 +2470,7 @@
     class_member_set_functions = NULL;
   }
   if (Getattr(n, "has_destructor")) {
-    Printf(sfile, "setMethod('delete', '_p%s', function(obj) {delete%s(obj)})\n",
-	   getRClassName(Getattr(n, "name")),
-	   getRClassName(Getattr(n, "name")));
+    Printf(sfile, "setMethod('delete', '_p%s', function(obj) {delete%s(obj)})\n", getRClassName(name), getRClassName(name));
 
   }
   if(!opaque && !Strcmp(kind, "struct") && copyStruct) {
@@ -2509,12 +2544,13 @@
 
 
 
-/***************************************************************
- Create the C routines that copy an S object of the class given
- by the given struct definition in Node *n to the C value
- and also the routine that goes from the C routine to an object
- of this S class.
-****************************************************************/
+/* -------------------------------------------------------------
+ * Create the C routines that copy an S object of the class given
+ * by the given struct definition in Node *n to the C value
+ * and also the routine that goes from the C routine to an object
+ * of this S class.
+ * --------------------------------------------------------------*/
+
 /*XXX
   Clean up the toCRef - make certain the names are correct for the types, etc.
   in all cases.
@@ -2609,13 +2645,14 @@
 
 
 
-/*****
-      Called when there is a typedef to be invoked.
+/* -------------------------------------------------------------
+ *  Called when there is a typedef to be invoked.
+ *
+ *  XXX Needs to be enhanced or split to handle the case where we have a
+ *  typedef within a classDeclaration emission because the struct/union/etc.
+ *  is anonymous.
+ * --------------------------------------------------------------*/
 
-      XXX Needs to be enhanced or split to handle the case where we have a
-      typedef within a classDeclaration emission because the struct/union/etc.
-      is anonymous.
-******/
 int R::typedefHandler(Node *n) {
   SwigType *tp = Getattr(n, "type");
   String *type = Getattr(n, "type");
@@ -2639,12 +2676,13 @@
 
 
 
-/*********************
-  Called when processing a field in a "class", i.e. struct, union or
-  actual class.  We set a state variable so that we can correctly
-  interpret the resulting functionWrapper() call and understand that
-  it is for a field element.
-**********************/
+/* --------------------------------------------------------------
+ * Called when processing a field in a "class", i.e. struct, union or
+ * actual class.  We set a state variable so that we can correctly
+ * interpret the resulting functionWrapper() call and understand that
+ * it is for a field element.
+ * --------------------------------------------------------------*/
+
 int R::membervariableHandler(Node *n) {
   SwigType *t = Getattr(n, "type");
   processType(t, n, NULL);
@@ -2679,12 +2717,14 @@
 }
 
 
-/**
-   Called when SWIG wants to initialize this
-   We initialize anythin we want here.
-   Most importantly, tell SWIG where to find the files (e.g. r.swg) for this module.
-   Use Swig_mark_arg() to tell SWIG that it is understood and not to throw an error.
-**/
+/* -----------------------------------------------------------------------
+ * Called when SWIG wants to initialize this
+ * We initialize anythin we want here.
+ * Most importantly, tell SWIG where to find the files (e.g. r.swg) for this module.
+ * Use Swig_mark_arg() to tell SWIG that it is understood and not to
+ * throw an error.
+ * --------------------------------------------------------------*/
+
 void R::main(int argc, char *argv[]) {
   init();
   Preprocessor_define("SWIGR 1", 0);
@@ -2767,10 +2807,10 @@
   }
 }
 
-/*
-  Could make this work for String or File and then just store the resulting string
-  rather than the collection of arguments and argc.
-*/
+/* -----------------------------------------------------------------------
+ * Could make this work for String or File and then just store the resulting string
+ * rather than the collection of arguments and argc.
+ * ----------------------------------------------------------------------- */
 int R::outputCommandLineArguments(File *out)
 {
   if(Argc < 1 || !Argv || !Argv[0])
@@ -2796,18 +2836,17 @@
 
 
 
-/*************************************************************************************/
 
-/*
-  Needs to be reworked.
-*/
+/* -----------------------------------------------------------------------
+ * Needs to be reworked.
+ *----------------------------------------------------------------------- */
 String * R::processType(SwigType *t, Node *n, int *nargs) {
   //XXX Need to handle typedefs, e.g.
   //  a type which is a typedef  to a function pointer.
 
   SwigType *tmp = Getattr(n, "tdname");
   if (debugMode)
-    Printf(stdout, "processType %s (tdname = %s)\n", Getattr(n, "name"), tmp);
+    Printf(stdout, "processType %s (tdname = %s)(SwigType = %s)\n", Getattr(n, "name"), tmp, Copy(t));
 
   SwigType *td = t;
   if (expandTypedef(t) &&
@@ -2852,4 +2891,55 @@
     return NULL;
 }
 
-/*************************************************************************************/
+
+/* -----------------------------------------------------------------------
+ * enumValue()
+ * This method will return a string with an enum value to use in from R when 
+ * setting up an enum variable
+ * ------------------------------------------------------------------------ */
+
+String *R::enumValue(Node *n) {
+  String *symname = Getattr(n, "sym:name");
+  String *value = Getattr(n, "value");
+  String *newsymname = 0;
+
+  Node *parent = parentNode(n);
+  symname = Getattr(n, "sym:name");
+  
+  // parent enumtype has namespace mangled in
+  String *etype = Getattr(parent, "enumtype");
+  // we have to directly call the c wrapper function, as the
+  // R wrapper to the enum is designed to be used after the enum
+  // structures have been created on the R side. This means
+  // that we'll need to construct a .Call expression
+
+  // change the type for variableWrapper
+  if (debugMode) {
+    Printf(stdout, "<enumValue> type set: %s\n", etype);
+  }
+
+  Setattr(n, "type", etype);
+
+  if (!getCurrentClass()) {
+    newsymname = Swig_name_member(0, Getattr(parent, "sym:name"), symname);
+    // Strange hack to change the name
+    Setattr(n, "name", Getattr(n, "value"));
+    Setattr(n, "sym:name", newsymname);
+    variableWrapper(n);
+    value = Swig_name_get(NSPACE_TODO, newsymname);
+  } else {
+    String *enumClassPrefix = getEnumClassPrefix();
+    newsymname = Swig_name_member(0, enumClassPrefix, symname);
+    Setattr(n, "name", Getattr(n, "value"));
+    Setattr(n, "sym:name", newsymname);
+    variableWrapper(n);
+    value = Swig_name_get(NSPACE_TODO, newsymname);
+  }
+  value = Swig_name_wrapper(value);
+  Replace(value, "_wrap", "R_swig", DOH_REPLACE_FIRST);
+
+  String *valuecall=NewString("");
+  Printv(valuecall, ".Call('", value, "',FALSE, PACKAGE='", Rpackage, "')", NIL);
+  Delete(value);
+  return valuecall;
+}
diff --git a/Source/Modules/swigmod.h b/Source/Modules/swigmod.h
index ef49c56..583cb13 100644
--- a/Source/Modules/swigmod.h
+++ b/Source/Modules/swigmod.h
@@ -383,7 +383,8 @@
 void SWIG_library_directory(const char *);
 int emit_num_arguments(ParmList *);
 int emit_num_required(ParmList *);
-int emit_isvarargs(ParmList *);
+int emit_isvarargs(ParmList *p);
+bool emit_isvarargs_function(Node *n);
 void emit_attach_parmmaps(ParmList *, Wrapper *f);
 void emit_mark_varargs(ParmList *l);
 String *emit_action(Node *n);
diff --git a/Source/Preprocessor/cpp.c b/Source/Preprocessor/cpp.c
index af17750..557b548 100644
--- a/Source/Preprocessor/cpp.c
+++ b/Source/Preprocessor/cpp.c
@@ -109,6 +109,19 @@
   return s;
 }
 
+static int is_digits(const String *str) {
+  const char *s = Char(str);
+  int isdigits = (*s != 0);
+  while (*s) {
+    if (!isdigit(*s)) {
+      isdigits = 0;
+      break;
+    }
+    s++;
+  }
+  return isdigits;
+}
+
 List *Preprocessor_depend(void) {
   return dependencies;
 }
@@ -1484,7 +1497,7 @@
       Putc(c, id);
       break;
 
-    case 42:			/* Strip any leading space before preprocessor value */
+    case 42:			/* Strip any leading space after the preprocessor directive (before preprocessor value) */
       if (isspace(c)) {
 	if (c == '\n') {
 	  Ungetc(c, s);
@@ -1804,6 +1817,8 @@
 	Swig_error(Getfile(s), Getline(id), "cpp debug: level = %d, startlevel = %d\n", level, start_level);
       } else if (Equal(id, "")) {
 	/* Null directive */
+      } else if (is_digits(id)) {
+	/* A gcc linemarker of the form '# linenum filename flags' (resulting from running gcc -E) */
       } else {
 	/* Ignore unknown preprocessor directives which are inside an inactive
 	 * conditional (github issue #394). */
diff --git a/Source/Swig/parms.c b/Source/Swig/parms.c
index bec1e63..3e832c3 100644
--- a/Source/Swig/parms.c
+++ b/Source/Swig/parms.c
@@ -254,3 +254,19 @@
   }
   return 0;
 }
+
+/* ---------------------------------------------------------------------
+ * ParmList_has_varargs()
+ *
+ * Returns 1 if the parameter list passed in has varargs.
+ * Otherwise returns 0.
+ * ---------------------------------------------------------------------- */
+
+int ParmList_has_varargs(ParmList *p) {
+  Parm *lp = 0;
+  while (p) {
+    lp = p;
+    p = nextSibling(p);
+  }
+  return lp ? SwigType_isvarargs(Getattr(lp, "type")) : 0;
+}
diff --git a/Source/Swig/scanner.c b/Source/Swig/scanner.c
index 9643366..908bc74 100644
--- a/Source/Swig/scanner.c
+++ b/Source/Swig/scanner.c
@@ -1160,6 +1160,8 @@
 	return SWIG_TOKEN_INT;
       if (isdigit(c))
 	state = 84;
+      else if ((c == 'e') || (c == 'E'))
+	state = 82;
       else if ((c == 'x') || (c == 'X'))
 	state = 85;
       else if ((c == 'b') || (c == 'B'))
@@ -1181,6 +1183,10 @@
 	return SWIG_TOKEN_INT;
       if (isdigit(c))
 	state = 84;
+      else if (c == '.')
+	state = 81;
+      else if ((c == 'e') || (c == 'E'))
+	state = 82;
       else if ((c == 'l') || (c == 'L')) {
 	state = 87;
       } else if ((c == 'u') || (c == 'U')) {
diff --git a/Source/Swig/swigparm.h b/Source/Swig/swigparm.h
index 368b4d2..7b27df5 100644
--- a/Source/Swig/swigparm.h
+++ b/Source/Swig/swigparm.h
@@ -24,6 +24,7 @@
 extern int        ParmList_len(ParmList *);
 extern int        ParmList_numrequired(ParmList *);
 extern int        ParmList_has_defaultargs(ParmList *p);
+extern int        ParmList_has_varargs(ParmList *p);
 
 /* Output functions */
 extern String    *ParmList_str(ParmList *);
diff --git a/Tools/config/ax_boost_base.m4 b/Tools/config/ax_boost_base.m4
index 0e0f266..f5a935c 100644
--- a/Tools/config/ax_boost_base.m4
+++ b/Tools/config/ax_boost_base.m4
@@ -1,5 +1,5 @@
 # ===========================================================================
-#       http://www.gnu.org/software/autoconf-archive/ax_boost_base.html
+#      https://www.gnu.org/software/autoconf-archive/ax_boost_base.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -10,7 +10,7 @@
 #
 #   Test for the Boost C++ libraries of a particular version (or newer)
 #
-#   If no path to the installed boost library is given the macro searches
+#   If no path to the installed boost library is given the macro searchs
 #   under /usr, /usr/local, /opt and /opt/local and evaluates the
 #   $BOOST_ROOT environment variable. Further documentation is available at
 #   <http://randspringer.de/boost/index.html>.
@@ -33,7 +33,15 @@
 #   and this notice are preserved. This file is offered as-is, without any
 #   warranty.
 
-#serial 26
+#serial 45
+
+# example boost program (need to pass version)
+m4_define([_AX_BOOST_BASE_PROGRAM],
+          [AC_LANG_PROGRAM([[
+#include <boost/version.hpp>
+]],[[
+(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($1))]));
+]])])
 
 AC_DEFUN([AX_BOOST_BASE],
 [
@@ -44,104 +52,121 @@
      or disable it (ARG=no)
      @<:@ARG=yes@:>@ ])],
     [
-    if test "$withval" = "no"; then
-        want_boost="no"
-    elif test "$withval" = "yes"; then
-        want_boost="yes"
-        ac_boost_path=""
-    else
-        want_boost="yes"
-        ac_boost_path="$withval"
-    fi
+     AS_CASE([$withval],
+       [no],[want_boost="no";_AX_BOOST_BASE_boost_path=""],
+       [yes],[want_boost="yes";_AX_BOOST_BASE_boost_path=""],
+       [want_boost="yes";_AX_BOOST_BASE_boost_path="$withval"])
     ],
     [want_boost="yes"])
 
 
 AC_ARG_WITH([boost-libdir],
-        AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
-        [Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
-        [
-        if test -d "$withval"
-        then
-                ac_boost_lib_path="$withval"
-        else
-                AC_MSG_ERROR(--with-boost-libdir expected directory name)
-        fi
-        ],
-        [ac_boost_lib_path=""]
-)
+  [AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
+    [Force given directory for boost libraries.
+     Note that this will override library path detection,
+     so use this parameter only if default library detection fails
+     and you know exactly where your boost libraries are located.])],
+  [
+   AS_IF([test -d "$withval"],
+         [_AX_BOOST_BASE_boost_lib_path="$withval"],
+    [AC_MSG_ERROR([--with-boost-libdir expected directory name])])
+  ],
+  [_AX_BOOST_BASE_boost_lib_path=""])
 
-if test "x$want_boost" = "xyes"; then
-    boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
-    boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
-    boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
-    boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
-    boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
-    if test "x$boost_lib_version_req_sub_minor" = "x" ; then
-        boost_lib_version_req_sub_minor="0"
-        fi
-    WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+  $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
-    AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
+BOOST_LDFLAGS=""
+BOOST_CPPFLAGS=""
+AS_IF([test "x$want_boost" = "xyes"],
+      [_AX_BOOST_BASE_RUNDETECT([$1],[$2],[$3])])
+AC_SUBST(BOOST_CPPFLAGS)
+AC_SUBST(BOOST_LDFLAGS)
+])
+
+
+# convert a version string in $2 to numeric and affect to polymorphic var $1
+AC_DEFUN([_AX_BOOST_BASE_TONUMERICVERSION],[
+  AS_IF([test "x$2" = "x"],[_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"],[_AX_BOOST_BASE_TONUMERICVERSION_req="$2"])
+  _AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\.[[0-9]]*\)'`
+  _AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\)'`
+  AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_major" = "x"],
+        [AC_MSG_ERROR([You should at least specify libboost major version])])
+  _AX_BOOST_BASE_TONUMERICVERSION_req_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.\([[0-9]]*\)'`
+  AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_minor" = "x"],
+        [_AX_BOOST_BASE_TONUMERICVERSION_req_minor="0"])
+  _AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+  AS_IF([test "X$_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor" = "X"],
+        [_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor="0"])
+  _AX_BOOST_BASE_TONUMERICVERSION_RET=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req_major \* 100000 \+  $_AX_BOOST_BASE_TONUMERICVERSION_req_minor \* 100 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor`
+  AS_VAR_SET($1,$_AX_BOOST_BASE_TONUMERICVERSION_RET)
+])
+
+dnl Run the detection of boost should be run only if $want_boost
+AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
+    _AX_BOOST_BASE_TONUMERICVERSION(WANT_BOOST_VERSION,[$1])
     succeeded=no
 
+
+    AC_REQUIRE([AC_CANONICAL_HOST])
     dnl On 64-bit systems check for system libraries in both lib64 and lib.
     dnl The former is specified by FHS, but e.g. Debian does not adhere to
     dnl this (as it rises problems for generic multi-arch support).
     dnl The last entry in the list is chosen by default when no libraries
     dnl are found, e.g. when only header-only libraries are installed!
-    libsubdirs="lib"
-    ax_arch=`uname -m`
-    case $ax_arch in
-      x86_64)
-        libsubdirs="lib64 libx32 lib lib64"
-        ;;
-      ppc64|s390x|sparc64|aarch64|ppc64le)
-        libsubdirs="lib64 lib lib64 ppc64le"
-        ;;
-    esac
+    AS_CASE([${host_cpu}],
+      [x86_64],[libsubdirs="lib64 libx32 lib lib64"],
+      [ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"],
+      [libsubdirs="lib"]
+    )
 
     dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
     dnl them priority over the other paths since, if libs are found there, they
     dnl are almost assuredly the ones desired.
-    AC_REQUIRE([AC_CANONICAL_HOST])
-    libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
-
-    case ${host_cpu} in
-      i?86)
-        libsubdirs="lib/i386-${host_os} $libsubdirs"
-        ;;
-    esac
+    AS_CASE([${host_cpu}],
+      [i?86],[multiarch_libsubdir="lib/i386-${host_os}"],
+      [multiarch_libsubdir="lib/${host_cpu}-${host_os}"]
+    )
 
     dnl first we check the system location for boost libraries
     dnl this location ist chosen if boost libraries are installed with the --layout=system option
     dnl or if you install boost with RPM
-    if test "$ac_boost_path" != ""; then
-        BOOST_CPPFLAGS="-I$ac_boost_path/include"
-        for ac_boost_path_tmp in $libsubdirs; do
-                if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
-                        BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
-                        break
-                fi
-        done
-    elif test "$cross_compiling" != yes; then
-        for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
-            if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
-                for libsubdir in $libsubdirs ; do
-                    if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
+    AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[
+        AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"])
+         AS_IF([test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"],[
+           AC_MSG_RESULT([yes])
+           BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include"
+           for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
+                AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) lib path in "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"])
+                AS_IF([test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ],[
+                        AC_MSG_RESULT([yes])
+                        BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp";
+                        break;
+                ],
+      [AC_MSG_RESULT([no])])
+           done],[
+      AC_MSG_RESULT([no])])
+    ],[
+        if test X"$cross_compiling" = Xyes; then
+            search_libsubdirs=$multiarch_libsubdir
+        else
+            search_libsubdirs="$multiarch_libsubdir $libsubdirs"
+        fi
+        for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
+            if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then
+                for libsubdir in $search_libsubdirs ; do
+                    if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
                 done
-                BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
-                BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
+                BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path_tmp/$libsubdir"
+                BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include"
                 break;
             fi
         done
-    fi
+    ])
 
     dnl overwrite ld flags if we have required special directory with
     dnl --with-boost-libdir parameter
-    if test "$ac_boost_lib_path" != ""; then
-       BOOST_LDFLAGS="-L$ac_boost_lib_path"
-    fi
+    AS_IF([test "x$_AX_BOOST_BASE_boost_lib_path" != "x"],
+          [BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"])
 
+    AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION)])
     CPPFLAGS_SAVED="$CPPFLAGS"
     CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
     export CPPFLAGS
@@ -152,60 +177,61 @@
 
     AC_REQUIRE([AC_PROG_CXX])
     AC_LANG_PUSH(C++)
-        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-    @%:@include <boost/version.hpp>
-    ]], [[
-    #if BOOST_VERSION >= $WANT_BOOST_VERSION
-    // Everything is okay
-    #else
-    #  error Boost version is too old
-    #endif
-    ]])],[
+        AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
         AC_MSG_RESULT(yes)
     succeeded=yes
     found_system=yes
-        ],[
-        ])
+        ],[])
     AC_LANG_POP([C++])
 
 
 
     dnl if we found no boost with system layout we search for boost libraries
     dnl built and installed without the --layout=system option or for a staged(not installed) version
-    if test "x$succeeded" != "xyes"; then
+    if test "x$succeeded" != "xyes" ; then
         CPPFLAGS="$CPPFLAGS_SAVED"
         LDFLAGS="$LDFLAGS_SAVED"
         BOOST_CPPFLAGS=
-        BOOST_LDFLAGS=
+        if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
+            BOOST_LDFLAGS=
+        fi
         _version=0
-        if test "$ac_boost_path" != ""; then
-            if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
-                for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
-                    _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
+        if test -n "$_AX_BOOST_BASE_boost_path" ; then
+            if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path"; then
+                for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
+                    _version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
                     V_CHECK=`expr $_version_tmp \> $_version`
-                    if test "$V_CHECK" = "1" ; then
+                    if test "x$V_CHECK" = "x1" ; then
                         _version=$_version_tmp
                     fi
                     VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
-                    BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
+                    BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include/boost-$VERSION_UNDERSCORE"
                 done
                 dnl if nothing found search for layout used in Windows distributions
                 if test -z "$BOOST_CPPFLAGS"; then
-                    if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then
-                        BOOST_CPPFLAGS="-I$ac_boost_path"
+                    if test -d "$_AX_BOOST_BASE_boost_path/boost" && test -r "$_AX_BOOST_BASE_boost_path/boost"; then
+                        BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path"
                     fi
                 fi
+                dnl if we found something and BOOST_LDFLAGS was unset before
+                dnl (because "$_AX_BOOST_BASE_boost_lib_path" = ""), set it here.
+                if test -n "$BOOST_CPPFLAGS" && test -z "$BOOST_LDFLAGS"; then
+                    for libsubdir in $libsubdirs ; do
+                        if ls "$_AX_BOOST_BASE_boost_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
+                    done
+                    BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$libsubdir"
+                fi
             fi
         else
-            if test "$cross_compiling" != yes; then
-                for ac_boost_path in /usr /usr/local /opt /opt/local ; do
-                    if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
-                        for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
-                            _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
+            if test "x$cross_compiling" != "xyes" ; then
+                for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local ; do
+                    if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path" ; then
+                        for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
+                            _version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
                             V_CHECK=`expr $_version_tmp \> $_version`
-                            if test "$V_CHECK" = "1" ; then
+                            if test "x$V_CHECK" = "x1" ; then
                                 _version=$_version_tmp
-                                best_path=$ac_boost_path
+                                best_path=$_AX_BOOST_BASE_boost_path
                             fi
                         done
                     fi
@@ -213,7 +239,7 @@
 
                 VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
                 BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
-                if test "$ac_boost_lib_path" = ""; then
+                if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
                     for libsubdir in $libsubdirs ; do
                         if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
                     done
@@ -221,7 +247,7 @@
                 fi
             fi
 
-            if test "x$BOOST_ROOT" != "x"; then
+            if test -n "$BOOST_ROOT" ; then
                 for libsubdir in $libsubdirs ; do
                     if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
                 done
@@ -230,7 +256,7 @@
                     stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
                         stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
                     V_CHECK=`expr $stage_version_shorten \>\= $_version`
-                    if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
+                    if test "x$V_CHECK" = "x1" && test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
                         AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
                         BOOST_CPPFLAGS="-I$BOOST_ROOT"
                         BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
@@ -245,34 +271,23 @@
         export LDFLAGS
 
         AC_LANG_PUSH(C++)
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-        @%:@include <boost/version.hpp>
-        ]], [[
-        #if BOOST_VERSION >= $WANT_BOOST_VERSION
-        // Everything is okay
-        #else
-        #  error Boost version is too old
-        #endif
-        ]])],[
+            AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
             AC_MSG_RESULT(yes)
         succeeded=yes
         found_system=yes
-            ],[
-            ])
+            ],[])
         AC_LANG_POP([C++])
     fi
 
-    if test "$succeeded" != "yes" ; then
-        if test "$_version" = "0" ; then
-            AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
+    if test "x$succeeded" != "xyes" ; then
+        if test "x$_version" = "x0" ; then
+            AC_MSG_NOTICE([[We could not detect the boost libraries (version $1 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
         else
             AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
         fi
         # execute ACTION-IF-NOT-FOUND (if present):
         ifelse([$3], , :, [$3])
     else
-        AC_SUBST(BOOST_CPPFLAGS)
-        AC_SUBST(BOOST_LDFLAGS)
         AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
         # execute ACTION-IF-FOUND (if present):
         ifelse([$2], , :, [$2])
@@ -280,6 +295,5 @@
 
     CPPFLAGS="$CPPFLAGS_SAVED"
     LDFLAGS="$LDFLAGS_SAVED"
-fi
 
 ])
diff --git a/Tools/config/ax_compare_version.m4 b/Tools/config/ax_compare_version.m4
index 74dc0fd..ffb4997 100644
--- a/Tools/config/ax_compare_version.m4
+++ b/Tools/config/ax_compare_version.m4
@@ -1,5 +1,5 @@
 # ===========================================================================
-#    http://www.gnu.org/software/autoconf-archive/ax_compare_version.html
+#    https://www.gnu.org/software/autoconf-archive/ax_compare_version.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -79,7 +79,7 @@
 #   and this notice are preserved. This file is offered as-is, without any
 #   warranty.
 
-#serial 11
+#serial 13
 
 dnl #########################################################################
 AC_DEFUN([AX_COMPARE_VERSION], [
@@ -146,7 +146,7 @@
     ],
     [.+],[
       AC_WARNING(
-        [illegal OP numeric parameter: $2])
+        [invalid OP numeric parameter: $2])
     ],[])
 
     # Pad zeros at end of numbers to make same length.
@@ -162,7 +162,7 @@
     [ne],[
       test "x$A" != "x$B" && ax_compare_version=true
     ],[
-      AC_WARNING([illegal OP parameter: $2])
+      AC_WARNING([invalid OP parameter: $2])
     ])
   ])
 
diff --git a/Tools/config/ax_path_generic.m4 b/Tools/config/ax_path_generic.m4
index f77fc78..8796689 100644
--- a/Tools/config/ax_path_generic.m4
+++ b/Tools/config/ax_path_generic.m4
@@ -1,5 +1,5 @@
 # ===========================================================================
-#      http://www.gnu.org/software/autoconf-archive/ax_path_generic.html
+#     https://www.gnu.org/software/autoconf-archive/ax_path_generic.html
 # ===========================================================================
 #
 # SYNOPSIS
@@ -14,11 +14,11 @@
 #   The script must support `--cflags' and `--libs' args. If MINIMUM-VERSION
 #   is specified, the script must also support the `--version' arg. If the
 #   `--with-library-[exec-]prefix' arguments to ./configure are given, it
-#   must also support `--prefix' and `--exec-prefix'. Prefereable use
+#   must also support `--prefix' and `--exec-prefix'. Preferably use
 #   CONFIG-SCRIPTS as config script, CFLAGS-ARG instead of `--cflags` and
 #   LIBS-ARG instead of `--libs`, if given.
 #
-#   The SED-EXPR-EXTRACTOR parameter representes the expression used in sed
+#   The SED-EXPR-EXTRACTOR parameter represents the expression used in sed
 #   to extract the version number. Use it if your 'foo-config --version'
 #   dumps something like 'Foo library v1.0.0 (alfa)' instead of '1.0.0'.
 #
@@ -69,7 +69,7 @@
 #   and this notice are preserved. This file is offered as-is, without any
 #   warranty.
 
-#serial 13
+#serial 17
 
 AU_ALIAS([AC_PATH_GENERIC], [AX_PATH_GENERIC])
 AC_DEFUN([AX_PATH_GENERIC],[
diff --git a/Tools/mkdist.py b/Tools/mkdist.py
index 11a0dd6..47cf8e7 100755
--- a/Tools/mkdist.py
+++ b/Tools/mkdist.py
@@ -1,100 +1,103 @@
 #!/usr/bin/env python
 
-# This script builds a swig-x.y.z distribution.
-# Usage: mkdist.py version branch, where version should be x.y.z and branch is normally 'master'
-
 import sys
-import string
 import os
 import subprocess
 
 def failed():
-  print "mkdist.py failed to complete"
-  sys.exit(2)
+    print("mkdist.py failed to complete")
+    sys.exit(2)
 
+import argparse
+parser = argparse.ArgumentParser(description="Build a SWIG distribution tarball swig-x.y.z.tar.gz")
+parser.add_argument("version", help="version string in format x.y.z")
+parser.add_argument("-b", "--branch", required=False, default="master", help="git branch name to create tarball from [master]")
+parser.add_argument("-f", "--force-tag", required=False, action="store_true", help="force tag (replace git tag if it already exists)")
+parser.add_argument("-s", "--skip-checks", required=False, action="store_true", help="skip checks (that local and remote repos are in sync)")
+args = parser.parse_args()
 
-try:
-   version = sys.argv[1]
-   dirname = "swig-" + version
-   branch = sys.argv[2]
-except:
-   print "Usage: mkdist.py version branch, where version should be x.y.z and branch is normally 'master'"
-   sys.exit(1)
+version = args.version
+branch = args.branch
+dirname = "swig-" + version
+force_tag = args.force_tag
+skip_checks = args.skip_checks
 
 if sys.version_info[0:2] < (2, 7):
-   print "Error: Python 2.7 is required"
-   sys.exit(3)
-
+     print("Error: Python 2.7 or higher is required")
+     sys.exit(3)
 
 # Check name matches normal unix conventions
-if string.lower(dirname) != dirname:
-  print "directory name ("+dirname+") should be in lowercase"
-  sys.exit(3)
+if dirname.lower() != dirname:
+    print("directory name (" + dirname + ") should be in lowercase")
+    sys.exit(3)
 
 # If directory and tarball exist, remove it
-print "Removing ", dirname
-os.system("rm -rf "+dirname)
+print("Removing " + dirname)
+os.system("rm -rf " + dirname)
 
-print "Removing "+dirname+".tar if exists"
-os.system("rm -f "+dirname+".tar.gz")
+print("Removing " + dirname + ".tar if exists")
+os.system("rm -f " + dirname + ".tar.gz")
 
-print "Removing "+dirname+".tar.gz if exists"
-os.system("rm -f "+dirname+".tar")
+print("Removing " + dirname + ".tar.gz if exists")
+os.system("rm -f " + dirname + ".tar")
 
 # Grab the code from git
 
-print "Checking git repository is in sync with remote repository"
+print("Checking there are no local changes in git repo")
 os.system("git remote update origin") == 0 or failed()
 command = ["git", "status", "--porcelain", "-uno"]
 out = subprocess.check_output(command)
 if out.strip() != "":
-  print "Local git repository has modifications"
-  print " ".join(command)
-  print out
-  sys.exit(3)
+    print("Local git repository has modifications")
+    print(" ".join(command))
+    print(out)
+    sys.exit(3)
 
-command = ["git", "log", "--oneline", branch + "..origin/" + branch]
-out = subprocess.check_output(command)
-if out.strip() != "":
-  print "Remote repository has additional modifications to local repository"
-  print " ".join(command)
-  print out
-  sys.exit(3)
+if not skip_checks:
+    print("Checking git repository is in sync with remote repository")
+    command = ["git", "log", "--oneline", branch + "..origin/" + branch]
+    out = subprocess.check_output(command)
+    if out.strip() != "":
+        print("Remote repository has additional modifications to local repository")
+        print(" ".join(command))
+        print(out)
+        sys.exit(3)
 
-command = ["git", "log", "--oneline", "origin/" + branch + ".." + branch]
-out = subprocess.check_output(command)
-if out.strip() != "":
-  print "Local repository has modifications not pushed to the remote repository"
-  print "These should be pushed and checked that they pass Continuous Integration testing before continuing"
-  print " ".join(command)
-  print out
-  sys.exit(3)
+    command = ["git", "log", "--oneline", "origin/" + branch + ".." + branch]
+    out = subprocess.check_output(command)
+    if out.strip() != "":
+        print("Local repository has modifications not pushed to the remote repository")
+        print("These should be pushed and checked that they pass Continuous Integration testing before continuing")
+        print(" ".join(command))
+        print(out)
+        sys.exit(3)
 
-print "Tagging release"
+print("Tagging release")
 tag = "'rel-" + version + "'"
-os.system("git tag -a -m " + tag + " " + tag) == 0 or failed()
+force = "-f " if force_tag else ""
+os.system("git tag -a -m " + tag + " " + force + tag) == 0 or failed()
 
 outdir = os.path.basename(os.getcwd()) + "/" + dirname + "/"
-print "Grabbing tagged release git repository using 'git archive' into " + outdir
+print("Grabbing tagged release git repository using 'git archive' into " + outdir)
 os.system("(cd .. && git archive --prefix=" + outdir + " " + tag + " . | tar -xf -)") == 0 or failed()
 
 # Go build the system
 
-print "Building system"
-os.system("cd "+dirname+" && ./autogen.sh") == 0 or failed()
-os.system("cd "+dirname+"/Source/CParse && bison -y -d parser.y && mv y.tab.c parser.c && mv y.tab.h parser.h") == 0 or failed()
-os.system("cd "+dirname+" && make -f Makefile.in libfiles srcdir=./") == 0 or failed()
+print("Building system")
+os.system("cd " + dirname + " && ./autogen.sh") == 0 or failed()
+os.system("cd " + dirname + "/Source/CParse && bison -y -d parser.y && mv y.tab.c parser.c && mv y.tab.h parser.h") == 0 or failed()
+os.system("cd " + dirname + " && make -f Makefile.in libfiles srcdir=./") == 0 or failed()
 
 # Remove autoconf files
-os.system("find "+dirname+" -name autom4te.cache -exec rm -rf {} \\;")
+os.system("find " + dirname + " -name autom4te.cache -exec rm -rf {} \\;")
 
 # Build documentation
-print "Building html documentation"
-os.system("cd "+dirname+"/Doc/Manual && make all clean-baks") == 0 or failed()
+print("Building html documentation")
+os.system("cd " + dirname + "/Doc/Manual && make all clean-baks") == 0 or failed()
 
 # Build the tar-ball
-os.system("tar -cf "+dirname+".tar "+dirname) == 0 or failed()
-os.system("gzip "+dirname+".tar") == 0 or failed()
+os.system("tar -cf " + dirname + ".tar " + dirname) == 0 or failed()
+os.system("gzip " + dirname + ".tar") == 0 or failed()
 
-print "Finished building "+dirname+".tar.gz"
+print("Finished building " + dirname + ".tar.gz")
 
diff --git a/Tools/mkrelease.py b/Tools/mkrelease.py
index ec9a2b7..014cef2 100755
--- a/Tools/mkrelease.py
+++ b/Tools/mkrelease.py
@@ -1,49 +1,56 @@
 #!/usr/bin/env python
 
-# This script builds the SWIG source tarball, creates the Windows executable and the Windows zip package
-# and uploads them both to SF ready for release. Also uploaded are the release notes.
 import sys
-import string
 import os
 
 def failed(message):
   if message == "":
-    print "mkrelease.py failed to complete"
+    print("mkrelease.py failed to complete")
   else:
-    print message
+    print(message)
   sys.exit(2)
 
-try:
-   version = sys.argv[1]
-   branch = sys.argv[2]
-   username = sys.argv[3]
-except:
-   print "Usage: python mkrelease.py version branch username"
-   print "where version should be x.y.z and username is your SF username"
-   sys.exit(1)
+import argparse
+parser = argparse.ArgumentParser(description="Build a SWIG distribution source tarball swig-x.y.z.tar.gz and the Windows zip package swigwin-x.y.z.zip.\nUpload them both to SourceForge ready for release.\nThe release notes are also uploaded.")
+parser.add_argument("version", help="version string in format x.y.z")
+parser.add_argument("-b", "--branch", required=False, default="master", help="git branch name to create tarball from [master]")
+parser.add_argument("-f", "--force-tag", required=False, action="store_true", help="force tag (replace git tag if it already exists)")
+parser.add_argument("-s", "--skip-checks", required=False, action="store_true", help="skip checks (that local and remote repos are in sync)")
+parser.add_argument("-u", "--username", required=False, help="SourceForge username (upload to SourceForge will be skipped if not provided)")
+args = parser.parse_args()
 
-print "Looking for rsync"
+version = args.version
+branch = args.branch
+dirname = "swig-" + version
+force_tag = args.force_tag
+skip_checks = args.skip_checks
+username = args.username
+
+print("Looking for rsync")
 os.system("which rsync") and failed("rsync not installed/found. Please install.")
 
-print "Making source tarball"
-os.system("python ./mkdist.py " + version + " " + branch) and failed("")
+print("Making source tarball")
+force = "--force-tag" if force_tag else ""
+skip = "--skip-checks" if skip_checks else ""
+os.system("python ./mkdist.py {} {} --branch {} {}".format(force, skip, branch, version)) and failed("")
 
-print "Build Windows package"
+print("Build Windows package")
 os.system("./mkwindows.sh " + version) and failed("")
 
-print "Uploading to SourceForge"
+if username:
+    print("Uploading to SourceForge")
 
-swig_dir_sf = username + ",swig@frs.sourceforge.net:/home/frs/project/s/sw/swig/swig/swig-" + version + "/"
-swigwin_dir_sf = username + ",swig@frs.sourceforge.net:/home/frs/project/s/sw/swig/swigwin/swigwin-" + version + "/"
+    swig_dir_sf = username + ",swig@frs.sourceforge.net:/home/frs/project/s/sw/swig/swig/swig-" + version + "/"
+    swigwin_dir_sf = username + ",swig@frs.sourceforge.net:/home/frs/project/s/sw/swig/swigwin/swigwin-" + version + "/"
 
-# If a file with 'readme' in the name exists in the same folder as the zip/tarball, it gets automatically displayed as the release notes by SF
-full_readme_file = "readme-" + version + ".txt"
-os.system("rm -f " + full_readme_file)
-os.system("cat swig-" + version + "/README " + "swig-" + version + "/CHANGES.current " + "swig-" + version + "/RELEASENOTES " + "> " + full_readme_file)
+    # If a file with 'readme' in the name exists in the same folder as the zip/tarball, it gets automatically displayed as the release notes by SF
+    full_readme_file = "readme-" + version + ".txt"
+    os.system("rm -f " + full_readme_file)
+    os.system("cat swig-" + version + "/README " + "swig-" + version + "/CHANGES.current " + "swig-" + version + "/RELEASENOTES " + "> " + full_readme_file)
 
-os.system("rsync --archive --verbose -P --times -e ssh " + "swig-" + version + ".tar.gz " + full_readme_file + " " + swig_dir_sf) and failed("")
-os.system("rsync --archive --verbose -P --times -e ssh " + "swigwin-" + version + ".zip " + full_readme_file + " " + swigwin_dir_sf) and failed("")
+    os.system("rsync --archive --verbose -P --times -e ssh " + "swig-" + version + ".tar.gz " + full_readme_file + " " + swig_dir_sf) and failed("")
+    os.system("rsync --archive --verbose -P --times -e ssh " + "swigwin-" + version + ".zip " + full_readme_file + " " + swigwin_dir_sf) and failed("")
 
-print "Finished"
+    print("Finished")
 
-print "Now log in to SourceForge and set the operating systems applicable to the newly uploaded tarball and zip file. Also remember to do a 'git push --tags'."
+    print("Now log in to SourceForge and set the operating systems applicable to the newly uploaded tarball and zip file. Also remember to do a 'git push --tags'.")
diff --git a/Tools/mkwindows.sh b/Tools/mkwindows.sh
index 0651bbd..e6ae843 100755
--- a/Tools/mkwindows.sh
+++ b/Tools/mkwindows.sh
@@ -9,6 +9,8 @@
 # path to zip program
 zip=
 
+wine=
+
 # options for configure
 extraconfigureoptions=
 compileflags="-O2 -Wall -Wextra"
@@ -41,6 +43,11 @@
     echo "Building native Windows executable on Linux"
     if test x$zip = x; then
       zip=zip
+      wine=$(which wine)
+    fi
+    if test x$wine = x; then
+      echo "Could not detect wine - please install wine-stable package."
+      exit 1;
     fi
     echo "Checking that mingw 32-bit gcc is installed/available"
     if test -n "`which i686-w64-mingw32-gcc`" ; then
@@ -109,9 +116,9 @@
       echo "Compiling (quietly)..."
       make > build.log
       echo "Simple check to see if swig.exe runs..."
-      env LD_LIBRARY_PATH= PATH= ./swig.exe -version || exit 1
+      env LD_LIBRARY_PATH= PATH= $wine ./swig.exe -version || exit 1
       echo "Simple check to see if ccache-swig.exe runs..."
-      env LD_LIBRARY_PATH= PATH= ./CCache/ccache-swig.exe -V || exit 1
+      env LD_LIBRARY_PATH= PATH= $wine ./CCache/ccache-swig.exe -V || exit 1
       echo "Creating $swigwinbasename.zip..."
       cd ..
       cp $swigbasename/swig.exe $swigwinbasename
diff --git a/Tools/obs-buildlogs.py b/Tools/obs-buildlogs.py
index eaf0f61..b97e7db 100755
--- a/Tools/obs-buildlogs.py
+++ b/Tools/obs-buildlogs.py
@@ -15,7 +15,7 @@
   for line in repos.stdout:
     command = ['osc', 'buildlog', '--last'] + line.split()
     filename = "-".join(line.split()) + ".log"
-    print "Downloading logs using: {}".format(" ".join(command))
+    print("Downloading logs using: {}".format(" ".join(command)))
     buildlog = subprocess.Popen(command, stdout=subprocess.PIPE)
 
     print("Writing log to {}".format(filename))
diff --git a/Tools/travis-linux-install.sh b/Tools/travis-linux-install.sh
index dc85265..d7d3150 100755
--- a/Tools/travis-linux-install.sh
+++ b/Tools/travis-linux-install.sh
@@ -1,26 +1,16 @@
 #!/bin/bash
 
+# Install Linux packages where the version has been overidden in .travis.yml
+
 set -e # exit on failure (same as -o errexit)
 
 lsb_release -a
 travis_retry sudo apt-get -qq update
 
-if [[ "$CC" == gcc-5 ]]; then
+if [[ -n "$GCC" ]]; then
 	travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
 	travis_retry sudo apt-get -qq update
-	travis_retry sudo apt-get install -qq g++-5
-elif [[ "$CC" == gcc-6 ]]; then
-	travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
-	travis_retry sudo apt-get -qq update
-	travis_retry sudo apt-get install -qq g++-6
-elif [[ "$CC" == gcc-7 ]]; then
-	travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
-	travis_retry sudo apt-get -qq update
-	travis_retry sudo apt-get install -qq g++-7
-elif [[ "$CC" == gcc-8 ]]; then
-	travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
-	travis_retry sudo apt-get -qq update
-	travis_retry sudo apt-get install -qq g++-8
+	travis_retry sudo apt-get install -qq g++-$GCC
 fi
 
 travis_retry sudo apt-get -qq install libboost-dev
@@ -37,18 +27,22 @@
 		travis_retry sudo dpkg -i dmd_2.066.0-0_amd64.deb
 		;;
 	"go")
+		if [[ "$VER" ]]; then
+		  eval "$(gimme ${VER}.x)"
+		fi
 		;;
 	"javascript")
 		case "$ENGINE" in
 			"node")
-				if [[ -z "$VER" ]]; then
-					travis_retry sudo apt-get install -qq nodejs node-gyp
+				travis_retry wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.10/install.sh | bash
+				export NVM_DIR="$HOME/.nvm"
+				[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
+				travis_retry nvm install ${VER}
+				nvm use ${VER}
+				if [ "$VER" == "0.10" ] || [ "$VER" == "0.12" ] ; then
+#					travis_retry sudo apt-get install -qq nodejs node-gyp
+					travis_retry npm install -g node-gyp@$VER
 				else
-					travis_retry wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.10/install.sh | bash
-					export NVM_DIR="$HOME/.nvm"
-					[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
-					travis_retry nvm install ${VER}
-					nvm use ${VER}
 					travis_retry npm install -g node-gyp
 				fi
 				;;
@@ -67,8 +61,6 @@
 		if [[ -z "$VER" ]]; then
 			travis_retry sudo apt-get -qq install lua5.2 liblua5.2-dev
 		else
-			travis_retry sudo add-apt-repository -y ppa:ubuntu-cloud-archive/mitaka-staging
-			travis_retry sudo apt-get -qq update
 			travis_retry sudo apt-get -qq install lua${VER} liblua${VER}-dev
 		fi
 		;;
@@ -76,8 +68,7 @@
 		travis_retry sudo apt-get -qq install racket
 		;;
 	"ocaml")
-		# configure also looks for ocamldlgen, but this isn't packaged.  But it isn't used by default so this doesn't matter.
-		travis_retry sudo apt-get -qq install ocaml ocaml-findlib
+		travis_retry sudo apt-get -qq install ocaml camlp4
 		;;
 	"octave")
 		if [[ -z "$VER" ]]; then
@@ -123,6 +114,10 @@
 		fi
 		;;
 	"scilab")
+		# Travis has the wrong version of Java pre-installed resulting in error using scilab:
+		# /usr/bin/scilab-bin: error while loading shared libraries: libjava.so: cannot open shared object file: No such file or directory
+		echo "JAVA_HOME was set to $JAVA_HOME"
+		unset JAVA_HOME
 		travis_retry sudo apt-get -qq install scilab
 		;;
 	"tcl")
diff --git a/Tools/travis-osx-install.sh b/Tools/travis-osx-install.sh
index 6bfb227..63a11ef 100755
--- a/Tools/travis-osx-install.sh
+++ b/Tools/travis-osx-install.sh
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# Install MacOS packages where the version has been overidden in .travis.yml
+
 set -e # exit on failure (same as -o errexit)
 
 sw_vers
diff --git a/appveyor.yml b/appveyor.yml
index 1eb7ae4..10bf064 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -118,6 +118,7 @@
 - if not "%OSVARIANT%"=="" CCache\ccache-swig -V
 - bash -c "file ./swig.exe"
 - bash -c "make check-%SWIGLANG%-version"
+- bash -c "make check-%SWIGLANG%-enabled"
 - bash -c "time make -k check-%SWIGLANG%-examples %CHECK_OPTIONS% %CHECK_OPTIONS2%"
 - bash -c "time make -k check-%SWIGLANG%-test-suite -j%MAKEJOBS% %CHECK_OPTIONS% %CHECK_OPTIONS2%"
 
diff --git a/configure.ac b/configure.ac
index 6380260..133975f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,11 +2,8 @@
 dnl The macros which aren't shipped with the autotools are stored in the
 dnl Tools/config directory in .m4 files.
 
-AC_INIT([swig],[4.0.0],[http://www.swig.org])
-
-dnl NB: When this requirement is increased to 2.60 or later, AC_PROG_SED
-dnl     definition below can be removed
-AC_PREREQ(2.58)
+AC_INIT([swig],[4.0.1],[http://www.swig.org])
+AC_PREREQ(2.60)
 
 AC_CONFIG_SRCDIR([Source/Swig/swig.h])
 AC_CONFIG_AUX_DIR([Tools/config])
@@ -44,11 +41,6 @@
 fi
 
 dnl PCRE
-
-dnl AX_PATH_GENERIC() relies on AC_PROG_SED() but it is defined only in
-dnl autoconf 2.60 so trivially predefine it ourselves for the older versions
-m4_ifdef([AC_PROG_SED],, [AC_DEFUN([AC_PROG_SED], [AC_PATH_PROG([SED], sed)])])
-
 AC_ARG_WITH([pcre],
   [AS_HELP_STRING([--without-pcre],
                   [Disable support for regular expressions using PCRE])],
@@ -2052,6 +2044,16 @@
     AC_MSG_NOTICE([Disabling OCaml])
     OCAMLC=
 else
+    # OCaml compiler
+    if test -z "$OCAMLC"; then
+	AC_CHECK_PROGS(OCAMLC, ocamlc)
+    fi
+
+    # OCaml Pre-Processor-Pretty-Printer
+    if test -z "$CAMLP4"; then
+	AC_CHECK_PROGS(CAMLP4, camlp4)
+    fi
+
     # OCaml DL load generator
     if test -z "$OCAMLDLGEN"; then
 	AC_CHECK_PROGS(OCAMLDLGEN, ocamldlgen)
@@ -2062,27 +2064,17 @@
 	AC_CHECK_PROGS(OCAMLFIND, ocamlfind)
     fi
 
-    # OCaml compiler
-    if test -z "$OCAMLC"; then
-	AC_CHECK_PROGS(OCAMLC, ocamlc)
-    fi
-
     # OCaml toplevel creator
     if test -z "$OCAMLMKTOP"; then
 	AC_CHECK_PROGS(OCAMLMKTOP, ocamlmktop)
     fi
-
-    # OCaml Pre-Processor-Pretty-Printer
-    if test -z "$CAMLP4"; then
-	AC_CHECK_PROGS(CAMLP4, camlp4)
-    fi
 fi
 
 AC_SUBST(OCAMLC)
+AC_SUBST(CAMLP4)
 AC_SUBST(OCAMLDLGEN)
 AC_SUBST(OCAMLFIND)
 AC_SUBST(OCAMLMKTOP)
-AC_SUBST(CAMLP4)
 
 #----------------------------------------------------------------
 # Look for C#
@@ -2644,7 +2636,7 @@
 
 
 SKIP_OCAML=
-if test -z "$OCAMLC" ; then
+if test -z "$OCAMLC" || test -z "$CAMLP4" ; then
     SKIP_OCAML="1"
 fi
 AC_SUBST(SKIP_OCAML)