Merge branch 'RMemberListTrialSimplify2019'

* RMemberListTrialSimplify2019:
  ENH R abstract_access_runme
  ENH R accessor processing test
  Removed some remaining commented sections
  moved registration routine and use swig_name_get
  calling Swig_name_setget
  Used Swig_name_register so that Swig_name_wrapper produces the correct name without a separate replace call.
  Removed last instance of using Strcmp to check for a set/get method. Replaced with check for flag.
  Alternative version of using memberlist processing. This clarifies the logic within OutputMemberReferenceMethod by filtering the lists into classes, rather than doing it internally. Code isn't any shorter.
  commenting out unused code
  first pass at removing string comparisons for set/get methods
  trial changing member list processing
diff --git a/.travis.yml b/.travis.yml
index 78d8883..32c6656 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,340 +5,415 @@
       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
+    - os: linux
+      env: SWIGLANG= GCC=9
+      sudo: required
+      dist: xenial
     - compiler: gcc
       os: linux
       env: SWIGLANG=csharp
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=d
+      env: SWIGLANG=d VER=2.066.0
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=go
+      env: SWIGLANG=d VER=2.086.1
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=go VER=1.5
+      env: SWIGLANG=go VER=1.3
       sudo: required
-      dist: trusty
+      dist: xenial
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=go VER=1.8
+      sudo: required
+      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
-    - compiler: gcc
-      os: linux
-      env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.2 CPP11=1
-      sudo: required
-      dist: trusty
-    - compiler: gcc
-      os: linux
-      env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.4 CPP11=1
-      sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       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 PY3=3 VER=3.8
+      sudo: required
+      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.8
       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
+      env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.8
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.7 SWIGOPTPY3=
+      env: SWIGLANG=python SWIG_FEATURES="-builtin -O" PY3=3 VER=3.8
       sudo: required
-      dist: trusty
+      dist: xenial
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.8 SWIGOPTPY3=
+      sudo: required
+      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
+      env: SWIGLANG=python SWIG_FEATURES=-O PY3=3 VER=3.8
       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
+      env: SWIGLANG=ruby VER=1.9
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=ruby VER=2.0.0
+      env: SWIGLANG=ruby VER=2.0
       sudo: required
-      dist: trusty
+      dist: xenial
     - compiler: gcc
       os: linux
-      env: SWIGLANG=ruby VER=2.3.0
+      env: SWIGLANG=ruby VER=2.1
       sudo: required
-      dist: trusty
+      dist: xenial
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=ruby VER=2.2
+      sudo: required
+      dist: xenial
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=ruby VER=2.3
+      sudo: required
+      dist: xenial
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=ruby VER=2.4
+      sudo: required
+      dist: xenial
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=ruby VER=2.5
+      sudo: required
+      dist: xenial
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=ruby VER=2.6
+      sudo: required
+      dist: xenial
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=ruby VER=2.7
+      sudo: required
+      dist: xenial
     - compiler: gcc
       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: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=go SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+      env: SWIGLANG=go VER=1.6 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=java CPP11=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=python SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+      env: SWIGLANG=python 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: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=tcl SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
+      env: SWIGLANG=tcl CPP11=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=csharp SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
+      env: SWIGLANG=csharp 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=go VER=1.6 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=java 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=python GCC=6 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=ruby GCC=6 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=tcl GCC=6 CPP14=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=7 CPP14=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=7 CPP14=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=csharp SWIG_CC=gcc-8 SWIG_CXX=g++-8 CPP17=1
+      env: SWIGLANG=csharp GCC=8 CPP17=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=java SWIG_CC=gcc-8 SWIG_CXX=g++-8 CPP17=1
+      env: SWIGLANG=java GCC=8 CPP17=1
       sudo: required
-      dist: trusty
+      dist: xenial
     - os: linux
-      env: SWIGLANG=python SWIG_CC=gcc-8 SWIG_CXX=g++-8 CPP17=1 PY3=3 VER=3.7
+      env: SWIGLANG=python GCC=8 CPP17=1 PY3=3 VER=3.8
       sudo: required
-      dist: trusty
+      dist: xenial
+    - os: linux
+      env: SWIGLANG=csharp GCC=9 CPP17=1
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG=java GCC=9 CPP17=1
+      sudo: required
+      dist: xenial
+    - os: linux
+      env: SWIGLANG=python GCC=9 CPP17=1 PY3=3 VER=3.8
+      sudo: required
+      dist: xenial
     - compiler: gcc
       os: osx
       env: SWIGLANG=
@@ -362,6 +437,9 @@
       env: SWIGLANG=lua
     - compiler: clang
       os: osx
+      env: SWIGLANG=octave SWIGJOBS=-j2
+    - compiler: clang
+      os: osx
       env: SWIGLANG=perl5
     - compiler: clang
       os: osx
@@ -375,46 +453,60 @@
     - compiler: clang
       os: osx
       env: SWIGLANG=tcl
+    - compiler: clang
+      os: osx
+      env: SWIGLANG=java CPP17=1
+      osx_image: xcode10.2
+    - compiler: clang
+      os: osx
+      env: SWIGLANG=python PY3=3 CPP17=1
+      osx_image: xcode10.2
 
   allow_failures:
-    # Sometimes hits the Travis 50 minute time limit
+    # Newer version of D not yet working/supported
     - compiler: gcc
       os: linux
-      env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.4 CPP11=1
+      env: SWIGLANG=d VER=2.086.1
       sudo: required
-      dist: trusty
+      dist: xenial
+    # seg fault in director_basic testcase
+    - compiler: gcc
+      os: linux
+      env: SWIGLANG=php VER=7.2
+      sudo: required
+      dist: xenial
+    # Sometimes hits the Travis 50 minute time limit
+    - compiler: clang
+      os: osx
+      env: SWIGLANG=octave SWIGJOBS=-j2
     # Experimental languages
     - 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
 
 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..6709f11 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,8 +1,8 @@
-*** ANNOUNCE: SWIG 4.0.0 (in progress) ***
+*** ANNOUNCE: SWIG 4.0.2 (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.2, 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.2.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.2.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..fe86967 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,1680 @@
 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.1 (21 Aug 2019)
+===========================
+
+2019-08-20: TekuConcept
+            [Javascript] #1535 Add %native support to Javascript.
+
+2019-08-20: bkotzz
+            [Java] #1616 Add SWIG_JavaIllegalStateException to support throwing
+            java.lang.IllegalStateException from JNI code.
+
+2019-08-19: sjml
+            [Lua] #1596 tostring output changes to show the underlying C/C++ pointer.
+
+2019-08-08: rokups
+            [C#, Java] #1601 Fix invalid code generated for "%constant enum EnumType.
+
+2019-08-07: wsfulton
+            [Python] Fix method overloading of methods that take STL containers of different
+            types. The following usage (using std::vector) would fail when using -builtin:
+
+              %include <std_string.i>
+              %include <std_vector.i>
+
+              %inline %{
+              struct X {};
+              %}
+
+              %template(VectorX) std::vector<X>;
+              %template(VectorInt) std::vector<int>;
+
+              %inline %{
+              using namespace std;
+              string VectorOverload(vector<X> v);
+              string VectorOverload(vector<int> v);
+              %}
+
+            The following would incorrectly fail:
+
+              s = VectorOverload([1, 2, 3])
+
+            With:
+
+              Traceback (most recent call last):
+                File "runme3.py", line 20, in <module>
+                  ret = VectorOverload([1, 2, 3])
+              TypeError: Wrong number or type of arguments for overloaded function 'VectorOverload'.
+                Possible C/C++ prototypes are:
+                  VectorOverload(std::vector< Number,std::allocator< Number > >)
+                  VectorOverload(std::vector< int,std::allocator< int > >)
+
+            The problem was due to some error handling that was not cleared during typehecking.
+            In this case an error was not cleared when the elements in the list failed the
+            typecheck for converting to X. Only occurs in Python 3+.
+
+            In some combinations of overloaded methods, the following type of error message would
+            occur:
+
+              RuntimeError: in sequence element 0
+
+              The above exception was the direct cause of the following exception:
+
+              Traceback (most recent call last):
+                File "runme3.py", line 23, in <module>
+                  check(VectorOverload(v), "vector<X>")
+              SystemError: <built-in function VectorOverload> returned a result with an error set
+
+2019-08-01: wsfulton
+            #1602 Fix regression in 4.0.0 where a template function containing a parameter
+            with the same name as the function name led to the parameter name used in the
+            target language being incorrectly modified.
+
+2019-07-29: wsfulton
+            Remove all generated files on error. Previously generated files were not removed,
+            potentially breaking Makefiles using file dependencies, especially when -Werror
+            (warnings as errors) was used.
+
+2019-07-23: smithx
+            [C#] #1530 #1532 Fix marshalling of std::wstring to C#.
+
+2019-07-18: gicmo
+            [Python] #1587 Python 3.8 support - remove use of deprecated PyObject_GC_UnTrack.
+
+2019-07-18: cher-nov
+            [Python] #1573 Generated Python code uses consistent string quoting style - double
+            quotes.
+
+2019-07-16: geefr
+            [C#] #616 #1576 Fix C# bool INPUT[], bool OUTPUT[], bool INOUT[] typemaps to marshall
+            as 1-byte.
+
+2019-07-12: vadz
+            [C#, Java] #1568 #1583 Fix std::set<> typemaps for primitive types.
+
+2019-07-12: vadz
+            #1566 #1584 Regression in 4.0.0 - fix missing value for first item of enums with
+            trailing comma.
+
+2019-07-11: mcfarljm
+            #1548 #1578 Fix segfault in Doxygen parser parsing empty lines in some commands like
+            \code.
+
+2019-07-09: IsaacPascual
+            [C#, Java] #1570 Fix name of generated C#/Java classes for %interface macros
+            in swiginterface.i when wrapping nested C++ classes.
+
+2019-07-05: wsfulton
+            [Python] #1547 Whitespace fixes in Doxygen translated comments into pydoc comments
+            for Sphinx compatibility.
+
+2019-06-28: wsfulton
+            [MzScheme, OCaml] #1559 $arg and $input were incorrectly substituted in the
+            argout typemap when two or more arguments were present.
+
+2019-06-24: wsfulton
+            [Python, Ruby] #1538 Remove the UnknownExceptionHandler class in order to be
+            C++17 compliant as it uses std::unexpected_handler which was removed in C++17.
+            This class was intended for director exception handling but was never used by
+            SWIG and was never documented.
+
+            *** POTENTIAL INCOMPATIBILITY ***
+
+2019-06-06: bkotzz
+            [Java] #1552 Improve performance in Java std::vector constructor wrapper that takes
+            a native Java array as input.
+
+2019-06-03: olly
+	    [Python] Fix regression in implicit_conv handling of tuples,
+	    introduced in SWIG 4.0.0.  Fixes #1553, reported by Alexandre
+	    Duret-Lutz.
+
+2019-05-24: wsfulton
+            [Octave] Fix detection of Octave on MacOS.
+
+2019-05-24: opoplawski
+            [Octave] #1522 Adapt OCTAVE_LDFLAGS for Octave 5.1.
+
+2019-05-22: ferdynator
+	    [PHP] #1528 Don't add a closing '?>' PHP tag to generated files.
+	    PSR-2 says it MUST be omitted for files containing only PHP.
+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 so the
+	    generated code builds when PHP was built with ZTS enabled.
+
+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 6529ac8..587d91e 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -4,1496 +4,63 @@
 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.2 (in progress)
 ===========================
 
-2019-04-09: wsfulton
-            [C#] Fix FxCop warning CA2002 in SWIGPendingException - a lock on a reference of
-            type 'Type'.
+2020-01-24: etse-dignitas, wsfulton
+            #1533 [C#, D, Java] Fix upcasting for shared_ptr's of templated types.
 
-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.
+2020-01-16: mcfarljm
+            #1643 #1654 When using -doxygen, fix segfault when nameless parameters or vararg parameters
+            are used.
 
-2019-03-30: wsfulton
-            [C#] #421 Fix CA1063 warning 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:
+2020-01-16: mcfarljm
+            #1632 #1659 Fix newline handling for doxygen "///" comments.
 
-              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.
+2020-01-14: mcfarljm
+            #1647 #1656 Fix crash handling empty doxygen comments.
 
-            *** POTENTIAL INCOMPATIBILITY ***
+2020-01-14: mcfarljm
+            #1608 Improve doxygen support.
+            - Add support for \param[] commands such as: \param[in].
+            - Optional arguments are marked as 'optional' in pydoc.
+            - Improve support for \code commands so that other languages are supported as code blocks.
+              Support added for java, c and py.  For example Python: \code{.py} ... \endcode
+            - Fix doxygen handling of \em and \p tags for Python.
 
-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:
+2020-01-13: wsfulton
+            [Python] #1595 Python -builtin constructors silently ignored keyword arguments.
+            Instead of silenty ignoring them, now a "TypeError: f() takes no keyword arguments"
+            exception is thrown if keyword arguments are used. Hence constructors and normal methods/
+            functions behave in the same way. Note, -keyword should be used with -builtin to obtain
+            keyword argument support.
 
-              SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass)
-              %template(ListKlass) std::list<SomeNamespace::Klass>;
+2020-01-05: jschueller shadchin
+            [Python] #1670 #1696 Add missing field initializers introduced in python 3.8:
+            tp_vectorcall and tp_print.
 
-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.
+2020-01-05: friedrichatgc
+            [Octave] #1688 Change swig_this() to use size_t instead of long for compatibility
+            with Windows 64 bit.
 
-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.
+2020-01-05: treitmayr
+            [Ruby] #1692 #1689 Add support for Ruby 2.7
 
-2019-03-12: vadz
-            [C#] #1495 Add std_set.i for std::set support.
+2019-12-30: treitmayr
+            [Ruby] #1653 #1668 Fix code generated when using -globalmodule option.
 
-2019-03-11: dirteat,opoplawski
-            [Octave] Fix compilation errors in Octave 5.1.
+2019-12-29: ZackerySpytz
+            [OCaml] #1686 Fix compilation errors with OCaml 4.09.0.
 
-              error: format not a string literal and no format arguments [-Werror=format-security]
+2019-12-10: wsfulton
+            #1679 Fix parsing of C++11 identifiers with special meaning (final and override) when
+            they are used as part of the scope name of an identifier, such as a namespace name.
 
-2019-02-28: wsfulton
-            [Java] std::vector improvements for types that do not have a default constructor.
+2019-11-26: wsfulton
+            [C#] #1628 'out' or 'ref' used in a cstype typemap was not always stripped out in parts
+            of director code generation.
 
-            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
-            #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
-            #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
-	    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.
+2019-11-01: wsfulton
+            [Python] #1595 Fix bug in support for keyword arguments (kwargs feature or -keyword)
+            when using -builtin. The fix is in the argument error checking when wrapping zero
+            argument constructors only.
diff --git a/Doc/Manual/Android.html b/Doc/Manual/Android.html
index 8947241..da475e9 100644
--- a/Doc/Manual/Android.html
+++ b/Doc/Manual/Android.html
@@ -6,7 +6,7 @@
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 </head>
 <body bgcolor="#FFFFFF">
-<H1><a name="Android">21 SWIG and Android</a></H1>
+<H1><a name="Android">22 SWIG and Android</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -31,7 +31,7 @@
 
 
 
-<H2><a name="Android_overview">21.1 Overview</a></H2>
+<H2><a name="Android_overview">22.1 Overview</a></H2>
 
 
 <p>
@@ -41,14 +41,14 @@
 This chapter contains a few Android specific notes and examples.
 </p>
 
-<H2><a name="Android_examples">21.2 Android examples</a></H2>
+<H2><a name="Android_examples">22.2 Android examples</a></H2>
 
 
-<H3><a name="Android_examples_intro">21.2.1 Examples introduction</a></H3>
+<H3><a name="Android_examples_intro">22.2.1 Examples introduction</a></H3>
 
 
 <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>
@@ -77,7 +77,7 @@
 The following examples are shipped with SWIG under the Examples/android directory and include a Makefile to build and install each example.
 </p>
 
-<H3><a name="Android_example_simple">21.2.2 Simple C example</a></H3>
+<H3><a name="Android_example_simple">22.2.2 Simple C example</a></H3>
 
 
 <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>
 
@@ -399,7 +399,7 @@
 <center><img src="android-simple.png" alt="Android screenshot of SwigSimple example"></center>
 
 
-<H3><a name="Android_example_class">21.2.3 C++ class example</a></H3>
+<H3><a name="Android_example_class">22.2.3 C++ class example</a></H3>
 
 
 <p>
@@ -747,7 +747,7 @@
 
 <center><img src="android-class.png" alt="Android screenshot of SwigClass example"></center>
 
-<H3><a name="Android_examples_other">21.2.4 Other examples</a></H3>
+<H3><a name="Android_examples_other">22.2.4 Other examples</a></H3>
 
 
 <p>
@@ -759,7 +759,7 @@
 Normally C++ exception handling and the STL is not available by default in the version of g++ shipped with Android, but this example turns these features on as described in the next section.
 </p>
 
-<H2><a name="Android_stl">21.3 C++ STL</a></H2>
+<H2><a name="Android_stl">22.3 C++ STL</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Arguments.html b/Doc/Manual/Arguments.html
index 2828bf4..3d633f3 100644
--- a/Doc/Manual/Arguments.html
+++ b/Doc/Manual/Arguments.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Arguments">12 Argument Handling</a></H1>
+<H1><a name="Arguments">13 Argument Handling</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -43,7 +43,7 @@
 describes some of the techniques for doing this.
 </p>
 
-<H2><a name="Arguments_nn2">12.1 The typemaps.i library</a></H2>
+<H2><a name="Arguments_nn2">13.1 The typemaps.i library</a></H2>
 
 
 <p>
@@ -51,7 +51,7 @@
 change certain properties of argument conversion.
 </p>
 
-<H3><a name="Arguments_nn3">12.1.1 Introduction</a></H3>
+<H3><a name="Arguments_nn3">13.1.1 Introduction</a></H3>
 
 
 <p>
@@ -195,7 +195,7 @@
 </pre>
 </div>
 
-<H3><a name="Arguments_nn4">12.1.2 Input parameters</a></H3>
+<H3><a name="Arguments_nn4">13.1.2 Input parameters</a></H3>
 
 
 <p>
@@ -248,7 +248,7 @@
 result = add(3, 4)
 </pre></div>
 
-<H3><a name="Arguments_nn5">12.1.3 Output parameters</a></H3>
+<H3><a name="Arguments_nn5">13.1.3 Output parameters</a></H3>
 
 
 <p>
@@ -315,7 +315,7 @@
 </pre>
 </div>
 
-<H3><a name="Arguments_nn6">12.1.4 Input/Output parameters</a></H3>
+<H3><a name="Arguments_nn6">13.1.4 Input/Output parameters</a></H3>
 
 
 <p>
@@ -380,7 +380,7 @@
 SWIG.  Backwards compatibility is preserved, but deprecated.
 </p>
 
-<H3><a name="Arguments_nn7">12.1.5 Using different names</a></H3>
+<H3><a name="Arguments_nn7">13.1.5 Using different names</a></H3>
 
 
 <p>
@@ -414,7 +414,7 @@
 file or a matching <tt>%clear</tt> declaration.
 </p>
 
-<H2><a name="Arguments_nn8">12.2 Applying constraints to input values</a></H2>
+<H2><a name="Arguments_nn8">13.2 Applying constraints to input values</a></H2>
 
 
 <p>
@@ -424,7 +424,7 @@
 can be accomplished including the <tt>constraints.i</tt> library file.
 </p>
 
-<H3><a name="Arguments_nn9">12.2.1 Simple constraint example</a></H3>
+<H3><a name="Arguments_nn9">13.2.1 Simple constraint example</a></H3>
 
 
 <p>
@@ -450,7 +450,7 @@
 exception will be raised. As a result, it is possible to catch bad
 values, prevent mysterious program crashes and so on.</p>
 
-<H3><a name="Arguments_nn10">12.2.2 Constraint methods</a></H3>
+<H3><a name="Arguments_nn10">13.2.2 Constraint methods</a></H3>
 
 
 <p>
@@ -466,7 +466,7 @@
 
 </pre></div>
 
-<H3><a name="Arguments_nn11">12.2.3 Applying constraints to new datatypes</a></H3>
+<H3><a name="Arguments_nn11">13.2.3 Applying constraints to new datatypes</a></H3>
 
 
 <p>
diff --git a/Doc/Manual/CCache.html b/Doc/Manual/CCache.html
index 3a7db5c..1a94709 100644
--- a/Doc/Manual/CCache.html
+++ b/Doc/Manual/CCache.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="CCache">20 Using SWIG with ccache - ccache-swig(1) manpage</a></H1>
+<H1><a name="CCache">21 Using SWIG with ccache - ccache-swig(1) manpage</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -35,7 +35,7 @@
 
 
 <p>
-<H2><a name="CCache_nn2">20.1 NAME</a></H2>
+<H2><a name="CCache_nn2">21.1 NAME</a></H2>
 
 
 <p>
@@ -43,7 +43,7 @@
 ccache-swig - a fast compiler cache
 
 <p>
-<H2><a name="CCache_nn3">20.2 SYNOPSIS</a></H2>
+<H2><a name="CCache_nn3">21.2 SYNOPSIS</a></H2>
 
 
 <p>
@@ -53,7 +53,7 @@
 <p>
 &lt;compiler&gt; [COMPILER OPTIONS]
 <p>
-<H2><a name="CCache_nn4">20.3 DESCRIPTION</a></H2>
+<H2><a name="CCache_nn4">21.3 DESCRIPTION</a></H2>
 
 
 <p>
@@ -62,7 +62,7 @@
 being done again. ccache-swig is ccache plus support for SWIG. ccache
 and ccache-swig are used interchangeably in this document.
 <p>
-<H2><a name="CCache_nn5">20.4 OPTIONS SUMMARY</a></H2>
+<H2><a name="CCache_nn5">21.4 OPTIONS SUMMARY</a></H2>
 
 
 <p>
@@ -82,7 +82,7 @@
 </pre>
 
 <p>
-<H2><a name="CCache_nn6">20.5 OPTIONS</a></H2>
+<H2><a name="CCache_nn6">21.5 OPTIONS</a></H2>
 
 
 <p>
@@ -124,7 +124,7 @@
 <p>
 </dl>
 <p>
-<H2><a name="CCache_nn7">20.6 INSTALLATION</a></H2>
+<H2><a name="CCache_nn7">21.6 INSTALLATION</a></H2>
 
 
 <p>
@@ -156,7 +156,7 @@
 Note! Do not use a hard link, use a symbolic link. A hardlink will
 cause "interesting" problems.
 <p>
-<H2><a name="CCache_nn8">20.7 EXTRA OPTIONS</a></H2>
+<H2><a name="CCache_nn8">21.7 EXTRA OPTIONS</a></H2>
 
 
 <p>
@@ -176,7 +176,7 @@
 treated as an input file name and instead be passed along to the
 compiler as a command line option.
 <p>
-<H2><a name="CCache_nn9">20.8 ENVIRONMENT VARIABLES</a></H2>
+<H2><a name="CCache_nn9">21.8 ENVIRONMENT VARIABLES</a></H2>
 
 
 <p>
@@ -315,7 +315,7 @@
 <p>
 </dl>
 <p>
-<H2><a name="CCache_nn10">20.9 CACHE SIZE MANAGEMENT</a></H2>
+<H2><a name="CCache_nn10">21.9 CACHE SIZE MANAGEMENT</a></H2>
 
 
 <p>
@@ -328,7 +328,7 @@
 below the numbers you specified in order to avoid doing the cache
 clean operation too often.
 <p>
-<H2><a name="CCache_nn11">20.10 CACHE COMPRESSION</a></H2>
+<H2><a name="CCache_nn11">21.10 CACHE COMPRESSION</a></H2>
 
 
 <p>
@@ -339,7 +339,7 @@
 that fit in the cache. You can turn off compression setting the
 CCACHE_NOCOMPRESS environment variable.
 <p>
-<H2><a name="CCache_nn12">20.11 HOW IT WORKS</a></H2>
+<H2><a name="CCache_nn12">21.11 HOW IT WORKS</a></H2>
 
 
 <p>
@@ -364,7 +364,7 @@
 discover a case where ccache changes the output of your compiler then
 please let me know.
 <p>
-<H2><a name="CCache_nn13">20.12 USING CCACHE WITH DISTCC</a></H2>
+<H2><a name="CCache_nn13">21.12 USING CCACHE WITH DISTCC</a></H2>
 
 
 <p>
@@ -378,7 +378,7 @@
 'distcc' and ccache will prefix the command line used with the
 compiler with the command 'distcc'.
 <p>
-<H2><a name="CCache_nn14">20.13 SHARING A CACHE</a></H2>
+<H2><a name="CCache_nn14">21.13 SHARING A CACHE</a></H2>
 
 
 <p>
@@ -407,7 +407,7 @@
   versions of ccache that do not support compression.
 </ul>
 <p>
-<H2><a name="CCache_nn15">20.14 HISTORY</a></H2>
+<H2><a name="CCache_nn15">21.14 HISTORY</a></H2>
 
 
 <p>
@@ -423,7 +423,7 @@
 compiler cache and I wanted to remove some of the limitations of the
 shell-script version.
 <p>
-<H2><a name="CCache_nn16">20.15 DIFFERENCES FROM COMPILERCACHE</a></H2>
+<H2><a name="CCache_nn16">21.15 DIFFERENCES FROM COMPILERCACHE</a></H2>
 
 
 <p>
@@ -441,7 +441,7 @@
 <li> ccache avoids a double call to cpp on a cache miss
 </ul>
 <p>
-<H2><a name="CCache_nn17">20.16 CREDITS</a></H2>
+<H2><a name="CCache_nn17">21.16 CREDITS</a></H2>
 
 
 <p>
@@ -453,12 +453,12 @@
  <li> Paul Russell for many suggestions and the debian packaging
 </ul>
 <p>
-<H2><a name="CCache_nn18">20.17 AUTHOR</a></H2>
+<H2><a name="CCache_nn18">21.17 AUTHOR</a></H2>
 
 
 <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 0526766..ca56887 100644
--- a/Doc/Manual/CSharp.html
+++ b/Doc/Manual/CSharp.html
@@ -6,7 +6,7 @@
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 </head>
 <body bgcolor="#FFFFFF">
-<H1><a name="CSharp">22 SWIG and C#</a></H1>
+<H1><a name="CSharp">23 SWIG and C#</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -55,7 +55,7 @@
 
 
 
-<H2><a name="CSharp_introduction">22.1 Introduction</a></H2>
+<H2><a name="CSharp_introduction">23.1 Introduction</a></H2>
 
 
 <p>
@@ -64,18 +64,27 @@
 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>.
+</p>
+
+<p>
+SWIG 3 and later requires .NET 2.0 at a minimum.
+There are some minor exceptions, where the minimum required is .NET 4.0.
+This is when using the <tt>std::complex</tt> and <tt>std::list</tt> STL containers.
+</p>
+
+<p>
 </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>
+<H3><a name="CSharp_introduction_swig2_compatibility">23.1.1 SWIG 2 Compatibility</a></H3>
 
 
 <p>
@@ -83,7 +92,7 @@
 </p>
 
 
-<H3><a name="CSharp_commandline">22.1.2 Additional command line options</a></H3>
+<H3><a name="CSharp_commandline">23.1.2 Additional command line options</a></H3>
 
 
 <p>
@@ -135,7 +144,7 @@
 Due to possible compiler limits it is not advisable to use <tt>-outfile</tt> for large projects.
 </p>
 
-<H2><a name="CSharp_differences_java">22.2 Differences to the Java module</a></H2>
+<H2><a name="CSharp_differences_java">23.2 Differences to the Java module</a></H2>
 
 
 <p>
@@ -556,7 +565,7 @@
 <a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> environment for automatic configuration of the example makefiles.
 Any one of the C# compilers (Mono or Microsoft) can be detected from within a Cygwin or Mingw environment if installed in your path. 
 
-<H2><a name="CSharp_void_pointers">22.3 Void pointers</a></H2>
+<H2><a name="CSharp_void_pointers">23.3 Void pointers</a></H2>
 
 
 <p>
@@ -574,7 +583,7 @@
 </pre>
 </div>
 
-<H2><a name="CSharp_arrays">22.4 C# Arrays</a></H2>
+<H2><a name="CSharp_arrays">23.4 C# Arrays</a></H2>
 
 
 <p>
@@ -586,7 +595,7 @@
 pinned arrays.
 </p>
 
-<H3><a name="CSharp_arrays_swig_library">22.4.1 The SWIG C arrays library</a></H3>
+<H3><a name="CSharp_arrays_swig_library">23.4.1 The SWIG C arrays library</a></H3>
 
 
 <p>
@@ -623,7 +632,7 @@
 </div>
 
 
-<H3><a name="CSharp_arrays_pinvoke_default_array_marshalling">22.4.2 Managed arrays using P/Invoke default array marshalling</a></H3>
+<H3><a name="CSharp_arrays_pinvoke_default_array_marshalling">23.4.2 Managed arrays using P/Invoke default array marshalling</a></H3>
 
 
 <p>
@@ -750,7 +759,7 @@
 </div>
 
 
-<H3><a name="CSharp_arrays_pinning">22.4.3 Managed arrays using pinning</a></H3>
+<H3><a name="CSharp_arrays_pinning">23.4.3 Managed arrays using pinning</a></H3>
 
 
 <p>
@@ -763,7 +772,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>
 
 
@@ -845,7 +854,7 @@
 
 
 
-<H2><a name="CSharp_exceptions">22.5 C# Exceptions</a></H2>
+<H2><a name="CSharp_exceptions">23.5 C# Exceptions</a></H2>
 
 
 <p>
@@ -942,7 +951,7 @@
 </p>
 
 
-<H3><a name="CSharp_exception_example_check_typemap">22.5.1 C# exception example using "check" typemap</a></H3>
+<H3><a name="CSharp_exception_example_check_typemap">23.5.1 C# exception example using "check" typemap</a></H3>
 
 
 <p>
@@ -1124,7 +1133,7 @@
 Actually it will issue this warning for any function beginning with <tt>SWIG_CSharpSetPendingException</tt>.
 </P>
 
-<H3><a name="CSharp_exception_example_percent_exception">22.5.2 C# exception example using %exception</a></H3>
+<H3><a name="CSharp_exception_example_percent_exception">23.5.2 C# exception example using %exception</a></H3>
 
 
 <p>
@@ -1189,7 +1198,7 @@
 </pre>
 </div>
 
-<H3><a name="CSharp_exception_example_exception_specifications">22.5.3 C# exception example using exception specifications</a></H3>
+<H3><a name="CSharp_exception_example_exception_specifications">23.5.3 C# exception example using exception specifications</a></H3>
 
 
 <p>
@@ -1245,7 +1254,7 @@
 Multiple catch handlers are generated should there be more than one exception specifications declared.
 </p>
 
-<H3><a name="CSharp_custom_application_exception">22.5.4 Custom C# ApplicationException example</a></H3>
+<H3><a name="CSharp_custom_application_exception">23.5.4 Custom C# ApplicationException example</a></H3>
 
 
 <p>
@@ -1379,7 +1388,7 @@
 </pre>
 </div>
 
-<H2><a name="CSharp_directors">22.6 C# Directors</a></H2>
+<H2><a name="CSharp_directors">23.6 C# Directors</a></H2>
 
 
 <p>
@@ -1392,7 +1401,7 @@
 However, the <a href="Java.html#Java_directors">Java directors</a> section should also be read in order to gain more insight into directors.
 </p>
 
-<H3><a name="CSharp_directors_example">22.6.1 Directors example</a></H3>
+<H3><a name="CSharp_directors_example">23.6.1 Directors example</a></H3>
 
 
 <p>
@@ -1513,7 +1522,7 @@
 </pre>
 </div>
 
-<H3><a name="CSharp_directors_implementation">22.6.2 Directors implementation</a></H3>
+<H3><a name="CSharp_directors_implementation">23.6.2 Directors implementation</a></H3>
 
 
 <p>
@@ -1721,7 +1730,7 @@
 </pre>
 </div>
 
-<H3><a name="CSharp_director_caveats">22.6.3 Director caveats</a></H3>
+<H3><a name="CSharp_director_caveats">23.6.3 Director caveats</a></H3>
 
 
 <p>
@@ -1769,7 +1778,7 @@
 should pass the call on to <tt>CSharpDefaults.DefaultMethod(int)</tt>using the C++ default value, as shown above.
 </p>
 
-<H2><a name="CSharp_multiple_modules">22.7 Multiple modules</a></H2>
+<H2><a name="CSharp_multiple_modules">23.7 Multiple modules</a></H2>
 
 
 <p>
@@ -1804,7 +1813,7 @@
 if you don't want users to easily stumble upon these so called 'internal workings' of the wrappers.
 </p>
 
-<H2><a name="CSharp_typemap_examples">22.8 C# Typemap examples</a></H2>
+<H2><a name="CSharp_typemap_examples">23.8 C# Typemap examples</a></H2>
 
 
 This section includes a few examples of typemaps.  For more examples, you
@@ -1812,7 +1821,7 @@
 the SWIG library.
 
 
-<H3><a name="CSharp_memory_management_member_variables">22.8.1 Memory management when returning references to member variables</a></H3>
+<H3><a name="CSharp_memory_management_member_variables">23.8.1 Memory management when returning references to member variables</a></H3>
 
 
 <p>
@@ -1936,7 +1945,7 @@
 Note the <tt>addReference</tt> call.
 </p>
 
-<H3><a name="CSharp_memory_management_objects">22.8.2 Memory management for objects passed to the C++ layer</a></H3>
+<H3><a name="CSharp_memory_management_objects">23.8.2 Memory management for objects passed to the C++ layer</a></H3>
 
 
 <p>
@@ -2068,7 +2077,7 @@
 </div>
 
 
-<H3><a name="CSharp_date_marshalling">22.8.3 Date marshalling using the csin typemap and associated attributes</a></H3>
+<H3><a name="CSharp_date_marshalling">23.8.3 Date marshalling using the csin typemap and associated attributes</a></H3>
 
 
 <p>
@@ -2354,7 +2363,7 @@
 </pre>
 </div>
 
-<H3><a name="CSharp_date_properties">22.8.4 A date example demonstrating marshalling of C# properties</a></H3>
+<H3><a name="CSharp_date_properties">23.8.4 A date example demonstrating marshalling of C# properties</a></H3>
 
 
 <p>
@@ -2454,7 +2463,7 @@
   <li>The 'csin' typemap has 'pre', 'post' and 'cshin' attributes, and these are all ignored in the property set. The code in these attributes must instead be replicated within the 'csvarin' typemap. The line creating the <tt>temp$csinput</tt> variable is such an example; it is identical to what is in the 'pre' attribute.
 </ul>
 
-<H3><a name="CSharp_date_pre_post_directors">22.8.5 Date example demonstrating the 'pre' and 'post' typemap attributes for directors</a></H3>
+<H3><a name="CSharp_date_pre_post_directors">23.8.5 Date example demonstrating the 'pre' and 'post' typemap attributes for directors</a></H3>
 
 
 <p>
@@ -2516,7 +2525,7 @@
 </p>
 
 
-<H3><a name="CSharp_partial_classes">22.8.6 Turning proxy classes into partial classes</a></H3>
+<H3><a name="CSharp_partial_classes">23.8.6 Turning proxy classes into partial classes</a></H3>
 
 
 <p>
@@ -2616,7 +2625,7 @@
 The following example is an alternative approach to adding managed code to the generated proxy class.
 </p>
 
-<H3><a name="CSharp_sealed_proxy_class">22.8.7 Turning proxy classes into sealed classes</a></H3>
+<H3><a name="CSharp_sealed_proxy_class">23.8.7 Turning proxy classes into sealed classes</a></H3>
 
 
 <p>
@@ -2706,7 +2715,7 @@
 'csbody' typemap code in csharp.swg by modifying swigCMemOwn to not be protected.
 </p>
 
-<H3><a name="CSharp_extending_proxy_class">22.8.8 Extending proxy classes with additional C# code</a></H3>
+<H3><a name="CSharp_extending_proxy_class">23.8.8 Extending proxy classes with additional C# code</a></H3>
 
 
 <p>
@@ -2745,7 +2754,7 @@
 </pre>
 </div>
 
-<H3><a name="CSharp_enum_underlying_type">22.8.9 Underlying type for enums</a></H3>
+<H3><a name="CSharp_enum_underlying_type">23.8.9 Underlying type for enums</a></H3>
 
 
 <P>
diff --git a/Doc/Manual/Contents.html b/Doc/Manual/Contents.html
index fa1ef9b..0d0c977 100644
--- a/Doc/Manual/Contents.html
+++ b/Doc/Manual/Contents.html
@@ -372,7 +372,19 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Preprocessor.html#Preprocessor">10 Preprocessing</a></h3>
+<h3><a href="CPlusPlus20.html#CPlusPlus20">10 SWIG and C++20</a></h3>
+
+<!-- INDEX -->
+<div class="sectiontoc">
+<ul>
+<li><a href="CPlusPlus20.html#CPlusPlus20_introduction">Introduction</a>
+<li><a href="CPlusPlus20.html#CPlusPlus20_core_language_changes">Core language changes</a>
+<li><a href="CPlusPlus20.html#CPlusPlus20_standard_library_changes">Standard library changes</a>
+</ul>
+</div>
+<!-- INDEX -->
+
+<h3><a href="Preprocessor.html#Preprocessor">11 Preprocessing</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -395,7 +407,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Library.html#Library">11 SWIG library</a></h3>
+<h3><a href="Library.html#Library">12 SWIG library</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -438,7 +450,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Arguments.html#Arguments">12 Argument Handling</a></h3>
+<h3><a href="Arguments.html#Arguments">13 Argument Handling</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -461,7 +473,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Typemaps.html#Typemaps">13 Typemaps</a></h3>
+<h3><a href="Typemaps.html#Typemaps">14 Typemaps</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -555,7 +567,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Customization.html#Customization">14 Customization Features</a></h3>
+<h3><a href="Customization.html#Customization">15 Customization Features</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -583,7 +595,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Contract.html#Contract">15 Contracts</a></h3>
+<h3><a href="Contract.html#Contract">16 Contracts</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -596,7 +608,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Varargs.html#Varargs">16 Variable Length Arguments</a></h3>
+<h3><a href="Varargs.html#Varargs">17 Variable Length Arguments</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -614,7 +626,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Doxygen.html#Doxygen">17 SWIG and Doxygen Translation</a></h3>
+<h3><a href="Doxygen.html#Doxygen">18 SWIG and Doxygen Translation</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -647,6 +659,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>
@@ -658,7 +674,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Warnings.html#Warnings">18 Warning Messages</a></h3>
+<h3><a href="Warnings.html#Warnings">19 Warning Messages</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -687,7 +703,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Modules.html#Modules">19 Working with Modules</a></h3>
+<h3><a href="Modules.html#Modules">20 Working with Modules</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -703,7 +719,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="CCache.html#CCache">20 Using SWIG with ccache - ccache-swig(1) manpage</a></h3>
+<h3><a href="CCache.html#CCache">21 Using SWIG with ccache - ccache-swig(1) manpage</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -729,7 +745,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Android.html#Android">21 SWIG and Android</a></h3>
+<h3><a href="Android.html#Android">22 SWIG and Android</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -747,7 +763,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="CSharp.html#CSharp">22 SWIG and C#</a></h3>
+<h3><a href="CSharp.html#CSharp">23 SWIG and C#</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -795,7 +811,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="D.html#D">23 SWIG and D</a></h3>
+<h3><a href="D.html#D">24 SWIG and D</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -829,7 +845,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Go.html#Go">24 SWIG and Go</a></h3>
+<h3><a href="Go.html#Go">25 SWIG and Go</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -873,7 +889,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Guile.html#Guile">25 SWIG and Guile</a></h3>
+<h3><a href="Guile.html#Guile">26 SWIG and Guile</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -909,7 +925,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Java.html#Java">26 SWIG and Java</a></h3>
+<h3><a href="Java.html#Java">27 SWIG and Java</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1063,7 +1079,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Javascript.html#Javascript">27 SWIG and Javascript</a></h3>
+<h3><a href="Javascript.html#Javascript">28 SWIG and Javascript</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1105,7 +1121,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Lua.html#Lua">28 SWIG and Lua</a></h3>
+<h3><a href="Lua.html#Lua">29 SWIG and Lua</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1173,7 +1189,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Octave.html#Octave">29 SWIG and Octave</a></h3>
+<h3><a href="Octave.html#Octave">30 SWIG and Octave</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1213,7 +1229,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Perl5.html#Perl5">30 SWIG and Perl5</a></h3>
+<h3><a href="Perl5.html#Perl5">31 SWIG and Perl5</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1289,7 +1305,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Php.html#Php">31 SWIG and PHP</a></h3>
+<h3><a href="Php.html#Php">32 SWIG and PHP</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1330,7 +1346,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Python.html#Python">32 SWIG and Python</a></h3>
+<h3><a href="Python.html#Python">33 SWIG and Python</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1472,7 +1488,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="R.html#R">33 SWIG and R</a></h3>
+<h3><a href="R.html#R">34 SWIG and R</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1488,7 +1504,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Ruby.html#Ruby">34 SWIG and Ruby</a></h3>
+<h3><a href="Ruby.html#Ruby">35 SWIG and Ruby</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1626,7 +1642,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Scilab.html#Scilab">35 SWIG and Scilab</a></h3>
+<h3><a href="Scilab.html#Scilab">36 SWIG and Scilab</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1695,7 +1711,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Tcl.html#Tcl">36 SWIG and Tcl</a></h3>
+<h3><a href="Tcl.html#Tcl">37 SWIG and Tcl</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1761,7 +1777,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Mzscheme.html#Mzscheme">37 SWIG and MzScheme/Racket</a></h3>
+<h3><a href="Mzscheme.html#Mzscheme">38 SWIG and MzScheme/Racket</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1773,7 +1789,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Ocaml.html#Ocaml">38 SWIG and OCaml</a></h3>
+<h3><a href="Ocaml.html#Ocaml">39 SWIG and OCaml</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
@@ -1828,7 +1844,7 @@
 </div>
 <!-- INDEX -->
 
-<h3><a href="Extending.html#Extending">39 Extending SWIG to support new languages</a></h3>
+<h3><a href="Extending.html#Extending">40 Extending SWIG to support new languages</a></h3>
 
 <!-- INDEX -->
 <div class="sectiontoc">
diff --git a/Doc/Manual/Contract.html b/Doc/Manual/Contract.html
index 93fb8c0..f7acbba 100644
--- a/Doc/Manual/Contract.html
+++ b/Doc/Manual/Contract.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Contract">15 Contracts</a></H1>
+<H1><a name="Contract">16 Contracts</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -39,7 +39,7 @@
 generated rather than having the program continue to execute.
 </p>
 
-<H2><a name="Contract_nn2">15.1 The %contract directive</a></H2>
+<H2><a name="Contract_nn2">16.1 The %contract directive</a></H2>
 
 
 <p>
@@ -95,7 +95,7 @@
 </pre>
 </div>
 
-<H2><a name="Contract_nn3">15.2 %contract and classes</a></H2>
+<H2><a name="Contract_nn3">16.2 %contract and classes</a></H2>
 
 
 <p>
@@ -174,7 +174,7 @@
 this means that both the arguments to <tt>Spam::bar</tt> must be positive.
 </p>
 
-<H2><a name="Contract_nn4">15.3 Constant aggregation and %aggregate_check</a></H2>
+<H2><a name="Contract_nn4">16.3 Constant aggregation and %aggregate_check</a></H2>
 
 
 <p>
@@ -263,7 +263,7 @@
 release.
 </p>
 
-<H2><a name="Contract_nn5">15.4 Notes</a></H2>
+<H2><a name="Contract_nn5">16.4 Notes</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Customization.html b/Doc/Manual/Customization.html
index 328bc23..5fe0f5b 100644
--- a/Doc/Manual/Customization.html
+++ b/Doc/Manual/Customization.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Customization">14 Customization Features</a></H1>
+<H1><a name="Customization">15 Customization Features</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -46,7 +46,7 @@
 customization mechanism known as "features" is described.
 </p>
 
-<H2><a name="Customization_exception">14.1 Exception handling with %exception</a></H2>
+<H2><a name="Customization_exception">15.1 Exception handling with %exception</a></H2>
 
 
 <p>
@@ -101,7 +101,7 @@
 provides the same functionality, but is substantially more flexible.
 </p>
 
-<H3><a name="Customization_nn3">14.1.1 Handling exceptions in C code</a></H3>
+<H3><a name="Customization_nn3">15.1.1 Handling exceptions in C code</a></H3>
 
 
 <p>
@@ -169,7 +169,7 @@
 and for Perl it is the <tt>croak</tt> method shown above.
 </p>
 
-<H3><a name="Customization_nn4">14.1.2 Exception handling with longjmp()</a></H3>
+<H3><a name="Customization_nn4">15.1.2 Exception handling with longjmp()</a></H3>
 
 
 <p>
@@ -245,7 +245,7 @@
 modify it to handle nested <tt>try</tt> declarations.
 </p>
 
-<H3><a name="Customization_nn5">14.1.3 Handling C++ exceptions</a></H3>
+<H3><a name="Customization_nn5">15.1.3 Handling C++ exceptions</a></H3>
 
 
 <p>
@@ -280,7 +280,7 @@
 </pre>
 </div>
 
-<H3><a name="Customization_allowexcept">14.1.4 Exception handlers for variables</a></H3>
+<H3><a name="Customization_allowexcept">15.1.4 Exception handlers for variables</a></H3>
 
 
 <p>
@@ -305,7 +305,7 @@
 </pre>
 </div>
 
-<H3><a name="Customization_nn6">14.1.5 Defining different exception handlers</a></H3>
+<H3><a name="Customization_nn6">15.1.5 Defining different exception handlers</a></H3>
 
 
 <p>
@@ -442,7 +442,7 @@
 %exception directive is much better.
 </p>
 
-<H3><a name="Customization_exception_special_variables">14.1.6 Special variables for %exception</a></H3>
+<H3><a name="Customization_exception_special_variables">15.1.6 Special variables for %exception</a></H3>
 
 
 <p>
@@ -545,7 +545,7 @@
 </pre></div>
 
 
-<H3><a name="Customization_nn7">14.1.7 Using The SWIG exception library</a></H3>
+<H3><a name="Customization_nn7">15.1.7 Using The SWIG exception library</a></H3>
 
 
 <p>
@@ -600,7 +600,7 @@
 The <tt>SWIG_exception()</tt> function can also be used in typemaps.
 </p>
 
-<H2><a name="Customization_ownership">14.2 Object ownership and %newobject</a></H2>
+<H2><a name="Customization_ownership">15.2 Object ownership and %newobject</a></H2>
 
 
 <p>
@@ -757,7 +757,7 @@
 The results might not be what you expect.
 </p>
 
-<H2><a name="Customization_features">14.3 Features and the %feature directive</a></H2>
+<H2><a name="Customization_features">15.3 Features and the %feature directive</a></H2>
 
 
 <p>
@@ -839,7 +839,7 @@
 The syntax in the first variation will generate the <tt>{ }</tt> delimiters used whereas the other variations will not.
 </p>
 
-<H3><a name="Customization_feature_attributes">14.3.1 Feature attributes</a></H3>
+<H3><a name="Customization_feature_attributes">15.3.1 Feature attributes</a></H3>
 
 
 <p>
@@ -880,7 +880,7 @@
 Further details can be obtained from the <a href="Java.html#Java_exception_handling">Java exception handling</a> section.
 </p>
 
-<H3><a name="Customization_feature_flags">14.3.2 Feature flags</a></H3>
+<H3><a name="Customization_feature_flags">15.3.2 Feature flags</a></H3>
 
 
 <p>
@@ -978,7 +978,7 @@
 The concept of clearing features is discussed next.
 </p>
 
-<H3><a name="Customization_clearing_features">14.3.3 Clearing features</a></H3>
+<H3><a name="Customization_clearing_features">15.3.3 Clearing features</a></H3>
 
 
 <p>
@@ -1071,7 +1071,7 @@
 </pre>
 </div>
 
-<H3><a name="Customization_features_default_args">14.3.4 Features and default arguments</a></H3>
+<H3><a name="Customization_features_default_args">15.3.4 Features and default arguments</a></H3>
 
 
 <p>
@@ -1146,7 +1146,7 @@
 in SWIG-1.3.23 when the approach to wrapping methods with default arguments was changed.
 </p>
 
-<H3><a name="Customization_features_example">14.3.5 Feature example</a></H3>
+<H3><a name="Customization_features_example">15.3.5 Feature example</a></H3>
 
 
 <p>
diff --git a/Doc/Manual/D.html b/Doc/Manual/D.html
index f1b3404..f9f2d53 100644
--- a/Doc/Manual/D.html
+++ b/Doc/Manual/D.html
@@ -6,7 +6,7 @@
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 </head>
 <body bgcolor="#FFFFFF">
-<H1><a name="D">23 SWIG and D</a></H1>
+<H1><a name="D">24 SWIG and D</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -41,7 +41,7 @@
 
 
 
-<H2><a name="D_introduction">23.1 Introduction</a></H2>
+<H2><a name="D_introduction">24.1 Introduction</a></H2>
 
 
 <p>From the <a href="http://www.digitalmars.com/d/">D Programming Language</a> web site: <em>D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. [...] The D language is statically typed and compiles directly to machine code.</em> As such, it is not very surprising that D is able to directly <a href="http://www.digitalmars.com/d/1.0/interfaceToC.html">interface with C libraries</a>. Why would a SWIG module for D be needed then in the first place?</p>
@@ -53,10 +53,10 @@
 <p>To help addressing these issues, the SWIG C# module has been forked to support D. Is has evolved quite a lot since then, but there are still many similarities, so if you do not find what you are looking for on this page, it might be worth having a look at the chapter on <a href="CSharp.html#CSharp">C#</a> (and also on <a href="Java.html#Java">Java</a>, since the C# module was in turn forked from it).</p>
 
 
-<H2><a name="D_command_line_invocation">23.2 Command line invocation</a></H2>
+<H2><a name="D_command_line_invocation">24.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,16 +77,16 @@
 
   <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>
 
 
-<H2><a name="D_typemaps">23.3 Typemaps</a></H2>
+<H2><a name="D_typemaps">24.3 Typemaps</a></H2>
 
 
-<H3><a name="D_typemap_name_comparison">23.3.1 C# &lt;-&gt; D name comparison</a></H3>
+<H3><a name="D_typemap_name_comparison">24.3.1 C# &lt;-&gt; D name comparison</a></H3>
 
 
 <p>If you already know the SWIG C# module, you might find the following name comparison table useful:</p>
@@ -112,7 +112,7 @@
 </pre></div>
 
 
-<H3><a name="D_ctype_imtype_dtype">23.3.2 ctype, imtype, dtype</a></H3>
+<H3><a name="D_ctype_imtype_dtype">24.3.2 ctype, imtype, dtype</a></H3>
 
 
 <p>Mapping of types between the C/C++ library, the C/C++ library wrapper exposing the C functions, the D wrapper module importing these functions and the D proxy code.</p>
@@ -120,7 +120,7 @@
 <p>The <tt>ctype</tt> typemap is used to determine the types to use in the C wrapper functions. The types from the <tt>imtype</tt> typemap are used in the extern(C) declarations of these functions in the intermediary D module. The <tt>dtype</tt> typemap contains the D types used in the D proxy module/class.</p>
 
 
-<H3><a name="D_in_out_directorin_direcetorout">23.3.3 in, out, directorin, directorout</a></H3>
+<H3><a name="D_in_out_directorin_direcetorout">24.3.3 in, out, directorin, directorout</a></H3>
 
 
 <p>Used for converting between the types for C/C++ and D when generating the code for the wrapper functions (on the C++ side).</p>
@@ -130,7 +130,7 @@
 <p>The <tt>directorin</tt> typemap is used to convert parameters to the type used in the D director callback function, its return value is processed by <tt>directorout</tt> (see below).</p>
 
 
-<H3><a name="D_din_dout_ddirectorin_ddirectorout">23.3.4 din, dout, ddirectorin, ddirectorout</a></H3>
+<H3><a name="D_din_dout_ddirectorin_ddirectorout">24.3.4 din, dout, ddirectorin, ddirectorout</a></H3>
 
 
 <p>Typemaps for code generation in D proxy and type wrapper classes.</p>
@@ -157,13 +157,13 @@
       dtype             DClass.method(dtype a)</pre></div>
 
 
-<H3><a name="D_typecheck_typemaps">23.3.5 typecheck typemaps</a></H3>
+<H3><a name="D_typecheck_typemaps">24.3.5 typecheck typemaps</a></H3>
 
 
 <p>Because, unlike many scripting languages supported by SWIG, D does not need any dynamic dispatch helper to access an overloaded function, the purpose of these is merely to issue a warning for overloaded C++ functions that cannot be overloaded in D (as more than one C++ type maps to a single D type).</p>
 
 
-<H3><a name="D_code_injection_typemaps">23.3.6 Code injection typemaps</a></H3>
+<H3><a name="D_code_injection_typemaps">24.3.6 Code injection typemaps</a></H3>
 
 
 <p>These typemaps are used for generating the skeleton of proxy classes for C++ types.</p>
@@ -178,7 +178,7 @@
 Code can also be injected into the D proxy class using <tt>%proxycode</tt>.
 </p>
 
-<H3><a name="D_special_variables">23.3.7 Special variable macros</a></H3>
+<H3><a name="D_special_variables">24.3.7 Special variable macros</a></H3>
 
 
 <p>The standard SWIG special variables are available for use within typemaps as described in the <a href="Typemaps.html#Typemaps">Typemaps documentation</a>, for example <tt>$1</tt>, <tt>$input</tt>, <tt>$result</tt> etc.</p>
@@ -299,7 +299,7 @@
 </dl>
 
 
-<H2><a name="D_features">23.4 D and %feature</a></H2>
+<H2><a name="D_features">24.4 D and %feature</a></H2>
 
 
 <p>The D module defines a number of directives which modify the <a href="Customization.html#Customization_features">SWIG features</a> set globally or for a specific declaration:</p>
@@ -329,7 +329,7 @@
 </dl>
 
 
-<H2><a name="D_pragmas">23.5 Pragmas</a></H2>
+<H2><a name="D_pragmas">24.5 Pragmas</a></H2>
 
 
 <p>There are a few SWIG pragmas specific to the D module, which you can use to influence the D code SWIG generates:</p>
@@ -368,7 +368,7 @@
 </dl>
 
 
-<H2><a name="D_exceptions">23.6 D Exceptions</a></H2>
+<H2><a name="D_exceptions">24.6 D Exceptions</a></H2>
 
 
 <p>Out of the box, C++ exceptions are fundamentally incompatible to their equivalent in the D world and cannot simply be propagated to a calling D method. There is, however, an easy way to solve this problem: Just catch the exception in the C/C++ wrapper layer, pass the contents to D, and make the wrapper code rethrow the exception in the D world.</p>
@@ -378,7 +378,7 @@
 <p>As this feature is implemented in exactly the same way it is for C#, please see the <a href="CSharp.html#CSharp_exceptions">C# documentation</a> for a more detailed explanation.</p>
 
 
-<H2><a name="D_directors">23.7 D Directors</a></H2>
+<H2><a name="D_directors">24.7 D Directors</a></H2>
 
 
 <p>When the directors feature is activated, SWIG generates extra code on both the C++ and the D side to enable cross-language polymorphism. Essentially, this means that if you subclass a proxy class in D, C++ code can access any overridden virtual methods just as if you created a derived class in C++.</p>
@@ -387,16 +387,16 @@
 </p>
 
 
-<H2><a name="D_other_features">23.8 Other features</a></H2>
+<H2><a name="D_other_features">24.8 Other features</a></H2>
 
 
-<H3><a name="D_nspace">23.8.1 Extended namespace support (nspace)</a></H3>
+<H3><a name="D_nspace">24.8.1 Extended namespace support (nspace)</a></H3>
 
 
 <p>By default, SWIG flattens all C++ namespaces into a single target language namespace, but as for Java and C#, the <a href="SWIGPlus.html#SWIGPlus_nspace"><tt>nspace</tt></a> feature is supported for D. If it is active, C++ namespaces are mapped to D packages/modules. Note, however, that like for the other languages, <em>free</em> variables and functions are not supported yet; currently, they are all allows written to the main proxy D module.</p>
 
 
-<H3><a name="D_native_pointer_support">23.8.2 Native pointer support</a></H3>
+<H3><a name="D_native_pointer_support">24.8.2 Native pointer support</a></H3>
 
 
 <p>Contrary to many of the scripting languages supported by SWIG, D fully supports C-style pointers. The D module thus includes a custom mechanism to wrap C pointers directly as D pointers where applicable, that is, if the type that is pointed to is represented the same in C and D (on the bit-level), dubbed a <em>primitive type</em> below.</p>
@@ -408,7 +408,7 @@
 <p>To determine if a type should be considered primitive, the <tt>cprimitive</tt> attribute on its <tt>dtype</tt> attribute is used. For example, the <tt>dtype</tt> typemap for <tt>float</tt> has <tt>cprimitive="1"</tt>, so the code from the <tt>nativepointer</tt> attribute is taken into account e.g. for <tt>float **</tt> or the function pointer <tt>float (*)(float *)</tt>.</p>
 
 
-<H3><a name="D_operator_overloading">23.8.3 Operator overloading</a></H3>
+<H3><a name="D_operator_overloading">24.8.3 Operator overloading</a></H3>
 
 
 <p>The D module comes with basic operator overloading support for both D1 and D2. There are, however, a few limitations arising from conceptual differences between C++ and D:</p>
@@ -420,7 +420,7 @@
 <p>There are also some cases where the operators can be translated to D, but the differences in the implementation details are big enough that a rather involved scheme would be required for automatic wrapping them, which has not been implemented yet. This affects, for example, the array subscript operator, <tt>[]</tt>, in combination with assignments - while <tt>operator []</tt> in C++ simply returns a reference which is then written to, D resorts to a separate <tt>opIndexAssign</tt> method -, or implicit casting (which was introduced in D2 via <tt>alias this</tt>). Despite the lack of automatic support, manually handling these cases should be perfectly possible.</p>
 
 
-<H3><a name="D_test_suite">23.8.4 Running the test-suite</a></H3>
+<H3><a name="D_test_suite">24.8.4 Running the test-suite</a></H3>
 
 
 <p>As with any other language, the SWIG test-suite can be built for D using the <tt>*-d-test-suite</tt> targets of the top-level Makefile. By default, D1 is targeted, to build it with D2, use the optional <tt>D_VERSION</tt> variable, e.g. <tt>make check-d-test-suite D_VERSION=2</tt>.</p>
@@ -428,14 +428,14 @@
 <p>Note: If you want to use GDC on Linux or another platform which requires you to link <tt>libdl</tt> for dynamically loading the shared library, you might have to add <tt>-ldl</tt> manually to the <tt>d_compile</tt> target in <tt>Examples/Makefile</tt>, because GDC does not currently honor the <tt>pragma(lib, ...)</tt> statement.</p>
 
 
-<H2><a name="D_typemap_examples">23.9 D Typemap examples</a></H2>
+<H2><a name="D_typemap_examples">24.9 D Typemap examples</a></H2>
 
 
 <p>There are no D-specific typemap examples yet. However, with the above <a href="D.html#D_typemap_name_comparison">name comparison table</a>, you should be able to get an idea what can be done by looking at the <a href="CSharp.html#CSharp_typemap_examples">corresponding C# section</a>.</p>
 
 
 
-<H2><a name="D_planned_features">23.10 Work in progress and planned features</a></H2>
+<H2><a name="D_planned_features">24.10 Work in progress and planned features</a></H2>
 
 
 <p>There are a couple of features which are not implemented yet, but would be very useful and might be added in the near future:</p>
diff --git a/Doc/Manual/Doxygen.html b/Doc/Manual/Doxygen.html
index b14b05b..40faa20 100644
--- a/Doc/Manual/Doxygen.html
+++ b/Doc/Manual/Doxygen.html
@@ -5,7 +5,7 @@
 <link rel="stylesheet" type="text/css" href="style.css">
 </head>
 <body bgcolor="#FFFFFF">
-<H1><a name="Doxygen">17 SWIG and Doxygen Translation</a></H1>
+<H1><a name="Doxygen">18 SWIG and Doxygen Translation</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -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>
@@ -57,36 +61,36 @@
 supported.
 </p>
 
-<H2><a name="Doxygen_translation_overview">17.1 Doxygen translation overview</a></H2>
+<H2><a name="Doxygen_translation_overview">18.1 Doxygen translation overview</a></H2>
 
 
 <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>
 
-<H2><a name="Doxygen_file_preparation">17.2 Preparations</a></H2>
+<H2><a name="Doxygen_file_preparation">18.2 Preparations</a></H2>
 
 
 <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>
 
@@ -113,14 +117,15 @@
 </pre></div>
 
 <p>
-Also any of the above with '&lt;' added after comment-starting symbol,
-like <i>/**&lt;, /*!&lt;, ///&lt;, </i> or <i> //!&lt;</i> will be
+Also any of the above with '<tt>&lt;</tt>' added after comment-starting symbol,
+like <tt>/**&lt;, /*!&lt;, ///&lt;, </tt> or <tt> //!&lt;</tt> will be
 treated as a post-comment and will be assigned to the code before the
 comment.
 
-Any number of '*' or '/' within a Doxygen comment is considered to be a
-separator and is not included in the final comment, so you may safely use
-comments like <i>/*********/</i> or <i>//////////</i>.
+Any number of '<tt>*</tt>' or '<tt>/</tt>' within a Doxygen comment is
+considered to be a separator and is not included in the final comment,
+so you may safely use comments like <tt>/*********/</tt>
+or <tt>//////////</tt>.
 </p>
 
 <p>
@@ -189,16 +194,16 @@
 These structural commands are stripped out by SWIG and are not assigned to anything.
 </p>
 
-<H3><a name="Doxygen_running_swig">17.2.1 Enabling Doxygen translation</a></H3>
+<H3><a name="Doxygen_running_swig">18.2.1 Enabling Doxygen translation</a></H3>
 
 
 <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>
 
-<H3><a name="Doxygen_features">17.2.2 Doxygen-specific %feature directives</a></H3>
+<H3><a name="Doxygen_features">18.2.2 Doxygen-specific %feature directives</a></H3>
 
 
 <p>
@@ -206,7 +211,7 @@
 href="Customization.html#Customization_features">%feature directives</a>:
 </p>
 
-<H4><a name="Doxygen_notranslate">17.2.2.1 doxygen:notranslate</a></H4>
+<H4><a name="Doxygen_notranslate">18.2.2.1 doxygen:notranslate</a></H4>
 
 
 <p>
@@ -218,7 +223,7 @@
 </p>
 
 
-<H4><a name="Doxygen_alias">17.2.2.2 doxygen:alias:&lt;command-name&gt;</a></H4>
+<H4><a name="Doxygen_alias">18.2.2.2 doxygen:alias:&lt;command-name&gt;</a></H4>
 
 
 <p>
@@ -265,7 +270,7 @@
 </p>
 
 
-<H4><a name="Doxygen_ignore">17.2.2.3 doxygen:ignore:&lt;command-name&gt;</a></H4>
+<H4><a name="Doxygen_ignore">18.2.2.3 doxygen:ignore:&lt;command-name&gt;</a></H4>
 
 
 <p>
@@ -293,7 +298,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
@@ -416,7 +421,7 @@
 </pre></div>
 
 
-<H4><a name="Doxygen_nolinktranslate">17.2.2.4 doxygen:nolinktranslate</a></H4>
+<H4><a name="Doxygen_nolinktranslate">18.2.2.4 doxygen:nolinktranslate</a></H4>
 
 
 <p>
@@ -425,7 +430,7 @@
 </p>
 
 
-<H4><a name="Doxygen_nostripparams">17.2.2.5 doxygen:nostripparams</a></H4>
+<H4><a name="Doxygen_nostripparams">18.2.2.5 doxygen:nostripparams</a></H4>
 
 
 <p>
@@ -435,14 +440,14 @@
 </p>
 
 
-<H3><a name="Doxygen_additional_options">17.2.3 Additional command line options</a></H3>
+<H3><a name="Doxygen_additional_options">18.2.3 Additional command line options</a></H3>
 
 
 <p>
 ALSO TO BE ADDED (Javadoc auto brief?)
 </p>
 
-<H2><a name="Doxygen_to_javadoc">17.3 Doxygen to Javadoc</a></H2>
+<H2><a name="Doxygen_to_javadoc">18.3 Doxygen to Javadoc</a></H2>
 
 
 <p>
@@ -451,7 +456,7 @@
 and proxy files.
 </p>
 
-<H3><a name="Doxygen_basic_example">17.3.1 Basic example</a></H3>
+<H3><a name="Doxygen_basic_example">18.3.1 Basic example</a></H3>
 
 
 <p>
@@ -558,7 +563,7 @@
 directives</a>):
 </p>
 
-<H3><a name="Doxygen_javadoc_tags">17.3.2 Javadoc tags</a></H3>
+<H3><a name="Doxygen_javadoc_tags">18.3.2 Javadoc tags</a></H3>
 
 
 <p>
@@ -602,6 +607,10 @@
 <td>translated to {@code ...}</td>
 </tr>
 <tr>
+<td>\code{&lt;ext&gt;}</td>
+<td>translated to {@code ...}; code language extension is ignored</td>
+</tr>
+<tr>
 <td>\cond</td>
 <td>translated to 'Conditional comment: &lt;condition&gt;'</td>
 </tr>
@@ -679,7 +688,7 @@
 </tr>
 <tr>
 <td>\n</td>
-<td>replaced with new line char</td>
+<td>replaced with newline char</td>
 </tr>
 <tr>
 <td>\note</td>
@@ -702,6 +711,10 @@
 <td>translated to @param</td>
 </tr>
 <tr>
+<td>\param[&lt;dir&gt;]</td>
+<td>translated to @param; parameter direction ('in'; 'out'; or 'in,out') is ignored</td>
+</tr>
+<tr>
 <td>\remark</td>
 <td>replaced with 'Remarks:'</td>
 </tr>
@@ -812,168 +825,120 @@
 </table>
 </div>
 
-<H3><a name="Doxygen_unsupported_tags">17.3.3 Unsupported tags</a></H3>
+<H3><a name="Doxygen_unsupported_tags">18.3.3 Unsupported tags</a></H3>
 
 
 <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
 sense, typically text content).
 Here is the list of these tags:
 </p>
+
 <div class="diagram">
-<table border="0" summary="Unsupported Java Doxygen Tags">
-<tr>
-  <th align="left">Unsupported Doxygen tags</th>
-</tr>
-<tr>
-<td>\addindex</td>
-<td>\addtogroup</td>
-<td>\anchor</td>
-<td>\attention</td>
-</tr>
-<tr>
-<td>\brief</td>
-<td>\bug</td>
-<td>\callgraph</td>
-<td>\callergraph</td>
-</tr>
-<tr>
-<td>\class</td>
-<td>\copybrief</td>
-<td>\copydetails</td>
-<td>\copydoc</td>
-</tr>
-<tr>
-<td>\date</td>
-<td>\def</td>
-<td>\defgroup</td>
-<td>\details</td>
-</tr>
-<tr>
-<td>\dir</td>
-<td>\dontinclude</td>
-<td>\dot</td>
-<td>\dotfile</td>
-</tr>
-<tr>
-<td>\enddot</td>
-<td>\endhtmlonly</td>
-<td>\endinternal</td>
-<td>\endlatexonly</td>
-</tr>
-<tr>
-<td>\endmanonly</td>
-<td>\endmsc</td>
-<td>\endrtfonly</td>
-<td>\endxmlonly</td>
-</tr>
-<tr>
-<td>\enum</td>
-<td>\example</td>
-<td>\extends</td>
-</tr>
-<tr>
-<td>\file</td>
-<td>\fn</td>
-<td>\headerfile</td>
-<td>\hideinitializer</td>
-</tr>
-<tr>
-<td>\htmlinclude</td>
-<td>\htmlonly</td>
-<td>\implements</td>
-<td>\include</td>
-</tr>
-<tr>
-<td>\includelineno</td>
-<td>\ingroup</td>
-<td>\internal</td>
-<td>\invariant</td>
-</tr>
-<tr>
-<td>\interface</td>
-<td>\latexonly</td>
-<td>\line</td>
-<td>\mainpage</td>
-</tr>
-<tr>
-<td>\manonly</td>
-<td>\memberof</td>
-<td>\msc</td>
-<td>\mscfile</td>
-</tr>
-<tr>
-<td>\name</td>
-<td>\namespace</td>
-<td>\nosubgrouping</td>
-<td>\package</td>
-</tr>
-<tr>
-<td>\page</td>
-<td>\paragraph</td>
-<td>\post</td>
-<td>\pre</td>
-</tr>
-<tr>
-<td>\private</td>
-<td>\privatesection</td>
-<td>\property</td>
-<td>\protected</td>
-</tr>
-<tr>
-<td>\protectedsection</td>
-<td>\protocol</td>
-<td>\public</td>
-<td>\publicsection</td>
-</tr>
-<tr>
-<td>\ref</td>
-<td>\related</td>
-<td>\relates</td>
-<td>\relatedalso</td>
-</tr>
-<tr>
-<td>\relatesalso</td>
-<td>\retval</td>
-<td>\rtfonly</td>
-<td>\section</td>
-</tr>
-<tr>
-<td>\short</td>
-<td>\showinitializer</td>
-<td>\skip</td>
-<td>\skipline</td>
-</tr>
-<tr>
-<td>\snippet</td>
-<td>\struct</td>
-<td>\subpage</td>
-<td>\subsection</td>
-</tr>
-<tr>
-<td>\subsubsection</td>
-<td>\tableofcontents</td>
-<td>\test</td>
-<td>\typedef</td>
-</tr>
-<tr>
-<td>\union</td>
-<td>\until</td>
-<td>\var</td>
-<td>\verbinclude</td>
-</tr>
-<tr>
-<td>\weakgroup</td>
-<td>\xmlonly</td>
-<td>\xrefitem</td>
-<td>\category</td>
-</tr>
-</table>
+  <b>Unsupported Doxygen tags</b>
+
+  <ul style="list-style-type:none;column-count:4;">
+    <li>\addindex</li>
+    <li>\addtogroup</li>
+    <li>\anchor</li>
+    <li>\attention</li>
+    <li>\brief</li>
+    <li>\bug</li>
+    <li>\callergraph</li>
+    <li>\callgraph</li>
+    <li>\category</li>
+    <li>\class</li>
+    <li>\copybrief</li>
+    <li>\copydetails</li>
+    <li>\copydoc</li>
+    <li>\date</li>
+    <li>\def</li>
+    <li>\defgroup</li>
+    <li>\details</li>
+    <li>\dir</li>
+    <li>\dontinclude</li>
+    <li>\dot</li>
+    <li>\dotfile</li>
+    <li>\enddot</li>
+    <li>\endhtmlonly</li>
+    <li>\endinternal</li>
+    <li>\endlatexonly</li>
+    <li>\endmanonly</li>
+    <li>\endmsc</li>
+    <li>\endrtfonly</li>
+    <li>\endxmlonly</li>
+    <li>\enum</li>
+    <li>\example</li>
+    <li>\extends</li>
+    <li>\file</li>
+    <li>\fn</li>
+    <li>\headerfile</li>
+    <li>\hideinitializer</li>
+    <li>\htmlinclude</li>
+    <li>\htmlonly</li>
+    <li>\implements</li>
+    <li>\include</li>
+    <li>\includelineno</li>
+    <li>\ingroup</li>
+    <li>\interface</li>
+    <li>\internal</li>
+    <li>\invariant</li>
+    <li>\latexonly</li>
+    <li>\line</li>
+    <li>\mainpage</li>
+    <li>\manonly</li>
+    <li>\memberof</li>
+    <li>\msc</li>
+    <li>\mscfile</li>
+    <li>\name</li>
+    <li>\namespace</li>
+    <li>\nosubgrouping</li>
+    <li>\package</li>
+    <li>\page</li>
+    <li>\paragraph</li>
+    <li>\post</li>
+    <li>\pre</li>
+    <li>\private</li>
+    <li>\privatesection</li>
+    <li>\property</li>
+    <li>\protected</li>
+    <li>\protectedsection</li>
+    <li>\protocol</li>
+    <li>\public</li>
+    <li>\publicsection</li>
+    <li>\ref</li>
+    <li>\related</li>
+    <li>\relatedalso</li>
+    <li>\relates</li>
+    <li>\relatesalso</li>
+    <li>\retval</li>
+    <li>\rtfonly</li>
+    <li>\section</li>
+    <li>\short</li>
+    <li>\showinitializer</li>
+    <li>\skip</li>
+    <li>\skipline</li>
+    <li>\snippet</li>
+    <li>\struct</li>
+    <li>\subpage</li>
+    <li>\subsection</li>
+    <li>\subsubsection</li>
+    <li>\tableofcontents</li>
+    <li>\test</li>
+    <li>\typedef</li>
+    <li>\union</li>
+    <li>\until</li>
+    <li>\var</li>
+    <li>\verbinclude</li>
+    <li>\weakgroup</li>
+    <li>\xmlonly</li>
+    <li>\xrefitem</li>
+  </ul>
 </div>
 
 <p>
@@ -983,79 +948,58 @@
 <!-- see parser.y, function isStructuralDoxygen() -->
 
 </p>
+
 <div class="diagram">
-<table border="0" summary="Ignored Java Doxygen Tags">
-<tr>
-  <th align="left">Ignored Doxygen tags</th>
-</tr>
-<tr>
-<td>\addtogroup</td>
-<td>\callgraph</td>
-<td>\callergraph</td>
-<td>\category</td>
-</tr>
-<tr>
-<td>\class</td>
-<td>\def</td>
-<td>\defgroup</td>
-<td>\dir</td>
-</tr>
-<tr>
-<td>\enum</td>
-<td>\example</td>
-<td>\file</td>
-<td>\fn</td>
-</tr>
-<tr>
-<td>\headerfile</td>
-<td>\hideinitializer</td>
-<td>\interface</td>
-<td>\internal</td>
-</tr>
-<tr>
-<td>\mainpage</td>
-<td>\name</td>
-<td>\namespace</td>
-<td>\nosubgrouping</td>
-</tr>
-<tr>
-<td>\overload</td>
-<td>\package</td>
-<td>\page</td>
-<td>\property</td>
-</tr>
-<tr>
-<td>\protocol</td>
-<td>\relates</td>
-<td>\relatesalso</td>
-<td>\showinitializer</td>
-</tr>
-<tr>
-<td>\struct</td>
-<td>\name</td>
-<td>\namespace</td>
-<td>\nosubgrouping</td>
-</tr>
-<tr>
-<td>\typedef</td>
-<td>\union</td>
-<td>\var</td>
-<td>\weakgroup</td>
-</tr>
+  <b>Ignored Doxygen tags</b>
 
-</table>
+  <ul style="list-style-type:none;column-count:4;">
+    <li>\addtogroup</li>
+    <li>\callergraph</li>
+    <li>\callgraph</li>
+    <li>\category</li>
+    <li>\class</li>
+    <li>\def</li>
+    <li>\defgroup</li>
+    <li>\dir</li>
+    <li>\enum</li>
+    <li>\example</li>
+    <li>\file</li>
+    <li>\fn</li>
+    <li>\headerfile</li>
+    <li>\hideinitializer</li>
+    <li>\interface</li>
+    <li>\internal</li>
+    <li>\mainpage</li>
+    <li>\name</li>
+    <li>\namespace</li>
+    <li>\nosubgrouping</li>
+    <li>\overload</li>
+    <li>\package</li>
+    <li>\page</li>
+    <li>\property</li>
+    <li>\protocol</li>
+    <li>\relates</li>
+    <li>\relatesalso</li>
+    <li>\showinitializer</li>
+    <li>\struct</li>
+    <li>\typedef</li>
+    <li>\union</li>
+    <li>\var</li>
+    <li>\weakgroup</li>
+  </ul>
 </div>
+  
 
 
 
-<H3><a name="Doxygen_further_details">17.3.4 Further details</a></H3>
+<H3><a name="Doxygen_further_details">18.3.4 Further details</a></H3>
 
 
 <p>
 TO BE ADDED.
 </p>
 
-<H2><a name="Doxygen_to_pydoc">17.4 Doxygen to Pydoc</a></H2>
+<H2><a name="Doxygen_to_pydoc">18.4 Doxygen to Pydoc</a></H2>
 
 
 <p>
@@ -1066,7 +1010,7 @@
 copying the appropriate command text.
 </p>
 
-<H3><a name="Doxygen_python_basic_example">17.4.1 Basic example</a></H3>
+<H3><a name="Doxygen_python_basic_example">18.4.1 Basic example</a></H3>
 
 
 <p>
@@ -1223,13 +1167,13 @@
 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>
 
-<H3><a name="Doxygen_pydoc_tags">17.4.2 Pydoc translator</a></H3>
+<H3><a name="Doxygen_pydoc_tags">18.4.2 Pydoc translator</a></H3>
 
 
 <p>
@@ -1242,11 +1186,11 @@
 </tr>
 <tr>
 <td>\a</td>
-<td>wrapped with '_'</td>
+<td>wrapped with '*'</td>
 </tr>
 <tr>
 <td>\arg</td>
-<td>prepended with ' --'</td>
+<td>prepended with '* '</td>
 </tr>
 <tr>
 <td>\author</td>
@@ -1254,17 +1198,28 @@
 </tr>
 <tr>
 <td>\authors</td>
-<td>prints 'Author:'</td>
+<td>prints 'Authors:'</td>
 </tr>
 <tr>
 <td>\b</td>
-<td>wrapped with '__'</td>
+<td>wrapped with '**'</td>
+</tr>
+<td>\c</td>
+<td>wrapped with '``'</td>
 </tr>
 <tr>
 <td>\cite</td>
 <td>wrapped with single quotes</td>
 </tr>
 <tr>
+<td>\code</td>
+<td>replaced with '.. code-block:: c++'</td>
+</tr>
+<tr>
+<td>\code{&lt;ext&gt;}</td>
+<td>replaced with '.. code-block:: &lt;lang&gt;', where the following doxygen code languages are recognized: .c -&gt; C, .py -&gt; python, .java &gt; java</td>
+</tr>
+<tr>
 <td>\cond</td>
 <td>translated to 'Conditional comment: &lt;condition&gt;'</td>
 </tr>
@@ -1278,7 +1233,7 @@
 </tr>
 <tr>
 <td>\e</td>
-<td>wrapped with '_'</td>
+<td>wrapped with '*'</td>
 </tr>
 <tr>
 <td>\else</td>
@@ -1290,7 +1245,7 @@
 </tr>
 <tr>
 <td>\em</td>
-<td>wrapped with '_'</td>
+<td>wrapped with '*'</td>
 </tr>
 <tr>
 <td>\endcond</td>
@@ -1301,8 +1256,24 @@
 <td>replaced with '}'</td>
 </tr>
 <tr>
+<td>\example</td>
+<td>replaced with 'Example:'</td>
+</tr>
+<tr>
 <td>\exception</td>
-<td>replaced with 'Throws:'</td>
+<td>replaced with ':raises:'</td>
+</tr>
+<tr>
+<td>\f$</td>
+<td>rendered using ':math:``'</td>
+</tr>
+<tr>
+<td>\f[</td>
+<td>rendered using '.. math::'</td>
+</tr>
+<tr>
+<td>\f{</td>
+<td>rendered using '.. math::'</td>
 </tr>
 <tr>
 <td>\if</td>
@@ -1314,11 +1285,11 @@
 </tr>
 <tr>
 <td>\li</td>
-<td>prepended with ' --'</td>
+<td>prepended with '* '</td>
 </tr>
 <tr>
 <td>\n</td>
-<td>replaced with new line char</td>
+<td>replaced with newline char</td>
 </tr>
 <tr>
 <td>\note</td>
@@ -1328,13 +1299,21 @@
 <td>\overload</td>
 <td>prints 'This is an overloaded ...' according to Doxygen docs</td>
 </tr>
+</tr>
+<td>\p</td>
+<td>wrapped with '``'</td>
+</tr>
 <tr>
 <td>\par</td>
 <td>replaced with 'Title: ...'</td>
 </tr>
 <tr>
 <td>\param</td>
-<td>translated to 'Arguments:\n param(type) --description'</td>
+<td>add ':type:' and ':param:' directives</td>
+</tr>
+<tr>
+<td>\param[&lt;dir&gt;]</td>
+<td>same as \param, but direction ('in'; 'out'; 'in,out') is included in ':type:' directive</td>
 </tr>
 <tr>
 <td>\remark</td>
@@ -1346,15 +1325,15 @@
 </tr>
 <tr>
 <td>\result</td>
-<td>replaced with 'Result:'</td>
+<td>add ':rtype:' and ':return:' directives</td>
 </tr>
 <tr>
 <td>\return</td>
-<td>replaced with 'Result:'</td>
+<td>add ':rtype:' and ':return:' directives</td>
 </tr>
 <tr>
 <td>\returns</td>
-<td>replaced with 'Result:'</td>
+<td>add ':rtype:' and ':return:' directives</td>
 </tr>
 <tr>
 <td>\sa</td>
@@ -1370,11 +1349,11 @@
 </tr>
 <tr>
 <td>\throw</td>
-<td>replaced with 'Throws:'</td>
+<td>replaced with ':raises:'</td>
 </tr>
 <tr>
 <td>\throws</td>
-<td>replaced wih 'Throws:'</td>
+<td>replaced wih ':raises:'</td>
 </tr>
 <tr>
 <td>\todo</td>
@@ -1382,7 +1361,11 @@
 </tr>
 <tr>
 <td>\tparam</td>
-<td>translated to 'Arguments:\n param(type) --description'</td>
+<td>add ':type:' and ':param:' directives</td>
+</tr>
+<tr>
+<td>\verbatim</td>
+<td>content copied verbatim</td>
 </tr>
 <tr>
 <td>\version</td>
@@ -1443,7 +1426,7 @@
 </table>
 </div>
 
-<H3><a name="Doxygen_python_unsupported_tags">17.4.3 Unsupported tags</a></H3>
+<H3><a name="Doxygen_python_unsupported_tags">18.4.3 Unsupported tags</a></H3>
 
 
 <p>
@@ -1454,194 +1437,188 @@
 sense, typically text content).
 Here is the list of these tags:
 </p>
+
 <div class="diagram">
-<table border="0" summary="Unsupported Python Doxygen Tags">
-<tr>
-  <th align="left">Unsupported Doxygen tags</th>
-</tr>
-<tr>
-<td>\addindex</td>
-<td>\addtogroup</td>
-<td>\anchor</td>
-<td>\attention</td>
-</tr>
-<tr>
-<td>\brief</td>
-<td>\bug</td>
-<td>\callgraph</td>
-<td>\callergraph</td>
-</tr>
-<tr>
-<td>\class</td>
-<td>\copybrief</td>
-<td>\copydetails</td>
-<td>\copydoc</td>
-</tr>
-<tr>
-<td>\date</td>
-<td>\def</td>
-<td>\defgroup</td>
-<td>\details</td>
-</tr>
-<tr>
-<td>\dir</td>
-<td>\dontinclude</td>
-<td>\dot</td>
-<td>\dotfile</td>
-</tr>
-<tr>
-<td>\code</td>
-<td>\endcode</td>
-<td>\endverbatim</td>
-<td>\endlink</td>
-</tr>
-<tr>
-<td>\enddot</td>
-<td>\endhtmlonly</td>
-<td>\endinternal</td>
-<td>\endlatexonly</td>
-</tr>
-<tr>
-<td>\endmanonly</td>
-<td>\endmsc</td>
-<td>\endrtfonly</td>
-<td>\endxmlonly</td>
-</tr>
-<tr>
-<td>\enum</td>
-<td>\example</td>
-<td>\extends</td>
-<td>\f$</td>
-</tr>
-<tr>
-<td>\f[</td>
-<td>\f]</td>
-<td>\f{</td>
-<td>\f}</td>
-</tr>
-<tr>
-<td>\file</td>
-<td>\fn</td>
-<td>\headerfile</td>
-<td>\hideinitializer</td>
-</tr>
-<tr>
-<td>\htmlinclude</td>
-<td>\htmlonly</td>
-<td>\implements</td>
-<td>\include</td>
-</tr>
-<tr>
-<td>\image</td>
-<td>\link</td>
-<td>\verbatim</td>
-<td>\p</td>
-</tr>
-<tr>
-<td>\includelineno</td>
-<td>\ingroup</td>
-<td>\internal</td>
-<td>\invariant</td>
-</tr>
-<tr>
-<td>\interface</td>
-<td>\latexonly</td>
-<td>\line</td>
-<td>\mainpage</td>
-</tr>
-<tr>
-<td>\manonly</td>
-<td>\memberof</td>
-<td>\msc</td>
-<td>\mscfile</td>
-</tr>
-<tr>
-<td>\name</td>
-<td>\namespace</td>
-<td>\nosubgrouping</td>
-<td>\package</td>
-</tr>
-<tr>
-<td>\page</td>
-<td>\paragraph</td>
-<td>\post</td>
-<td>\pre</td>
-</tr>
-<tr>
-<td>\private</td>
-<td>\privatesection</td>
-<td>\property</td>
-<td>\protected</td>
-</tr>
-<tr>
-<td>\protectedsection</td>
-<td>\protocol</td>
-<td>\public</td>
-<td>\publicsection</td>
-</tr>
-<tr>
-<td>\ref</td>
-<td>\related</td>
-<td>\relates</td>
-<td>\relatedalso</td>
-</tr>
-<tr>
-<td>\relatesalso</td>
-<td>\retval</td>
-<td>\rtfonly</td>
-<td>\section</td>
-</tr>
-<tr>
-<td>\short</td>
-<td>\showinitializer</td>
-<td>\skip</td>
-<td>\skipline</td>
-</tr>
-<tr>
-<td>\snippet</td>
-<td>\struct</td>
-<td>\subpage</td>
-<td>\subsection</td>
-</tr>
-<tr>
-<td>\subsubsection</td>
-<td>\tableofcontents</td>
-<td>\test</td>
-<td>\typedef</td>
-</tr>
-<tr>
-<td>\union</td>
-<td>\until</td>
-<td>\var</td>
-<td>\verbinclude</td>
-</tr>
-<tr>
-<td>\weakgroup</td>
-<td>\xmlonly</td>
-<td>\xrefitem</td>
-<td>\category</td>
-</tr>
-<tr>
-<td>\c</td>
-</tr>
-</table>
+  <b>Unsupported Python Doxygen tags</b>
+
+  <ul style="list-style-type:none;column-count:4;">
+    <li>\addindex</li>
+    <li>\addtogroup</li>
+    <li>\anchor</li>
+    <li>\attention</li>
+    <li>\brief</li>
+    <li>\bug</li>
+    <li>\callergraph</li>
+    <li>\callgraph</li>
+    <li>\category</li>
+    <li>\class</li>
+    <li>\copybrief</li>
+    <li>\copydetails</li>
+    <li>\copydoc</li>
+    <li>\date</li>
+    <li>\def</li>
+    <li>\defgroup</li>
+    <li>\details</li>
+    <li>\dir</li>
+    <li>\dontinclude</li>
+    <li>\dot</li>
+    <li>\dotfile</li>
+    <li>\enddot</li>
+    <li>\endhtmlonly</li>
+    <li>\endinternal</li>
+    <li>\endlatexonly</li>
+    <li>\endlink</li>
+    <li>\endmanonly</li>
+    <li>\endmsc</li>
+    <li>\endrtfonly</li>
+    <li>\endxmlonly</li>
+    <li>\enum</li>
+    <li>\extends</li>
+    <li>\file</li>
+    <li>\fn</li>
+    <li>\headerfile</li>
+    <li>\hideinitializer</li>
+    <li>\htmlinclude</li>
+    <li>\htmlonly</li>
+    <li>\image</li>
+    <li>\implements</li>
+    <li>\include</li>
+    <li>\includelineno</li>
+    <li>\ingroup</li>
+    <li>\interface</li>
+    <li>\internal</li>
+    <li>\invariant</li>
+    <li>\latexonly</li>
+    <li>\line</li>
+    <li>\link</li>
+    <li>\mainpage</li>
+    <li>\manonly</li>
+    <li>\memberof</li>
+    <li>\msc</li>
+    <li>\mscfile</li>
+    <li>\name</li>
+    <li>\namespace</li>
+    <li>\nosubgrouping</li>
+    <li>\package</li>
+    <li>\page</li>
+    <li>\paragraph</li>
+    <li>\post</li>
+    <li>\pre</li>
+    <li>\private</li>
+    <li>\privatesection</li>
+    <li>\property</li>
+    <li>\protected</li>
+    <li>\protectedsection</li>
+    <li>\protocol</li>
+    <li>\public</li>
+    <li>\publicsection</li>
+    <li>\ref</li>
+    <li>\related</li>
+    <li>\relatedalso</li>
+    <li>\relates</li>
+    <li>\relatesalso</li>
+    <li>\retval</li>
+    <li>\rtfonly</li>
+    <li>\section</li>
+    <li>\short</li>
+    <li>\showinitializer</li>
+    <li>\skip</li>
+    <li>\skipline</li>
+    <li>\snippet</li>
+    <li>\struct</li>
+    <li>\subpage</li>
+    <li>\subsection</li>
+    <li>\subsubsection</li>
+    <li>\tableofcontents</li>
+    <li>\test</li>
+    <li>\typedef</li>
+    <li>\union</li>
+    <li>\until</li>
+    <li>\var</li>
+    <li>\verbinclude</li>
+    <li>\weakgroup</li>
+    <li>\xmlonly</li>
+    <li>\xrefitem</li>
+  </ul>
 </div>
 
-<H3><a name="Doxygen_python_further_details">17.4.4 Further details</a></H3>
+<H3><a name="Doxygen_python_further_details">18.4.4 Further details</a></H3>
 
 
 <p>
 TO BE ADDED.
 </p>
 
-<H2><a name="Doxygen_developer_details">17.5 Developer information</a></H2>
+<H2><a name="Doxygen_troubleshooting">18.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">18.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">18.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">18.6.1 Doxygen translator design</a></H3>
 
 
 <p>
@@ -1667,11 +1644,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">18.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 +1657,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">18.6.3 Tests</a></H3>
 
 
 <p>
@@ -1732,7 +1709,7 @@
 properties.
 </p>
 
-<H2><a name="Doxygen_language_extension">17.6 Extending to other languages</a></H2>
+<H2><a name="Doxygen_language_extension">18.7 Extending to other languages</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Extending.html b/Doc/Manual/Extending.html
index b013283..7c2a6c6 100644
--- a/Doc/Manual/Extending.html
+++ b/Doc/Manual/Extending.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Extending">39 Extending SWIG to support new languages</a></H1>
+<H1><a name="Extending">40 Extending SWIG to support new languages</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -81,7 +81,7 @@
 
 
 
-<H2><a name="Extending_nn2">39.1 Introduction</a></H2>
+<H2><a name="Extending_nn2">40.1 Introduction</a></H2>
 
 
 <p>
@@ -97,7 +97,7 @@
 you should probably look at one of SWIG's existing modules.
 </p>
 
-<H2><a name="Extending_nn3">39.2 Prerequisites</a></H2>
+<H2><a name="Extending_nn3">40.2 Prerequisites</a></H2>
 
 
 <p>
@@ -127,7 +127,7 @@
 wrapper code are driven by C++ datatypes.
 </p>
 
-<H2><a name="Extending_nn4">39.3 The Big Picture</a></H2>
+<H2><a name="Extending_nn4">40.3 The Big Picture</a></H2>
 
 
 <p>
@@ -164,7 +164,7 @@
 based on pattern matching and interact heavily with the underlying type system.
 </p>
 
-<H2><a name="Extending_nn5">39.4 Execution Model</a></H2>
+<H2><a name="Extending_nn5">40.4 Execution Model</a></H2>
 
 
 <p>
@@ -209,7 +209,7 @@
 The next few sections briefly describe some of these stages.
 </p>
 
-<H3><a name="Extending_nn6">39.4.1 Preprocessing</a></H3>
+<H3><a name="Extending_nn6">40.4.1 Preprocessing</a></H3>
 
 
 <p>
@@ -290,7 +290,7 @@
 construction of the wrapper code.
 </p>
 
-<H3><a name="Extending_nn7">39.4.2 Parsing</a></H3>
+<H3><a name="Extending_nn7">40.4.2 Parsing</a></H3>
 
 
 <p>
@@ -391,7 +391,7 @@
 arguments).
 </p>
 
-<H3><a name="Extending_nn8">39.4.3 Parse Trees</a></H3>
+<H3><a name="Extending_nn8">40.4.3 Parse Trees</a></H3>
 
 
 <p>
@@ -646,7 +646,7 @@
 </pre>
 </div>
 
-<H3><a name="Extending_nn9">39.4.4 Attribute namespaces</a></H3>
+<H3><a name="Extending_nn9">40.4.4 Attribute namespaces</a></H3>
 
 
 <p>
@@ -665,7 +665,7 @@
 <tt>perl:foo</tt>.
 </p>
 
-<H3><a name="Extending_nn10">39.4.5 Symbol Tables</a></H3>
+<H3><a name="Extending_nn10">40.4.5 Symbol Tables</a></H3>
 
 
 <p>
@@ -756,7 +756,7 @@
 </pre>
 </div>
 
-<H3><a name="Extending_nn11">39.4.6 The %feature directive</a></H3>
+<H3><a name="Extending_nn11">40.4.6 The %feature directive</a></H3>
 
 
 <p>
@@ -812,7 +812,7 @@
 stored without any modifications.
 </p>
 
-<H3><a name="Extending_nn12">39.4.7 Code Generation</a></H3>
+<H3><a name="Extending_nn12">40.4.7 Code Generation</a></H3>
 
 
 <p>
@@ -934,7 +934,7 @@
 The role of these functions is described shortly.
 </p>
 
-<H3><a name="Extending_nn13">39.4.8 SWIG and XML</a></H3>
+<H3><a name="Extending_nn13">40.4.8 SWIG and XML</a></H3>
 
 
 <p>
@@ -947,7 +947,7 @@
 your mind as a model.
 </p>
 
-<H2><a name="Extending_nn14">39.5 Primitive Data Structures</a></H2>
+<H2><a name="Extending_nn14">40.5 Primitive Data Structures</a></H2>
 
 
 <p>
@@ -993,7 +993,7 @@
 </pre>
 </div>
 
-<H3><a name="Extending_nn15">39.5.1 Strings</a></H3>
+<H3><a name="Extending_nn15">40.5.1 Strings</a></H3>
 
 
 <p>
@@ -1134,7 +1134,7 @@
 
 </div>
 
-<H3><a name="Extending_nn16">39.5.2 Hashes</a></H3>
+<H3><a name="Extending_nn16">40.5.2 Hashes</a></H3>
 
 
 <p>
@@ -1211,7 +1211,7 @@
 </div>
 
 
-<H3><a name="Extending_nn17">39.5.3 Lists</a></H3>
+<H3><a name="Extending_nn17">40.5.3 Lists</a></H3>
 
 
 <p>
@@ -1300,7 +1300,7 @@
 and is used to create a String object.
 </div>
 
-<H3><a name="Extending_nn18">39.5.4 Common operations</a></H3>
+<H3><a name="Extending_nn18">40.5.4 Common operations</a></H3>
 
 
 The following operations are applicable to all datatypes.
@@ -1355,7 +1355,7 @@
 Gets the line number associated with <tt>x</tt>.
 </div>
 
-<H3><a name="Extending_nn19">39.5.5 Iterating over Lists and Hashes</a></H3>
+<H3><a name="Extending_nn19">40.5.5 Iterating over Lists and Hashes</a></H3>
 
 
 To iterate over the elements of a list or a hash table, the following functions are used:
@@ -1400,7 +1400,7 @@
 
 </div>
 
-<H3><a name="Extending_nn20">39.5.6 I/O</a></H3>
+<H3><a name="Extending_nn20">40.5.6 I/O</a></H3>
 
 
 Special I/O functions are used for all internal I/O.  These operations
@@ -1534,7 +1534,7 @@
 Similarly, the preprocessor and parser all operate on string-files.
 </p>
 
-<H2><a name="Extending_nn21">39.6 Navigating and manipulating parse trees</a></H2>
+<H2><a name="Extending_nn21">40.6 Navigating and manipulating parse trees</a></H2>
 
 
 Parse trees are built as collections of hash tables.   Each node is a hash table in which
@@ -1668,7 +1668,7 @@
 the parent so that sibling nodes are unaffected.
 </div>
 
-<H2><a name="Extending_nn22">39.7 Working with attributes</a></H2>
+<H2><a name="Extending_nn22">40.7 Working with attributes</a></H2>
 
 
 <p>
@@ -1785,7 +1785,7 @@
 function.
 </div>
 
-<H2><a name="Extending_nn23">39.8 Type system</a></H2>
+<H2><a name="Extending_nn23">40.8 Type system</a></H2>
 
 
 <p>
@@ -1794,7 +1794,7 @@
 type theory is impossible here.   However, let's cover the highlights.
 </p>
 
-<H3><a name="Extending_nn24">39.8.1 String encoding of types</a></H3>
+<H3><a name="Extending_nn24">40.8.1 String encoding of types</a></H3>
 
 
 <p>
@@ -1895,7 +1895,7 @@
 string concatenation.
 </p>
 
-<H3><a name="Extending_nn25">39.8.2 Type construction</a></H3>
+<H3><a name="Extending_nn25">40.8.2 Type construction</a></H3>
 
 
 <p>
@@ -2064,7 +2064,7 @@
 <tt>ty</tt> is unmodified.
 </div>
 
-<H3><a name="Extending_nn26">39.8.3 Type tests</a></H3>
+<H3><a name="Extending_nn26">40.8.3 Type tests</a></H3>
 
 
 <p>
@@ -2151,7 +2151,7 @@
 Checks if <tt>ty</tt> is a templatized type.
 </div>
 
-<H3><a name="Extending_nn27">39.8.4 Typedef and inheritance</a></H3>
+<H3><a name="Extending_nn27">40.8.4 Typedef and inheritance</a></H3>
 
 
 <p>
@@ -2253,7 +2253,7 @@
 will consist only of primitive typenames.
 </div>
 
-<H3><a name="Extending_nn28">39.8.5 Lvalues</a></H3>
+<H3><a name="Extending_nn28">40.8.5 Lvalues</a></H3>
 
 
 <p>
@@ -2290,7 +2290,7 @@
 </pre>
 </div>
 
-<H3><a name="Extending_nn29">39.8.6 Output functions</a></H3>
+<H3><a name="Extending_nn29">40.8.6 Output functions</a></H3>
 
 
 <p>
@@ -2352,7 +2352,7 @@
 that appear in wrappers (e.g., <tt>SWIGTYPE_p_double</tt>).
 </div>
 
-<H2><a name="Extending_nn30">39.9 Parameters</a></H2>
+<H2><a name="Extending_nn30">40.9 Parameters</a></H2>
 
 
 <p>
@@ -2451,7 +2451,7 @@
 Returns the number of required (non-optional) arguments in <tt>p</tt>.
 </div>
 
-<H2><a name="Extending_nn31">39.10 Writing a Language Module</a></H2>
+<H2><a name="Extending_nn31">40.10 Writing a Language Module</a></H2>
 
 
 <p>
@@ -2466,7 +2466,7 @@
 this to other languages.
 </p>
 
-<H3><a name="Extending_nn32">39.10.1 Execution model</a></H3>
+<H3><a name="Extending_nn32">40.10.1 Execution model</a></H3>
 
 
 <p>
@@ -2476,7 +2476,7 @@
 different methods of the <tt>Language</tt> that must be defined by your module.
 </p>
 
-<H3><a name="Extending_starting_out">39.10.2 Starting out</a></H3>
+<H3><a name="Extending_starting_out">40.10.2 Starting out</a></H3>
 
 
 <p>
@@ -2584,7 +2584,7 @@
 messages from your new module should appear.
 </p>
 
-<H3><a name="Extending_nn34">39.10.3 Command line options</a></H3>
+<H3><a name="Extending_nn34">40.10.3 Command line options</a></H3>
 
 
 <p>
@@ -2643,7 +2643,7 @@
 unrecognized command line option error.
 </p>
 
-<H3><a name="Extending_nn35">39.10.4 Configuration and preprocessing</a></H3>
+<H3><a name="Extending_nn35">40.10.4 Configuration and preprocessing</a></H3>
 
 
 <p>
@@ -2692,7 +2692,7 @@
 <tt>python.swg</tt>.
 </p>
 
-<H3><a name="Extending_nn36">39.10.5 Entry point to code generation</a></H3>
+<H3><a name="Extending_nn36">40.10.5 Entry point to code generation</a></H3>
 
 
 <p>
@@ -2750,7 +2750,7 @@
 </pre>
 </div>
 
-<H3><a name="Extending_nn37">39.10.6 Module I/O and wrapper skeleton</a></H3>
+<H3><a name="Extending_nn37">40.10.6 Module I/O and wrapper skeleton</a></H3>
 
 
 <!-- please report bugs in this section to mgossage -->
@@ -2898,7 +2898,7 @@
 </pre>
 </div>
 
-<H3><a name="Extending_nn38">39.10.7 Low-level code generators</a></H3>
+<H3><a name="Extending_nn38">40.10.7 Low-level code generators</a></H3>
 
 
 <!-- please report bugs in this section to mgossage -->
@@ -3031,7 +3031,7 @@
   /* Close the function(error) */
   Printv(wrapper-&gt;code, "return ERROR;\n", "}\n", NIL);
 
-  /* final substititions if applicable */
+  /* final substitutions if applicable */
   ...
 
   /* Dump the function out */
@@ -3052,7 +3052,7 @@
 </p>
 
 
-<H3><a name="Extending_configuration_files">39.10.8 Configuration files</a></H3>
+<H3><a name="Extending_configuration_files">40.10.8 Configuration files</a></H3>
 
 
 <!-- please report bugs in this section to ttn -->
@@ -3196,7 +3196,7 @@
 </dl>
 
 
-<H3><a name="Extending_nn40">39.10.9 Runtime support</a></H3>
+<H3><a name="Extending_nn40">40.10.9 Runtime support</a></H3>
 
 
 <p>
@@ -3205,7 +3205,7 @@
 the SWIG files that implement those functions.
 </p>
 
-<H3><a name="Extending_nn41">39.10.10 Standard library files</a></H3>
+<H3><a name="Extending_nn41">40.10.10 Standard library files</a></H3>
 
 
 <p>
@@ -3224,7 +3224,7 @@
 Please copy these and modify for any new language.
 </p>
 
-<H3><a name="Extending_nn42">39.10.11 User examples</a></H3>
+<H3><a name="Extending_nn42">40.10.11 User examples</a></H3>
 
 
 <p>
@@ -3253,7 +3253,7 @@
 files</a>.
 </p>
 
-<H3><a name="Extending_test_suite">39.10.12 Test driven development and the test-suite</a></H3>
+<H3><a name="Extending_test_suite">40.10.12 Test driven development and the test-suite</a></H3>
 
 
 <p>
@@ -3312,7 +3312,7 @@
 but error/exception out with an error message on stderr on failure.
 </p>
 
-<H4><a name="Extending_running_test_suite">39.10.12.1 Running the test-suite</a></H4>
+<H4><a name="Extending_running_test_suite">40.10.12.1 Running the test-suite</a></H4>
 
 
 <p>
@@ -3504,7 +3504,7 @@
 The test cases used and the way it works is described in <tt>Examples/test-suite/errors/Makefile.in</tt>.
 </p>
 
-<H3><a name="Extending_nn43">39.10.13 Documentation</a></H3>
+<H3><a name="Extending_nn43">40.10.13 Documentation</a></H3>
 
 
 <p>
@@ -3536,7 +3536,7 @@
      if available.
 </ul>
 
-<H3><a name="Extending_coding_style_guidelines">39.10.14 Coding style guidelines</a></H3>
+<H3><a name="Extending_coding_style_guidelines">40.10.14 Coding style guidelines</a></H3>
 
 
 <p>
@@ -3561,7 +3561,7 @@
 </p>
 
 
-<H3><a name="Extending_language_status">39.10.15 Target language status</a></H3>
+<H3><a name="Extending_language_status">40.10.15 Target language status</a></H3>
 
 
 <p>
@@ -3570,7 +3570,7 @@
 This section provides more details on how this status is given.
 </p>
 
-<H4><a name="Extending_supported_status">39.10.15.1 Supported status</a></H4>
+<H4><a name="Extending_supported_status">40.10.15.1 Supported status</a></H4>
 
 
 <p>
@@ -3617,7 +3617,7 @@
 </li>
 </ul>
 
-<H4><a name="Extending_experimental_status">39.10.15.2 Experimental status</a></H4>
+<H4><a name="Extending_experimental_status">40.10.15.2 Experimental status</a></H4>
 
 
 <p>
@@ -3682,7 +3682,7 @@
 </li>
 </ul>
 
-<H3><a name="Extending_prerequisites">39.10.16 Prerequisites for adding a new language module to the SWIG distribution</a></H3>
+<H3><a name="Extending_prerequisites">40.10.16 Prerequisites for adding a new language module to the SWIG distribution</a></H3>
 
 
 <p>
@@ -3746,7 +3746,7 @@
 </p>
 
 
-<H2><a name="Extending_debugging_options">39.11 Debugging Options</a></H2>
+<H2><a name="Extending_debugging_options">40.11 Debugging Options</a></H2>
 
 
 <p>
@@ -3773,7 +3773,7 @@
 The complete list of command line options for SWIG are available by running <tt>swig -help</tt>.
 </p>
 
-<H2><a name="Extending_nn46">39.12 Guide to parse tree nodes</a></H2>
+<H2><a name="Extending_nn46">40.12 Guide to parse tree nodes</a></H2>
 
 
 <p>
@@ -4181,7 +4181,7 @@
 </pre>
 </div>
 
-<H2><a name="Extending_further_info">39.13 Further Development Information</a></H2>
+<H2><a name="Extending_further_info">40.13 Further Development Information</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Go.html b/Doc/Manual/Go.html
index 047b46e..1a5bb08 100644
--- a/Doc/Manual/Go.html
+++ b/Doc/Manual/Go.html
@@ -6,7 +6,7 @@
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 </head>
 <body bgcolor="#FFFFFF">
-<H1><a name="Go">24 SWIG and Go</a></H1>
+<H1><a name="Go">25 SWIG and Go</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -57,7 +57,7 @@
 see <a href="http://golang.org/">golang.org</a>.
 </p>
 
-<H2><a name="Go_overview">24.1 Overview</a></H2>
+<H2><a name="Go_overview">25.1 Overview</a></H2>
 
 
 <p>
@@ -86,7 +86,7 @@
 are not used.
 </p>
 
-<H2><a name="Go_examples">24.2 Examples</a></H2>
+<H2><a name="Go_examples">25.2 Examples</a></H2>
 
 
 <p>
@@ -101,7 +101,7 @@
 </p>
 
 
-<H2><a name="Go_running_swig">24.3 Running SWIG with Go</a></H2>
+<H2><a name="Go_running_swig">25.3 Running SWIG with Go</a></H2>
 
 
 <p>
@@ -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
@@ -181,7 +181,7 @@
 </pre></div>
 
 
-<H3><a name="Go_commandline">24.3.1 Go-specific Commandline Options</a></H3>
+<H3><a name="Go_commandline">25.3.1 Go-specific Commandline Options</a></H3>
 
 
 <p>
@@ -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,18 +266,25 @@
   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>
 
 
-<H3><a name="Go_outputs">24.3.2 Generated Wrapper Files</a></H3>
+<H3><a name="Go_outputs">25.3.2 Generated Wrapper Files</a></H3>
 
 
 <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>
@@ -308,7 +320,7 @@
 </ul>
 
 
-<H2><a name="Go_basic_tour">24.4 A tour of basic C/C++ wrapping</a></H2>
+<H2><a name="Go_basic_tour">25.4 A tour of basic C/C++ wrapping</a></H2>
 
 
 <p>
@@ -318,7 +330,7 @@
 essential aspects of this wrapping.
 </p>
 
-<H3><a name="Go_package">24.4.1 Go Package Name</a></H3>
+<H3><a name="Go_package">25.4.1 Go Package Name</a></H3>
 
 
 <p>
@@ -328,7 +340,7 @@
 command line option.
 </p>
 
-<H3><a name="Go_names">24.4.2 Go Names</a></H3>
+<H3><a name="Go_names">25.4.2 Go Names</a></H3>
 
 
 <p>
@@ -360,7 +372,7 @@
 named <tt>Delete</tt> followed by that name.
 </p>
 
-<H3><a name="Go_constants">24.4.3 Go Constants</a></H3>
+<H3><a name="Go_constants">25.4.3 Go Constants</a></H3>
 
 
 <p>
@@ -368,7 +380,7 @@
 directive become Go constants, declared with a <tt>const</tt>
 declaration.
 
-<H3><a name="Go_enumerations">24.4.4 Go Enumerations</a></H3>
+<H3><a name="Go_enumerations">25.4.4 Go Enumerations</a></H3>
 
 
 <p>
@@ -378,7 +390,7 @@
 code should avoid modifying those variables.
 </p>
 
-<H3><a name="Go_classes">24.4.5 Go Classes</a></H3>
+<H3><a name="Go_classes">25.4.5 Go Classes</a></H3>
 
 
 <p>
@@ -456,7 +468,7 @@
 for this by calling the Swigcptr() method.
 </p>
 
-<H4><a name="Go_class_memory">24.4.5.1 Go Class Memory Management</a></H4>
+<H4><a name="Go_class_memory">25.4.5.1 Go Class Memory Management</a></H4>
 
 
 <p>
@@ -578,7 +590,7 @@
 </pre>
 </div>
 
-<H4><a name="Go_class_inheritance">24.4.5.2 Go Class Inheritance</a></H4>
+<H4><a name="Go_class_inheritance">25.4.5.2 Go Class Inheritance</a></H4>
 
 
 <p>
@@ -590,16 +602,16 @@
 be checked dynamically.
 </p>
 
-<H3><a name="Go_templates">24.4.6 Go Templates</a></H3>
+<H3><a name="Go_templates">25.4.6 Go Templates</a></H3>
 
 
 <p>
 In order to use C++ templates in Go, you must tell SWIG to create
-wrappers for a particular template instantation.  To do this, use
+wrappers for a particular template instantiation.  To do this, use
 the <tt>%template</tt> directive.
 
 
-<H3><a name="Go_director_classes">24.4.7 Go Director Classes</a></H3>
+<H3><a name="Go_director_classes">25.4.7 Go Director Classes</a></H3>
 
 
 <p>
@@ -617,7 +629,7 @@
 </p>
 
 
-<H4><a name="Go_director_example_cpp_code">24.4.7.1 Example C++ code</a></H4>
+<H4><a name="Go_director_example_cpp_code">25.4.7.1 Example C++ code</a></H4>
 
 
 <p>
@@ -689,7 +701,7 @@
 </p>
 
 
-<H4><a name="Go_director_enable">24.4.7.2 Enable director feature</a></H4>
+<H4><a name="Go_director_enable">25.4.7.2 Enable director feature</a></H4>
 
 
 <p>
@@ -724,7 +736,7 @@
 </p>
 
 
-<H4><a name="Go_director_ctor_dtor">24.4.7.3 Constructor and destructor</a></H4>
+<H4><a name="Go_director_ctor_dtor">25.4.7.3 Constructor and destructor</a></H4>
 
 
 <p>
@@ -777,7 +789,7 @@
 </p>
 
 
-<H4><a name="Go_director_overriding">24.4.7.4 Override virtual methods</a></H4>
+<H4><a name="Go_director_overriding">25.4.7.4 Override virtual methods</a></H4>
 
 
 <p>
@@ -845,7 +857,7 @@
 </p>
 
 
-<H4><a name="Go_director_base_methods">24.4.7.5 Call base methods</a></H4>
+<H4><a name="Go_director_base_methods">25.4.7.5 Call base methods</a></H4>
 
 
 <p>
@@ -882,7 +894,7 @@
 </p>
 
 
-<H4><a name="Go_director_subclass">24.4.7.6 Subclass via embedding</a></H4>
+<H4><a name="Go_director_subclass">25.4.7.6 Subclass via embedding</a></H4>
 
 
 <p>
@@ -950,7 +962,7 @@
 </p>
 
 
-<H4><a name="Go_director_finalizer">24.4.7.7 Memory management with runtime.SetFinalizer</a></H4>
+<H4><a name="Go_director_finalizer">25.4.7.7 Memory management with runtime.SetFinalizer</a></H4>
 
 
 <p>
@@ -1015,7 +1027,7 @@
 </p>
 
 
-<H4><a name="Go_director_foobargo_class">24.4.7.8 Complete FooBarGo example class</a></H4>
+<H4><a name="Go_director_foobargo_class">25.4.7.8 Complete FooBarGo example class</a></H4>
 
 
 <p>
@@ -1144,7 +1156,7 @@
 </p>
 
 
-<H3><a name="Go_primitive_type_mappings">24.4.8 Default Go primitive type mappings</a></H3>
+<H3><a name="Go_primitive_type_mappings">25.4.8 Default Go primitive type mappings</a></H3>
 
 
 <p>
@@ -1251,7 +1263,7 @@
 into Go types.
 </p>
 
-<H3><a name="Go_output_arguments">24.4.9 Output arguments</a></H3>
+<H3><a name="Go_output_arguments">25.4.9 Output arguments</a></H3>
 
 
 <p>Because of limitations in the way output arguments are processed in swig,
@@ -1291,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
@@ -1304,7 +1316,7 @@
 </pre>
 </div>
 
-<H3><a name="Go_adding_additional_code">24.4.10 Adding additional go code</a></H3>
+<H3><a name="Go_adding_additional_code">25.4.10 Adding additional go code</a></H3>
 
 
 <p>Often the APIs generated by swig are not very natural in go, especially if
@@ -1399,7 +1411,7 @@
 </pre>
 </div>
 
-<H3><a name="Go_typemaps">24.4.11 Go typemaps</a></H3>
+<H3><a name="Go_typemaps">25.4.11 Go typemaps</a></H3>
 
 
 <p>
diff --git a/Doc/Manual/Guile.html b/Doc/Manual/Guile.html
index 31d8225..9d55b63 100644
--- a/Doc/Manual/Guile.html
+++ b/Doc/Manual/Guile.html
@@ -8,7 +8,7 @@
 
 <body bgcolor="#ffffff">
 
-<H1><a name="Guile">25 SWIG and Guile</a></H1>
+<H1><a name="Guile">26 SWIG and Guile</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -48,7 +48,7 @@
 <p>
 This section details guile-specific support in SWIG.
 
-<H2><a name="Guile_nn1">25.1 Supported Guile Versions</a></H2>
+<H2><a name="Guile_nn1">26.1 Supported Guile Versions</a></H2>
 
 
 <p>
@@ -62,7 +62,7 @@
 so your mileage may vary. To be safe set environment variable
 GUILE_AUTO_COMPILE to 0 when using swig generated guile code.
 
-<H2><a name="Guile_nn2">25.2 Meaning of "Module"</a></H2>
+<H2><a name="Guile_nn2">26.2 Meaning of "Module"</a></H2>
 
 
 <p>
@@ -70,7 +70,7 @@
 separately for SWIG, Guile, and Libtool.  To avoid horrible confusion,
 we explicitly prefix the context, e.g., "guile-module".
 
-<H2><a name="Guile_nn3">25.3 Old GH Guile API</a></H2>
+<H2><a name="Guile_nn3">26.3 Old GH Guile API</a></H2>
 
 
 <p>Guile 1.8 and older could be interfaced using two different api's, the SCM
@@ -81,7 +81,7 @@
 version of SWIG that can still generate guile GH wrapper code is 2.0.9. Please
 use that version if you really need the GH wrapper code.
 
-<H2><a name="Guile_nn4">25.4 Linkage</a></H2>
+<H2><a name="Guile_nn4">26.4 Linkage</a></H2>
 
 
 <p>
@@ -89,7 +89,7 @@
 which manifests in multiple shared-library usage conventions.  A set of
 policies implementing a usage convention is called a <b>linkage</b>.
 
-<H3><a name="Guile_nn5">25.4.1 Simple Linkage</a></H3>
+<H3><a name="Guile_nn5">26.4.1 Simple Linkage</a></H3>
 
 
 <p>
@@ -194,7 +194,7 @@
 <code>SWIG_init</code> via a preprocessor define to avoid symbol
 clashes. For this case, however, passive linkage is available.
 
-<H3><a name="Guile_nn6">25.4.2 Passive Linkage</a></H3>
+<H3><a name="Guile_nn6">26.4.2 Passive Linkage</a></H3>
 
 
 <p>Passive linkage is just like simple linkage, but it generates an
@@ -204,7 +204,7 @@
 <p>You should use passive linkage rather than simple linkage when you
 are using multiple modules.
 
-<H3><a name="Guile_nn7">25.4.3 Native Guile Module Linkage</a></H3>
+<H3><a name="Guile_nn7">26.4.3 Native Guile Module Linkage</a></H3>
 
 
 <p>SWIG can also generate wrapper code that does all the Guile module
@@ -245,7 +245,7 @@
 </div>
 </ul>
 
-<H3><a name="Guile_nn8">25.4.4 Old Auto-Loading Guile Module Linkage</a></H3>
+<H3><a name="Guile_nn8">26.4.4 Old Auto-Loading Guile Module Linkage</a></H3>
 
 
 <p>Guile used to support an autoloading facility for object-code
@@ -271,7 +271,7 @@
 an appropriate name. 
 
 
-<H3><a name="Guile_nn9">25.4.5 Hobbit4D Linkage</a></H3>
+<H3><a name="Guile_nn9">26.4.5 Hobbit4D Linkage</a></H3>
 
 
 <p>
@@ -296,7 +296,7 @@
 experimental; the (hobbit4d link) conventions are not well understood.
 </p>
 
-<H2><a name="Guile_nn10">25.5 Underscore Folding</a></H2>
+<H2><a name="Guile_nn10">26.5 Underscore Folding</a></H2>
 
 
 <p>
@@ -308,7 +308,7 @@
 <code>%rename</code> to specify the Guile name of the wrapped
 functions and variables (see CHANGES).
 
-<H2><a name="Guile_nn11">25.6 Typemaps</a></H2>
+<H2><a name="Guile_nn11">26.6 Typemaps</a></H2>
 
 
 <p>
@@ -400,7 +400,7 @@
 <a href="Customization.html#Customization_features">Features and the %feature directive</a>
 for info on how to apply the %feature.</p>
 
-<H2><a name="Guile_nn12">25.7 Representation of pointers as smobs</a></H2>
+<H2><a name="Guile_nn12">26.7 Representation of pointers as smobs</a></H2>
 
 
 <p>
@@ -421,7 +421,7 @@
 If the Scheme object passed was not a SWIG smob representing a compatible
 pointer, a <code>wrong-type-arg</code> exception is raised.
 
-<H3><a name="Guile_nn14">25.7.1 Smobs</a></H3>
+<H3><a name="Guile_nn14">26.7.1 Smobs</a></H3>
 
 
 <p>
@@ -440,7 +440,7 @@
 the corresponding GOOPS class.</p>
 
 
-<H3><a name="Guile_nn15">25.7.2 Garbage Collection</a></H3>
+<H3><a name="Guile_nn15">26.7.2 Garbage Collection</a></H3>
 
 
 <p>Garbage collection is a feature of Guile since version 1.6. As SWIG now requires Guile &gt; 1.8,
@@ -454,14 +454,14 @@
 Object ownership and %newobject</a> in the SWIG manual.  All typemaps use an $owner var, and
 the guile module replaces $owner with 0 or 1 depending on feature:new.</p>
 
-<H2><a name="Guile_nn16">25.8 Native Guile pointers</a></H2>
+<H2><a name="Guile_nn16">26.8 Native Guile pointers</a></H2>
 
 
 <p>
 In addition to SWIG smob pointers, <a href="https://www.gnu.org/software/guile/manual/html_node/Foreign-Pointers.html">Guile's native pointer type</a> are accepted as arguments to wrapped SWIG functions. This can be useful for passing <a href="https://www.gnu.org/software/guile/manual/html_node/Void-Pointers-and-Byte-Access.html#">pointers to bytevector data</a> to wrapped functions.
 </p>
 
-<H2><a name="Guile_nn17">25.9 Exception Handling</a></H2>
+<H2><a name="Guile_nn17">26.9 Exception Handling</a></H2>
 
 
 <p>
@@ -487,7 +487,7 @@
 The default when not specified here is to use "swig-error".
 See Lib/exception.i for details.
 
-<H2><a name="Guile_nn18">25.10 Procedure documentation</a></H2>
+<H2><a name="Guile_nn18">26.10 Procedure documentation</a></H2>
 
 
 <p>If invoked with the command-line option <code>-procdoc
@@ -522,7 +522,7 @@
 typemap argument <code>doc</code>. See <code>Lib/guile/typemaps.i</code> for
 details.
 
-<H2><a name="Guile_nn19">25.11 Procedures with setters</a></H2>
+<H2><a name="Guile_nn19">26.11 Procedures with setters</a></H2>
 
 
 <p>For global variables, SWIG creates a single wrapper procedure
@@ -550,7 +550,7 @@
 pointer)</code> and <code>(<var>struct-member</var>-set pointer
 value)</code> are <em>not</em> generated.
 
-<H2><a name="Guile_nn20">25.12 GOOPS Proxy Classes</a></H2>
+<H2><a name="Guile_nn20">26.12 GOOPS Proxy Classes</a></H2>
 
 
 <p>SWIG can also generate classes and generic functions for use with
@@ -696,7 +696,7 @@
 <code>%import "foo.h"</code> before the <code>%inline</code> block.
 </p>
 
-<H3><a name="Guile_nn21">25.12.1 Naming Issues</a></H3>
+<H3><a name="Guile_nn21">26.12.1 Naming Issues</a></H3>
 
 
 <p>As you can see in the example above, there are potential naming conflicts.  The default exported
@@ -733,7 +733,7 @@
 (use-modules ((Test) #:renamer (symbol-prefix-proc 'goops:)))
 </pre></div>
 
-<H3><a name="Guile_nn22">25.12.2 Linking</a></H3>
+<H3><a name="Guile_nn22">26.12.2 Linking</a></H3>
 
 
 <p>The guile-modules generated above all need to be linked together.  GOOPS support requires
diff --git a/Doc/Manual/Introduction.html b/Doc/Manual/Introduction.html
index 1a2e26a..facfc7d 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.
@@ -416,6 +416,7 @@
 Most of C++11 is also supported. Details are in the <a href="CPlusPlus11.html#CPlusPlus11">C++11</a> chapter.
 C++14 support is covered in the <a href="CPlusPlus14.html#CPlusPlus14">C++14</a> chapter.
 C++17 support is covered in the <a href="CPlusPlus17.html#CPlusPlus17">C++17</a> chapter.
+C++20 support is covered in the <a href="CPlusPlus20.html#CPlusPlus20">C++20</a> chapter.
 </p>
 
 <p>
@@ -464,7 +465,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 +532,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 cdefba6..b9234b2 100644
--- a/Doc/Manual/Java.html
+++ b/Doc/Manual/Java.html
@@ -6,7 +6,7 @@
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 </head>
 <body bgcolor="#FFFFFF">
-<H1><a name="Java">26 SWIG and Java</a></H1>
+<H1><a name="Java">27 SWIG and Java</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -167,7 +167,7 @@
 </p>
 
 
-<H2><a name="Java_overview">26.1 Overview</a></H2>
+<H2><a name="Java_overview">27.1 Overview</a></H2>
 
 
 <p>
@@ -202,7 +202,7 @@
 The latter sections cover the advanced techniques of using typemaps for complete control of the wrapping process.
 </p>
 
-<H2><a name="Java_preliminaries">26.2 Preliminaries</a></H2>
+<H2><a name="Java_preliminaries">27.2 Preliminaries</a></H2>
 
 
 <p>
@@ -222,7 +222,7 @@
 Android uses Java JNI and also works with SWIG. Please read the <a href="Android.html#Android">Android chapter</a> in conjunction with this one if you are targeting Android.
 </p>
 
-<H3><a name="Java_running_swig">26.2.1 Running SWIG</a></H3>
+<H3><a name="Java_running_swig">27.2.1 Running SWIG</a></H3>
 
 
 <p>
@@ -281,7 +281,7 @@
 compiling and using the generated files.
 </p>
 
-<H3><a name="Java_commandline">26.2.2 Additional Commandline Options</a></H3>
+<H3><a name="Java_commandline">27.2.2 Additional Commandline Options</a></H3>
 
 
 <p>
@@ -318,7 +318,7 @@
 Their use will become clearer by the time you have finished reading this section on SWIG and Java.
 </p>
 
-<H3><a name="Java_getting_right_headers">26.2.3 Getting the right header files</a></H3>
+<H3><a name="Java_getting_right_headers">27.2.3 Getting the right header files</a></H3>
 
 
 <p>
@@ -333,7 +333,7 @@
 <p>
 The exact location may vary on your machine, but the above locations are typical. </p>
 
-<H3><a name="Java_compiling_dynamic">26.2.4 Compiling a dynamic module</a></H3>
+<H3><a name="Java_compiling_dynamic">27.2.4 Compiling a dynamic module</a></H3>
 
 
 <p>
@@ -368,7 +368,7 @@
 If the name of your SWIG module is "<tt>example</tt>", the name of the corresponding shared library file should be "<tt>libexample.so</tt>" (or equivalent depending on your machine, see <a href="#Java_dynamic_linking_problems">Dynamic linking problems</a> for more information). 
 The name of the module is specified using the <tt>%module</tt> directive or <tt>-module</tt> command line option.</p>
 
-<H3><a name="Java_using_module">26.2.5 Using your module</a></H3>
+<H3><a name="Java_using_module">27.2.5 Using your module</a></H3>
 
 
 <p>
@@ -403,7 +403,7 @@
 If it doesn't work have a look at the following section which discusses problems loading the shared library.
 </p>
 
-<H3><a name="Java_dynamic_linking_problems">26.2.6 Dynamic linking problems</a></H3>
+<H3><a name="Java_dynamic_linking_problems">27.2.6 Dynamic linking problems</a></H3>
 
 
 <p>
@@ -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>
 
@@ -490,7 +490,7 @@
 </p>
 
 
-<H3><a name="Java_compilation_problems_cpp">26.2.7 Compilation problems and compiling with C++</a></H3>
+<H3><a name="Java_compilation_problems_cpp">27.2.7 Compilation problems and compiling with C++</a></H3>
 
 
 <p>
@@ -542,7 +542,7 @@
 </p>
 
 
-<H3><a name="Java_building_windows">26.2.8 Building on Windows</a></H3>
+<H3><a name="Java_building_windows">27.2.8 Building on Windows</a></H3>
 
 
 <p>
@@ -551,7 +551,7 @@
 This section covers the process of using SWIG with Microsoft Visual C++ 6 although the procedure may be similar with other compilers.  
 In order for everything to work, you will need to have a JDK installed on your machine in order to read the JNI header files.</p>
 
-<H4><a name="Java_visual_studio">26.2.8.1 Running SWIG from Visual Studio</a></H4>
+<H4><a name="Java_visual_studio">27.2.8.1 Running SWIG from Visual Studio</a></H4>
 
 
 <p>
@@ -590,7 +590,7 @@
 If the library fails to load have a look at <a href="#Java_dynamic_linking_problems">Dynamic linking problems</a>.
 </p>
 
-<H4><a name="Java_nmake">26.2.8.2 Using NMAKE</a></H4>
+<H4><a name="Java_nmake">27.2.8.2 Using NMAKE</a></H4>
 
 
 <p>
@@ -645,11 +645,11 @@
 <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>
 
 
-<H2><a name="Java_basic_tour">26.3 A tour of basic C/C++ wrapping</a></H2>
+<H2><a name="Java_basic_tour">27.3 A tour of basic C/C++ wrapping</a></H2>
 
 
 <p>
@@ -659,7 +659,7 @@
 This section briefly covers the essential aspects of this wrapping.
 </p>
 
-<H3><a name="Java_module_packages_classes">26.3.1 Modules, packages and generated Java classes</a></H3>
+<H3><a name="Java_module_packages_classes">27.3.1 Modules, packages and generated Java classes</a></H3>
 
 
 <p>
@@ -695,7 +695,7 @@
 SWIG won't create the directory, so make sure it exists beforehand.
 </p>
 
-<H3><a name="Java_functions">26.3.2 Functions</a></H3>
+<H3><a name="Java_functions">27.3.2 Functions</a></H3>
 
 
 <p>
@@ -729,7 +729,7 @@
 </pre></div>
 
 
-<H3><a name="Java_global_variables">26.3.3 Global variables</a></H3>
+<H3><a name="Java_global_variables">27.3.3 Global variables</a></H3>
 
 
 <p>
@@ -816,7 +816,7 @@
 </div>
 
 
-<H3><a name="Java_constants">26.3.4 Constants</a></H3>
+<H3><a name="Java_constants">27.3.4 Constants</a></H3>
 
 
 <p>
@@ -956,7 +956,7 @@
 </p>
 
 
-<H3><a name="Java_enumerations">26.3.5 Enumerations</a></H3>
+<H3><a name="Java_enumerations">27.3.5 Enumerations</a></H3>
 
 
 <p>
@@ -970,7 +970,7 @@
 Before looking at the various approaches for wrapping named C/C++ enums, anonymous enums are considered.
 </p>
 
-<H4><a name="Java_anonymous_enums">26.3.5.1 Anonymous enums</a></H4>
+<H4><a name="Java_anonymous_enums">27.3.5.1 Anonymous enums</a></H4>
 
 
 <p>
@@ -1033,7 +1033,7 @@
 </p>
 
 
-<H4><a name="Java_typesafe_enums">26.3.5.2 Typesafe enums</a></H4>
+<H4><a name="Java_typesafe_enums">27.3.5.2 Typesafe enums</a></H4>
 
 
 <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>
@@ -1127,7 +1126,7 @@
 The following section details proper Java enum generation.
 </p>
 
-<H4><a name="Java_proper_enums">26.3.5.3 Proper Java enums</a></H4>
+<H4><a name="Java_proper_enums">27.3.5.3 Proper Java enums</a></H4>
 
 
 <p>
@@ -1180,7 +1179,7 @@
 <a href="#Java_simpler_enum_classes">Simpler Java enums for enums without initializers</a> section.
 </p>
 
-<H4><a name="Java_typeunsafe_enums">26.3.5.4 Type unsafe enums</a></H4>
+<H4><a name="Java_typeunsafe_enums">27.3.5.4 Type unsafe enums</a></H4>
 
 
 <p>
@@ -1228,7 +1227,7 @@
 Thus the upgrade path to proper enums provided in JDK 1.5 is more painful.
 </p>
 
-<H4><a name="Java_simple_enums">26.3.5.5 Simple enums</a></H4>
+<H4><a name="Java_simple_enums">27.3.5.5 Simple enums</a></H4>
 
 
 <p>
@@ -1247,7 +1246,7 @@
 The type unsafe approach is preferable to this one and this simple approach is only included for backwards compatibility with these earlier versions of SWIG.
 </p>
 
-<H3><a name="Java_pointers">26.3.6 Pointers</a></H3>
+<H3><a name="Java_pointers">27.3.6 Pointers</a></H3>
 
 
 <p>
@@ -1335,7 +1334,7 @@
 a NULL pointer if the conversion can't be performed.
 </p>
 
-<H3><a name="Java_structures">26.3.7 Structures</a></H3>
+<H3><a name="Java_structures">27.3.7 Structures</a></H3>
 
 
 <p>
@@ -1503,7 +1502,7 @@
 </div>
 
 
-<H3><a name="Java_classes">26.3.8 C++ classes</a></H3>
+<H3><a name="Java_classes">27.3.8 C++ classes</a></H3>
 
 
 <p>
@@ -1566,7 +1565,7 @@
 </div>
 
 
-<H3><a name="Java_inheritance">26.3.9 C++ inheritance</a></H3>
+<H3><a name="Java_inheritance">27.3.9 C++ inheritance</a></H3>
 
 
 <p>
@@ -1627,7 +1626,7 @@
 A warning is given when multiple inheritance is detected and only the first base class is used. 
 </p>
 
-<H3><a name="Java_pointers_refs_arrays">26.3.10 Pointers, references, arrays and pass by value</a></H3>
+<H3><a name="Java_pointers_refs_arrays">27.3.10 Pointers, references, arrays and pass by value</a></H3>
 
 
 <p>
@@ -1682,7 +1681,7 @@
 when the returned object's finalizer is run by the garbage collector).
 </p>
 
-<H4><a name="Java_null_pointers">26.3.10.1 Null pointers</a></H4>
+<H4><a name="Java_null_pointers">27.3.10.1 Null pointers</a></H4>
 
 
 <p>
@@ -1706,7 +1705,7 @@
 The converse also occurs, that is, NULL pointers are translated into <tt>null</tt> Java objects when returned from a C/C++ function.
 </p>
 
-<H3><a name="Java_overloaded_functions">26.3.11 C++ overloaded functions</a></H3>
+<H3><a name="Java_overloaded_functions">27.3.11 C++ overloaded functions</a></H3>
 
 
 <p>
@@ -1821,7 +1820,7 @@
 </pre>
 </div>
 
-<H3><a name="Java_default_arguments">26.3.12 C++ default arguments</a></H3>
+<H3><a name="Java_default_arguments">27.3.12 C++ default arguments</a></H3>
 
 
 <p>
@@ -1864,7 +1863,7 @@
 </p>
 
 
-<H3><a name="Java_namespaces">26.3.13 C++ namespaces</a></H3>
+<H3><a name="Java_namespaces">27.3.13 C++ namespaces</a></H3>
 
 
 <p>
@@ -1954,7 +1953,7 @@
 you will need to open up the visibility for the pointer constructor and <tt>getCPtr</tt> method from the default 'protected' to 'public' with the <tt>SWIG_JAVABODY_PROXY</tt> macro. See <a href="#Java_code_typemaps">Java code typemaps</a>.
 </p>
 
-<H3><a name="Java_templates">26.3.14 C++ templates</a></H3>
+<H3><a name="Java_templates">27.3.14 C++ templates</a></H3>
 
 
 <p>
@@ -2003,10 +2002,10 @@
 More details can be found in the <a href="SWIGPlus.html#SWIGPlus">SWIG and C++</a> chapter.   
 </p>
 
-<H3><a name="Java_smart_pointers">26.3.15 C++ Smart Pointers</a></H3>
+<H3><a name="Java_smart_pointers">27.3.15 C++ Smart Pointers</a></H3>
 
 
-<H4><a name="Java_smart_pointers_shared_ptr">26.3.15.1 The shared_ptr Smart Pointer</a></H4>
+<H4><a name="Java_smart_pointers_shared_ptr">27.3.15.1 The shared_ptr Smart Pointer</a></H4>
 
 
 <p>
@@ -2017,7 +2016,7 @@
 </p>
 
 
-<H4><a name="Java_smart_pointers_generic">26.3.15.2 Generic Smart Pointers</a></H4>
+<H4><a name="Java_smart_pointers_generic">27.3.15.2 Generic Smart Pointers</a></H4>
 
 
 <p>
@@ -2101,7 +2100,7 @@
 </pre>
 </div>
 
-<H2><a name="Java_further_details">26.4 Further details on the generated Java classes</a></H2>
+<H2><a name="Java_further_details">27.4 Further details on the generated Java classes</a></H2>
 
 
 <p>
@@ -2116,7 +2115,7 @@
 First, the crucial intermediary JNI class is considered.
 </p>
 
-<H3><a name="Java_imclass">26.4.1 The intermediary JNI class</a></H3>
+<H3><a name="Java_imclass">27.4.1 The intermediary JNI class</a></H3>
 
 
 <p>
@@ -2236,7 +2235,7 @@
 from <tt>modulename</tt> to <tt>modulenameModule</tt>.
 </p>
 
-<H4><a name="Java_imclass_pragmas">26.4.1.1 The intermediary JNI class pragmas</a></H4>
+<H4><a name="Java_imclass_pragmas">27.4.1.1 The intermediary JNI class pragmas</a></H4>
 
 
 <p>
@@ -2318,7 +2317,7 @@
 All the methods in the intermediary JNI class will then not be callable outside of the package as the method modifiers have been changed from public access to default access. This is useful if you want to prevent users calling these low level functions.
 </p>
 
-<H3><a name="Java_module_class">26.4.2 The Java module class</a></H3>
+<H3><a name="Java_module_class">27.4.2 The Java module class</a></H3>
 
 
 <p>
@@ -2349,7 +2348,7 @@
 The primary reason for having the module class wrapping the calls in the intermediary JNI class is to implement static type checking. In this case only a <tt>Foo</tt> can be passed to the <tt>egg</tt> function, whereas any <tt>long</tt> can be passed to the <tt>egg</tt> function in the intermediary JNI class.
 </p>
 
-<H4><a name="Java_module_class_pragmas">26.4.2.1 The Java module class pragmas</a></H4>
+<H4><a name="Java_module_class_pragmas">27.4.2.1 The Java module class pragmas</a></H4>
 
 
 <p>
@@ -2400,7 +2399,7 @@
 </p>
 
 
-<H3><a name="Java_proxy_classes">26.4.3 Java proxy classes</a></H3>
+<H3><a name="Java_proxy_classes">27.4.3 Java proxy classes</a></H3>
 
 
 <p>
@@ -2476,7 +2475,7 @@
 </pre>
 </div>
 
-<H4><a name="Java_memory_management">26.4.3.1 Memory management</a></H4>
+<H4><a name="Java_memory_management">27.4.3.1 Memory management</a></H4>
 
 
 <p>
@@ -2638,7 +2637,7 @@
 </p>
 
 
-<H4><a name="Java_inheritance_mirroring">26.4.3.2 Inheritance</a></H4>
+<H4><a name="Java_inheritance_mirroring">27.4.3.2 Inheritance</a></H4>
 
 
 <p>
@@ -2754,7 +2753,7 @@
 </p>
 
 
-<H4><a name="Java_proxy_classes_gc">26.4.3.3 Proxy classes and garbage collection</a></H4>
+<H4><a name="Java_proxy_classes_gc">27.4.3.3 Proxy classes and garbage collection</a></H4>
 
 
 <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>
@@ -2837,7 +2836,7 @@
 See the <a href="http://www.devx.com/Java/Article/30192">How to Handle Java Finalization's Memory-Retention Issues</a> article for alternative approaches to managing memory by avoiding finalizers altogether.
 </p>
 
-<H4><a name="Java_pgcpp">26.4.3.4 The premature garbage collection prevention parameter for proxy class marshalling</a></H4>
+<H4><a name="Java_pgcpp">27.4.3.4 The premature garbage collection prevention parameter for proxy class marshalling</a></H4>
 
 
 <p>
@@ -2959,7 +2958,7 @@
 <b>Compatibility note:</b> The generation of this additional parameter did not occur in versions prior to SWIG-1.3.30.
 </p>
 
-<H4><a name="Java_multithread_libraries">26.4.3.5 Single threaded applications and thread safety</a></H4>
+<H4><a name="Java_multithread_libraries">27.4.3.5 Single threaded applications and thread safety</a></H4>
 
 
 <p>
@@ -3047,7 +3046,7 @@
 </pre></div>
  
 
-<H3><a name="Java_type_wrapper_classes">26.4.4 Type wrapper classes</a></H3>
+<H3><a name="Java_type_wrapper_classes">27.4.4 Type wrapper classes</a></H3>
 
 
 <p>
@@ -3134,7 +3133,7 @@
 </div>
 
 
-<H3><a name="Java_enum_classes">26.4.5 Enum classes</a></H3>
+<H3><a name="Java_enum_classes">27.4.5 Enum classes</a></H3>
 
 
 <p>
@@ -3143,7 +3142,7 @@
 The following sub-sections detail the various types of enum classes that can be generated.
 </p>
 
-<H4><a name="Java_typesafe_enums_classes">26.4.5.1 Typesafe enum classes</a></H4>
+<H4><a name="Java_typesafe_enums_classes">27.4.5.1 Typesafe enum classes</a></H4>
 
 
 <p>
@@ -3227,7 +3226,7 @@
 The <tt>toString</tt> method is overridden so that the enum name is available.
 </p>
 
-<H4><a name="Java_proper_enums_classes">26.4.5.2 Proper Java enum classes</a></H4>
+<H4><a name="Java_proper_enums_classes">27.4.5.2 Proper Java enum classes</a></H4>
 
 
 <p>
@@ -3305,7 +3304,7 @@
 <a href="#Java_simpler_enum_classes">Simpler Java enums for enums without initializers</a> section describes how typemaps can be used to achieve this.
 </p>
 
-<H4><a name="Java_typeunsafe_enums_classes">26.4.5.3 Type unsafe enum classes</a></H4>
+<H4><a name="Java_typeunsafe_enums_classes">27.4.5.3 Type unsafe enum classes</a></H4>
 
 
 <p>
@@ -3336,7 +3335,7 @@
 </pre>
 </div>
 
-<H3><a name="Java_interfaces">26.4.6 Interfaces</a></H3>
+<H3><a name="Java_interfaces">27.4.6 Interfaces</a></H3>
 
 
 <p>
@@ -3581,7 +3580,7 @@
 See <a href="Java.html#Java_code_typemaps">Java code typemaps</a> for details.
 </p>
 
-<H2><a name="Java_directors">26.5 Cross language polymorphism using directors</a></H2>
+<H2><a name="Java_directors">27.5 Cross language polymorphism using directors</a></H2>
 
 
 <p>
@@ -3603,7 +3602,7 @@
 Neither C++ code nor Java code needs to know where a particular method is implemented: the combination of proxy classes, director classes, and C wrapper functions transparently takes care of all the cross-language method routing.
 </p>
 
-<H3><a name="Java_enabling_directors">26.5.1 Enabling directors</a></H3>
+<H3><a name="Java_enabling_directors">27.5.1 Enabling directors</a></H3>
 
 
 <p>
@@ -3671,7 +3670,7 @@
 </pre>
 </div>
 
-<H3><a name="Java_directors_classes">26.5.2 Director classes</a></H3>
+<H3><a name="Java_directors_classes">27.5.2 Director classes</a></H3>
 
 
 <p>
@@ -3699,7 +3698,7 @@
 </p>
 
 
-<H3><a name="Java_directors_overhead">26.5.3 Overhead and code bloat</a></H3>
+<H3><a name="Java_directors_overhead">27.5.3 Overhead and code bloat</a></H3>
 
 
 <p>
@@ -3717,7 +3716,7 @@
 </p>
 
 
-<H3><a name="Java_directors_example">26.5.4 Simple directors example</a></H3>
+<H3><a name="Java_directors_example">27.5.4 Simple directors example</a></H3>
 
 
 <p>
@@ -3780,7 +3779,7 @@
 </pre>
 </div>
 
-<H3><a name="Java_directors_threading">26.5.5 Director threading issues</a></H3>
+<H3><a name="Java_directors_threading">27.5.5 Director threading issues</a></H3>
 
 
 <p>
@@ -3800,7 +3799,7 @@
 </pre>
 </div>
 
-<H3><a name="Java_directors_performance">26.5.6 Director performance tuning</a></H3>
+<H3><a name="Java_directors_performance">27.5.6 Director performance tuning</a></H3>
 
 
 <p>
@@ -3821,7 +3820,7 @@
 The disadvantage is that invocation of director methods from C++ when Java doesn't actually override the method will require an additional call up into Java and back to C++.  As such, this option is only useful when overrides are extremely common and instantiation is frequent enough that its performance is critical.
 </p>
 
-<H3><a name="Java_exceptions_from_directors">26.5.7 Java exceptions from directors</a></H3>
+<H3><a name="Java_exceptions_from_directors">27.5.7 Java exceptions from directors</a></H3>
 
 
 <p>
@@ -3897,7 +3896,7 @@
 More on the <tt>Swig::DirectorException</tt> class can be found in the next section which details how to customize the handling of director exceptions.
 </p>
 
-<H4><a name="Java_customizing_director_exceptions">26.5.7.1 Customizing director exceptions</a></H4>
+<H4><a name="Java_customizing_director_exceptions">27.5.7.1 Customizing director exceptions</a></H4>
 
 
 <p>
@@ -4455,7 +4454,7 @@
 </pre>
 </div>
 
-<H2><a name="Java_allprotected">26.6 Accessing protected members</a></H2>
+<H2><a name="Java_allprotected">27.6 Accessing protected members</a></H2>
 
 
 <p>
@@ -4551,7 +4550,7 @@
 
 
 
-<H2><a name="Java_common_customization">26.7 Common customization features</a></H2>
+<H2><a name="Java_common_customization">27.7 Common customization features</a></H2>
 
 
 <p>
@@ -4563,7 +4562,7 @@
 to improve the interface to existing C/C++ code.
 </p>
 
-<H3><a name="Java_helper_functions">26.7.1 C/C++ helper functions</a></H3>
+<H3><a name="Java_helper_functions">27.7.1 C/C++ helper functions</a></H3>
 
 
 <p>
@@ -4629,7 +4628,7 @@
 customization features as covered in later sections, but sometimes helper functions are a quick and easy solution to difficult cases.  
 </p>
 
-<H3><a name="Java_class_extension">26.7.2 Class extension with %extend</a></H3>
+<H3><a name="Java_class_extension">27.7.2 Class extension with %extend</a></H3>
 
 
 <p>
@@ -4692,7 +4691,7 @@
 in any way---the extensions only show up in the Java interface.
 </p>
 
-<H3><a name="Java_proxycode">26.7.3 Class extension with %proxycode</a></H3>
+<H3><a name="Java_proxycode">27.7.3 Class extension with %proxycode</a></H3>
 
 
 <p>
@@ -4829,7 +4828,7 @@
 </pre>
 </div>
 
-<H3><a name="Java_exception_handling">26.7.4 Exception handling with %exception and %javaexception</a></H3>
+<H3><a name="Java_exception_handling">27.7.4 Exception handling with %exception and %javaexception</a></H3>
 
 
 <p>
@@ -4988,7 +4987,7 @@
 The typemap example <a href="#Java_exception_typemap">Handling C++ exception specifications as Java exceptions</a> provides further exception handling capabilities.
 </p>
 
-<H3><a name="Java_method_access">26.7.5 Method access with %javamethodmodifiers</a></H3>
+<H3><a name="Java_method_access">27.7.5 Method access with %javamethodmodifiers</a></H3>
 
 
 <p>
@@ -5014,7 +5013,7 @@
 </pre>
 </div>
 
-<H2><a name="Java_tips_techniques">26.8 Tips and techniques</a></H2>
+<H2><a name="Java_tips_techniques">27.8 Tips and techniques</a></H2>
 
 
 <p>
@@ -5024,7 +5023,7 @@
 solving these problems.
 </p>
 
-<H3><a name="Java_input_output_parameters">26.8.1 Input and output parameters using primitive pointers and references</a></H3>
+<H3><a name="Java_input_output_parameters">27.8.1 Input and output parameters using primitive pointers and references</a></H3>
 
 
 <p>
@@ -5198,7 +5197,7 @@
 will not have the intended effect since <tt>typemaps.i</tt> does not define an OUTPUT rule for <tt>Bar</tt>.
 </p>
 
-<H3><a name="Java_simple_pointers">26.8.2 Simple pointers</a></H3>
+<H3><a name="Java_simple_pointers">27.8.2 Simple pointers</a></H3>
 
 
 <p>
@@ -5264,7 +5263,7 @@
 See the <a href="Library.html#Library">SWIG Library</a> chapter for further details.
 </p>
 
-<H3><a name="Java_c_arrays">26.8.3 Wrapping C arrays with Java arrays</a></H3>
+<H3><a name="Java_c_arrays">27.8.3 Wrapping C arrays with Java arrays</a></H3>
 
 
 <p>
@@ -5331,7 +5330,7 @@
 There is an alternative approach using the SWIG array library and this is covered in the next section.
 </p>
 
-<H3><a name="Java_unbounded_c_arrays">26.8.4 Unbounded C Arrays</a></H3>
+<H3><a name="Java_unbounded_c_arrays">27.8.4 Unbounded C Arrays</a></H3>
 
 
 <p>
@@ -5476,7 +5475,7 @@
 package binary data, etc.
 </p>
 
-<H3><a name="Java_binary_char">26.8.5 Binary data vs Strings</a></H3>
+<H3><a name="Java_binary_char">27.8.5 Binary data vs Strings</a></H3>
 
 
 <p>
@@ -5520,7 +5519,7 @@
 </pre></div>
 
 
-<H3><a name="Java_heap_allocations">26.8.6 Overriding new and delete to allocate from Java heap</a></H3>
+<H3><a name="Java_heap_allocations">27.8.6 Overriding new and delete to allocate from Java heap</a></H3>
 
 
 <p>
@@ -5637,7 +5636,7 @@
 code.
 </p>
 
-<H2><a name="Java_typemaps">26.9 Java typemaps</a></H2>
+<H2><a name="Java_typemaps">27.9 Java typemaps</a></H2>
 
 
 <p>
@@ -5645,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>
@@ -5658,7 +5657,7 @@
 part of using SWIG---the default wrapping behavior is enough in most cases.
 Typemaps are only used if you want to change some aspect of the generated code.
 
-<H3><a name="Java_default_primitive_type_mappings">26.9.1 Default primitive type mappings</a></H3>
+<H3><a name="Java_default_primitive_type_mappings">27.9.1 Default primitive type mappings</a></H3>
 
 
 <p>
@@ -5810,7 +5809,7 @@
 </p>
 
 
-<H3><a name="Java_default_non_primitive_typemaps">26.9.2 Default typemaps for non-primitive types</a></H3>
+<H3><a name="Java_default_non_primitive_typemaps">27.9.2 Default typemaps for non-primitive types</a></H3>
 
 
 <p>
@@ -5825,7 +5824,7 @@
 The Java type is either the proxy class or type wrapper class.
 </p>
 
-<H3><a name="Java_jvm64">26.9.3 Sixty four bit JVMs</a></H3>
+<H3><a name="Java_jvm64">27.9.3 Sixty four bit JVMs</a></H3>
 
 
 <p>
@@ -5838,7 +5837,7 @@
 </p>
 
 
-<H3><a name="Java_what_is_typemap">26.9.4 What is a typemap?</a></H3>
+<H3><a name="Java_what_is_typemap">27.9.4 What is a typemap?</a></H3>
 
 
 <p>
@@ -5961,7 +5960,7 @@
 </pre>
 </div>
 
-<H3><a name="Java_typemaps_c_to_java_types">26.9.5 Typemaps for mapping C/C++ types to Java types</a></H3>
+<H3><a name="Java_typemaps_c_to_java_types">27.9.5 Typemaps for mapping C/C++ types to Java types</a></H3>
 
 
 <p>
@@ -6241,7 +6240,7 @@
 
 </table>
 
-<H3><a name="Java_typemap_attributes">26.9.6 Java typemap attributes</a></H3>
+<H3><a name="Java_typemap_attributes">27.9.6 Java typemap attributes</a></H3>
 
 
 <p>
@@ -6287,7 +6286,7 @@
 Note that when the 'pre' or 'post' attributes are specified and the associated type is used in a constructor, a constructor helper function is generated. This is necessary as the Java proxy constructor wrapper makes a call to a support constructor using a <i>this</i> call. In Java the <i>this</i> call must be the first statement in the constructor body. The constructor body thus calls the helper function and the helper function instead makes the JNI call, ensuring the 'pre' code is called before the JNI call is made. There is a <a href="#Java_date_marshalling">Date marshalling</a> example showing 'pre', 'post' and 'pgcppname' attributes in action.
 </p>
 
-<H3><a name="Java_special_variables">26.9.7 Java special variables</a></H3>
+<H3><a name="Java_special_variables">27.9.7 Java special variables</a></H3>
 
 
 <p>
@@ -6469,7 +6468,7 @@
 <a href="SWIGPlus.html#SWIGPlus_nspace">nspace feature</a>.
 </p>
 
-<H3><a name="Java_typemaps_for_c_and_cpp">26.9.8 Typemaps for both C and C++ compilation</a></H3>
+<H3><a name="Java_typemaps_for_c_and_cpp">27.9.8 Typemaps for both C and C++ compilation</a></H3>
 
 
 <p>
@@ -6506,7 +6505,7 @@
 </p>
 
 
-<H3><a name="Java_code_typemaps">26.9.9 Java code typemaps</a></H3>
+<H3><a name="Java_code_typemaps">27.9.9 Java code typemaps</a></H3>
 
 
 <p>
@@ -6804,7 +6803,7 @@
 </pre>
 </div>
 
-<H3><a name="Java_directors_typemaps">26.9.10 Director specific typemaps</a></H3>
+<H3><a name="Java_directors_typemaps">27.9.10 Director specific typemaps</a></H3>
 
 
 <p>
@@ -7081,7 +7080,7 @@
 
 </div>
 
-<H2><a name="Java_typemap_examples">26.10 Typemap Examples</a></H2>
+<H2><a name="Java_typemap_examples">27.10 Typemap Examples</a></H2>
 
 
 <p>
@@ -7091,7 +7090,7 @@
 </p>
 
 
-<H3><a name="Java_simpler_enum_classes">26.10.1 Simpler Java enums for enums without initializers</a></H3>
+<H3><a name="Java_simpler_enum_classes">27.10.1 Simpler Java enums for enums without initializers</a></H3>
 
 
 <p>
@@ -7170,7 +7169,7 @@
 </p>
 
 
-<H3><a name="Java_exception_typemap">26.10.2 Handling C++ exception specifications as Java exceptions</a></H3>
+<H3><a name="Java_exception_typemap">27.10.2 Handling C++ exception specifications as Java exceptions</a></H3>
 
 
 <p>
@@ -7295,7 +7294,7 @@
 </p>
 
 
-<H3><a name="Java_nan_exception_typemap">26.10.3 NaN Exception - exception handling for a particular type</a></H3>
+<H3><a name="Java_nan_exception_typemap">27.10.3 NaN Exception - exception handling for a particular type</a></H3>
 
 
 <p>
@@ -7450,7 +7449,7 @@
 If we had, we would have put it in the "in" typemap which, like all JNI and Java typemaps, also supports the 'throws' attribute.
 </p>
 
-<H3><a name="Java_converting_java_string_arrays">26.10.4 Converting Java String arrays to char ** </a></H3>
+<H3><a name="Java_converting_java_string_arrays">27.10.4 Converting Java String arrays to char ** </a></H3>
 
 
 <p>
@@ -7594,7 +7593,7 @@
 what Java types to use.
 </p>
 
-<H3><a name="Java_expanding_java_object">26.10.5 Expanding a Java object to multiple arguments</a></H3>
+<H3><a name="Java_expanding_java_object">27.10.5 Expanding a Java object to multiple arguments</a></H3>
 
 
 <p>
@@ -7676,7 +7675,7 @@
 </div>
 
 
-<H3><a name="Java_using_typemaps_return_arguments">26.10.6 Using typemaps to return arguments</a></H3>
+<H3><a name="Java_using_typemaps_return_arguments">27.10.6 Using typemaps to return arguments</a></H3>
 
 
 <p>
@@ -7794,7 +7793,7 @@
 1 12.0  340.0
 </pre></div>
 
-<H3><a name="Java_adding_downcasts">26.10.7 Adding Java downcasts to polymorphic return types</a></H3>
+<H3><a name="Java_adding_downcasts">27.10.7 Adding Java downcasts to polymorphic return types</a></H3>
 
 
 <p>
@@ -8000,7 +7999,7 @@
 Note that the JNI code above uses a number of string lookups to call a constructor, whereas this would not occur using byte compiled Java code.
 </p>
 
-<H3><a name="Java_adding_equals_method">26.10.8 Adding an equals method to the Java classes</a></H3>
+<H3><a name="Java_adding_equals_method">27.10.8 Adding an equals method to the Java classes</a></H3>
 
 
 <p>
@@ -8044,7 +8043,7 @@
 </div>
 
 
-<H3><a name="Java_void_pointers">26.10.9 Void pointers and a common Java base class</a></H3>
+<H3><a name="Java_void_pointers">27.10.9 Void pointers and a common Java base class</a></H3>
 
 
 <p>
@@ -8103,7 +8102,7 @@
     <li> It also has a function which effectively implements a cast from the type of the proxy/type wrapper class to a void pointer. This is necessary for passing a proxy class or a type wrapper class to a function that takes a void pointer.
 </ul>
 
-<H3><a name="Java_struct_pointer_pointer">26.10.10 Struct pointer to pointer</a></H3>
+<H3><a name="Java_struct_pointer_pointer">27.10.10 Struct pointer to pointer</a></H3>
 
 
 <p>
@@ -8283,7 +8282,7 @@
 the Butler class would behave much like any pure Java class and feel more natural to Java users.
 </p>
 
-<H3><a name="Java_memory_management_member_variables">26.10.11 Memory management when returning references to member variables</a></H3>
+<H3><a name="Java_memory_management_member_variables">27.10.11 Memory management when returning references to member variables</a></H3>
 
 
 <p>
@@ -8406,7 +8405,7 @@
 Note the <tt>addReference</tt> call.
 </p>
 
-<H3><a name="Java_memory_management_objects">26.10.12 Memory management for objects passed to the C++ layer</a></H3>
+<H3><a name="Java_memory_management_objects">27.10.12 Memory management for objects passed to the C++ layer</a></H3>
 
 
 <p>
@@ -8534,7 +8533,7 @@
 </pre>
 </div>
 
-<H3><a name="Java_date_marshalling">26.10.13 Date marshalling using the javain typemap and associated attributes</a></H3>
+<H3><a name="Java_date_marshalling">27.10.13 Date marshalling using the javain typemap and associated attributes</a></H3>
 
 
 <p>
@@ -8711,7 +8710,7 @@
 
 
 
-<H2><a name="Java_directors_faq">26.11 Living with Java Directors</a></H2>
+<H2><a name="Java_directors_faq">27.11 Living with Java Directors</a></H2>
 
 
 <p>
@@ -8890,10 +8889,10 @@
   </li>
 </ol>
 
-<H2><a name="Java_odds_ends">26.12 Odds and ends</a></H2>
+<H2><a name="Java_odds_ends">27.12 Odds and ends</a></H2>
 
 
-<H3><a name="Java_javadoc_comments">26.12.1 JavaDoc comments</a></H3>
+<H3><a name="Java_javadoc_comments">27.12.1 JavaDoc comments</a></H3>
 
 
 <p>
@@ -8949,7 +8948,7 @@
 
 
 
-<H3><a name="Java_functional_interface">26.12.2 Functional interface without proxy classes</a></H3>
+<H3><a name="Java_functional_interface">27.12.2 Functional interface without proxy classes</a></H3>
 
 
 <p>
@@ -9010,7 +9009,7 @@
 </p>
 
 
-<H3><a name="Java_using_own_jni_functions">26.12.3 Using your own JNI functions</a></H3>
+<H3><a name="Java_using_own_jni_functions">27.12.3 Using your own JNI functions</a></H3>
 
 
 <p>
@@ -9060,7 +9059,7 @@
 </p>
 
 
-<H3><a name="Java_performance">26.12.4 Performance concerns and hints</a></H3>
+<H3><a name="Java_performance">27.12.4 Performance concerns and hints</a></H3>
 
 
 <p>
@@ -9081,7 +9080,7 @@
 This method normally calls the C++ destructor or <tt>free()</tt> for C code.
 </p>
 
-<H3><a name="Java_debugging">26.12.5 Debugging</a></H3>
+<H3><a name="Java_debugging">27.12.5 Debugging</a></H3>
 
 
 <p>
@@ -9103,7 +9102,7 @@
 </p>
 
 
-<H2><a name="Java_examples">26.13 Java Examples</a></H2>
+<H2><a name="Java_examples">27.13 Java Examples</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html
index c328bbb..cce5b5e 100644
--- a/Doc/Manual/Javascript.html
+++ b/Doc/Manual/Javascript.html
@@ -1,13 +1,13 @@
 <!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>
 <body>
 
-<H1><a name="Javascript">27 SWIG and Javascript</a></H1>
+<H1><a name="Javascript">28 SWIG and Javascript</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -52,21 +52,21 @@
 
 <p>This chapter describes SWIG's support of Javascript. It does not cover SWIG basics, but only information that is specific to this module.</p>
 
-<H2><a name="Javascript_overview">27.1 Overview</a></H2>
+<H2><a name="Javascript_overview">28.1 Overview</a></H2>
 
 
 <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>
 
-<H2><a name="Javascript_preliminaries">27.2 Preliminaries</a></H2>
+<H2><a name="Javascript_preliminaries">28.2 Preliminaries</a></H2>
 
 
-<H3><a name="Javascript_running_swig">27.2.1 Running SWIG</a></H3>
+<H3><a name="Javascript_running_swig">28.2.1 Running SWIG</a></H3>
 
 
 <p>Suppose that you defined a SWIG module such as the following:</p>
@@ -121,7 +121,7 @@
 <b>Note</b>: be aware that <code>v8</code> has a C++ API, and thus, the generated modules must be compiled as C++.
 </p>
 
-<H3><a name="Javascript_running_tests_examples">27.2.2 Running Tests and Examples</a></H3>
+<H3><a name="Javascript_running_tests_examples">28.2.2 Running Tests and Examples</a></H3>
 
 
 <p>The configuration for tests and examples currently supports Linux and Mac only and not MinGW (Windows) yet.</p>
@@ -153,7 +153,7 @@
 $ make check-javascript-examples V8_VERSION=0x032530 ENGINE=v8</pre>
 </div>
 
-<H3><a name="Javascript_known_issues">27.2.3 Known Issues</a></H3>
+<H3><a name="Javascript_known_issues">28.2.3 Known Issues</a></H3>
 
 
 <p>At the moment, the Javascript generators pass all tests syntactically, i.e., the generated source code compiles. However, there are still remaining runtime issues.</p>
@@ -163,19 +163,18 @@
     <li><p>Multiple output arguments do not work for JSC</p></li>
     <li><p>C89 incompatibility: the JSC generator might still generate C89 violating code</p></li>
     <li><p><code>long long</code> is not supported</p></li>
-    <li><p><code>%native</code> is not supported</p></li>
     <li><p>Javascript callbacks are not supported</p></li>
     <li><p><code>instanceOf</code> does not work under JSC</p></li>
 </ul>
 
 <p>The primary development environment has been Linux (Ubuntu 12.04). Windows and Mac OS X have been tested sporadically. Therefore, the generators might have more issues on those platforms. Please report back any problem you observe to help us improving this module quickly.</p>
 
-<H2><a name="Javascript_integration">27.3 Integration</a></H2>
+<H2><a name="Javascript_integration">28.3 Integration</a></H2>
 
 
 <p>This chapter gives a short introduction how to use a native Javascript extension: as a <code>node.js</code> module, and as an extension for an embedded Webkit.</p>
 
-<H3><a name="Javascript_node_extensions">27.3.1 Creating node.js Extensions</a></H3>
+<H3><a name="Javascript_node_extensions">28.3.1 Creating node.js Extensions</a></H3>
 
 
 <p>To install <code>node.js</code> you can download an installer from their <a href="https://launchpad.net/~chris-lea/+archive/node.js">web-site</a> for Mac OS X and Windows. For Linux you can either build the source yourself and run <code>sudo checkinstall</code> or keep to the (probably stone-age) packaged version. For Ubuntu there is a <a href="https://launchpad.net/~chris-lea/+archive/ubuntu/node.js/">PPA</a> available.</p>
@@ -221,7 +220,7 @@
 </div>
 <p>A more detailed explanation is given in the <a href="#Javascript_examples">Examples</a> section.</p>
 
-<H4><a name="Javascript_troubleshooting">27.3.1.1 Troubleshooting</a></H4>
+<H4><a name="Javascript_troubleshooting">28.3.1.1 Troubleshooting</a></H4>
 
 
 <ul>
@@ -233,12 +232,12 @@
 $ sudo apt-get remove gyp</pre>
 </div>
 
-<H3><a name="Javascript_embedded_webkit">27.3.2 Embedded Webkit</a></H3>
+<H3><a name="Javascript_embedded_webkit">28.3.2 Embedded Webkit</a></H3>
 
 
 <p>Webkit is pre-installed on Mac OS X and available as a library for GTK.</p>
 
-<H4><a name="Javascript_osx">27.3.2.1 Mac OS X</a></H4>
+<H4><a name="Javascript_osx">28.3.2.1 Mac OS X</a></H4>
 
 
 <p>There is general information about programming with WebKit on <a href="https://developer.apple.com/library/mac/documentation/cocoa/conceptual/DisplayWebContent/DisplayWebContent.html">Apple Developer Documentation</a>. Details about <code>Cocoa</code> programming are not covered here.</p>
@@ -286,10 +285,10 @@
 @end</pre>
 </div>
 
-<H4><a name="Javascript_gtk">27.3.2.2 GTK</a></H4>
+<H4><a name="Javascript_gtk">28.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>
@@ -331,7 +330,7 @@
 }</pre>
 </div>
 
-<H3><a name="Javascript_applications_webkit">27.3.3 Creating Applications with node-webkit</a></H3>
+<H3><a name="Javascript_applications_webkit">28.3.3 Creating Applications with node-webkit</a></H3>
 
 
 <p>To get started with <code>node-webkit</code> there is a very informative set of <a href="https://github.com/rogerwang/node-webkit/wiki">wiki pages</a>.</p>
@@ -422,12 +421,12 @@
 };</pre>
 </div>
 
-<H2><a name="Javascript_examples">27.4 Examples</a></H2>
+<H2><a name="Javascript_examples">28.4 Examples</a></H2>
 
 
 <p>Some basic examples are shown here in more detail.</p>
 
-<H3><a name="Javascript_simple_example">27.4.1 Simple</a></H3>
+<H3><a name="Javascript_simple_example">28.4.1 Simple</a></H3>
 
 
 <p>The common example <code>simple</code> looks like this:</p>
@@ -477,7 +476,7 @@
 
 <p><b>Note</b>: ECMAScript 5, the currently implemented Javascript standard, does not have modules. <code>node.js</code> and other implementations provide this mechanism defined by the <a href="http://wiki.commonjs.org/wiki/CommonJS">CommonJS</a> group. For browsers this is provided by <a href="http://browserify.org">Browserify</a>, for instance.</p>
 
-<H3><a name="Javascript_class_example">27.4.2 Class</a></H3>
+<H3><a name="Javascript_class_example">28.4.2 Class</a></H3>
 
 
 <p>The common example <code>class</code> defines three classes, <code>Shape</code>, <code>Circle</code>, and <code>Square</code>:</p>
@@ -604,15 +603,15 @@
 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>
+<H2><a name="Javascript_implementation">28.5 Implementation</a></H2>
 
 
 <p>The Javascript Module implementation has taken a very different approach compared to other language modules in order to support different Javascript interpreters.</p>
 
-<H3><a name="Javascript_source_code">27.5.1 Source Code</a></H3>
+<H3><a name="Javascript_source_code">28.5.1 Source Code</a></H3>
 
 
 <p>The Javascript module is implemented in <code>Source/Modules/javascript.cxx</code>. It dispatches the code generation to a <code>JSEmitter</code> instance, <code>V8Emitter</code> or <code>JSCEmitter</code>. Additionally there are some helpers: <code>Template</code>, for templated code generation, and <code>JSEmitterState</code>, which is used to manage state information during AST traversal. This rough map shall make it easier to find a way through this huge source file:</p>
@@ -713,7 +712,7 @@
 ...</pre>
 </div>
 
-<H3><a name="Javascript_code_templates">27.5.2 Code Templates</a></H3>
+<H3><a name="Javascript_code_templates">28.5.2 Code Templates</a></H3>
 
 
 <p>All generated code is created on the basis of code templates. The templates for <em>JavascriptCore</em> can be found in <code>Lib/javascript/jsc/javascriptcode.swg</code>, for <em>v8</em> in <code>Lib/javascript/v8/javascriptcode.swg</code>.</p>
@@ -752,7 +751,7 @@
 </div>
 <p><code>Template</code> creates a copy of that string and <code>Template::replace</code> uses Swig's <code>Replaceall</code> to replace variables in the template. <code>Template::trim</code> can be used to eliminate leading and trailing whitespaces. <code>Template::print</code> is used to write the final template string to a Swig <code>DOH</code> (based on <code>Printv</code>). All methods allow chaining.</p>
 
-<H3><a name="Javascript_emitter">27.5.3 Emitter</a></H3>
+<H3><a name="Javascript_emitter">28.5.3 Emitter</a></H3>
 
 
 <p>The Javascript module delegates code generation to a <code>JSEmitter</code> instance. The following extract shows the essential interface:</p>
@@ -871,7 +870,7 @@
 </div>
 <p>In <code>enterClass</code> the emitter stores state information that is necessary when processing class members. In <code>exitClass</code> the wrapper code for the whole class is generated.</p>
 
-<H3><a name="Javascript_emitter_states">27.5.4 Emitter states</a></H3>
+<H3><a name="Javascript_emitter_states">28.5.4 Emitter states</a></H3>
 
 
 <p>For storing information during the AST traversal the emitter provides a <code>JSEmitterState</code> with different slots to store data representing the scopes global, class, function, and variable.</p>
@@ -915,7 +914,7 @@
 <p>State information can be retrieved using <code>state.clazz(NAME)</code> or with <code>Getattr</code> on <code>state.clazz()</code> which actually returns a <code>Hash</code> instance.</p>
 
 
-<H3><a name="Javascript_jsc_exceptions">27.5.5 Handling Exceptions in JavascriptCore</a></H3>
+<H3><a name="Javascript_jsc_exceptions">28.5.5 Handling Exceptions in JavascriptCore</a></H3>
 
 
 <p>Applications with an embedded JavascriptCore should be able to present detailed exception messages that occur in the Javascript engine. Below is an example derived from code provided by Brian Barnes on how these exception details can be extracted.</p>
diff --git a/Doc/Manual/Library.html b/Doc/Manual/Library.html
index 4ef6aeb..5f72b55 100644
--- a/Doc/Manual/Library.html
+++ b/Doc/Manual/Library.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Library">11 SWIG library</a></H1>
+<H1><a name="Library">12 SWIG library</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -67,7 +67,7 @@
 carefully if you used the old libraries.
 </p>
 
-<H2><a name="Library_nn2">11.1 The %include directive and library search path</a></H2>
+<H2><a name="Library_nn2">12.1 The %include directive and library search path</a></H2>
 
 
 <p>
@@ -99,7 +99,7 @@
 The directories that are searched are displayed when using <tt>-verbose</tt> commandline option.
 </p>
 
-<H2><a name="Library_nn3">11.2 C arrays and pointers</a></H2>
+<H2><a name="Library_nn3">12.2 C arrays and pointers</a></H2>
 
 
 <p>
@@ -111,7 +111,7 @@
 memory, their use is potentially unsafe and you should exercise caution.
 </p>
 
-<H3><a name="Library_nn4">11.2.1 cpointer.i</a></H3>
+<H3><a name="Library_nn4">12.2.1 cpointer.i</a></H3>
 
 
 <p>
@@ -327,7 +327,7 @@
 <b>Note:</b> When working with simple pointers, typemaps can often be used to provide more seamless operation.
 </p>
 
-<H3><a name="Library_carrays">11.2.2 carrays.i</a></H3>
+<H3><a name="Library_carrays">12.2.2 carrays.i</a></H3>
 
 
 <p>
@@ -506,7 +506,7 @@
 SWIG's default handling of these types is to handle them as character strings and the two macros do not do enough to change this.
 </p>
 
-<H3><a name="Library_nn6">11.2.3 cmalloc.i</a></H3>
+<H3><a name="Library_nn6">12.2.3 cmalloc.i</a></H3>
 
 
 <p>
@@ -667,7 +667,7 @@
 </pre>
 </div>
 
-<H3><a name="Library_nn7">11.2.4 cdata.i</a></H3>
+<H3><a name="Library_nn7">12.2.4 cdata.i</a></H3>
 
 
 <p>
@@ -769,7 +769,7 @@
 Clearly they are unsafe.
 </p>
 
-<H2><a name="Library_nn8">11.3 C string handling</a></H2>
+<H2><a name="Library_nn8">12.3 C string handling</a></H2>
 
 
 <p>
@@ -789,7 +789,7 @@
 for manipulating raw C strings.
 </p>
 
-<H3><a name="Library_nn9">11.3.1 Default string handling</a></H3>
+<H3><a name="Library_nn9">12.3.1 Default string handling</a></H3>
 
 
 <p>
@@ -830,7 +830,7 @@
 not work well with binary data. Instead, strings are assumed to be NULL-terminated.
 </p>
 
-<H3><a name="Library_nn10">11.3.2 Passing binary data</a></H3>
+<H3><a name="Library_nn10">12.3.2 Passing binary data</a></H3>
 
 
 <p>
@@ -872,7 +872,7 @@
 The <tt>(char *STRING, int LENGTH)</tt> multi-argument typemap is also available in addition to <tt>(char *STRING, size_t LENGTH)</tt>.
 </p>
 
-<H3><a name="Library_nn11">11.3.3 Using %newobject to release memory</a></H3>
+<H3><a name="Library_nn11">12.3.3 Using %newobject to release memory</a></H3>
 
 
 <p>
@@ -913,7 +913,7 @@
 See <a href="Customization.html#Customization_ownership">Object ownership and %newobject</a> for more details.
 </p>
 
-<H3><a name="Library_nn12">11.3.4 cstring.i</a></H3>
+<H3><a name="Library_nn12">12.3.4 cstring.i</a></H3>
 
 
 <p>
@@ -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
@@ -1373,7 +1373,7 @@
 </li>
 </ul>
 
-<H2><a name="Library_stl_cpp_library">11.4 STL/C++ library</a></H2>
+<H2><a name="Library_stl_cpp_library">12.4 STL/C++ library</a></H2>
 
 
 <p>
@@ -1420,7 +1420,7 @@
 </p>
 
 
-<H3><a name="Library_std_string">11.4.1 std::string</a></H3>
+<H3><a name="Library_std_string">12.4.1 std::string</a></H3>
 
 
 <p>
@@ -1504,7 +1504,7 @@
 </pre>
 </div>
 
-<H3><a name="Library_std_vector">11.4.2 std::vector</a></H3>
+<H3><a name="Library_std_vector">12.4.2 std::vector</a></H3>
 
 
 <p>
@@ -1581,8 +1581,8 @@
 }
 
 void halve_in_place(std::vector&lt;double&gt;&amp; v) {
-  std::transform(v.begin(), v.end(), v.begin(),
-                 std::bind2nd(std::divides&lt;double&gt;(), 2.0));
+  for (std::vector&lt;double&gt;::iterator it = v.begin(); it != v.end(); ++it)
+    *it /= 2.0;
 }
 </pre>
 </div>
@@ -1683,7 +1683,7 @@
 details and the public API exposed to the interpreter vary.
 </p>
 
-<H3><a name="Library_stl_exceptions">11.4.3 STL exceptions</a></H3>
+<H3><a name="Library_stl_exceptions">12.4.3 STL exceptions</a></H3>
 
 
 <p>
@@ -1733,10 +1733,10 @@
 Any thrown STL exceptions will then be gracefully handled instead of causing a crash.
 </p>
 
-<H3><a name="Library_std_shared_ptr">11.4.4 shared_ptr smart pointer</a></H3>
+<H3><a name="Library_std_shared_ptr">12.4.4 shared_ptr smart pointer</a></H3>
 
 
-<H4><a name="Library_shared_ptr_basics">11.4.4.1 shared_ptr basics</a></H4>
+<H4><a name="Library_shared_ptr_basics">12.4.4.1 shared_ptr basics</a></H4>
 
 
 <p>
@@ -1832,7 +1832,7 @@
 </pre>
 </div>
 
-<H4><a name="Library_shared_ptr_inheritance">11.4.4.2 shared_ptr and inheritance</a></H4>
+<H4><a name="Library_shared_ptr_inheritance">12.4.4.2 shared_ptr and inheritance</a></H4>
 
 
 <p>
@@ -1923,7 +1923,7 @@
 </pre>
 </div>
 
-<H4><a name="Library_shared_ptr_overloading">11.4.4.3 shared_ptr and method overloading</a></H4>
+<H4><a name="Library_shared_ptr_overloading">12.4.4.3 shared_ptr and method overloading</a></H4>
 
 
 <p>
@@ -1945,7 +1945,7 @@
 For the interested reader, SWIG detects that they are equivalent types via the <a href=Typemaps.html#Typemaps_typecheck_pointer>typecheck typemaps</a> in the shared_ptr library.
 </p>
 
-<H4><a name="Library_shared_ptr_templates">11.4.4.4 shared_ptr and templates</a></H4>
+<H4><a name="Library_shared_ptr_templates">12.4.4.4 shared_ptr and templates</a></H4>
 
 
 <p>
@@ -1987,7 +1987,7 @@
 </pre>
 </div>
 
-<H4><a name="Library_shared_ptr_directors">11.4.4.5 shared_ptr and directors</a></H4>
+<H4><a name="Library_shared_ptr_directors">12.4.4.5 shared_ptr and directors</a></H4>
 
 
 <p>
@@ -1995,7 +1995,7 @@
 </p>
 
 
-<H3><a name="Library_std_auto_ptr">11.4.5 auto_ptr smart pointer</a></H3>
+<H3><a name="Library_std_auto_ptr">12.4.5 auto_ptr smart pointer</a></H3>
 
 
 <p>
@@ -2044,10 +2044,10 @@
 </pre>
 </div>
 
-<H2><a name="Library_nn16">11.5 Utility Libraries</a></H2>
+<H2><a name="Library_nn16">12.5 Utility Libraries</a></H2>
 
 
-<H3><a name="Library_nn17">11.5.1 exception.i</a></H3>
+<H3><a name="Library_nn17">12.5.1 exception.i</a></H3>
 
 
 <p>
diff --git a/Doc/Manual/Lua.html b/Doc/Manual/Lua.html
index 0fa1ecb..60f7e17 100644
--- a/Doc/Manual/Lua.html
+++ b/Doc/Manual/Lua.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Lua">28 SWIG and Lua</a></H1>
+<H1><a name="Lua">29 SWIG and Lua</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -77,20 +77,20 @@
 
 
 <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>
 </p>
 
-<H2><a name="Lua_nn2">28.1 Preliminaries</a></H2>
+<H2><a name="Lua_nn2">29.1 Preliminaries</a></H2>
 
 
 <p>
 The current SWIG implementation is designed to work with Lua 5.0.x, 5.1.x and 5.2.x. It should work with later versions of Lua, but certainly not with Lua 4.0 due to substantial API changes. It is possible to either static link or dynamic link a Lua module into the interpreter (normally Lua static links its libraries, as dynamic linking is not available on all platforms). SWIG also has support for eLua starting from eLua 0.8. Due to substantial changes between SWIG 2.x and SWIG 3.0 and unavailability of testing platform, eLua status was downgraded to 'experimental'.
 </p>
 
-<H2><a name="Lua_nn3">28.2 Running SWIG</a></H2>
+<H2><a name="Lua_nn3">29.2 Running SWIG</a></H2>
 
 
 <p>
@@ -138,7 +138,7 @@
 The <tt>-elua</tt> option puts all the C function wrappers and variable get/set wrappers in rotables. It also generates a metatable which will control the access to these variables from eLua. It also offers a significant amount of module size compression. On the other hand, the <tt>-eluac</tt> option puts all the wrappers in a single rotable. With this option, no matter how huge the module, it will consume no additional microcontroller SRAM (crass compression). There is a catch though: Metatables are not generated with <tt>-eluac</tt>. To access any value from eLua, one must directly call the wrapper function associated with that value.
 </p>
 
-<H3><a name="Lua_commandline">28.2.1 Additional command line options</a></H3>
+<H3><a name="Lua_commandline">29.2.1 Additional command line options</a></H3>
 
 
 <p>
@@ -179,7 +179,7 @@
 </tr>
 </table>
 
-<H3><a name="Lua_nn4">28.2.2 Compiling and Linking and Interpreter</a></H3>
+<H3><a name="Lua_nn4">29.2.2 Compiling and Linking and Interpreter</a></H3>
 
 
 <p>
@@ -250,7 +250,7 @@
 More information on building and configuring eLua can be found here: <a href="http://www.eluaproject.net/doc/v0.8/en_building.html">http://www.eluaproject.net/doc/v0.8/en_building.html</a>
 </p>
 
-<H3><a name="Lua_nn5">28.2.3 Compiling a dynamic module</a></H3>
+<H3><a name="Lua_nn5">29.2.3 Compiling a dynamic module</a></H3>
 
 
 <p>
@@ -318,7 +318,7 @@
 
 
 
-<H3><a name="Lua_nn6">28.2.4 Using your module</a></H3>
+<H3><a name="Lua_nn6">29.2.4 Using your module</a></H3>
 
 
 <p>
@@ -336,19 +336,19 @@
 &gt;
 </pre></div>
 
-<H2><a name="Lua_nn7">28.3 A tour of basic C/C++ wrapping</a></H2>
+<H2><a name="Lua_nn7">29.3 A tour of basic C/C++ wrapping</a></H2>
 
 
 <p>
 By default, SWIG tries to build a very natural Lua interface to your C/C++ code. This section briefly covers the essential aspects of this wrapping.
 </p>
-<H3><a name="Lua_nn8">28.3.1 Modules</a></H3>
+<H3><a name="Lua_nn8">29.3.1 Modules</a></H3>
 
 
 <p>
 The SWIG module directive specifies the name of the Lua module. If you specify `module example', then everything is wrapped into a Lua table 'example' containing all the functions and variables. When choosing a module name, make sure you don't use the same name as a built-in Lua command or standard module name.
 </p>
-<H3><a name="Lua_nn9">28.3.2 Functions</a></H3>
+<H3><a name="Lua_nn9">29.3.2 Functions</a></H3>
 
 
 <p>
@@ -389,7 +389,7 @@
 24
 </pre></div>
 
-<H3><a name="Lua_nn10">28.3.3 Global variables</a></H3>
+<H3><a name="Lua_nn10">29.3.3 Global variables</a></H3>
 
 
 <p>
@@ -477,7 +477,7 @@
 In general, functions of the form <tt>"variable_get()"</tt> and <tt>"variable_set()"</tt> are automatically generated by SWIG for use with <tt>-eluac</tt>.
 </p>
 
-<H3><a name="Lua_nn11">28.3.4 Constants and enums</a></H3>
+<H3><a name="Lua_nn11">29.3.4 Constants and enums</a></H3>
 
 
 <p>
@@ -512,7 +512,7 @@
 Hello World
 </pre></div>
 
-<H4><a name="Lua_nn13">28.3.4.1 Constants/enums and classes/structures</a></H4>
+<H4><a name="Lua_nn13">29.3.4.1 Constants/enums and classes/structures</a></H4>
 
 
 <p>
@@ -568,7 +568,7 @@
 It is worth mentioning, that <tt>example.Test.TEST1</tt> and <tt>example.Test_TEST1</tt> are different entities and changing one does not change the other. 
 Given the fact that these are constantes and they are not supposed to be changed, it is up to you to avoid such issues.
 </p>
-<H3><a name="Lua_nn12">28.3.5 Pointers</a></H3>
+<H3><a name="Lua_nn12">29.3.5 Pointers</a></H3>
 
 
 <p>
@@ -606,7 +606,7 @@
 nil
 </pre></div>
 
-<H3><a name="Lua_structures">28.3.6 Structures</a></H3>
+<H3><a name="Lua_structures">29.3.6 Structures</a></H3>
 
 
 <p>
@@ -710,7 +710,7 @@
 In general, functions of the form <tt>"new_struct()"</tt>, <tt>"struct_member_get()"</tt>, <tt>"struct_member_set()"</tt> and <tt>"free_struct()"</tt> are automatically generated by SWIG for each structure defined in C. (Please note: This doesn't apply for modules generated with the <tt>-elua</tt> option)
 </p>
 
-<H3><a name="Lua_nn14">28.3.7 C++ classes</a></H3>
+<H3><a name="Lua_nn14">29.3.7 C++ classes</a></H3>
 
 
 <p>
@@ -785,7 +785,7 @@
 However, if the <tt>-no-old-metatable-bindings</tt> option is used, then the backward compatible names are not generated in addition to ordinary ones.
 </p>
 
-<H3><a name="Lua_nn15">28.3.8 C++ inheritance</a></H3>
+<H3><a name="Lua_nn15">29.3.8 C++ inheritance</a></H3>
 
 
 <p>
@@ -810,7 +810,7 @@
 <p>
 It is safe to use multiple inheritance with SWIG.
 </p>
-<H3><a name="Lua_nn16">28.3.9 Pointers, references, values, and arrays</a></H3>
+<H3><a name="Lua_nn16">29.3.9 Pointers, references, values, and arrays</a></H3>
 
 
 <p>
@@ -841,7 +841,7 @@
 <p>
 then all three functions will return a pointer to some Foo object. Since the third function (spam7) returns a value, newly allocated memory is used to hold the result and a pointer is returned (Lua will release this memory when the return value is garbage collected). The other two are pointers which are assumed to be managed by the C code and so will not be garbage collected.
 </p>
-<H3><a name="Lua_nn17">28.3.10 C++ overloaded functions</a></H3>
+<H3><a name="Lua_nn17">29.3.10 C++ overloaded functions</a></H3>
 
 
 <p>
@@ -927,7 +927,7 @@
 <p>
 Dealing with the Lua coercion mechanism, the priority is roughly (integers, floats, strings, userdata). But it is better to rename the functions rather than rely upon the ordering.
 </p>
-<H3><a name="Lua_nn18">28.3.11 C++ operators</a></H3>
+<H3><a name="Lua_nn18">29.3.11 C++ operators</a></H3>
 
 
 <p>
@@ -1059,7 +1059,7 @@
 </ul>
 <p>No other lua metafunction is inherited. For example, __gc is not inherited and must be redefined in every class. <tt>__tostring</tt> is subject to a special handling. If absent in class and in class bases, a default one will be provided by SWIG.
 </p>
-<H3><a name="Lua_nn19">28.3.12 Class extension with %extend</a></H3>
+<H3><a name="Lua_nn19">29.3.12 Class extension with %extend</a></H3>
 
 
 <p>
@@ -1116,7 +1116,7 @@
 Extend works with both C and C++ code, on classes and structs. It does not modify the underlying object in any way---the extensions only show up in the Lua interface. The only item to take note of is the code has to use the '$self' instead of 'this', and that you cannot access protected/private members of the code (as you are not officially part of the class).
 </p>
 
-<H3><a name="Lua_nn20">28.3.13 Using %newobject to release memory</a></H3>
+<H3><a name="Lua_nn20">29.3.13 Using %newobject to release memory</a></H3>
 
 
 <p> If you have a function that allocates memory like this,</p>
@@ -1140,7 +1140,7 @@
 </div>
 <p> This will release the allocated memory.</p>
 
-<H3><a name="Lua_nn21">28.3.14 C++ templates</a></H3>
+<H3><a name="Lua_nn21">29.3.14 C++ templates</a></H3>
 
 
 <p>
@@ -1175,7 +1175,7 @@
 <p>
 Obviously, there is more to template wrapping than shown in this example. More details can be found in the SWIG and C++ chapter. Some more complicated examples will appear later.
 </p>
-<H3><a name="Lua_nn22">28.3.15 C++ Smart Pointers</a></H3>
+<H3><a name="Lua_nn22">29.3.15 C++ Smart Pointers</a></H3>
 
 
 <p>
@@ -1227,7 +1227,7 @@
 &gt; f = p:__deref__()     -- Returns underlying Foo *
 </pre></div>
 
-<H3><a name="Lua_nn23">28.3.16 C++ Exceptions</a></H3>
+<H3><a name="Lua_nn23">29.3.16 C++ Exceptions</a></H3>
 
 
 <p>
@@ -1370,7 +1370,7 @@
 add exception specification to functions or globally (respectively).
 </p>
 
-<H3><a name="Lua_namespaces">28.3.17 Namespaces </a></H3>
+<H3><a name="Lua_namespaces">29.3.17 Namespaces </a></H3>
 
 
 <p>
@@ -1421,7 +1421,7 @@
 19
 &gt;
 </pre></div>
-<H4><a name="Lua_nn27">28.3.17.1 Compatibility Note </a></H4>
+<H4><a name="Lua_nn27">29.3.17.1 Compatibility Note </a></H4>
 
 
 <p>
@@ -1437,7 +1437,7 @@
 </pre></div>
 
 
-<H4><a name="Lua_nn29">28.3.17.2 Names </a></H4>
+<H4><a name="Lua_nn29">29.3.17.2 Names </a></H4>
 
 
 <p> If SWIG is launched without <tt>-no-old-metatable-bindings</tt> option, then it enters backward-compatible mode. While in this mode, it tries
@@ -1481,7 +1481,7 @@
 &gt;
 </pre></div>
 
-<H4><a name="Lua_nn30">28.3.17.3 Inheritance </a></H4>
+<H4><a name="Lua_nn30">29.3.17.3 Inheritance </a></H4>
 
 
 <p> The internal organization of inheritance has changed. 
@@ -1522,12 +1522,12 @@
 &gt;
 </pre></div>
 
-<H2><a name="Lua_nn24">28.4 Typemaps</a></H2>
+<H2><a name="Lua_nn24">29.4 Typemaps</a></H2>
 
 
 <p>This section explains what typemaps are and how to use them. The default wrapping behaviour of SWIG is enough in most cases. However sometimes SWIG may need a little additional assistance to know which typemap to apply to provide the best wrapping. This section will be explaining how to use typemaps to best effect</p>
 
-<H3><a name="Lua_nn25">28.4.1 What is a typemap?</a></H3>
+<H3><a name="Lua_nn25">29.4.1 What is a typemap?</a></H3>
 
 
 <p>A typemap is nothing more than a code generation rule that is attached to a specific C datatype. For example, to convert integers from Lua to C, you might define a typemap like this:</p>
@@ -1555,7 +1555,7 @@
 720
 </pre></div>
 
-<H3><a name="Lua_nn26">28.4.2 Using typemaps</a></H3>
+<H3><a name="Lua_nn26">29.4.2 Using typemaps</a></H3>
 
 
 <p>There are many ready written typemaps built into SWIG for all common types (int, float, short, long, char*, enum and more), which SWIG uses automatically, with no effort required on your part.</p>
@@ -1608,7 +1608,7 @@
 
 <p>Note: C++ references must be handled exactly the same way. However SWIG will automatically wrap a <tt>const int&amp;</tt>  as an input parameter (since that it obviously input).</p>
 
-<H3><a name="Lua_typemap_arrays">28.4.3 Typemaps and arrays</a></H3>
+<H3><a name="Lua_typemap_arrays">29.4.3 Typemaps and arrays</a></H3>
 
 
 <p>Arrays present a challenge for SWIG, because like pointers SWIG does not know whether these are input or output values, nor
@@ -1672,7 +1672,7 @@
 
 <p>Note: SWIG also can support arrays of pointers in a similar manner.</p>
 
-<H3><a name="Lua_typemaps_ptr_ptr_functions">28.4.4 Typemaps and pointer-pointer functions</a></H3>
+<H3><a name="Lua_typemaps_ptr_ptr_functions">29.4.4 Typemaps and pointer-pointer functions</a></H3>
 
 
 <p>Several C++ libraries use a pointer-pointer functions to create its objects. These functions require a pointer to a pointer which is then filled with the pointer to the new object. Microsoft's COM and DirectX as well as many other libraries have this kind of function. An example is given below:</p>
@@ -1706,7 +1706,7 @@
 ptr=nil -- the iMath* will be GC'ed as normal
 </pre></div>
 
-<H2><a name="Lua_writing_typemaps">28.5 Writing typemaps</a></H2>
+<H2><a name="Lua_writing_typemaps">29.5 Writing typemaps</a></H2>
 
 
 <p>This section describes how you can modify SWIG's default wrapping behavior for various C/C++ datatypes using the <tt>%typemap</tt> directive. This is an advanced topic that assumes familiarity with the Lua C API as well as the material in the "<a href="Typemaps.html#Typemaps">Typemaps</a>" chapter.</p>
@@ -1715,7 +1715,7 @@
 
 <p>Before proceeding, you should read the previous section on using typemaps, and look at the existing typemaps found in luatypemaps.swg and typemaps.i. These are both well documented and fairly easy to read. You should not attempt to write your own typemaps until you have read and can understand both of these files (they may well also give you an idea to base your work on).</p>
 
-<H3><a name="Lua_typemaps_write">28.5.1 Typemaps you can write</a></H3>
+<H3><a name="Lua_typemaps_write">29.5.1 Typemaps you can write</a></H3>
 
 
 <p>There are many different types of typemap that can be written, the full list can be found in the "<a href="Typemaps.html#Typemaps">Typemaps</a>" chapter. However the following are the most commonly used ones.</p>
@@ -1728,7 +1728,7 @@
 (the syntax for the typecheck is different from the typemap, see typemaps for details).</li>
 </ul>
 
-<H3><a name="Lua_nn31">28.5.2 SWIG's Lua-C API</a></H3>
+<H3><a name="Lua_nn31">29.5.2 SWIG's Lua-C API</a></H3>
 
 
 <p>This section explains the SWIG specific Lua-C API. It does not cover the main Lua-C api, as this is well documented and not worth covering.</p>
@@ -1777,7 +1777,7 @@
 <div class="indent">
 Similar to SWIG_fail_arg, except that it will display the swig_type_info information instead.</div>
 
-<H2><a name="Lua_nn32">28.6 Customization of your Bindings</a></H2>
+<H2><a name="Lua_nn32">29.6 Customization of your Bindings</a></H2>
 
 
 <p>
@@ -1786,7 +1786,7 @@
 
 
 
-<H3><a name="Lua_nn33">28.6.1 Writing your own custom wrappers</a></H3>
+<H3><a name="Lua_nn33">29.6.1 Writing your own custom wrappers</a></H3>
 
 
 <p>
@@ -1805,7 +1805,7 @@
 The <tt>%native</tt> directive in the above example, tells SWIG that there is a function <tt>int native_function(lua_State*L);</tt> which is to be added into the module under the name '<tt>my_func</tt>'. SWIG will not add any wrapper for this function, beyond adding it into the function table. How you write your code is entirely up to you.
 </p>
 
-<H3><a name="Lua_nn34">28.6.2 Adding additional Lua code</a></H3>
+<H3><a name="Lua_nn34">29.6.2 Adding additional Lua code</a></H3>
 
 
 <p>
@@ -1843,7 +1843,7 @@
 See Examples/lua/arrays for an example of this code.
 </p>
 
-<H2><a name="Lua_nn35">28.7 Details on the Lua binding</a></H2>
+<H2><a name="Lua_nn35">29.7 Details on the Lua binding</a></H2>
 
 
 <p>
@@ -1854,7 +1854,7 @@
  </i>
 </p>
 
-<H3><a name="Lua_nn36">28.7.1 Binding global data into the module.</a></H3>
+<H3><a name="Lua_nn36">29.7.1 Binding global data into the module.</a></H3>
 
 
 <p>
@@ -1914,7 +1914,7 @@
 <p>
 That way when you call '<tt>a=example.Foo</tt>', the interpreter looks at the table 'example' sees that there is no field 'Foo' and calls __index. This will in turn check in '.get' table and find the existence of 'Foo' and then return the value of the C function call 'Foo_get()'. Similarly for the code '<tt>example.Foo=10</tt>', the interpreter will check the table, then call the __newindex which will then check the '.set' table and call the C function 'Foo_set(10)'.
 </p>
-<H3><a name="Lua_nn37">28.7.2 Userdata and Metatables</a></H3>
+<H3><a name="Lua_nn37">29.7.2 Userdata and Metatables</a></H3>
 
 
 <p>
@@ -1994,7 +1994,7 @@
 <p>
 Note: Operator overloads are basically done in the same way, by adding functions such as '__add' &amp; '__call' to the class' metatable. The current implementation is a bit rough as it will add any member function beginning with '__' into the metatable too, assuming its an operator overload.
 </p>
-<H3><a name="Lua_nn38">28.7.3 Memory management</a></H3>
+<H3><a name="Lua_nn38">29.7.3 Memory management</a></H3>
 
 
 <p>
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/Modules.html b/Doc/Manual/Modules.html
index 7efd74e..b9b7b2b 100644
--- a/Doc/Manual/Modules.html
+++ b/Doc/Manual/Modules.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Modules">19 Working with Modules</a></H1>
+<H1><a name="Modules">20 Working with Modules</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -24,7 +24,7 @@
 
 
 
-<H2><a name="Modules_introduction">19.1 Modules Introduction</a></H2>
+<H2><a name="Modules_introduction">20.1 Modules Introduction</a></H2>
 
 
 <p>
@@ -78,7 +78,7 @@
 Each module in the collection is created via separate invocations of SWIG.
 </p>
 
-<H2><a name="Modules_nn1">19.2 Basics</a></H2>
+<H2><a name="Modules_nn1">20.2 Basics</a></H2>
 
 
 <p>
@@ -177,7 +177,7 @@
 issue, read on.
 </p>
 
-<H2><a name="Modules_nn2">19.3 The SWIG runtime code</a></H2>
+<H2><a name="Modules_nn2">20.3 The SWIG runtime code</a></H2>
 
 
 <p>
@@ -243,7 +243,7 @@
 is empty. Only modules compiled with the same pair will share type information.
 </p>
 
-<H2><a name="Modules_external_run_time">19.4 External access to the runtime</a></H2>
+<H2><a name="Modules_external_run_time">20.4 External access to the runtime</a></H2>
 
 
 <p>As described in <a href="Typemaps.html#Typemaps_runtime_type_checker">The run-time type checker</a>,
@@ -282,7 +282,7 @@
 access.
 </p>
 
-<H2><a name="Modules_nn4">19.5 A word of caution about static libraries</a></H2>
+<H2><a name="Modules_nn4">20.5 A word of caution about static libraries</a></H2>
 
 
 <p>
@@ -293,7 +293,7 @@
 behavior. When working with dynamically loadable modules, you should try to work exclusively with shared libraries.
 </p>
 
-<H2><a name="Modules_nn5">19.6 References</a></H2>
+<H2><a name="Modules_nn5">20.6 References</a></H2>
 
 
 <p>
@@ -301,7 +301,7 @@
 an outside reference.  John Levine's "Linkers and Loaders" is highly recommended.
 </p>
 
-<H2><a name="Modules_nn6">19.7 Reducing the wrapper file size</a></H2>
+<H2><a name="Modules_nn6">20.7 Reducing the wrapper file size</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Mzscheme.html b/Doc/Manual/Mzscheme.html
index 860a5c4..cff511a 100644
--- a/Doc/Manual/Mzscheme.html
+++ b/Doc/Manual/Mzscheme.html
@@ -8,7 +8,7 @@
 
 <body bgcolor="#ffffff">
 
-<H1><a name="Mzscheme">37 SWIG and MzScheme/Racket</a></H1>
+<H1><a name="Mzscheme">38 SWIG and MzScheme/Racket</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -24,7 +24,7 @@
 <p>
 This section contains information on SWIG's support of Racket, formally known as MzScheme.
 
-<H2><a name="MzScheme_nn2">37.1 Creating native structures</a></H2>
+<H2><a name="MzScheme_nn2">38.1 Creating native structures</a></H2>
 
 
 <p>
@@ -65,7 +65,7 @@
 </pre>
 </div>
 
-<H2><a name="MzScheme_simple">37.2 Simple example</a></H2>
+<H2><a name="MzScheme_simple">38.2 Simple example</a></H2>
 
 
 <p>
@@ -166,11 +166,11 @@
   <li> The above requests mzc to create an extension using the CGC garbage-collector. The alternative -- the 3m collector -- has generally better performance, but work is still required for SWIG to emit code which is compatible with it.
 </ul>
 
-<H2><a name="MzScheme_external_docs">37.3 External documentation</a></H2>
+<H2><a name="MzScheme_external_docs">38.3 External documentation</a></H2>
 
 
 <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/Ocaml.html b/Doc/Manual/Ocaml.html
index 92b5260..4ae07e9 100644
--- a/Doc/Manual/Ocaml.html
+++ b/Doc/Manual/Ocaml.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Ocaml">38 SWIG and OCaml</a></H1>
+<H1><a name="Ocaml">39 SWIG and OCaml</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -88,7 +88,7 @@
 <a href="http://ocaml.org/">The Ocaml Website</a>.
 </p>
 
-<H2><a name="Ocaml_nn2">38.1 Preliminaries</a></H2>
+<H2><a name="Ocaml_nn2">39.1 Preliminaries</a></H2>
 
 
 <p>
@@ -106,7 +106,7 @@
 will be loaded dynamically.  This has only been tested on Linux so far.
 </p>
 
-<H3><a name="Ocaml_nn3">38.1.1 Running SWIG</a></H3>
+<H3><a name="Ocaml_nn3">39.1.1 Running SWIG</a></H3>
 
 
 <p>
@@ -129,7 +129,7 @@
 the resulting .ml and .mli files as well, and do the final link with -custom
 (not needed for native link).</p>
 
-<H3><a name="Ocaml_nn4">38.1.2 Compiling the code</a></H3>
+<H3><a name="Ocaml_nn4">39.1.2 Compiling the code</a></H3>
 
 
 <p>
@@ -166,7 +166,7 @@
 </pre>
 </div>
 
-<H3><a name="Ocaml_nn5">38.1.3 The camlp4 module</a></H3>
+<H3><a name="Ocaml_nn5">39.1.3 The camlp4 module</a></H3>
 
 
 <p>
@@ -242,7 +242,7 @@
 </td></tr>
 </table>
 
-<H3><a name="Ocaml_nn6">38.1.4 Using your module</a></H3>
+<H3><a name="Ocaml_nn6">39.1.4 Using your module</a></H3>
 
 
 <p>
@@ -256,7 +256,7 @@
 option is not needed when you build native code.
 </p>
 
-<H3><a name="Ocaml_nn7">38.1.5 Compilation problems and compiling with C++</a></H3>
+<H3><a name="Ocaml_nn7">39.1.5 Compilation problems and compiling with C++</a></H3>
 
 
 <p>
@@ -267,7 +267,7 @@
 Most code meant to be compiled as C++ will not have problems.
 </p>
 
-<H2><a name="Ocaml_nn8">38.2 The low-level Ocaml/C interface</a></H2>
+<H2><a name="Ocaml_nn8">39.2 The low-level Ocaml/C interface</a></H2>
 
 
 <p>
@@ -367,7 +367,7 @@
 signature for a function that uses value in this way.
 </p>
 
-<H3><a name="Ocaml_nn9">38.2.1 The generated module</a></H3>
+<H3><a name="Ocaml_nn9">39.2.1 The generated module</a></H3>
 
 
 <p>
@@ -401,7 +401,7 @@
 </td></tr>
 </table>
 
-<H3><a name="Ocaml_nn10">38.2.2 Enums</a></H3>
+<H3><a name="Ocaml_nn10">39.2.2 Enums</a></H3>
 
 
 <p>
@@ -464,7 +464,7 @@
 </pre>
 </div>
 
-<H4><a name="Ocaml_nn11">38.2.2.1 Enum typing in Ocaml</a></H4>
+<H4><a name="Ocaml_nn11">39.2.2.1 Enum typing in Ocaml</a></H4>
 
 
 <p>
@@ -477,10 +477,10 @@
 values using the swig_val function before sharing them with another module.
 </p>
 
-<H3><a name="Ocaml_nn12">38.2.3 Arrays</a></H3>
+<H3><a name="Ocaml_nn12">39.2.3 Arrays</a></H3>
 
 
-<H4><a name="Ocaml_nn13">38.2.3.1 Simple types of bounded arrays</a></H4>
+<H4><a name="Ocaml_nn13">39.2.3.1 Simple types of bounded arrays</a></H4>
 
 
 <p>
@@ -501,7 +501,7 @@
 for arrays whose bounds are completely specified.
 </p>
 
-<H4><a name="Ocaml_nn14">38.2.3.2 Complex and unbounded arrays</a></H4>
+<H4><a name="Ocaml_nn14">39.2.3.2 Complex and unbounded arrays</a></H4>
 
 
 <p>
@@ -514,7 +514,7 @@
 so you have to specify it for yourself in the form of a typemap.
 </p>
 
-<H4><a name="Ocaml_nn15">38.2.3.3 Using an object</a></H4>
+<H4><a name="Ocaml_nn15">39.2.3.3 Using an object</a></H4>
 
 
 <p>
@@ -528,7 +528,7 @@
 such as using a required sentinel, etc.
 </p>
 
-<H4><a name="Ocaml_nn16">38.2.3.4 Example typemap for a function taking float * and int</a></H4>
+<H4><a name="Ocaml_nn16">39.2.3.4 Example typemap for a function taking float * and int</a></H4>
 
 
 <p>
@@ -579,7 +579,7 @@
 </pre></td></tr></table>
 
 
-<H3><a name="Ocaml_nn17">38.2.4 C++ Classes</a></H3>
+<H3><a name="Ocaml_nn17">39.2.4 C++ Classes</a></H3>
 
 
 <p>
@@ -622,7 +622,7 @@
 returned value for the same object.
 </p>
 
-<H4><a name="Ocaml_nn18">38.2.4.1 STL vector and string Example</a></H4>
+<H4><a name="Ocaml_nn18">39.2.4.1 STL vector and string Example</a></H4>
 
 
 <p>
@@ -702,7 +702,7 @@
 #
 </pre></div>
 
-<H4><a name="Ocaml_nn19">38.2.4.2 C++ Class Example</a></H4>
+<H4><a name="Ocaml_nn19">39.2.4.2 C++ Class Example</a></H4>
 
 
 <p>
@@ -732,7 +732,7 @@
 };
 </pre></td></tr></table>
 
-<H4><a name="Ocaml_nn20">38.2.4.3 Compiling the example</a></H4>
+<H4><a name="Ocaml_nn20">39.2.4.3 Compiling the example</a></H4>
 
 
 <div class="code"><pre>
@@ -750,7 +750,7 @@
   -L$QTPATH/lib -cclib -lqt
 </pre></div>
 
-<H4><a name="Ocaml_nn21">38.2.4.4 Sample Session</a></H4>
+<H4><a name="Ocaml_nn21">39.2.4.4 Sample Session</a></H4>
 
 
 <div class="code"><pre>
@@ -777,10 +777,10 @@
 containing the string "hi" in a button.
 </p>
 
-<H3><a name="Ocaml_nn22">38.2.5 Director Classes</a></H3>
+<H3><a name="Ocaml_nn22">39.2.5 Director Classes</a></H3>
 
 
-<H4><a name="Ocaml_nn23">38.2.5.1 Director Introduction</a></H4>
+<H4><a name="Ocaml_nn23">39.2.5.1 Director Introduction</a></H4>
 
 
 <p>
@@ -807,7 +807,7 @@
 };
 </pre></div>
 
-<H4><a name="Ocaml_nn24">38.2.5.2 Overriding Methods in Ocaml</a></H4>
+<H4><a name="Ocaml_nn24">39.2.5.2 Overriding Methods in Ocaml</a></H4>
 
 
 <p>
@@ -835,7 +835,7 @@
 an overloaded class.  This example is contained in Examples/ocaml/shapes.
 </p>
 
-<H4><a name="Ocaml_nn25">38.2.5.3 Director Usage Example</a></H4>
+<H4><a name="Ocaml_nn25">39.2.5.3 Director Usage Example</a></H4>
 
 
 <table border="1" bgcolor="#dddddd" summary="Director usage example">
@@ -896,7 +896,7 @@
 program in C++.
 </p>
 
-<H4><a name="Ocaml_nn26">38.2.5.4 Creating director objects</a></H4>
+<H4><a name="Ocaml_nn26">39.2.5.4 Creating director objects</a></H4>
 
 
 <p>
@@ -937,7 +937,7 @@
 properly.
 </p>
 
-<H4><a name="Ocaml_nn27">38.2.5.5 Typemaps for directors, directorin, directorout, directorargout</a></H4>
+<H4><a name="Ocaml_nn27">39.2.5.5 Typemaps for directors, directorin, directorout, directorargout</a></H4>
 
 
 <p>
@@ -948,7 +948,7 @@
 and to receive arguments the same way you normally receive function returns.
 </p>
 
-<H4><a name="Ocaml_nn28">38.2.5.6 directorin typemap</a></H4>
+<H4><a name="Ocaml_nn28">39.2.5.6 directorin typemap</a></H4>
 
 
 <p>
@@ -959,7 +959,7 @@
 can use the same body as a simple <tt>out</tt> typemap.
 </p>
 
-<H4><a name="Ocaml_nn29">38.2.5.7 directorout typemap</a></H4>
+<H4><a name="Ocaml_nn29">39.2.5.7 directorout typemap</a></H4>
 
 
 <p>
@@ -970,7 +970,7 @@
 ownership, etc.
 </p>
 
-<H4><a name="Ocaml_nn30">38.2.5.8 directorargout typemap</a></H4>
+<H4><a name="Ocaml_nn30">39.2.5.8 directorargout typemap</a></H4>
 
 
 <p>
@@ -987,7 +987,7 @@
 values will read zero, and struct or object returns have undefined results.
 </p>
 
-<H3><a name="Ocaml_nn31">38.2.6 Exceptions</a></H3>
+<H3><a name="Ocaml_nn31">39.2.6 Exceptions</a></H3>
 
 
 <p>
@@ -1075,7 +1075,7 @@
 to raise exceptions.  See the <a href="Library.html#Library">SWIG Library</a> chapter.
 </p>
 
-<H2><a name="Ocaml_nn32">38.3 Documentation Features</a></H2>
+<H2><a name="Ocaml_nn32">39.3 Documentation Features</a></H2>
 
 
 <p>
@@ -1084,7 +1084,7 @@
 <a href="https://caml.inria.fr/pub/docs/manual-ocaml/ocamldoc.html">OCamldoc</a>.
 </p>
 
-<H3><a name="Ocaml_nn33">38.3.1 Module docstring</a></H3>
+<H3><a name="Ocaml_nn33">39.3.1 Module docstring</a></H3>
 
 
 <p>
diff --git a/Doc/Manual/Octave.html b/Doc/Manual/Octave.html
index bd6b08f..bdef5db 100644
--- a/Doc/Manual/Octave.html
+++ b/Doc/Manual/Octave.html
@@ -9,7 +9,7 @@
 
 <body bgcolor="#ffffff">
 
-<H1><a name="Octave">29 SWIG and Octave</a></H1>
+<H1><a name="Octave">30 SWIG and Octave</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -60,7 +60,7 @@
 Also, there are a dozen or so examples in the Examples/octave directory, and hundreds in the test suite (Examples/test-suite and Examples/test-suite/octave).
 </p>
 
-<H2><a name="Octave_nn2">29.1 Preliminaries</a></H2>
+<H2><a name="Octave_nn2">30.1 Preliminaries</a></H2>
 
 
 <p>
@@ -76,7 +76,7 @@
 The SWIG runtime exports the function <tt>swig_octave_prereq()</tt> for checking the version of Octave.
 </p>
 
-<H2><a name="Octave_nn3">29.2 Running SWIG</a></H2>
+<H2><a name="Octave_nn3">30.2 Running SWIG</a></H2>
 
 
 <p>
@@ -108,7 +108,7 @@
 This creates a C++ source file "example_wrap.cpp". A C++ file is generated even when wrapping C code as Octave is itself written in C++ and requires wrapper code to be in the same language. The generated C++ source file contains the low-level wrappers that need to be compiled and linked with the rest of your C/C++ application (in this case, the gcd implementation) to create an extension module.
 </p>
 
-<H3><a name="Octave_nn4">29.2.1 Command-line options</a></H3>
+<H3><a name="Octave_nn4">30.2.1 Command-line options</a></H3>
 
 
 <p>
@@ -131,7 +131,7 @@
 The <em>-opprefix</em> options sets the prefix of the names of global/friend <a href="#Octave_nn18">operator</a> functions.
 </p>
 
-<H3><a name="Octave_nn5">29.2.2 Compiling a dynamic module</a></H3>
+<H3><a name="Octave_nn5">30.2.2 Compiling a dynamic module</a></H3>
 
 
 <p>
@@ -158,7 +158,7 @@
 
           <div class="targetlang"><pre>octave:1&gt; swigexample</pre></div>
 
-<H3><a name="Octave_nn6">29.2.3 Using your module</a></H3>
+<H3><a name="Octave_nn6">30.2.3 Using your module</a></H3>
 
 
 <p>
@@ -176,10 +176,10 @@
 octave:5&gt; swigexample.cvar.Foo
 ans =  4 </pre></div>
 
-<H2><a name="Octave_nn7">29.3 A tour of basic C/C++ wrapping</a></H2>
+<H2><a name="Octave_nn7">30.3 A tour of basic C/C++ wrapping</a></H2>
 
 
-<H3><a name="Octave_nn8">29.3.1 Modules</a></H3>
+<H3><a name="Octave_nn8">30.3.1 Modules</a></H3>
 
 
 <p>
@@ -224,7 +224,7 @@
 ans =  2
 </pre></div>
 
-<H3><a name="Octave_nn9">29.3.2 Functions</a></H3>
+<H3><a name="Octave_nn9">30.3.2 Functions</a></H3>
 
 
 <p>
@@ -241,7 +241,7 @@
     <div class="targetlang"><pre>octave:1&gt; swigexample.fact(4)
 24 </pre></div>
 
-<H3><a name="Octave_nn10">29.3.3 Global variables</a></H3>
+<H3><a name="Octave_nn10">30.3.3 Global variables</a></H3>
 
 
 <p>
@@ -294,7 +294,7 @@
 octave:3&gt; swigexample.PI
 ans =  3.1420 </pre></div>
 
-<H3><a name="Octave_nn11">29.3.4 Constants and enums</a></H3>
+<H3><a name="Octave_nn11">30.3.4 Constants and enums</a></H3>
 
 
 <p>
@@ -316,7 +316,7 @@
 swigexample.SUNDAY=0
 .... </pre></div>
 
-<H3><a name="Octave_nn12">29.3.5 Pointers</a></H3>
+<H3><a name="Octave_nn12">30.3.5 Pointers</a></H3>
 
 
 <p>
@@ -363,7 +363,7 @@
 error: value on right hand side of assignment is undefined
 error: evaluating assignment expression near line 2, column 2 </pre></div>
 
-<H3><a name="Octave_nn13">29.3.6 Structures and C++ classes</a></H3>
+<H3><a name="Octave_nn13">30.3.6 Structures and C++ classes</a></H3>
 
 
 <p>
@@ -498,7 +498,7 @@
 Depending on the ownership setting of a <tt>swig_ref</tt>, it may call C++ destructors when its reference count goes to zero. See the section on memory management below for details.
 </p>
 
-<H3><a name="Octave_nn15">29.3.7 C++ inheritance</a></H3>
+<H3><a name="Octave_nn15">30.3.7 C++ inheritance</a></H3>
 
 
 <p>
@@ -507,7 +507,7 @@
 the tree is walked to find a match in the current class as well as any of its bases. The lookup is then cached in the <tt>swig_ref</tt>.
 </p>
 
-<H3><a name="Octave_nn17">29.3.8 C++ overloaded functions</a></H3>
+<H3><a name="Octave_nn17">30.3.8 C++ overloaded functions</a></H3>
 
 
 <p>
@@ -517,7 +517,7 @@
 <tt>typecheck</tt> typemaps are used to analyze each argument, as well as assign precedence. See the chapter on typemaps for details.
 </p>
 
-<H3><a name="Octave_nn18">29.3.9 C++ operators</a></H3>
+<H3><a name="Octave_nn18">30.3.9 C++ operators</a></H3>
 
 
 <p>
@@ -621,7 +621,7 @@
 Octave can also utilise friend (i.e. non-member) operators with a simple %rename: see the example in the Examples/octave/operator directory.
 </p>
 
-<H3><a name="Octave_nn19">29.3.10 Class extension with %extend</a></H3>
+<H3><a name="Octave_nn19">30.3.10 Class extension with %extend</a></H3>
 
 
 <p>
@@ -660,7 +660,7 @@
 Octave 3.8.0 and later versions will also map unary functions X() to the corresponding <tt>__X__</tt> method, where X includes: abs(), acos(), acosh(), angle(), arg(), asin(), asinh(), atan(), atanh(), cbrt(), ceil(), conj(), cos(), cosh(), dawson(), erf(), erfc(), erfcinv(), erfcx(), erfi(), erfinv(), exp(), expm1(), finite(), fix(), floor(), gamma(), imag(), isalnum(), isalpha(), isascii(), iscntrl(), isdigit(), isgraph(), isinf(), islower(), isna(), isnan(), isprint(), ispunct(), isspace(), isupper(), isxdigit(), lgamma(), log(), log10(), log1p(), log2(), real(), round(), roundb(), signbit(), signum(), sin(), sinh(), sqrt(), tan(), tanh(), toascii(), tolower(), toupper()
 </p>
 
-<H3><a name="Octave_nn20">29.3.11 C++ templates</a></H3>
+<H3><a name="Octave_nn20">30.3.11 C++ templates</a></H3>
 
 
 <p>
@@ -737,10 +737,10 @@
 </pre></div>
 
 
-<H3><a name="Octave_nn21">29.3.12 C++ Smart Pointers</a></H3>
+<H3><a name="Octave_nn21">30.3.12 C++ Smart Pointers</a></H3>
 
 
-<H4><a name="Octave_smart_pointers_shared_ptr">29.3.12.1 The shared_ptr Smart Pointer</a></H4>
+<H4><a name="Octave_smart_pointers_shared_ptr">30.3.12.1 The shared_ptr Smart Pointer</a></H4>
 
 
 <p>
@@ -751,14 +751,14 @@
 </p>
 
 
-<H4><a name="Octave_smart_pointers_generic">29.3.12.2 Generic Smart Pointers</a></H4>
+<H4><a name="Octave_smart_pointers_generic">30.3.12.2 Generic Smart Pointers</a></H4>
 
 
 <p>
 C++ smart pointers are fully supported as in other modules.
 </p>
 
-<H3><a name="Octave_nn22">29.3.13 Directors (calling Octave from C++ code)</a></H3>
+<H3><a name="Octave_nn22">30.3.13 Directors (calling Octave from C++ code)</a></H3>
 
 
 <p>
@@ -839,14 +839,14 @@
 octave-side routine called
 </pre></div>
 
-<H3><a name="Octave_nn23">29.3.14 Threads</a></H3>
+<H3><a name="Octave_nn23">30.3.14 Threads</a></H3>
 
 
 <p>
 The use of threads in wrapped Director code is not supported; i.e., an Octave-side implementation of a C++ class must be called from the Octave interpreter's thread. Anything fancier (apartment/queue model, whatever) is left to the user. Without anything fancier, this amounts to the limitation that Octave must drive the module... like, for example, an optimization package that calls Octave to evaluate an objective function.
 </p>
 
-<H3><a name="Octave_nn24">29.3.15 Memory management</a></H3>
+<H3><a name="Octave_nn24">30.3.15 Memory management</a></H3>
 
 
 <p>
@@ -880,14 +880,14 @@
 In the case where one wishes for the C++ side to own an object that was created in Octave (especially a Director object), one can use the __disown() method to invert this logic. Then letting the Octave reference count go to zero will not destroy the object, but destroying the object will invalidate the Octave-side object if it still exists (and call destructors of other C++ bases in the case of multiple inheritance/<tt>subclass()</tt>'ing).
 </p>
 
-<H3><a name="Octave_nn25">29.3.16 STL support</a></H3>
+<H3><a name="Octave_nn25">30.3.16 STL support</a></H3>
 
 
 <p>
 Various STL library files are provided for wrapping STL containers.
 </p>
 
-<H3><a name="Octave_nn26">29.3.17 Matrix typemaps</a></H3>
+<H3><a name="Octave_nn26">30.3.17 Matrix typemaps</a></H3>
 
 
 <p>
diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html
index 766ccae..1e7bd9f 100644
--- a/Doc/Manual/Perl5.html
+++ b/Doc/Manual/Perl5.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Perl5">30 SWIG and Perl5</a></H1>
+<H1><a name="Perl5">31 SWIG and Perl5</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -97,7 +97,7 @@
 Perl 5.6 seems to mostly work, while older versions don't.
 </p>
 
-<H2><a name="Perl5_nn2">30.1 Overview</a></H2>
+<H2><a name="Perl5_nn2">31.1 Overview</a></H2>
 
 
 <p>
@@ -118,7 +118,7 @@
 options are found near the end of the chapter.
 </p>
 
-<H2><a name="Perl5_nn3">30.2 Preliminaries</a></H2>
+<H2><a name="Perl5_nn3">31.2 Preliminaries</a></H2>
 
 
 <p>
@@ -143,7 +143,7 @@
 <tt>example_wrap.c</tt> and link it with the rest of your program.
 </p>
 
-<H3><a name="Perl5_nn4">30.2.1 Getting the right header files</a></H3>
+<H3><a name="Perl5_nn4">31.2.1 Getting the right header files</a></H3>
 
 
 <p>
@@ -175,7 +175,7 @@
 </pre>
 </div>
 
-<H3><a name="Perl5_nn5">30.2.2 Compiling a dynamic module</a></H3>
+<H3><a name="Perl5_nn5">31.2.2 Compiling a dynamic module</a></H3>
 
 
 <p>
@@ -208,7 +208,7 @@
 `<tt>example.sl</tt>', or the appropriate dynamic module name on your system.
 </p>
 
-<H3><a name="Perl5_nn6">30.2.3 Building a dynamic module with MakeMaker</a></H3>
+<H3><a name="Perl5_nn6">31.2.3 Building a dynamic module with MakeMaker</a></H3>
 
 
 <p>
@@ -242,7 +242,7 @@
 found in "Programming Perl, 2nd ed." by Larry Wall, Tom Christiansen,
 and Randal Schwartz.</p>
 
-<H3><a name="Perl5_nn7">30.2.4 Building a static version of Perl</a></H3>
+<H3><a name="Perl5_nn7">31.2.4 Building a static version of Perl</a></H3>
 
 
 <p>
@@ -311,7 +311,7 @@
 additional libraries such as <tt>-lsocket, -lnsl, -ldl</tt>, etc.
 </p>
 
-<H3><a name="Perl5_nn8">30.2.5 Using the module</a></H3>
+<H3><a name="Perl5_nn8">31.2.5 Using the module</a></H3>
 
 
 <p>
@@ -464,7 +464,7 @@
 read the man pages).
 </p>
 
-<H3><a name="Perl5_nn9">30.2.6 Compilation problems and compiling with C++</a></H3>
+<H3><a name="Perl5_nn9">31.2.6 Compilation problems and compiling with C++</a></H3>
 
 
 <p>
@@ -607,7 +607,7 @@
 any conflicting macros you find to <a href="http://www.swig.org/mail.html">swig-user mailing list</a>.
 </p>
 
-<H3><a name="Perl5_nn10">30.2.7 Compiling for 64-bit platforms</a></H3>
+<H3><a name="Perl5_nn10">31.2.7 Compiling for 64-bit platforms</a></H3>
 
 
 <p>
@@ -634,7 +634,7 @@
 linking standard (e.g., -o32 and -n32 on Irix).
 </p>
 
-<H2><a name="Perl5_nn11">30.3 Building Perl Extensions under Windows</a></H2>
+<H2><a name="Perl5_nn11">31.3 Building Perl Extensions under Windows</a></H2>
 
 
 <p>
@@ -645,7 +645,7 @@
 although the procedure may be similar with other compilers.  
 </p>
 
-<H3><a name="Perl5_nn12">30.3.1 Running SWIG from Developer Studio</a></H3>
+<H3><a name="Perl5_nn12">31.3.1 Running SWIG from Developer Studio</a></H3>
 
 
 <p>
@@ -708,7 +708,7 @@
 
 </pre></div>
 
-<H3><a name="Perl5_nn13">30.3.2 Using other compilers</a></H3>
+<H3><a name="Perl5_nn13">31.3.2 Using other compilers</a></H3>
 
 
 <p>
@@ -716,7 +716,7 @@
 For general hints and suggestions refer to the <a href="Windows.html#Windows">Windows</a> chapter.
 </p>
 
-<H2><a name="Perl5_nn14">30.4 The low-level interface</a></H2>
+<H2><a name="Perl5_nn14">31.4 The low-level interface</a></H2>
 
 
 <p>
@@ -726,7 +726,7 @@
 construct more user-friendly proxy classes as described in the next section.
 </p>
 
-<H3><a name="Perl5_nn15">30.4.1 Functions</a></H3>
+<H3><a name="Perl5_nn15">31.4.1 Functions</a></H3>
 
 
 <p>
@@ -749,7 +749,7 @@
 $a = &amp;example::fact(2);
 </pre></div>
 
-<H3><a name="Perl5_nn16">30.4.2 Global variables</a></H3>
+<H3><a name="Perl5_nn16">31.4.2 Global variables</a></H3>
 
 
 <p>
@@ -819,7 +819,7 @@
 </pre>
 </div>
 
-<H3><a name="Perl5_nn17">30.4.3 Constants</a></H3>
+<H3><a name="Perl5_nn17">31.4.3 Constants</a></H3>
 
 
 <p>
@@ -859,7 +859,7 @@
 </pre>
 </div>
 
-<H3><a name="Perl5_nn18">30.4.4 Pointers</a></H3>
+<H3><a name="Perl5_nn18">31.4.4 Pointers</a></H3>
 
 
 <p>
@@ -968,7 +968,7 @@
 SWIG and XS, this is no longer supported.
 </p>
 
-<H3><a name="Perl5_nn19">30.4.5 Structures</a></H3>
+<H3><a name="Perl5_nn19">31.4.5 Structures</a></H3>
 
 
 <p>
@@ -1102,7 +1102,7 @@
 </div>
 
 
-<H3><a name="Perl5_nn20">30.4.6 C++ classes</a></H3>
+<H3><a name="Perl5_nn20">31.4.6 C++ classes</a></H3>
 
 
 <p>
@@ -1167,7 +1167,7 @@
 can be built using these low-level accessors.  This is described shortly.
 </p>
 
-<H3><a name="Perl5_nn21">30.4.7 C++ classes and type-checking</a></H3>
+<H3><a name="Perl5_nn21">31.4.7 C++ classes and type-checking</a></H3>
 
 
 <p>
@@ -1203,7 +1203,7 @@
 multiple inheritance is used).
 </p>
 
-<H3><a name="Perl5_nn22">30.4.8 C++ overloaded functions</a></H3>
+<H3><a name="Perl5_nn22">31.4.8 C++ overloaded functions</a></H3>
 
 
 <p>
@@ -1247,7 +1247,7 @@
 Please refer to the "SWIG Basics" chapter for more information. 
 </p>
 
-<H3><a name="Perl5_nn23">30.4.9 Operators</a></H3>
+<H3><a name="Perl5_nn23">31.4.9 Operators</a></H3>
 
 
     <p>
@@ -1274,7 +1274,7 @@
 <li>operator or  </li>
     </ul>
 
-<H3><a name="Perl5_nn24">30.4.10 Modules and packages</a></H3>
+<H3><a name="Perl5_nn24">31.4.10 Modules and packages</a></H3>
 
 
 <p>
@@ -1369,7 +1369,7 @@
 </pre></div>
 -->
 
-<H2><a name="Perl5_nn25">30.5 Input and output parameters</a></H2>
+<H2><a name="Perl5_nn25">31.5 Input and output parameters</a></H2>
 
 
 <p>
@@ -1588,7 +1588,7 @@
 <b>Note:</b> The <tt>REFERENCE</tt> feature is only currently supported for numeric types (integers and floating point).
 </p>
 
-<H2><a name="Perl5_nn26">30.6 Exception handling</a></H2>
+<H2><a name="Perl5_nn26">31.6 Exception handling</a></H2>
 
 
 <p>
@@ -1752,7 +1752,7 @@
 functionality, but it has additional capabilities that make it more powerful.
 </p>
 
-<H2><a name="Perl5_nn27">30.7 Remapping datatypes with typemaps</a></H2>
+<H2><a name="Perl5_nn27">31.7 Remapping datatypes with typemaps</a></H2>
 
 
 <p>
@@ -1769,7 +1769,7 @@
 C-Perl interface.
 </p>
 
-<H3><a name="Perl5_nn28">30.7.1 A simple typemap example</a></H3>
+<H3><a name="Perl5_nn28">31.7.1 A simple typemap example</a></H3>
 
 
 <p>
@@ -1873,7 +1873,7 @@
 </div>
 
 
-<H3><a name="Perl5_nn29">30.7.2 Perl5 typemaps</a></H3>
+<H3><a name="Perl5_nn29">31.7.2 Perl5 typemaps</a></H3>
 
 
 <p>
@@ -1978,7 +1978,7 @@
 Check value of input parameter.
 </div>
 
-<H3><a name="Perl5_nn30">30.7.3 Typemap variables</a></H3>
+<H3><a name="Perl5_nn30">31.7.3 Typemap variables</a></H3>
 
 
 <p>
@@ -2049,7 +2049,7 @@
 The Perl name of the wrapper function being created.
 </div>
 
-<H3><a name="Perl5_nn31">30.7.4 Useful functions</a></H3>
+<H3><a name="Perl5_nn31">31.7.4 Useful functions</a></H3>
 
 
 <p>
@@ -2118,7 +2118,7 @@
 </div>
 
 
-<H2><a name="Perl5_nn32">30.8 Typemap Examples</a></H2>
+<H2><a name="Perl5_nn32">31.8 Typemap Examples</a></H2>
 
 
 <p>
@@ -2127,7 +2127,7 @@
 the SWIG library.
 </p>
 
-<H3><a name="Perl5_nn33">30.8.1 Converting a Perl5 array to a char **</a></H3>
+<H3><a name="Perl5_nn33">31.8.1 Converting a Perl5 array to a char **</a></H3>
 
 
 <p>
@@ -2219,7 +2219,7 @@
 </pre></div>
 
 
-<H3><a name="Perl5_nn34">30.8.2 Return values</a></H3>
+<H3><a name="Perl5_nn34">31.8.2 Return values</a></H3>
 
 
 <p>
@@ -2248,7 +2248,7 @@
 }
 </pre></div>
 
-<H3><a name="Perl5_nn35">30.8.3 Returning values from arguments</a></H3>
+<H3><a name="Perl5_nn35">31.8.3 Returning values from arguments</a></H3>
 
 
 <p>
@@ -2302,7 +2302,7 @@
 ($x, $y) = multout(7, 13);
 </pre></div>
 
-<H3><a name="Perl5_nn36">30.8.4 Accessing array structure members</a></H3>
+<H3><a name="Perl5_nn36">31.8.4 Accessing array structure members</a></H3>
 
 
 <p>
@@ -2365,7 +2365,7 @@
 to copy the converted array into a C data structure.
 </p>
 
-<H3><a name="Perl5_nn37">30.8.5 Turning Perl references into C pointers</a></H3>
+<H3><a name="Perl5_nn37">31.8.5 Turning Perl references into C pointers</a></H3>
 
 
 <p>
@@ -2430,7 +2430,7 @@
 
 </pre></div>
 
-<H3><a name="Perl5_nn38">30.8.6 Pointer handling</a></H3>
+<H3><a name="Perl5_nn38">31.8.6 Pointer handling</a></H3>
 
 
 <p>
@@ -2515,7 +2515,7 @@
 </pre>
 </div>
 
-<H2><a name="Perl5_nn39">30.9 Proxy classes</a></H2>
+<H2><a name="Perl5_nn39">31.9 Proxy classes</a></H2>
 
 
 <p>
@@ -2531,7 +2531,7 @@
 details of the proxy interface.
 </p>
 
-<H3><a name="Perl5_nn40">30.9.1 Preliminaries</a></H3>
+<H3><a name="Perl5_nn40">31.9.1 Preliminaries</a></H3>
 
 
 <p>
@@ -2553,7 +2553,7 @@
 high level wrappers.  The wrappers, in turn, interact with the low-level procedural module.
 </p>
 
-<H3><a name="Perl5_nn41">30.9.2 Structure and class wrappers</a></H3>
+<H3><a name="Perl5_nn41">31.9.2 Structure and class wrappers</a></H3>
 
 
 <p>
@@ -2680,7 +2680,7 @@
 
 </pre></div>
 
-<H3><a name="Perl5_nn42">30.9.3 Object Ownership</a></H3>
+<H3><a name="Perl5_nn42">31.9.3 Object Ownership</a></H3>
 
 
 <p>
@@ -2767,7 +2767,7 @@
 sophisticated languages.
 </p>
 
-<H3><a name="Perl5_nn43">30.9.4 Nested Objects</a></H3>
+<H3><a name="Perl5_nn43">31.9.4 Nested Objects</a></H3>
 
 
 <p>
@@ -2820,7 +2820,7 @@
 %${$p-&gt;{v}} = ( x=&gt;0, y=&gt;0, z=&gt;0);         
 </pre></div>
 
-<H3><a name="Perl5_nn44">30.9.5 Proxy Functions</a></H3>
+<H3><a name="Perl5_nn44">31.9.5 Proxy Functions</a></H3>
 
 
 <p>
@@ -2854,7 +2854,7 @@
 identical manner.
 </p>
 
-<H3><a name="Perl5_nn45">30.9.6 Inheritance</a></H3>
+<H3><a name="Perl5_nn45">31.9.6 Inheritance</a></H3>
 
 
 <p>
@@ -2930,7 +2930,7 @@
 not even sure if it really works).
 </p>
 
-<H3><a name="Perl5_nn46">30.9.7 Modifying the proxy methods</a></H3>
+<H3><a name="Perl5_nn46">31.9.7 Modifying the proxy methods</a></H3>
 
 
 <p>
@@ -2958,7 +2958,7 @@
 };
 </pre></div>
 
-<H2><a name="Perl5_nn47">30.10 Adding additional Perl code</a></H2>
+<H2><a name="Perl5_nn47">31.10 Adding additional Perl code</a></H2>
 
 
 <p>
@@ -3009,7 +3009,7 @@
 </pre>
 </div>
 
-<H2><a name="Perl5_directors">30.11 Cross language polymorphism</a></H2>
+<H2><a name="Perl5_directors">31.11 Cross language polymorphism</a></H2>
 
 
 <p>
@@ -3043,7 +3043,7 @@
 all the cross-language method routing transparently.
 </p>
 
-<H3><a name="Perl5_nn48">30.11.1 Enabling directors</a></H3>
+<H3><a name="Perl5_nn48">31.11.1 Enabling directors</a></H3>
 
 
 <p>
@@ -3133,7 +3133,7 @@
 </div>
 
 
-<H3><a name="Perl5_nn49">30.11.2 Director classes</a></H3>
+<H3><a name="Perl5_nn49">31.11.2 Director classes</a></H3>
 
 
  
@@ -3214,7 +3214,7 @@
 calls through Perl.
 </p>
 
-<H3><a name="Perl5_nn50">30.11.3 Ownership and object destruction</a></H3>
+<H3><a name="Perl5_nn50">31.11.3 Ownership and object destruction</a></H3>
 
 
 <p>
@@ -3263,7 +3263,7 @@
 </div>
 
 
-<H3><a name="Perl5_nn51">30.11.4 Exception unrolling</a></H3>
+<H3><a name="Perl5_nn51">31.11.4 Exception unrolling</a></H3>
 
 
 <p>
@@ -3319,7 +3319,7 @@
 exception as soon as the C wrapper function returns.
 </p>
 
-<H3><a name="Perl5_nn52">30.11.5 Overhead and code bloat</a></H3>
+<H3><a name="Perl5_nn52">31.11.5 Overhead and code bloat</a></H3>
 
 
 <p>
@@ -3353,7 +3353,7 @@
 Perl.
 </p>
 
-<H3><a name="Perl5_nn53">30.11.6 Typemaps</a></H3>
+<H3><a name="Perl5_nn53">31.11.6 Typemaps</a></H3>
 
 
 <p>
diff --git a/Doc/Manual/Php.html b/Doc/Manual/Php.html
index 1b8b2d4..09c514e 100644
--- a/Doc/Manual/Php.html
+++ b/Doc/Manual/Php.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Php">31 SWIG and PHP</a></H1>
+<H1><a name="Php">32 SWIG and PHP</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -70,7 +70,7 @@
 available.
 </p>
 
-<H2><a name="Php_nn1">31.1 Generating PHP Extensions</a></H2>
+<H2><a name="Php_nn1">32.1 Generating PHP Extensions</a></H2>
 
 
 <p>
@@ -119,7 +119,7 @@
 this approach, or provide explicit support for it.
 </p>
 
-<H3><a name="Php_nn1_1">31.1.1 Building a loadable extension</a></H3>
+<H3><a name="Php_nn1_1">32.1.1 Building a loadable extension</a></H3>
 
 
 <p>
@@ -134,7 +134,7 @@
         gcc -shared example_wrap.o example.o -o example.so
 </pre></div>
 
-<H3><a name="Php_nn1_3">31.1.2 Using PHP Extensions</a></H3>
+<H3><a name="Php_nn1_3">32.1.2 Using PHP Extensions</a></H3>
 
 
 <p>
@@ -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>
@@ -182,7 +182,7 @@
 almost certainly want to include it anyway.
 </p>
 
-<H2><a name="Php_nn2">31.2 Basic PHP interface</a></H2>
+<H2><a name="Php_nn2">32.2 Basic PHP interface</a></H2>
 
 
 <p>
@@ -194,7 +194,7 @@
 namespace feature.
 </p>
 
-<H3><a name="Php_nn2_1">31.2.1 Constants</a></H3>
+<H3><a name="Php_nn2_1">32.2.1 Constants</a></H3>
 
 
 <p>
@@ -231,10 +231,12 @@
 <p>
 There's one peculiarity of how constants work in PHP which it is useful
 to note (this is not specific to SWIG though) - if you try to use an undeclared
-constant, PHP will emit a notice and then expand the constant to a string
-version of the constant's name.  Unfortunately it is easy to miss the notice
-if you're using PHP in a webserver, as it will probably end up in error.log or
-similar.
+constant, PHP will emit a warning (or a notice in PHP 7.1 and earlier) and then
+expand the constant to a string version of the constant's name.  Unfortunately
+it is easy to miss the warning message if you're using PHP in a webserver as
+it will probably end up in error.log or similar.  Apparently this will throw
+an Error in a future version of PHP, but until then it's something to be
+aware of.
 </p>
 
 <p>
@@ -268,11 +270,10 @@
 <p>
 The mis-spelled constant will become the string 'EASY_TO_MISPEL', which
 is treated as true by the if test, when the value of the intended constant
-would be treated as false!  Modern versions of PHP will at least issue
-a PHP notice by default when this happens.
+would be treated as false!
 </p>
 
-<H3><a name="Php_nn2_2">31.2.2 Global Variables</a></H3>
+<H3><a name="Php_nn2_2">32.2.2 Global Variables</a></H3>
 
 
 <p>
@@ -321,7 +322,7 @@
 At this time SWIG does not support custom accessor methods.
 </p>
 
-<H3><a name="Php_nn2_3">31.2.3 Functions</a></H3>
+<H3><a name="Php_nn2_3">32.2.3 Functions</a></H3>
 
 
 <p>
@@ -374,7 +375,7 @@
 -->
 
 
-<H3><a name="Php_nn2_4">31.2.4 Overloading</a></H3>
+<H3><a name="Php_nn2_4">32.2.4 Overloading</a></H3>
 
 
 <p>
@@ -429,7 +430,7 @@
 </p>
 -->
 
-<H3><a name="Php_nn2_5">31.2.5 Pointers and References</a></H3>
+<H3><a name="Php_nn2_5">32.2.5 Pointers and References</a></H3>
 
 
 <p>
@@ -567,7 +568,7 @@
 variable, or assigning <tt>NULL</tt> to a variable.
 </p>
 
-<H3><a name="Php_nn2_6">31.2.6 Structures and C++ classes</a></H3>
+<H3><a name="Php_nn2_6">32.2.6 Structures and C++ classes</a></H3>
 
 
 <p>
@@ -628,7 +629,7 @@
 Member variables and methods are accessed using the <tt>-&gt;</tt> operator.
 </p>
 
-<H4><a name="Php_nn2_6_1">31.2.6.1 Using -noproxy</a></H4>
+<H4><a name="Php_nn2_6_1">32.2.6.1 Using -noproxy</a></H4>
 
 
 <p>
@@ -654,7 +655,7 @@
 Complex_im_get($obj);
 </pre></div>
 
-<H4><a name="Php_nn2_6_2">31.2.6.2 Constructors and Destructors</a></H4>
+<H4><a name="Php_nn2_6_2">32.2.6.2 Constructors and Destructors</a></H4>
 
 
 <p>
@@ -695,7 +696,7 @@
 <tt>unset($v)</tt>
 </p>
 
-<H4><a name="Php_nn2_6_3">31.2.6.3 Static Member Variables</a></H4>
+<H4><a name="Php_nn2_6_3">32.2.6.3 Static Member Variables</a></H4>
 
 
 <p>
@@ -738,7 +739,7 @@
 echo "There have now been " . Ko::threats() . " threats\n";
 
 </pre></div>
-<H4><a name="Php_nn2_6_4">31.2.6.4 Static Member Functions</a></H4>
+<H4><a name="Php_nn2_6_4">32.2.6.4 Static Member Functions</a></H4>
 
 
 <p>
@@ -760,7 +761,7 @@
 </pre></div>
 
 
-<H4><a name="Php_nn2_6_5">31.2.6.5 Specifying Implemented Interfaces</a></H4>
+<H4><a name="Php_nn2_6_5">32.2.6.5 Specifying Implemented Interfaces</a></H4>
 
 
 <p>
@@ -778,7 +779,7 @@
 If there are multiple interfaces, just list them separated by commas.
 </p>
 
-<H3><a name="Php_nn2_7">31.2.7 PHP Pragmas, Startup and Shutdown code</a></H3>
+<H3><a name="Php_nn2_7">32.2.7 PHP Pragmas, Startup and Shutdown code</a></H3>
 
 
 <p>
@@ -875,7 +876,7 @@
 into the request init (PHP_RINIT_FUNCTION) and request shutdown (PHP_RSHUTDOWN_FUNCTION) code respectively.
 </p>
 
-<H2><a name="Php_nn3">31.3 Cross language polymorphism</a></H2>
+<H2><a name="Php_nn3">32.3 Cross language polymorphism</a></H2>
 
 
 <p>
@@ -910,7 +911,7 @@
 transparently.
 </p>
 
-<H3><a name="Php_nn3_1">31.3.1 Enabling directors</a></H3>
+<H3><a name="Php_nn3_1">32.3.1 Enabling directors</a></H3>
 
 
 <p>
@@ -999,7 +1000,7 @@
 </div>
 
 
-<H3><a name="Php_nn3_2">31.3.2 Director classes</a></H3>
+<H3><a name="Php_nn3_2">32.3.2 Director classes</a></H3>
 
 
  
@@ -1080,7 +1081,7 @@
 calls through PHP.
 </p>
 
-<H3><a name="Php_nn3_3">31.3.3 Ownership and object destruction</a></H3>
+<H3><a name="Php_nn3_3">32.3.3 Ownership and object destruction</a></H3>
 
 
 <p>
@@ -1136,7 +1137,7 @@
 deleting all the Foo pointers it contains at some point.
 </p>
 
-<H3><a name="Php_nn3_4">31.3.4 Exception unrolling</a></H3>
+<H3><a name="Php_nn3_4">32.3.4 Exception unrolling</a></H3>
 
 
 <p>
@@ -1203,7 +1204,7 @@
 as soon as the C wrapper function returns.
 </p>
 
-<H3><a name="Php_nn3_5">31.3.5 Overhead and code bloat</a></H3>
+<H3><a name="Php_nn3_5">32.3.5 Overhead and code bloat</a></H3>
 
 
 <p>
@@ -1236,7 +1237,7 @@
 directive) for only those methods that are likely to be extended in PHP.
 </p>
 
-<H3><a name="Php_nn3_6">31.3.6 Typemaps</a></H3>
+<H3><a name="Php_nn3_6">32.3.6 Typemaps</a></H3>
 
 
 <p>
@@ -1250,7 +1251,7 @@
 </p>
 
 
-<H3><a name="Php_nn3_7">31.3.7 Miscellaneous</a></H3>
+<H3><a name="Php_nn3_7">32.3.7 Miscellaneous</a></H3>
 
 
 <p> Director typemaps for STL classes are mostly in place, and hence you
diff --git a/Doc/Manual/Preprocessor.html b/Doc/Manual/Preprocessor.html
index 1bf59e2..63ee2c2 100644
--- a/Doc/Manual/Preprocessor.html
+++ b/Doc/Manual/Preprocessor.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Preprocessor">10 Preprocessing</a></H1>
+<H1><a name="Preprocessor">11 Preprocessing</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -38,7 +38,7 @@
 chapter describes some of these modifications.
 </p>
 
-<H2><a name="Preprocessor_nn2">10.1 File inclusion</a></H2>
+<H2><a name="Preprocessor_nn2">11.1 File inclusion</a></H2>
 
 
 <p>
@@ -64,7 +64,7 @@
 is that you often don't want SWIG to try and wrap everything included
 in standard header system headers and auxiliary files.
 
-<H2><a name="Preprocessor_nn3">10.2 File imports</a></H2>
+<H2><a name="Preprocessor_nn3">11.2 File imports</a></H2>
 
 
 <p>
@@ -93,7 +93,7 @@
 as imports.    This might be useful if you want to extract type definitions from system 
 header files without generating any wrappers.
 
-<H2><a name="Preprocessor_condition_compilation">10.3 Conditional Compilation</a></H2>
+<H2><a name="Preprocessor_condition_compilation">11.3 Conditional Compilation</a></H2>
 
 
 <p>
@@ -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>
@@ -151,7 +151,7 @@
 within the SWIG compiler).
 </p>
 
-<H2><a name="Preprocessor_nn5">10.4 Macro Expansion</a></H2>
+<H2><a name="Preprocessor_nn5">11.4 Macro Expansion</a></H2>
 
 
 <p>
@@ -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>
@@ -206,7 +206,7 @@
 </li>
 </ul>
 
-<H2><a name="Preprocessor_nn6">10.5 SWIG Macros</a></H2>
+<H2><a name="Preprocessor_nn6">11.5 SWIG Macros</a></H2>
 
 
 <p>
@@ -252,7 +252,7 @@
 support).
 </p>
 
-<H2><a name="Preprocessor_nn7">10.6 C99 and GNU Extensions</a></H2>
+<H2><a name="Preprocessor_nn7">11.6 C99 and GNU Extensions</a></H2>
 
 
 <p>
@@ -308,14 +308,14 @@
 SWIG directives and are provided to make SWIG more compatible with C99 code.
 </p>
 
-<H2><a name="Preprocessor_delimiters">10.7 Preprocessing and delimiters</a></H2>
+<H2><a name="Preprocessor_delimiters">11.7 Preprocessing and delimiters</a></H2>
 
 
 <p>
 The preprocessor handles { }, " " and %{ %} delimiters differently.
 </p>
 
-<H3><a name="Preprocessor_nn8">10.7.1 Preprocessing and %{ ... %} &amp; " ... " delimiters</a></H3>
+<H3><a name="Preprocessor_nn8">11.7.1 Preprocessing and %{ ... %} &amp; " ... " delimiters</a></H3>
 
 
 <p>
@@ -340,7 +340,7 @@
 modification to the output (including all preprocessor directives).
 </p>
 
-<H3><a name="Preprocessor_nn9">10.7.2 Preprocessing and { ... } delimiters</a></H3>
+<H3><a name="Preprocessor_nn9">11.7.2 Preprocessing and { ... } delimiters</a></H3>
 
 
 <p>
@@ -382,7 +382,7 @@
 SWIG will strip the extra <tt>%</tt> and leave the preprocessor directive in the code.
 </p>
 
-<H2><a name="Preprocessor_typemap_delimiters">10.8 Preprocessor and Typemaps</a></H2>
+<H2><a name="Preprocessor_typemap_delimiters">11.8 Preprocessor and Typemaps</a></H2>
 
 
 <p>
@@ -453,17 +453,17 @@
 </div>
 
 
-<H2><a name="Preprocessor_nn10">10.9 Viewing preprocessor output</a></H2>
+<H2><a name="Preprocessor_nn10">11.9 Viewing preprocessor output</a></H2>
 
 
 <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>
 
-<H2><a name="Preprocessor_warning_error">10.10 The #error and #warning directives</a></H2>
+<H2><a name="Preprocessor_warning_error">11.10 The #error and #warning directives</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html
index 2554e9d..fd07301 100644
--- a/Doc/Manual/Python.html
+++ b/Doc/Manual/Python.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Python">32 SWIG and Python</a></H1>
+<H1><a name="Python">33 SWIG and Python</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -168,7 +168,7 @@
 Basics</a>" chapter.
 </p>
 
-<H2><a name="Python_nn2">32.1 Overview</a></H2>
+<H2><a name="Python_nn2">33.1 Overview</a></H2>
 
 
 <p>
@@ -195,10 +195,10 @@
 details.
 </p>
 
-<H2><a name="Python_nn3">32.2 Preliminaries</a></H2>
+<H2><a name="Python_nn3">33.2 Preliminaries</a></H2>
 
 
-<H3><a name="Python_nn4">32.2.1 Running SWIG</a></H3>
+<H3><a name="Python_nn4">33.2.1 Running SWIG</a></H3>
 
 
 <p>
@@ -295,13 +295,13 @@
 how you might go about compiling and using the generated files.
 </p>
 
-<H3><a name="Python_nn6">32.2.2 Using distutils</a></H3>
+<H3><a name="Python_nn6">33.2.2 Using distutils</a></H3>
 
 
 <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>
@@ -387,7 +387,7 @@
 can even build extensions to the standard Windows Python using MingGW)
 </p>
 
-<H3><a name="Python_nn7">32.2.3 Hand compiling a dynamic module</a></H3>
+<H3><a name="Python_nn7">33.2.3 Hand compiling a dynamic module</a></H3>
 
 
 <p>
@@ -435,7 +435,7 @@
 </p>
 
 
-<H3><a name="Python_nn8">32.2.4 Static linking</a></H3>
+<H3><a name="Python_nn8">33.2.4 Static linking</a></H3>
 
 
 <p>
@@ -514,7 +514,7 @@
 (perhaps using distutils).
 </p>
 
-<H3><a name="Python_nn9">32.2.5 Using your module</a></H3>
+<H3><a name="Python_nn9">33.2.5 Using your module</a></H3>
 
 
 <p>
@@ -671,7 +671,7 @@
 read the man pages).
 </p>
 
-<H3><a name="Python_nn10">32.2.6 Compilation of C++ extensions</a></H3>
+<H3><a name="Python_nn10">33.2.6 Compilation of C++ extensions</a></H3>
 
 
 <p>
@@ -763,7 +763,7 @@
 might want to investigate using a more formal standard such as COM.
 </p>
 
-<H3><a name="Python_nn11">32.2.7 Compiling for 64-bit platforms</a></H3>
+<H3><a name="Python_nn11">33.2.7 Compiling for 64-bit platforms</a></H3>
 
 
 <p>
@@ -800,7 +800,7 @@
 extension.
 </p>
 
-<H3><a name="Python_nn12">32.2.8 Building Python extensions under Windows</a></H3>
+<H3><a name="Python_nn12">33.2.8 Building Python extensions under Windows</a></H3>
 
 
 <p>
@@ -930,7 +930,7 @@
 </p>
 
 
-<H3><a name="Python_commandline">32.2.9 Additional Python commandline options</a></H3>
+<H3><a name="Python_commandline">33.2.9 Additional Python commandline options</a></H3>
 
 
 <p>
@@ -974,7 +974,7 @@
 Many of these options are covered later on and their use should become clearer by the time you have finished reading this section on SWIG and Python.
 </p>
 
-<H2><a name="Python_nn13">32.3 A tour of basic C/C++ wrapping</a></H2>
+<H2><a name="Python_nn13">33.3 A tour of basic C/C++ wrapping</a></H2>
 
 
 <p>
@@ -983,7 +983,7 @@
 This section briefly covers the essential aspects of this wrapping.
 </p>
 
-<H3><a name="Python_nn14">32.3.1 Modules</a></H3>
+<H3><a name="Python_nn14">33.3.1 Modules</a></H3>
 
 
 <p>
@@ -996,7 +996,7 @@
 Python command or standard module name.
 </p>
 
-<H3><a name="Python_nn15">32.3.2 Functions</a></H3>
+<H3><a name="Python_nn15">33.3.2 Functions</a></H3>
 
 
 <p>
@@ -1020,7 +1020,7 @@
 &gt;&gt;&gt;
 </pre></div>
 
-<H3><a name="Python_nn16">32.3.3 Global variables</a></H3>
+<H3><a name="Python_nn16">33.3.3 Global variables</a></H3>
 
 
 <p>
@@ -1158,7 +1158,7 @@
 if there are no global variables in a module.
 </p>
 
-<H3><a name="Python_nn17">32.3.4 Constants and enums</a></H3>
+<H3><a name="Python_nn17">33.3.4 Constants and enums</a></H3>
 
 
 <p>
@@ -1198,7 +1198,7 @@
 generate code that prevents this.  You will just have to be careful.
 </p>
 
-<H3><a name="Python_nn18">32.3.5 Pointers</a></H3>
+<H3><a name="Python_nn18">33.3.5 Pointers</a></H3>
 
 
 <p>
@@ -1339,7 +1339,7 @@
 <tt>None</tt> if the conversion can't be performed.
 </p>
 
-<H3><a name="Python_nn19">32.3.6 Structures</a></H3>
+<H3><a name="Python_nn19">33.3.6 Structures</a></H3>
 
 
 <p>
@@ -1549,7 +1549,7 @@
 </p>
 
 
-<H3><a name="Python_nn20">32.3.7 C++ classes</a></H3>
+<H3><a name="Python_nn20">33.3.7 C++ classes</a></H3>
 
 
 <p>
@@ -1637,7 +1637,7 @@
 </pre>
 </div>
 
-<H3><a name="Python_nn21">32.3.8 C++ inheritance</a></H3>
+<H3><a name="Python_nn21">33.3.8 C++ inheritance</a></H3>
 
 
 <p>
@@ -1692,7 +1692,7 @@
 It is safe to use multiple inheritance with SWIG.
 </p>
 
-<H3><a name="Python_nn22">32.3.9 Pointers, references, values, and arrays</a></H3>
+<H3><a name="Python_nn22">33.3.9 Pointers, references, values, and arrays</a></H3>
 
 
 <p>
@@ -1753,7 +1753,7 @@
 allocation/deallocation process.
 </p>
 
-<H3><a name="Python_nn23">32.3.10 C++ overloaded functions</a></H3>
+<H3><a name="Python_nn23">33.3.10 C++ overloaded functions</a></H3>
 
 
 <p>
@@ -1876,7 +1876,7 @@
 Please refer to the "SWIG and C++" chapter for more information about overloading.
 </p>
 
-<H3><a name="Python_nn24">32.3.11 C++ operators</a></H3>
+<H3><a name="Python_nn24">33.3.11 C++ operators</a></H3>
 
 
 <p>
@@ -1973,7 +1973,7 @@
 This follows the guidelines in <a href="https://www.python.org/dev/peps/pep-0207/">PEP 207 - Rich Comparisons</a> and <a href="https://docs.python.org/3/library/constants.html#NotImplemented">NotImplemented Python constant</a>.
 </p>
 
-<H3><a name="Python_nn25">32.3.12 C++ namespaces</a></H3>
+<H3><a name="Python_nn25">33.3.12 C++ namespaces</a></H3>
 
 
 <p>
@@ -2040,7 +2040,7 @@
 identical symbol names, well, then you get what you deserve.
 </p>
 
-<H3><a name="Python_nn26">32.3.13 C++ templates</a></H3>
+<H3><a name="Python_nn26">33.3.13 C++ templates</a></H3>
 
 
 <p>
@@ -2094,10 +2094,10 @@
 examples will appear later.
 </p>
 
-<H3><a name="Python_nn27">32.3.14 C++ Smart Pointers</a></H3>
+<H3><a name="Python_nn27">33.3.14 C++ Smart Pointers</a></H3>
 
 
-<H4><a name="Python_smart_pointers_shared_ptr">32.3.14.1 The shared_ptr Smart Pointer</a></H4>
+<H4><a name="Python_smart_pointers_shared_ptr">33.3.14.1 The shared_ptr Smart Pointer</a></H4>
 
 
 <p>
@@ -2108,7 +2108,7 @@
 </p>
 
 
-<H4><a name="Python_smart_pointers_generic">32.3.14.2 Generic Smart Pointers</a></H4>
+<H4><a name="Python_smart_pointers_generic">33.3.14.2 Generic Smart Pointers</a></H4>
 
 
 <p>
@@ -2192,7 +2192,7 @@
 </pre>
 </div>
 
-<H3><a name="Python_nn27a">32.3.15 C++ reference counted objects</a></H3>
+<H3><a name="Python_nn27a">33.3.15 C++ reference counted objects</a></H3>
 
 
 <p>
@@ -2201,7 +2201,7 @@
 </p>
 
 
-<H2><a name="Python_nn28">32.4 Further details on the Python class interface</a></H2>
+<H2><a name="Python_nn28">33.4 Further details on the Python class interface</a></H2>
 
 
 <p>
@@ -2224,7 +2224,7 @@
 section.
 </p>
 
-<H3><a name="Python_nn29">32.4.1 Proxy classes</a></H3>
+<H3><a name="Python_nn29">33.4.1 Proxy classes</a></H3>
 
 
 <p>
@@ -2313,7 +2313,7 @@
 by Python built-in types until Python 2.2).
 </p>
 
-<H3><a name="Python_builtin_types">32.4.2 Built-in Types</a></H3>
+<H3><a name="Python_builtin_types">33.4.2 Built-in Types</a></H3>
 
 
 <p>
@@ -2355,9 +2355,9 @@
 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>
+<H4><a name="Python_builtin_limitations">33.4.2.1 Limitations</a></H4>
 
 
 <p>Use of the <tt>-builtin</tt> option implies a couple of limitations:
@@ -2518,7 +2518,7 @@
 </li>
 </ul>
 
-<H4><a name="Python_builtin_overloads">32.4.2.2 Operator overloads and slots -- use them!</a></H4>
+<H4><a name="Python_builtin_overloads">33.4.2.2 Operator overloads and slots -- use them!</a></H4>
 
 
 <p>The entire justification for the <tt>-builtin</tt> option is improved
@@ -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
@@ -2678,7 +2678,7 @@
 </p>
 
 
-<H3><a name="Python_nn30">32.4.3 Memory management</a></H3>
+<H3><a name="Python_nn30">33.4.3 Memory management</a></H3>
 
 
 <p>NOTE: Although this section refers to proxy objects, everything here also applies
@@ -2873,7 +2873,7 @@
 typemaps--an advanced topic discussed later.
 </p>
 
-<H2><a name="Python_directors">32.5 Cross language polymorphism</a></H2>
+<H2><a name="Python_directors">33.5 Cross language polymorphism</a></H2>
 
 
 <p>
@@ -2907,7 +2907,7 @@
 all the cross-language method routing transparently.
 </p>
 
-<H3><a name="Python_nn33">32.5.1 Enabling directors</a></H3>
+<H3><a name="Python_nn33">33.5.1 Enabling directors</a></H3>
 
 
 <p>
@@ -2999,7 +2999,7 @@
 </div>
 
 
-<H3><a name="Python_nn34">32.5.2 Director classes</a></H3>
+<H3><a name="Python_nn34">33.5.2 Director classes</a></H3>
 
 
 <p>
@@ -3079,7 +3079,7 @@
 calls through Python.
 </p>
 
-<H3><a name="Python_nn35">32.5.3 Ownership and object destruction</a></H3>
+<H3><a name="Python_nn35">33.5.3 Ownership and object destruction</a></H3>
 
 
 <p>
@@ -3146,7 +3146,7 @@
 references to the Foo objects remain in Python.
 </p>
 
-<H3><a name="Python_nn36">32.5.4 Exception unrolling</a></H3>
+<H3><a name="Python_nn36">33.5.4 Exception unrolling</a></H3>
 
 
 <p>
@@ -3205,7 +3205,7 @@
 exception as soon as the C wrapper function returns.
 </p>
 
-<H3><a name="Python_nn37">32.5.5 Overhead and code bloat</a></H3>
+<H3><a name="Python_nn37">33.5.5 Overhead and code bloat</a></H3>
 
 
 <p>
@@ -3239,7 +3239,7 @@
 Python.
 </p>
 
-<H3><a name="Python_nn38">32.5.6 Typemaps</a></H3>
+<H3><a name="Python_nn38">33.5.6 Typemaps</a></H3>
 
 
 <p>
@@ -3253,7 +3253,7 @@
 </p>
 
 
-<H3><a name="Python_nn39">32.5.7 Miscellaneous</a></H3>
+<H3><a name="Python_nn39">33.5.7 Miscellaneous</a></H3>
 
 
 <p>
@@ -3300,7 +3300,7 @@
 </p>
 
 
-<H2><a name="Python_nn40">32.6 Common customization features</a></H2>
+<H2><a name="Python_nn40">33.6 Common customization features</a></H2>
 
 
 <p>
@@ -3313,7 +3313,7 @@
 improve your the interface to an extension module.
 </p>
 
-<H3><a name="Python_nn41">32.6.1 C/C++ helper functions</a></H3>
+<H3><a name="Python_nn41">33.6.1 C/C++ helper functions</a></H3>
 
 
 <p>
@@ -3394,7 +3394,7 @@
 customization features as covered in later sections.
 </p>
 
-<H3><a name="Python_nn42">32.6.2 Adding additional Python code</a></H3>
+<H3><a name="Python_nn42">33.6.2 Adding additional Python code</a></H3>
 
 
 <p>
@@ -3650,7 +3650,7 @@
 </p>
 
 
-<H3><a name="Python_nn43">32.6.3 Class extension with %extend</a></H3>
+<H3><a name="Python_nn43">33.6.3 Class extension with %extend</a></H3>
 
 
 <p>
@@ -3739,7 +3739,7 @@
 in any way---the extensions only show up in the Python interface.
 </p>
 
-<H3><a name="Python_nn44">32.6.4 Exception handling with %exception</a></H3>
+<H3><a name="Python_nn44">33.6.4 Exception handling with %exception</a></H3>
 
 
 <p>
@@ -3873,10 +3873,10 @@
 to raise exceptions.  See the <a href="Library.html#Library">SWIG Library</a> chapter.
 </p>
 
-<H3><a name="Python_optimization">32.6.5 Optimization options</a></H3>
+<H3><a name="Python_optimization">33.6.5 Optimization options</a></H3>
 
 
-<H4><a name="Python_fastproxy">32.6.5.1 -fastproxy</a></H4>
+<H4><a name="Python_fastproxy">33.6.5.1 -fastproxy</a></H4>
 
 
 <p>
@@ -4002,14 +4002,14 @@
 
 <p>
 The class defines each method in two different ways. The first definition is replaced by the second definition and so the second definition is the one used when the method is called.
-While this possibly provides the best of both worlds, the time to import the module will be slighly slower when the class is defined due to the additional method definitions.
+While this possibly provides the best of both worlds, the time to import the module will be slightly slower when the class is defined due to the additional method definitions.
 </p>
 
 <p>
 The command line options mentioned above also apply to wrapped C/C++ global functions, not just class methods.
 </p>
 
-<H2><a name="Python_nn45">32.7 Tips and techniques</a></H2>
+<H2><a name="Python_nn45">33.7 Tips and techniques</a></H2>
 
 
 <p>
@@ -4019,7 +4019,7 @@
 solving these problems.
 </p>
 
-<H3><a name="Python_nn46">32.7.1 Input and output parameters</a></H3>
+<H3><a name="Python_nn46">33.7.1 Input and output parameters</a></H3>
 
 
 <p>
@@ -4232,7 +4232,7 @@
 may not have the intended effect since <tt>typemaps.i</tt> does not define an OUTPUT rule for <tt>Bar</tt>.
 </p>
 
-<H3><a name="Python_nn47">32.7.2 Simple pointers</a></H3>
+<H3><a name="Python_nn47">33.7.2 Simple pointers</a></H3>
 
 
 <p>
@@ -4301,7 +4301,7 @@
 See the <a href="Library.html#Library">SWIG Library</a> chapter for further details.
 </p>
 
-<H3><a name="Python_nn48">32.7.3 Unbounded C Arrays</a></H3>
+<H3><a name="Python_nn48">33.7.3 Unbounded C Arrays</a></H3>
 
 
 <p>
@@ -4363,7 +4363,7 @@
 package binary data, etc.
 </p>
 
-<H3><a name="Python_nn49">32.7.4 String handling</a></H3>
+<H3><a name="Python_nn49">33.7.4 String handling</a></H3>
 
 
 <p>
@@ -4433,7 +4433,7 @@
 </p>
 
 
-<H3><a name="Python_default_args">32.7.5 Default arguments</a></H3>
+<H3><a name="Python_default_args">33.7.5 Default arguments</a></H3>
 
 
 <p>
@@ -4532,7 +4532,7 @@
 equivalent Python default argument values.
 </p>
 
-<H2><a name="Python_nn53">32.8 Typemaps</a></H2>
+<H2><a name="Python_nn53">33.8 Typemaps</a></H2>
 
 
 <p>
@@ -4549,7 +4549,7 @@
 C-Python interface or if you want to elevate your guru status.
 </p>
 
-<H3><a name="Python_nn54">32.8.1 What is a typemap?</a></H3>
+<H3><a name="Python_nn54">33.8.1 What is a typemap?</a></H3>
 
 
 <p>
@@ -4665,7 +4665,7 @@
 </pre>
 </div>
 
-<H3><a name="Python_nn55">32.8.2 Python typemaps</a></H3>
+<H3><a name="Python_nn55">33.8.2 Python typemaps</a></H3>
 
 
 <p>
@@ -4706,7 +4706,7 @@
 </p>
 
 
-<H3><a name="Python_nn56">32.8.3 Typemap variables</a></H3>
+<H3><a name="Python_nn56">33.8.3 Typemap variables</a></H3>
 
 
 <p>
@@ -4777,7 +4777,7 @@
 The Python name of the wrapper function being created.
 </div>
 
-<H3><a name="Python_nn57">32.8.4 Useful Python Functions</a></H3>
+<H3><a name="Python_nn57">33.8.4 Useful Python Functions</a></H3>
 
 
 <p>
@@ -4905,7 +4905,7 @@
 </pre>
 </div>
 
-<H2><a name="Python_nn58">32.9 Typemap Examples</a></H2>
+<H2><a name="Python_nn58">33.9 Typemap Examples</a></H2>
 
 
 <p>
@@ -4914,7 +4914,7 @@
 the SWIG library.
 </p>
 
-<H3><a name="Python_nn59">32.9.1 Converting  Python list to a char ** </a></H3>
+<H3><a name="Python_nn59">33.9.1 Converting  Python list to a char ** </a></H3>
 
 
 <p>
@@ -4994,7 +4994,7 @@
 the C function.
 </p>
 
-<H3><a name="Python_nn60">32.9.2 Expanding a Python object into multiple arguments</a></H3>
+<H3><a name="Python_nn60">33.9.2 Expanding a Python object into multiple arguments</a></H3>
 
 
 <p>
@@ -5113,7 +5113,7 @@
 </pre>
 </div>
 
-<H3><a name="Python_nn61">32.9.3 Using typemaps to return arguments</a></H3>
+<H3><a name="Python_nn61">33.9.3 Using typemaps to return arguments</a></H3>
 
 
 <p>
@@ -5201,7 +5201,7 @@
 &gt;&gt;&gt;
 </pre></div>
 
-<H3><a name="Python_nn62">32.9.4 Mapping Python tuples into small arrays</a></H3>
+<H3><a name="Python_nn62">33.9.4 Mapping Python tuples into small arrays</a></H3>
 
 
 <p>
@@ -5250,7 +5250,7 @@
 for small structures, this approach works fine.
 </p>
 
-<H3><a name="Python_nn63">32.9.5 Mapping sequences to C arrays</a></H3>
+<H3><a name="Python_nn63">33.9.5 Mapping sequences to C arrays</a></H3>
 
 
 <p>
@@ -5339,7 +5339,7 @@
 </pre>
 </div>
 
-<H3><a name="Python_nn64">32.9.6 Pointer handling</a></H3>
+<H3><a name="Python_nn64">33.9.6 Pointer handling</a></H3>
 
 
 <p>
@@ -5436,7 +5436,7 @@
 class object (if applicable).
 </p>
 
-<H3><a name="Python_memory_management_member_variables">32.9.7 Memory management when returning references to member variables</a></H3>
+<H3><a name="Python_memory_management_member_variables">33.9.7 Memory management when returning references to member variables</a></H3>
 
 
 <p>
@@ -5597,7 +5597,7 @@
 
 
 
-<H2><a name="Python_nn65">32.10 Docstring Features</a></H2>
+<H2><a name="Python_nn65">33.10 Docstring Features</a></H2>
 
 
 <p>
@@ -5625,7 +5625,7 @@
 </p>
 
 
-<H3><a name="Python_nn66">32.10.1 Module docstring</a></H3>
+<H3><a name="Python_nn66">33.10.1 Module docstring</a></H3>
 
 
 <p>
@@ -5659,7 +5659,7 @@
 </div>
 
 
-<H3><a name="Python_nn67">32.10.2 %feature("autodoc")</a></H3>
+<H3><a name="Python_nn67">33.10.2 %feature("autodoc")</a></H3>
 
 
 <p>
@@ -5687,7 +5687,7 @@
 feature, <tt>%feature("autodoc", "<i>level</i>")</tt>.
 The four values for <i>level</i> are covered in the following sub-sections.
 
-<H4><a name="Python_nn68">32.10.2.1 %feature("autodoc", "0")</a></H4>
+<H4><a name="Python_nn68">33.10.2.1 %feature("autodoc", "0")</a></H4>
 
 
 <p>
@@ -5716,7 +5716,7 @@
 </div>
 
 
-<H4><a name="Python_nn69">32.10.2.2 %feature("autodoc", "1")</a></H4>
+<H4><a name="Python_nn69">33.10.2.2 %feature("autodoc", "1")</a></H4>
 
 
 <p>
@@ -5741,7 +5741,7 @@
 </div>
 
 
-<H4><a name="Python_autodoc2">32.10.2.3 %feature("autodoc", "2")</a></H4>
+<H4><a name="Python_autodoc2">33.10.2.3 %feature("autodoc", "2")</a></H4>
 
 
 <p>
@@ -5803,7 +5803,7 @@
 </pre>
 </div>
 
-<H4><a name="Python_autodoc3">32.10.2.4 %feature("autodoc", "3")</a></H4>
+<H4><a name="Python_autodoc3">33.10.2.4 %feature("autodoc", "3")</a></H4>
 
 
 <p>
@@ -5829,7 +5829,7 @@
 </div>
 
 
-<H4><a name="Python_nn70">32.10.2.5 %feature("autodoc", "docstring")</a></H4>
+<H4><a name="Python_nn70">33.10.2.5 %feature("autodoc", "docstring")</a></H4>
 
 
 <p>
@@ -5848,7 +5848,7 @@
 </div>
 
 
-<H3><a name="Python_nn71">32.10.3 %feature("docstring")</a></H3>
+<H3><a name="Python_nn71">33.10.3 %feature("docstring")</a></H3>
 
 
 <p>
@@ -5880,7 +5880,7 @@
 </pre>
 </div>
 
-<H2><a name="Python_nn72">32.11 Python Packages</a></H2>
+<H2><a name="Python_nn72">33.11 Python Packages</a></H2>
 
 
 <p>Python has concepts of modules and packages. Modules are separate units of
@@ -5954,7 +5954,7 @@
 <tt>%module</tt> directive or import related command line options. These are
 explained in the following sections.</p>
 
-<H3><a name="Python_modulepackage">32.11.1 Setting the Python package</a></H3>
+<H3><a name="Python_modulepackage">33.11.1 Setting the Python package</a></H3>
 
 
 <p>
@@ -6008,7 +6008,7 @@
 </pre>
 </div>
 
-<H3><a name="Python_absrelimports">32.11.2 Absolute and relative imports</a></H3>
+<H3><a name="Python_absrelimports">33.11.2 Absolute and relative imports</a></H3>
 
 
 <p>Suppose, we have the following hierarchy of files:</p>
@@ -6145,7 +6145,7 @@
 <tt>__init__.py</tt> to import symbols from submodules or subpackages and the
 submodule depends on other submodules (discussed later).</p>
 
-<H3><a name="Python_absimport">32.11.3 Enforcing absolute import semantics</a></H3>
+<H3><a name="Python_absimport">33.11.3 Enforcing absolute import semantics</a></H3>
 
 
 <p>As you may know, there is an incompatibility in import semantics (for the
@@ -6182,7 +6182,7 @@
 </pre>
 </div>
 
-<H3><a name="Python_importfrominit">32.11.4 Importing from __init__.py</a></H3>
+<H3><a name="Python_importfrominit">33.11.4 Importing from __init__.py</a></H3>
 
 
 <p>Imports in <tt>__init__.py</tt> are handy when you want to populate a
@@ -6292,7 +6292,7 @@
 effect (note, that the Python 2 case also needs the <tt>-relativeimport</tt>
 workaround).</p>
 
-<H3><a name="Python_implicit_namespace_packages">32.11.5 Implicit namespace packages</a></H3>
+<H3><a name="Python_implicit_namespace_packages">33.11.5 Implicit namespace packages</a></H3>
 
 
 <p> Python 3.3 introduced
@@ -6370,7 +6370,7 @@
 </p>
 
 
-<H3><a name="Python_package_search">32.11.6 Location of modules</a></H3>
+<H3><a name="Python_package_search">33.11.6 Location of modules</a></H3>
 
 
 <p>
@@ -6406,7 +6406,7 @@
 An input interface file, foo.i, results in the two modules foo.py and _foo.so for each of the configurations.
 </p>
 
-<H4><a name="Python_package_search_both_package_modules">32.11.6.1 Both modules in the same package</a></H4>
+<H4><a name="Python_package_search_both_package_modules">33.11.6.1 Both modules in the same package</a></H4>
 
 
 <p>
@@ -6441,7 +6441,7 @@
 </div>
 
 
-<H4><a name="Python_package_search_both_global_modules">32.11.6.2 Both modules are global</a></H4>
+<H4><a name="Python_package_search_both_global_modules">33.11.6.2 Both modules are global</a></H4>
 
 
 <p>
@@ -6473,7 +6473,7 @@
 </pre>
 </div>
 
-<H4><a name="Python_package_search_wrapper_split">32.11.6.3 Split modules custom configuration</a></H4>
+<H4><a name="Python_package_search_wrapper_split">33.11.6.3 Split modules custom configuration</a></H4>
 
 
 <p>In this non-standard 'split module' configuration, the pure Python module is in a package and the low level C/C++ module is global.
@@ -6523,7 +6523,7 @@
 </p>
 
 
-<H4><a name="Python_custom_module_import">32.11.6.4 More on customizing the module import code</a></H4>
+<H4><a name="Python_custom_module_import">33.11.6.4 More on customizing the module import code</a></H4>
 
 
 <p>
@@ -6643,7 +6643,7 @@
 </pre>
 </div>
 
-<H4><a name="Python_package_search_static">32.11.6.5 Statically linked C modules</a></H4>
+<H4><a name="Python_package_search_static">33.11.6.5 Statically linked C modules</a></H4>
 
 
 <p>It is strongly recommended to use dynamically linked modules for the C
@@ -6715,7 +6715,7 @@
 to do this (remember you are now the Python importer) or use dynamic linking.
 </p>
 
-<H2><a name="Python_python3support">32.12 Python 3 Support</a></H2>
+<H2><a name="Python_python3support">33.12 Python 3 Support</a></H2>
 
 
 <p>
@@ -6740,7 +6740,7 @@
 SWIG.
 </p>
 
-<H3><a name="Python_nn74">32.12.1 Function annotation</a></H3>
+<H3><a name="Python_nn74">33.12.1 Function annotation</a></H3>
 
 
 <p>
@@ -6773,7 +6773,7 @@
 <a href="https://www.python.org/dev/peps/pep-3107/">PEP 3107</a>.
 </p>
 
-<H3><a name="Python_nn75">32.12.2 Buffer interface</a></H3>
+<H3><a name="Python_nn75">33.12.2 Buffer interface</a></H3>
 
 
 <p>
@@ -6925,7 +6925,7 @@
 </div>
 
 
-<H3><a name="Python_nn76">32.12.3 Abstract base classes</a></H3>
+<H3><a name="Python_nn76">33.12.3 Abstract base classes</a></H3>
 
 
 <p>
@@ -6975,7 +6975,7 @@
 requires Python 3.3 or later.
 </p>
 
-<H3><a name="Python_nn77">32.12.4 Byte string output conversion</a></H3>
+<H3><a name="Python_nn77">33.12.4 Byte string output conversion</a></H3>
 
 
 <p>
@@ -7156,7 +7156,7 @@
 (as Python unicode).
 </p>
 
-<H3><a name="Python_2_unicode">32.12.5 Python 2 Unicode</a></H3>
+<H3><a name="Python_2_unicode">33.12.5 Python 2 Unicode</a></H3>
 
 
 <p>
@@ -7228,7 +7228,7 @@
 prohibiting it.
 </p>
 
-<H2><a name="Python_multithreaded">32.13 Support for Multithreaded Applications</a></H2>
+<H2><a name="Python_multithreaded">33.13 Support for Multithreaded Applications</a></H2>
 
 
 <p>By default, SWIG does not enable support for multithreaded Python applications.  More
@@ -7243,7 +7243,7 @@
     interface for this is described in the next section.
 </p>
 
-<H3><a name="Python_thread_UI">32.13.1 UI for Enabling Multithreading Support</a></H3>
+<H3><a name="Python_thread_UI">33.13.1 UI for Enabling Multithreading Support</a></H3>
 
 
 <p>The user interface is as follows:</p>
@@ -7286,7 +7286,7 @@
   </li>
 </ol>
 
-<H3><a name="Python_thread_performance">32.13.2 Multithread Performance</a></H3>
+<H3><a name="Python_thread_performance">33.13.2 Multithread Performance</a></H3>
 
 
 <p>
diff --git a/Doc/Manual/R.html b/Doc/Manual/R.html
index 45e5541..6547ab1 100644
--- a/Doc/Manual/R.html
+++ b/Doc/Manual/R.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="R">33 SWIG and R</a></H1>
+<H1><a name="R">34 SWIG and R</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -28,13 +28,15 @@
 R is a GPL'ed open source statistical and plotting environment.
 Information about R can be found at <a
 href="http://www.r-project.org/">www.r-project.org</a>.
+</p>
 
+<p>
 The R bindings are under active development.  They have been used to
 compile and run an R interface to QuantLib running on Mandriva Linux
 with gcc. The R bindings also work on Microsoft Windows using Visual C++.
 </p>
 
-<H2><a name="R_nn2">33.1 Bugs</a></H2>
+<H2><a name="R_nn2">34.1 Bugs</a></H2>
 
 
 <p>
@@ -46,7 +48,7 @@
 <li>C Array wrappings
 </ul>
 
-<H2><a name="R_nn3">33.2 Using R and SWIG</a></H2>
+<H2><a name="R_nn3">34.2 Using R and SWIG</a></H2>
 
 
 <p>
@@ -113,11 +115,10 @@
 </pre>
 </div>
 
+<p>
 The cacheMetaData(1) will cause R to refresh its object tables.
 Without it, inheritance of wrapped objects may fail.
-
-<p>
-These two files can be loaded in any order
+These two files can be loaded in any order.
 </p>
 
 <p>
@@ -137,25 +138,29 @@
 <li>Make sure the architecture of the shared library(x64 for instance), matches the architecture of the R program you want to load your shared library into
 </ul>
 
-<H2><a name="R_nn4">33.3 Precompiling large R files</a></H2>
+<H2><a name="R_nn4">34.3 Precompiling large R files</a></H2>
 
 
+<p>
 In cases where the R file is large, one make save a lot of loading
 time by precompiling the R wrapper.  This can be done by creating the
 file makeRData.R which contains the following
+</p>
 
-<pre>
+<div class="code"><pre>
 source('BigFile.R')
 save(list=ls(all=TRUE), file="BigFile.RData", compress=TRUE)
 q(save="no")
-</pre>
+</pre></div>
 
+<p>
 This will generate a compiled R file called BigFile.RData that
 will save a large amount of loading time.
+</p>
 
 
 
-<H2><a name="R_nn5">33.4 General policy</a></H2>
+<H2><a name="R_nn5">34.4 General policy</a></H2>
 
 
 <p>
@@ -164,7 +169,7 @@
 to provide R syntax.
 </p>
 
-<H2><a name="R_language_conventions">33.5 Language conventions</a></H2>
+<H2><a name="R_language_conventions">34.5 Language conventions</a></H2>
 
 
 <p>
@@ -173,7 +178,7 @@
 slices)
 </p>
 
-<H2><a name="R_nn6">33.6 C++ classes</a></H2>
+<H2><a name="R_nn6">34.6 C++ classes</a></H2>
 
 
 <p>
@@ -185,28 +190,34 @@
 of the proxy class baggage you see in other languages.
 </p>
 
-<H2><a name="R_nn7">33.7 Enumerations</a></H2>
+<H2><a name="R_nn7">34.7 Enumerations</a></H2>
 
 
 <p>
 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.
+</p>
 
+<p>
 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:
+</p>
+
 <div class="code"><pre>
 enum colour { red=-1, blue, green = 10 };
 </pre></div>
 
+<p>
 will be initialized by the following call in R:
+</p>
+
 <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>
@@ -216,7 +227,9 @@
 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.
+</p>
 
+<p>
 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
@@ -224,14 +237,17 @@
 values, and those attributes are used to identify and access the
 appropriate environments and thus translate between characters
 and integers.
+</p>
 
+<p>
 The relevant functions, for debugging purposes, are <tt>enumToInteger</tt> and
 <tt>enumFromInteger</tt>.
+</p>
 
+<p>
 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/Ruby.html b/Doc/Manual/Ruby.html
index aa42126..5581cc4 100644
--- a/Doc/Manual/Ruby.html
+++ b/Doc/Manual/Ruby.html
@@ -8,7 +8,7 @@
 
 <body bgcolor="#ffffff">
 
-<H1><a name="Ruby">34 SWIG and Ruby</a></H1>
+<H1><a name="Ruby">35 SWIG and Ruby</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -149,10 +149,10 @@
 
 <p>This chapter describes SWIG's support of Ruby.</p>
 
-<H2><a name="Ruby_nn2">34.1 Preliminaries</a></H2>
+<H2><a name="Ruby_nn2">35.1 Preliminaries</a></H2>
 
 
-<p> SWIG 3.0 is known to work with Ruby versions 1.8 and later.
+<p> SWIG 4.0 is known to work with Ruby versions 1.9 and later.
 Given the choice, you should use the latest stable version of Ruby. You
 should also determine if your system supports shared libraries and
 dynamic loading. SWIG will work with or without dynamic loading, but
@@ -164,7 +164,7 @@
 chapter. It is also assumed that the reader has a basic understanding
 of Ruby. </p>
 
-<H3><a name="Ruby_nn3">34.1.1 Running SWIG</a></H3>
+<H3><a name="Ruby_nn3">35.1.1 Running SWIG</a></H3>
 
 
 <p> To build a Ruby module, run SWIG using the <tt>-ruby</tt>
@@ -188,7 +188,7 @@
 build a Ruby extension module. To finish building the module, you need
 to compile this file and link it with the rest of your program. </p>
 
-<H3><a name="Ruby_nn4">34.1.2 Getting the right header files</a></H3>
+<H3><a name="Ruby_nn4">35.1.2 Getting the right header files</a></H3>
 
 
 <p> In order to compile the wrapper code, the compiler needs the <tt>ruby.h</tt>
@@ -202,7 +202,7 @@
 </pre>
 </div>
 
-<H3><a name="Ruby_nn5">34.1.3 Compiling a dynamic module</a></H3>
+<H3><a name="Ruby_nn5">35.1.3 Compiling a dynamic module</a></H3>
 
 
 <p> Ruby extension modules are typically compiled into shared
@@ -275,7 +275,7 @@
 of options. You might also check the <a href="https://github.com/swig/swig/wiki">SWIG Wiki</a>
 for additional information. </p>
 
-<H3><a name="Ruby_nn6">34.1.4 Using your module</a></H3>
+<H3><a name="Ruby_nn6">35.1.4 Using your module</a></H3>
 
 
 <p> Ruby <i>module</i> names must be capitalized,
@@ -305,7 +305,7 @@
 <p> will result in an extension module using the feature name
 "example" and Ruby module name "Example". </p>
 
-<H3><a name="Ruby_nn7">34.1.5 Static linking</a></H3>
+<H3><a name="Ruby_nn7">35.1.5 Static linking</a></H3>
 
 
 <p> An alternative approach to dynamic linking is to rebuild the
@@ -320,7 +320,7 @@
 file, adding your directory to the list of extensions in the file, and
 finally rebuilding Ruby. </p>
 
-<H3><a name="Ruby_nn8">34.1.6 Compilation of C++ extensions</a></H3>
+<H3><a name="Ruby_nn8">35.1.6 Compilation of C++ extensions</a></H3>
 
 
 <p> On most machines, C++ extension modules should be linked
@@ -352,7 +352,7 @@
 create_makefile('example')</pre>
 </div>
 
-<H2><a name="Ruby_nn9">34.2 Building Ruby Extensions under Windows 95/NT</a></H2>
+<H2><a name="Ruby_nn9">35.2 Building Ruby Extensions under Windows 95/NT</a></H2>
 
 
 <p> Building a SWIG extension to Ruby under Windows 95/NT is
@@ -377,7 +377,7 @@
 distribution to the Ruby package, as you will need the Ruby header
 files. </p>
 
-<H3><a name="Ruby_nn10">34.2.1 Running SWIG from Developer Studio</a></H3>
+<H3><a name="Ruby_nn10">35.2.1 Running SWIG from Developer Studio</a></H3>
 
 
 <p> If you are developing your application within Microsoft
@@ -441,13 +441,13 @@
 </pre>
 </div>
 
-<H2><a name="Ruby_nn11">34.3 The Ruby-to-C/C++ Mapping</a></H2>
+<H2><a name="Ruby_nn11">35.3 The Ruby-to-C/C++ Mapping</a></H2>
 
 
 <p> This section describes the basics of how SWIG maps C or C++
 declarations in your SWIG interface files to Ruby constructs. </p>
 
-<H3><a name="Ruby_nn12">34.3.1 Modules</a></H3>
+<H3><a name="Ruby_nn12">35.3.1 Modules</a></H3>
 
 
 <p> The SWIG <tt>%module</tt> directive specifies
@@ -519,7 +519,7 @@
 names of your constants, classes and methods don't conflict with any of
 Ruby's built-in names. </p>
 
-<H3><a name="Ruby_nn13">34.3.2 Functions</a></H3>
+<H3><a name="Ruby_nn13">35.3.2 Functions</a></H3>
 
 
 <p> Global functions are wrapped as Ruby module methods. For
@@ -553,7 +553,7 @@
 24</pre>
 </div>
 
-<H3><a name="Ruby_nn14">34.3.3 Variable Linking</a></H3>
+<H3><a name="Ruby_nn14">35.3.3 Variable Linking</a></H3>
 
 
 <p> C/C++ global variables are wrapped as a pair of singleton
@@ -615,7 +615,25 @@
 effect until it is explicitly disabled using <tt>%mutable</tt>.
 </p>
 
-<H3><a name="Ruby_nn15">34.3.4 Constants</a></H3>
+<p>Note: When SWIG is invoked with the <tt>-globalmodule</tt> option in
+effect, the C/C++ global variables will be translated into Ruby global
+variables. Type-checking and the optional read-only characteristic are
+available in the same way as described above. However the example would
+then have to be modified and executed in the following way:
+
+<div class="code targetlang">
+<pre>$ <b>irb</b>
+irb(main):001:0&gt; <b>require 'Example'</b>
+true
+irb(main):002:0&gt; <b>$variable1 = 2</b>
+2
+irb(main):003:0&gt; <b>$Variable2 = 4 * 10.3</b>
+41.2
+irb(main):004:0&gt; <b>$Variable2</b>
+41.2</pre>
+</div>
+
+<H3><a name="Ruby_nn15">35.3.4 Constants</a></H3>
 
 
 <p> C/C++ constants are wrapped as module constants initialized
@@ -643,7 +661,7 @@
 3.14159</pre>
 </div>
 
-<H3><a name="Ruby_nn16">34.3.5 Pointers</a></H3>
+<H3><a name="Ruby_nn16">35.3.5 Pointers</a></H3>
 
 
 <p> "Opaque" pointers to arbitrary C/C++ types (i.e. types that
@@ -667,7 +685,7 @@
 <p> A <tt>NULL</tt> pointer is always represented by
 the Ruby <tt>nil</tt> object. </p>
 
-<H3><a name="Ruby_nn17">34.3.6 Structures</a></H3>
+<H3><a name="Ruby_nn17">35.3.6 Structures</a></H3>
 
 
 <p> C/C++ structs are wrapped as Ruby classes, with accessor
@@ -772,7 +790,7 @@
 }</pre>
 </div>
 
-<H3><a name="Ruby_nn18">34.3.7 C++ classes</a></H3>
+<H3><a name="Ruby_nn18">35.3.7 C++ classes</a></H3>
 
 
 <p> Like structs, C++ classes are wrapped by creating a new Ruby
@@ -827,7 +845,7 @@
 3</pre>
 </div>
 
-<H3><a name="Ruby_nn19">34.3.8 C++ Inheritance</a></H3>
+<H3><a name="Ruby_nn19">35.3.8 C++ Inheritance</a></H3>
 
 
 <p> The SWIG type-checker is fully aware of C++ inheritance.
@@ -980,7 +998,7 @@
 (i.e. they exhibit <a href="http://c2.com/cgi/wiki?DuckTyping">"Duck
 Typing"</a>). </p>
 
-<H3><a name="Ruby_nn20">34.3.9 C++ Overloaded Functions</a></H3>
+<H3><a name="Ruby_nn20">35.3.9 C++ Overloaded Functions</a></H3>
 
 
 <p> C++ overloaded functions, methods, and constructors are
@@ -1070,7 +1088,7 @@
 <p>Please refer to the <a href="SWIGPlus.html#SWIGPlus">"SWIG
 and C++"</a> chapter for more information about overloading. </p>
 
-<H3><a name="Ruby_nn21">34.3.10 C++ Operators</a></H3>
+<H3><a name="Ruby_nn21">35.3.10 C++ Operators</a></H3>
 
 
 <p> For the most part, overloaded operators are handled
@@ -1112,7 +1130,7 @@
 is discussed in the <a href="#Ruby_operator_overloading">section
 on operator overloading</a>. </p>
 
-<H3><a name="Ruby_nn22">34.3.11 C++ namespaces</a></H3>
+<H3><a name="Ruby_nn22">35.3.11 C++ namespaces</a></H3>
 
 
 <p> SWIG is aware of C++ namespaces, but namespace names do not
@@ -1169,7 +1187,7 @@
 program utilizes thousands of small deeply nested namespaces each with
 identical symbol names, well, then you get what you deserve. </p>
 
-<H3><a name="Ruby_nn23">34.3.12 C++ templates</a></H3>
+<H3><a name="Ruby_nn23">35.3.12 C++ templates</a></H3>
 
 
 <p> C++ templates don't present a huge problem for SWIG. However,
@@ -1211,7 +1229,7 @@
 4</pre>
 </div>
 
-<H3><a name="Ruby_nn23_1">34.3.13 C++ Standard Template Library (STL)</a></H3>
+<H3><a name="Ruby_nn23_1">35.3.13 C++ Standard Template Library (STL)</a></H3>
 
 
 <p> On a related note, the standard SWIG library contains a
@@ -1304,7 +1322,7 @@
 shown in these examples. More details can be found in the <a href="SWIGPlus.html#SWIGPlus">SWIG and C++</a>
 chapter.</p>
 
-<H3><a name="Ruby_C_STL_Functors">34.3.14 C++ STL Functors</a></H3>
+<H3><a name="Ruby_C_STL_Functors">35.3.14 C++ STL Functors</a></H3>
 
 
 <p>Some containers in the STL allow you to modify their default
@@ -1365,7 +1383,7 @@
 </pre>
 </div>
 
-<H3><a name="Ruby_C_Iterators">34.3.15 C++ STL Iterators</a></H3>
+<H3><a name="Ruby_C_Iterators">35.3.15 C++ STL Iterators</a></H3>
 
 
 <p>The STL is well known for the use of iterators. There
@@ -1448,10 +1466,10 @@
 
 <p>If you'd rather have STL classes without any iterators, you should define <tt>-DSWIG_NO_EXPORT_ITERATOR_METHODS</tt> when running swig.</p>
 
-<H3><a name="Ruby_nn24">34.3.16 C++ Smart Pointers</a></H3>
+<H3><a name="Ruby_nn24">35.3.16 C++ Smart Pointers</a></H3>
 
 
-<H4><a name="Ruby_smart_pointers_shared_ptr">34.3.16.1 The shared_ptr Smart Pointer</a></H4>
+<H4><a name="Ruby_smart_pointers_shared_ptr">35.3.16.1 The shared_ptr Smart Pointer</a></H4>
 
 
 <p>
@@ -1462,7 +1480,7 @@
 </p>
 
 
-<H4><a name="Ruby_smart_pointers_generic">34.3.16.2 Generic Smart Pointers</a></H4>
+<H4><a name="Ruby_smart_pointers_generic">35.3.16.2 Generic Smart Pointers</a></H4>
 
 
 <p> In certain C++ programs, it is common to use classes that
@@ -1527,7 +1545,7 @@
 <pre>irb(main):004:0&gt; <b>f = p.__deref__()</b> # Returns underlying Foo *</pre>
 </div>
 
-<H3><a name="Ruby_nn25">34.3.17 Cross-Language Polymorphism</a></H3>
+<H3><a name="Ruby_nn25">35.3.17 Cross-Language Polymorphism</a></H3>
 
 
 <p> SWIG's Ruby module supports cross-language polymorphism
@@ -1536,7 +1554,7 @@
 section just notes the differences that you need to be aware of when
 using this feature with Ruby. </p>
 
-<H4><a name="Ruby_nn26">34.3.17.1 Exception Unrolling</a></H4>
+<H4><a name="Ruby_nn26">35.3.17.1 Exception Unrolling</a></H4>
 
 
 <p> Whenever a C++ director class routes one of its virtual
@@ -1559,7 +1577,7 @@
 function from Ruby's C API. If any Ruby exception is raised, it will be
 caught here and a C++ exception is raised in its place. </p>
 
-<H2><a name="Ruby_nn27">34.4 Naming</a></H2>
+<H2><a name="Ruby_nn27">35.4 Naming</a></H2>
 
 
 <p>Ruby has several common naming conventions. Constants are
@@ -1597,7 +1615,7 @@
 by SWIG, it is turned off by default in SWIG 1.3.28. However, it is
 planned to become the default option in future releases.</p>
 
-<H3><a name="Ruby_nn28">34.4.1 Defining Aliases</a></H3>
+<H3><a name="Ruby_nn28">35.4.1 Defining Aliases</a></H3>
 
 
 <p> It's a fairly common practice in the Ruby built-ins and
@@ -1667,7 +1685,7 @@
 on <a href="Customization.html#Customization">"Customization
 Features"</a>) for more details).</p>
 
-<H3><a name="Ruby_nn29">34.4.2 Predicate Methods</a></H3>
+<H3><a name="Ruby_nn29">35.4.2 Predicate Methods</a></H3>
 
 
 <p> Ruby methods that return a boolean value and end in a
@@ -1716,7 +1734,7 @@
 used for other kinds of features apply (see the chapter on <a href="Customization.html#Customization">"Customization
 Features"</a>) for more details). </p>
 
-<H3><a name="Ruby_nn30">34.4.3 Bang Methods</a></H3>
+<H3><a name="Ruby_nn30">35.4.3 Bang Methods</a></H3>
 
 
 <p> Ruby methods that modify an object in-place and end in an
@@ -1748,7 +1766,7 @@
 used for other kinds of features apply (see the chapter on <a href="Customization.html#Customization">"Customization
 Features"</a>) for more details). </p>
 
-<H3><a name="Ruby_nn31">34.4.4 Getters and Setters</a></H3>
+<H3><a name="Ruby_nn31">35.4.4 Getters and Setters</a></H3>
 
 
 <p> Often times a C++ library will expose properties through
@@ -1783,7 +1801,7 @@
 %rename("value=") Foo::setValue(int value);</pre>
 </div>
 
-<H2><a name="Ruby_nn32">34.5 Input and output parameters</a></H2>
+<H2><a name="Ruby_nn32">35.5 Input and output parameters</a></H2>
 
 
 <p> A common problem in some C programs is handling parameters
@@ -1922,10 +1940,10 @@
 <pre>r, c = Example.get_dimensions(m)</pre>
 </div>
 
-<H2><a name="Ruby_nn33">34.6 Exception handling </a></H2>
+<H2><a name="Ruby_nn33">35.6 Exception handling </a></H2>
 
 
-<H3><a name="Ruby_nn34">34.6.1 Using the %exception directive </a></H3>
+<H3><a name="Ruby_nn34">35.6.1 Using the %exception directive </a></H3>
 
 
 <p>The SWIG <tt>%exception</tt> directive can be
@@ -2034,7 +2052,7 @@
 limited to C++ exception handling. See the chapter on <a href="Customization.html#Customization">Customization
 Features</a> for more examples.</p>
 
-<H3><a name="Ruby_nn34_2">34.6.2 Handling Ruby Blocks </a></H3>
+<H3><a name="Ruby_nn34_2">35.6.2 Handling Ruby Blocks </a></H3>
 
 
 <p>One of the highlights of Ruby and most of its standard library
@@ -2101,7 +2119,7 @@
 
 <p>For more information on typemaps, see <a href="#Ruby_nn37">Typemaps</a>.</p>
 
-<H3><a name="Ruby_nn35">34.6.3 Raising exceptions </a></H3>
+<H3><a name="Ruby_nn35">35.6.3 Raising exceptions </a></H3>
 
 
 <p>There are three ways to raise exceptions from C++ code to
@@ -2258,7 +2276,7 @@
 is the exception type. You can raise a custom exception type or one of
 the built-in Ruby exception types.</p>
 
-<H3><a name="Ruby_nn36">34.6.4 Exception classes </a></H3>
+<H3><a name="Ruby_nn36">35.6.4 Exception classes </a></H3>
 
 
 <p>Starting with SWIG 1.3.28, the Ruby module supports the <tt>%exceptionclass</tt>
@@ -2295,7 +2313,7 @@
 <p>For another example look at swig/Examples/ruby/exception_class.
 </p>
 
-<H2><a name="Ruby_nn37">34.7 Typemaps</a></H2>
+<H2><a name="Ruby_nn37">35.7 Typemaps</a></H2>
 
 
 <p> This section describes how you can modify SWIG's default
@@ -2310,7 +2328,7 @@
 in most cases. Typemaps are only used if you want to change some aspect
 of the primitive C-Ruby interface.</p>
 
-<H3><a name="Ruby_nn38">34.7.1 What is a typemap?</a></H3>
+<H3><a name="Ruby_nn38">35.7.1 What is a typemap?</a></H3>
 
 
 <p> A typemap is nothing more than a code generation rule that is
@@ -2467,7 +2485,7 @@
 2</pre>
 </div>
 
-<H3><a name="Ruby_Typemap_scope">34.7.2 Typemap scope</a></H3>
+<H3><a name="Ruby_Typemap_scope">35.7.2 Typemap scope</a></H3>
 
 
 <p> Once defined, a typemap remains in effect for all of the
@@ -2513,7 +2531,7 @@
 };</pre>
 </div>
 
-<H3><a name="Ruby_Copying_a_typemap">34.7.3 Copying a typemap</a></H3>
+<H3><a name="Ruby_Copying_a_typemap">35.7.3 Copying a typemap</a></H3>
 
 
 <p> A typemap is copied by using assignment. For example:</p>
@@ -2555,7 +2573,7 @@
 %apply (char *buf, int len) { (char *buffer, int size) }; // Multiple arguments</pre>
 </div>
 
-<H3><a name="Ruby_Deleting_a_typemap">34.7.4 Deleting a typemap</a></H3>
+<H3><a name="Ruby_Deleting_a_typemap">35.7.4 Deleting a typemap</a></H3>
 
 
 <p> A typemap can be deleted by simply defining no code. For
@@ -2580,7 +2598,7 @@
 will make that type unusable unless you also define a new set of
 typemaps immediately after the clear operation.</p>
 
-<H3><a name="Ruby_Placement_of_typemaps">34.7.5 Placement of typemaps</a></H3>
+<H3><a name="Ruby_Placement_of_typemaps">35.7.5 Placement of typemaps</a></H3>
 
 
 <p> Typemap declarations can be declared in the global scope,
@@ -2651,13 +2669,13 @@
 string</tt>
 .</p>
 
-<H3><a name="Ruby_nn39">34.7.6 Ruby typemaps</a></H3>
+<H3><a name="Ruby_nn39">35.7.6 Ruby typemaps</a></H3>
 
 
 <p>The following list details all of the typemap methods that
 can be used by the Ruby module: </p>
 
-<H4><a name="Ruby_in_typemap">34.7.6.1 "in" typemap</a></H4>
+<H4><a name="Ruby_in_typemap">35.7.6.1 "in" typemap</a></H4>
 
 
 <p>Converts Ruby objects to input
@@ -2724,7 +2742,7 @@
 
 <p> At this time, only zero or one arguments may be converted.</p>
 
-<H4><a name="Ruby_typecheck_typemap">34.7.6.2 "typecheck" typemap</a></H4>
+<H4><a name="Ruby_typecheck_typemap">35.7.6.2 "typecheck" typemap</a></H4>
 
 
 <p> The "typecheck" typemap is used to support overloaded
@@ -2746,7 +2764,7 @@
 "typecheck" typemaps. More details about this follow in a later section
 on "Typemaps and Overloading."</p>
 
-<H4><a name="Ruby_out_typemap">34.7.6.3 "out" typemap</a></H4>
+<H4><a name="Ruby_out_typemap">35.7.6.3 "out" typemap</a></H4>
 
 
 <p>Converts return value of a C function
@@ -2797,7 +2815,7 @@
 </table>
 </div>
 
-<H4><a name="Ruby_arginit_typemap">34.7.6.4 "arginit" typemap</a></H4>
+<H4><a name="Ruby_arginit_typemap">35.7.6.4 "arginit" typemap</a></H4>
 
 
 <p> The "arginit" typemap is used to set the initial value of a
@@ -2812,7 +2830,7 @@
 }</pre>
 </div>
 
-<H4><a name="Ruby_default_typemap">34.7.6.5 "default" typemap</a></H4>
+<H4><a name="Ruby_default_typemap">35.7.6.5 "default" typemap</a></H4>
 
 
 <p> The "default" typemap is used to turn an argument into a
@@ -2837,7 +2855,7 @@
 Default/optional arguments</a> section for further information on
 default argument wrapping.</p>
 
-<H4><a name="Ruby_check_typemap">34.7.6.6 "check" typemap</a></H4>
+<H4><a name="Ruby_check_typemap">35.7.6.6 "check" typemap</a></H4>
 
 
 <p> The "check" typemap is used to supply value checking code
@@ -2852,7 +2870,7 @@
 }</pre>
 </div>
 
-<H4><a name="Ruby_argout_typemap_">34.7.6.7 "argout" typemap</a></H4>
+<H4><a name="Ruby_argout_typemap_">35.7.6.7 "argout" typemap</a></H4>
 
 
 <p> The "argout" typemap is used to return values from arguments.
@@ -2906,7 +2924,7 @@
 
 <p> See the <tt>typemaps.i</tt> library for examples.</p>
 
-<H4><a name="Ruby_freearg_typemap_">34.7.6.8 "freearg" typemap</a></H4>
+<H4><a name="Ruby_freearg_typemap_">35.7.6.8 "freearg" typemap</a></H4>
 
 
 <p> The "freearg" typemap is used to cleanup argument data. It is
@@ -2933,7 +2951,7 @@
 that may be used in other typemaps whenever a wrapper function needs to
 abort prematurely.</p>
 
-<H4><a name="Ruby_newfree_typemap">34.7.6.9 "newfree" typemap</a></H4>
+<H4><a name="Ruby_newfree_typemap">35.7.6.9 "newfree" typemap</a></H4>
 
 
 <p> The "newfree" typemap is used in conjunction with the <tt>%newobject</tt>
@@ -2957,7 +2975,7 @@
 <p> See <a href="Customization.html#Customization_ownership">Object
 ownership and %newobject</a> for further details.</p>
 
-<H4><a name="Ruby_memberin_typemap">34.7.6.10 "memberin" typemap</a></H4>
+<H4><a name="Ruby_memberin_typemap">35.7.6.10 "memberin" typemap</a></H4>
 
 
 <p> The "memberin" typemap is used to copy data from<em> an
@@ -2975,21 +2993,21 @@
 already provides a default implementation for arrays, strings, and
 other objects.</p>
 
-<H4><a name="Ruby_varin_typemap">34.7.6.11 "varin" typemap</a></H4>
+<H4><a name="Ruby_varin_typemap">35.7.6.11 "varin" typemap</a></H4>
 
 
 <p> The "varin" typemap is used to convert objects in the target
 language to C for the purposes of assigning to a C/C++ global variable.
 This is implementation specific.</p>
 
-<H4><a name="Ruby_varout_typemap_">34.7.6.12 "varout" typemap</a></H4>
+<H4><a name="Ruby_varout_typemap_">35.7.6.12 "varout" typemap</a></H4>
 
 
 <p> The "varout" typemap is used to convert a C/C++ object to an
 object in the target language when reading a C/C++ global variable.
 This is implementation specific.</p>
 
-<H4><a name="Ruby_throws_typemap">34.7.6.13 "throws" typemap</a></H4>
+<H4><a name="Ruby_throws_typemap">35.7.6.13 "throws" typemap</a></H4>
 
 
 <p> The "throws" typemap is only used when SWIG parses a C++
@@ -3030,7 +3048,7 @@
 deal with them. For a neat way to handle these, see the <a href="Customization.html#Customization_exception">Exception
 handling with %exception</a> section.</p>
 
-<H4><a name="Ruby_directorin_typemap">34.7.6.14 directorin typemap</a></H4>
+<H4><a name="Ruby_directorin_typemap">35.7.6.14 directorin typemap</a></H4>
 
 
 <p>Converts C++ objects in director
@@ -3089,7 +3107,7 @@
 </table>
 </div>
 
-<H4><a name="Ruby_directorout_typemap">34.7.6.15 directorout typemap</a></H4>
+<H4><a name="Ruby_directorout_typemap">35.7.6.15 directorout typemap</a></H4>
 
 
 <p>Converts Ruby objects in director
@@ -3162,7 +3180,7 @@
 
 </p>
 
-<H4><a name="Ruby_directorargout_typemap">34.7.6.16 directorargout typemap</a></H4>
+<H4><a name="Ruby_directorargout_typemap">35.7.6.16 directorargout typemap</a></H4>
 
 
 <p>Output argument processing in director
@@ -3220,19 +3238,19 @@
 </table>
 </div>
 
-<H4><a name="Ruby_ret_typemap">34.7.6.17 ret typemap</a></H4>
+<H4><a name="Ruby_ret_typemap">35.7.6.17 ret typemap</a></H4>
 
 
 <p>Cleanup of function return values
 </p>
 
-<H4><a name="Ruby_globalin_typemap">34.7.6.18 globalin typemap</a></H4>
+<H4><a name="Ruby_globalin_typemap">35.7.6.18 globalin typemap</a></H4>
 
 
 <p>Setting of C global variables
 </p>
 
-<H3><a name="Ruby_nn40">34.7.7 Typemap variables</a></H3>
+<H3><a name="Ruby_nn40">35.7.7 Typemap variables</a></H3>
 
 
 <p>
@@ -3282,7 +3300,7 @@
 <div class="indent">The Ruby name of the wrapper function
 being created. </div>
 
-<H3><a name="Ruby_nn41">34.7.8 Useful Functions</a></H3>
+<H3><a name="Ruby_nn41">35.7.8 Useful Functions</a></H3>
 
 
 <p> When you write a typemap, you usually have to work directly
@@ -3297,7 +3315,7 @@
 That should help you avoid having to rewrite a lot of typemaps
 across multiple languages.</p>
 
-<H4><a name="Ruby_nn42">34.7.8.1 C Datatypes to Ruby Objects</a></H4>
+<H4><a name="Ruby_nn42">35.7.8.1 C Datatypes to Ruby Objects</a></H4>
 
 
 <div class="diagram">
@@ -3339,7 +3357,7 @@
 </table>
 </div>
 
-<H4><a name="Ruby_nn43">34.7.8.2 Ruby Objects to C Datatypes</a></H4>
+<H4><a name="Ruby_nn43">35.7.8.2 Ruby Objects to C Datatypes</a></H4>
 
 
 <p>Here, while the Ruby versions return the value directly, the SWIG
@@ -3407,7 +3425,7 @@
 </table>
 </div>
 
-<H4><a name="Ruby_nn44">34.7.8.3 Macros for VALUE</a></H4>
+<H4><a name="Ruby_nn44">35.7.8.3 Macros for VALUE</a></H4>
 
 
 <p> <tt>RSTRING_LEN(str)</tt> </p>
@@ -3430,7 +3448,7 @@
 
 <div class="indent">pointer to array storage</div>
 
-<H4><a name="Ruby_nn45">34.7.8.4 Exceptions</a></H4>
+<H4><a name="Ruby_nn45">35.7.8.4 Exceptions</a></H4>
 
 
 <p> <tt>void rb_raise(VALUE exception, const char *fmt,
@@ -3509,7 +3527,7 @@
 flag. The given format string <i>fmt</i> and remaining
 arguments are interpreted as with <tt>printf()</tt>. </div>
 
-<H4><a name="Ruby_nn46">34.7.8.5 Iterators</a></H4>
+<H4><a name="Ruby_nn46">35.7.8.5 Iterators</a></H4>
 
 
 <p> <tt>void rb_iter_break()</tt> </p>
@@ -3555,14 +3573,14 @@
 <div class="indent"> Equivalent to Ruby's <tt>throw</tt>.
 </div>
 
-<H3><a name="Ruby_nn47">34.7.9 Typemap Examples</a></H3>
+<H3><a name="Ruby_nn47">35.7.9 Typemap Examples</a></H3>
 
 
 <p> This section includes a few examples of typemaps. For more
 examples, you might look at the examples in the <tt>Example/ruby</tt>
 directory. </p>
 
-<H3><a name="Ruby_nn48">34.7.10 Converting a Ruby array to a char **</a></H3>
+<H3><a name="Ruby_nn48">35.7.10 Converting a Ruby array to a char **</a></H3>
 
 
 <p> A common problem in many C programs is the processing of
@@ -3627,7 +3645,7 @@
 the array, the "freearg" typemap is used to later release this memory
 after the execution of the C function. </p>
 
-<H3><a name="Ruby_nn49">34.7.11 Collecting arguments in a hash</a></H3>
+<H3><a name="Ruby_nn49">35.7.11 Collecting arguments in a hash</a></H3>
 
 
 <p> Ruby's solution to the "keyword arguments" capability of some
@@ -3841,7 +3859,7 @@
 program that uses the extension, can be found in the <tt>Examples/ruby/hashargs</tt>
 directory of the SWIG distribution. </p>
 
-<H3><a name="Ruby_nn50">34.7.12 Pointer handling</a></H3>
+<H3><a name="Ruby_nn50">35.7.12 Pointer handling</a></H3>
 
 
 <p> Occasionally, it might be necessary to convert pointer values
@@ -3900,7 +3918,7 @@
 }</pre>
 </div>
 
-<H4><a name="Ruby_nn51">34.7.12.1 Ruby Datatype Wrapping</a></H4>
+<H4><a name="Ruby_nn51">35.7.12.1 Ruby Datatype Wrapping</a></H4>
 
 
 <p> <tt>VALUE Data_Wrap_Struct(VALUE class, void
@@ -3927,7 +3945,7 @@
 type <i>c-type</i> from the data object <i>obj</i>
 and assigns that pointer to <i>ptr</i>. </div>
 
-<H3><a name="Ruby_nn52">34.7.13 Example: STL Vector to Ruby Array</a></H3>
+<H3><a name="Ruby_nn52">35.7.13 Example: STL Vector to Ruby Array</a></H3>
 
 
 <p>Another use for macros and type maps is to create a Ruby array
@@ -4019,7 +4037,7 @@
 which does much more than this. Refer to the section called
 the<a href="#Ruby_nn23_1"> C++ Standard Template Library</a>.
 
-<H2><a name="Ruby_nn65">34.8 Docstring Features</a></H2>
+<H2><a name="Ruby_nn65">35.8 Docstring Features</a></H2>
 
 
 <p>
@@ -4053,7 +4071,7 @@
 $ rdoc -r file_wrap.c
 </pre></div>
 
-<H3><a name="Ruby_nn66">34.8.1 Module docstring</a></H3>
+<H3><a name="Ruby_nn66">35.8.1 Module docstring</a></H3>
 
 
 <p>
@@ -4083,7 +4101,7 @@
 %module(docstring=DOCSTRING) xrc</pre>
 </div>
 
-<H3><a name="Ruby_nn67">34.8.2 %feature("autodoc")</a></H3>
+<H3><a name="Ruby_nn67">35.8.2 %feature("autodoc")</a></H3>
 
 
 <p>Since SWIG does know everything about the function it wraps,
@@ -4104,7 +4122,7 @@
 feature, described below.
 </p>
 
-<H4><a name="Ruby_nn68">34.8.2.1 %feature("autodoc", "0")</a></H4>
+<H4><a name="Ruby_nn68">35.8.2.1 %feature("autodoc", "0")</a></H4>
 
 
 <p>
@@ -4128,7 +4146,7 @@
   ...</pre>
 </div>
 
-<H4><a name="Ruby_autodoc1">34.8.2.2 %feature("autodoc", "1")</a></H4>
+<H4><a name="Ruby_autodoc1">35.8.2.2 %feature("autodoc", "1")</a></H4>
 
 
 <p>
@@ -4148,7 +4166,7 @@
   ...</pre>
 </div>
 
-<H4><a name="Ruby_autodoc2">34.8.2.3 %feature("autodoc", "2")</a></H4>
+<H4><a name="Ruby_autodoc2">35.8.2.3 %feature("autodoc", "2")</a></H4>
 
 
 <p>
@@ -4160,7 +4178,7 @@
 this:
 </p>
 
-<H4><a name="Ruby_feature_autodoc3">34.8.2.4 %feature("autodoc", "3")</a></H4>
+<H4><a name="Ruby_feature_autodoc3">35.8.2.4 %feature("autodoc", "3")</a></H4>
 
 
 <p>
@@ -4181,7 +4199,7 @@
         bar - Bar</pre>
 </div>
 
-<H4><a name="Ruby_nn70">34.8.2.5 %feature("autodoc", "docstring")</a></H4>
+<H4><a name="Ruby_nn70">35.8.2.5 %feature("autodoc", "docstring")</a></H4>
 
 
 <p>
@@ -4197,7 +4215,7 @@
 void GetPosition(int* OUTPUT, int* OUTPUT);</pre>
 </div>
 
-<H3><a name="Ruby_nn71">34.8.3 %feature("docstring")</a></H3>
+<H3><a name="Ruby_nn71">35.8.3 %feature("docstring")</a></H3>
 
 
 <p>
@@ -4208,10 +4226,10 @@
 If an item already has an autodoc string then it is combined with the
 docstring and they are output together. </p>
 
-<H2><a name="Ruby_nn53">34.9 Advanced Topics</a></H2>
+<H2><a name="Ruby_nn53">35.9 Advanced Topics</a></H2>
 
 
-<H3><a name="Ruby_operator_overloading">34.9.1 Operator overloading</a></H3>
+<H3><a name="Ruby_operator_overloading">35.9.1 Operator overloading</a></H3>
 
 
 <p> SWIG allows operator overloading with, by using the <tt>%extend</tt>
@@ -4392,7 +4410,7 @@
 parses the expression <i>a != b</i> as <i>!(a == b)</i>.
 </p>
 
-<H3><a name="Ruby_nn55">34.9.2 Creating Multi-Module Packages</a></H3>
+<H3><a name="Ruby_nn55">35.9.2 Creating Multi-Module Packages</a></H3>
 
 
 <p> The chapter on <a href="Modules.html#Modules">Working
@@ -4518,7 +4536,7 @@
 5.0</pre>
 </div>
 
-<H3><a name="Ruby_nn56">34.9.3 Specifying Mixin Modules</a></H3>
+<H3><a name="Ruby_nn56">35.9.3 Specifying Mixin Modules</a></H3>
 
 
 <p> The Ruby language doesn't support multiple inheritance, but
@@ -4585,7 +4603,7 @@
 on <a href="Customization.html#Customization">"Customization
 Features"</a>) for more details). </p>
 
-<H2><a name="Ruby_nn57">34.10 Memory Management</a></H2>
+<H2><a name="Ruby_nn57">35.10 Memory Management</a></H2>
 
 
 <p>One of the most common issues in generating SWIG bindings for
@@ -4608,7 +4626,7 @@
 invoked. Clearly, developing a SWIG wrapper requires a thorough
 understanding of how the underlying library manages memory.</p>
 
-<H3><a name="Ruby_nn58">34.10.1 Mark and Sweep Garbage Collector </a></H3>
+<H3><a name="Ruby_nn58">35.10.1 Mark and Sweep Garbage Collector </a></H3>
 
 
 <p>Ruby uses a mark and sweep garbage collector. When the garbage
@@ -4639,7 +4657,7 @@
 C++ struct, then a "free" function must be defined that deallocates
 this memory. </p>
 
-<H3><a name="Ruby_nn59">34.10.2 Object Ownership</a></H3>
+<H3><a name="Ruby_nn59">35.10.2 Object Ownership</a></H3>
 
 
 <p>As described above, memory management depends on clearly
@@ -4784,7 +4802,7 @@
 
 <p> This code can be seen in swig/examples/ruby/tracking.</p>
 
-<H3><a name="Ruby_nn60">34.10.3 Object Tracking</a></H3>
+<H3><a name="Ruby_nn60">35.10.3 Object Tracking</a></H3>
 
 
 <p>The remaining parts of this section will use the class library
@@ -5010,7 +5028,7 @@
 also have to call the <tt>SWIG_RubyRemoveTracking</tt> and <tt>RubyUnlinkObjects</tt>
 methods.</p>
 
-<H3><a name="Ruby_nn61">34.10.4 Mark Functions</a></H3>
+<H3><a name="Ruby_nn61">35.10.4 Mark Functions</a></H3>
 
 
 <p>With a bit more testing, we see that our class library still
@@ -5139,7 +5157,7 @@
 
 <p>This code can be seen in swig/examples/ruby/mark_function.</p>
 
-<H3><a name="Ruby_nn62">34.10.5 Free Functions</a></H3>
+<H3><a name="Ruby_nn62">35.10.5 Free Functions</a></H3>
 
 
 <p>By default, SWIG creates a "free" function that is called when
@@ -5307,7 +5325,7 @@
 
 <p>This code can be seen in swig/examples/ruby/free_function.</p>
 
-<H3><a name="Ruby_nn63">34.10.6 Embedded Ruby and the C++ Stack</a></H3>
+<H3><a name="Ruby_nn63">35.10.6 Embedded Ruby and the C++ Stack</a></H3>
 
 
 <p>As has been said, the Ruby GC runs and marks objects before
diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html
index 79d52ef..c54d117 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);
 ...
@@ -827,6 +827,32 @@
 </div>
 
 <p>
+This logic can lead to false attempts at converting <tt>#define</tt> into <tt>%constant</tt> though.
+For example the following case does not have any undefined symbols within the macro:
+</p>
+
+<div class="code">
+<pre>
+// For indicating pure virtual functions such as: virtual void f() PURE;
+#define PURE = 0
+</pre>
+</div>
+
+<p>
+A warning is issued:
+</p>
+
+<div class="shell">
+<pre>
+pure.h:1: Warning 305: Bad constant value (ignored).
+</pre>
+</div>
+
+<p>
+In such cases simply ignore the warning or suppress it using the normal warning suppression techniques.
+</p>
+
+<p>
 The use of constant expressions is allowed, but SWIG does not evaluate
 them. Rather, it passes them through to the output file and lets the C
 compiler perform the final evaluation (SWIG does perform a limited
@@ -1826,7 +1852,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 +2268,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 +2441,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>
 
@@ -3438,6 +3464,18 @@
 %}
 </pre></div>
 
+<p>
+Please note that some language backends (e.g. C# or Java) don't have any
+initialization function, hence you should define a global object performing
+the necessary initialization for them instead:
+</p>
+
+<div class="code"><pre>
+%init %{
+  static struct MyInit { MyInit() { init_variables(); } } myInit;
+%}
+</pre></div>
+
 <H2><a name="SWIG_nn45">5.7 An Interface Building Strategy</a></H2>
 
 
@@ -3469,7 +3507,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..0c259e3 100644
--- a/Doc/Manual/SWIGPlus.html
+++ b/Doc/Manual/SWIGPlus.html
@@ -88,12 +88,13 @@
 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.
+<a href="CPlusPlus20.html#CPlusPlus20">SWIG and C++20</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 +145,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..5c4ef62 100644
--- a/Doc/Manual/Scilab.html
+++ b/Doc/Manual/Scilab.html
@@ -9,7 +9,7 @@
 
 <body bgcolor="#ffffff">
 
-<H1><a name="Scilab">35 SWIG and Scilab</a></H1>
+<H1><a name="Scilab">36 SWIG and Scilab</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -88,7 +88,7 @@
 </p>
 
 
-<H2><a name="Scilab_preliminaries">35.1 Preliminaries</a></H2>
+<H2><a name="Scilab_preliminaries">36.1 Preliminaries</a></H2>
 
 
 <p>
@@ -105,7 +105,7 @@
 </p>
 
 
-<H2><a name="Scilab_running_swig">35.2 Running SWIG</a></H2>
+<H2><a name="Scilab_running_swig">36.2 Running SWIG</a></H2>
 
 
 <p>
@@ -139,7 +139,7 @@
 </p>
 
 
-<H3><a name="Scilab_running_swig_generating_module">35.2.1 Generating the module</a></H3>
+<H3><a name="Scilab_running_swig_generating_module">36.2.1 Generating the module</a></H3>
 
 
 <p>
@@ -182,7 +182,7 @@
 </p>
 
 
-<H3><a name="Scilab_running_swig_building_module">35.2.2 Building the module</a></H3>
+<H3><a name="Scilab_running_swig_building_module">36.2.2 Building the module</a></H3>
 
 
 <p>
@@ -202,7 +202,7 @@
 Note: we supposed in this example that the path to the Scilab include directory is <tt>/usr/local/include/scilab</tt> (which is the case in a Debian environment), this should be changed for another environment.
 </p>
 
-<H3><a name="Scilab_running_swig_loading_module">35.2.3 Loading the module</a></H3>
+<H3><a name="Scilab_running_swig_loading_module">36.2.3 Loading the module</a></H3>
 
 
 <p>
@@ -226,7 +226,7 @@
 which means that Scilab has successfully loaded the shared library. The module functions and other symbols are now available in Scilab.
 </p>
 
-<H3><a name="Scilab_running_swig_using_module">35.2.4 Using the module</a></H3>
+<H3><a name="Scilab_running_swig_using_module">36.2.4 Using the module</a></H3>
 
 
 <p>
@@ -260,7 +260,7 @@
 Note: for conciseness, we assume in the subsequent Scilab code examples that the modules have been beforehand built and loaded in Scilab.
 </p>
 
-<H3><a name="Scilab_running_swig_options">35.2.5 Scilab command line options</a></H3>
+<H3><a name="Scilab_running_swig_options">36.2.5 Scilab command line options</a></H3>
 
 
 <p>
@@ -320,10 +320,10 @@
 </pre></div>
 
 
-<H2><a name="Scilab_wrapping">35.3 A basic tour of C/C++ wrapping</a></H2>
+<H2><a name="Scilab_wrapping">36.3 A basic tour of C/C++ wrapping</a></H2>
 
 
-<H3><a name="Scilab_wrapping_overview">35.3.1 Overview</a></H3>
+<H3><a name="Scilab_wrapping_overview">36.3.1 Overview</a></H3>
 
 
 <p>
@@ -332,7 +332,7 @@
 There are a few exceptions, such as constants and enumerations, which can be wrapped directly as Scilab variables.
 </p>
 
-<H3><a name="Scilab_wrapping_identifiers">35.3.2 Identifiers</a></H3>
+<H3><a name="Scilab_wrapping_identifiers">36.3.2 Identifiers</a></H3>
 
 
 <p>
@@ -347,7 +347,7 @@
 Note: truncations can be disabled by specifying the target version 6 of Scilab in the <tt>targetversion</tt> argument (i.e. <tt>-targetversion 6</tt>).
 </p>
 
-<H3><a name="Scilab_wrapping_functions">35.3.3 Functions</a></H3>
+<H3><a name="Scilab_wrapping_functions">36.3.3 Functions</a></H3>
 
 
 <p>
@@ -378,7 +378,7 @@
     24.
 </pre></div>
 
-<H4><a name="Scilab_nn13">35.3.3.1 Argument passing</a></H4>
+<H4><a name="Scilab_nn13">36.3.3.1 Argument passing</a></H4>
 
 
 <p>
@@ -431,7 +431,7 @@
     7.
 </pre></div>
 
-<H4><a name="Scilab_nn14">35.3.3.2 Multiple output arguments</a></H4>
+<H4><a name="Scilab_nn14">36.3.3.2 Multiple output arguments</a></H4>
 
 
 <p>
@@ -480,7 +480,7 @@
 </pre></div>
 
 
-<H3><a name="Scilab_wrapping_global_variables">35.3.4 Global variables</a></H3>
+<H3><a name="Scilab_wrapping_global_variables">36.3.4 Global variables</a></H3>
 
 
 <p>
@@ -549,10 +549,10 @@
 </pre></div>
 
 
-<H3><a name="Scilab_wrapping_constants_and_enums">35.3.5 Constants and enumerations</a></H3>
+<H3><a name="Scilab_wrapping_constants_and_enums">36.3.5 Constants and enumerations</a></H3>
 
 
-<H4><a name="Scilab_wrapping_constants">35.3.5.1 Constants</a></H4>
+<H4><a name="Scilab_wrapping_constants">36.3.5.1 Constants</a></H4>
 
 
 <p>
@@ -693,7 +693,7 @@
     3.14
 </pre></div>
 
-<H4><a name="Scilab_wrapping_enums">35.3.5.2 Enumerations</a></H4>
+<H4><a name="Scilab_wrapping_enums">36.3.5.2 Enumerations</a></H4>
 
 
 <p>
@@ -758,7 +758,7 @@
 
 </pre></div>
 
-<H3><a name="Scilab_wrapping_pointers">35.3.6 Pointers</a></H3>
+<H3><a name="Scilab_wrapping_pointers">36.3.6 Pointers</a></H3>
 
 
 <p>
@@ -820,7 +820,7 @@
 The user of a pointer is responsible for freeing it or, like in the example, closing any resources associated with it (just as is required in a C program).
 </p>
 
-<H4><a name="Scilab_wrapping_pointers_utility_functions">35.3.6.1 Utility functions</a></H4>
+<H4><a name="Scilab_wrapping_pointers_utility_functions">36.3.6.1 Utility functions</a></H4>
 
 
 <p>
@@ -861,7 +861,7 @@
 </pre></div>
 
 
-<H4><a name="Scilab_wrapping_pointers_null_pointers">35.3.6.2 Null pointers:</a></H4>
+<H4><a name="Scilab_wrapping_pointers_null_pointers">36.3.6.2 Null pointers:</a></H4>
 
 
 <p>
@@ -877,7 +877,7 @@
 </pre></div>
 
 
-<H3><a name="Scilab_wrapping_structs">35.3.7 Structures</a></H3>
+<H3><a name="Scilab_wrapping_structs">36.3.7 Structures</a></H3>
 
 
 <p>
@@ -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>
@@ -986,7 +986,7 @@
 --&gt; delete_Bar(b);
 </pre></div>
 
-<H3><a name="Scilab_wrapping_cpp_classes">35.3.8 C++ classes</a></H3>
+<H3><a name="Scilab_wrapping_cpp_classes">36.3.8 C++ classes</a></H3>
 
 
 <p>
@@ -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>
@@ -1054,7 +1054,7 @@
 --&gt; delete_Point(p);
 </pre></div>
 
-<H3><a name="Scilab_wrapping_cpp_inheritance">35.3.9 C++ inheritance</a></H3>
+<H3><a name="Scilab_wrapping_cpp_inheritance">36.3.9 C++ inheritance</a></H3>
 
 
 <p>
@@ -1129,7 +1129,7 @@
     18.84
 </pre></div>
 
-<H3><a name="Scilab_wrapping_cpp_overloading">35.3.10 C++ overloading</a></H3>
+<H3><a name="Scilab_wrapping_cpp_overloading">36.3.10 C++ overloading</a></H3>
 
 
 <p>
@@ -1169,7 +1169,7 @@
 </pre></div>
 
 
-<H3><a name="Scilab_wrapping_pointers_references_values_arrays">35.3.11 Pointers, references, values, and arrays</a></H3>
+<H3><a name="Scilab_wrapping_pointers_references_values_arrays">36.3.11 Pointers, references, values, and arrays</a></H3>
 
 
 <p>
@@ -1227,7 +1227,7 @@
 As the function <tt>spam7</tt> returns a value, new instance of <tt>Foo</tt> has to be allocated, and a pointer on this instance is returned.
 </p>
 
-<H3><a name="Scilab_wrapping_cpp_templates">35.3.12 C++ templates</a></H3>
+<H3><a name="Scilab_wrapping_cpp_templates">36.3.12 C++ templates</a></H3>
 
 
 <p>
@@ -1286,7 +1286,7 @@
 More details on template support can be found in the <a href="SWIGPlus.html#SWIGPlus_nn30">templates</a> documentation.
 </p>
 
-<H3><a name="Scilab_wrapping_cpp_operators">35.3.13 C++ operators</a></H3>
+<H3><a name="Scilab_wrapping_cpp_operators">36.3.13 C++ operators</a></H3>
 
 
 <p>
@@ -1339,7 +1339,7 @@
 </pre></div>
 
 
-<H3><a name="Scilab_wrapping_cpp_namespaces">35.3.14 C++ namespaces</a></H3>
+<H3><a name="Scilab_wrapping_cpp_namespaces">36.3.14 C++ namespaces</a></H3>
 
 
 <p>
@@ -1417,7 +1417,7 @@
 </p>
 
 
-<H3><a name="Scilab_wrapping_cpp_exceptions">35.3.15 C++ exceptions</a></H3>
+<H3><a name="Scilab_wrapping_cpp_exceptions">36.3.15 C++ exceptions</a></H3>
 
 
 <p>
@@ -1500,17 +1500,17 @@
 See the <a href="SWIGPlus.html#SWIGPlus">SWIG C++ documentation</a> for more details.
 </p>
 
-<H3><a name="Scilab_wrapping_cpp_stl">35.3.16 C++ STL</a></H3>
+<H3><a name="Scilab_wrapping_cpp_stl">36.3.16 C++ STL</a></H3>
 
 
 <p>
 The Standard Template Library (STL) is partially supported. See <a href="#Scilab_typemaps_stl">STL</a> for more details.
 </p>
 
-<H2><a name="Scilab_typemaps">35.4 Type mappings and libraries</a></H2>
+<H2><a name="Scilab_typemaps">36.4 Type mappings and libraries</a></H2>
 
 
-<H3><a name="Scilab_typemaps_primitive_types">35.4.1 Default primitive type mappings</a></H3>
+<H3><a name="Scilab_typemaps_primitive_types">36.4.1 Default primitive type mappings</a></H3>
 
 
 <p>
@@ -1561,7 +1561,7 @@
 
 
 
-<H3><a name="Scilab_typemaps_arrays">35.4.2 Arrays</a></H3>
+<H3><a name="Scilab_typemaps_arrays">36.4.2 Arrays</a></H3>
 
 
 <p>
@@ -1616,7 +1616,7 @@
 [ 0  1  2  3 ]
 </pre></div>
 
-<H3><a name="Scilab_typemaps_pointer-to-pointers">35.4.3 Pointer-to-pointers</a></H3>
+<H3><a name="Scilab_typemaps_pointer-to-pointers">36.4.3 Pointer-to-pointers</a></H3>
 
 
 <p>
@@ -1689,7 +1689,7 @@
 </pre></div>
 
 
-<H3><a name="Scilab_typemaps_matrices">35.4.4 Matrices</a></H3>
+<H3><a name="Scilab_typemaps_matrices">36.4.4 Matrices</a></H3>
 
 
 <p>
@@ -1782,7 +1782,7 @@
 <li>There is no control while converting <tt>double</tt> values to integers, <tt>double</tt> values are truncated without any checking or warning.</li>
 </ul>
 
-<H3><a name="Scilab_typemaps_stl">35.4.5 STL</a></H3>
+<H3><a name="Scilab_typemaps_stl">36.4.5 STL</a></H3>
 
 
 <p>
@@ -1982,7 +1982,7 @@
 --&gt; delete_PersonPtrSet(p);
 </pre></div>
 
-<H2><a name="Scilab_module_initialization">35.5 Module initialization</a></H2>
+<H2><a name="Scilab_module_initialization">36.5 Module initialization</a></H2>
 
 
 <p>
@@ -2006,7 +2006,7 @@
 --&gt; example_Init();
 </pre></div>
 
-<H2><a name="Scilab_building_modes">35.6 Building modes</a></H2>
+<H2><a name="Scilab_building_modes">36.6 Building modes</a></H2>
 
 
 <p>
@@ -2021,7 +2021,7 @@
 <li>the <tt>builder</tt> mode. In this mode, Scilab is responsible of building.
 </ul>
 
-<H3><a name="Scilab_building_modes_nobuilder_mode">35.6.1 No-builder mode</a></H3>
+<H3><a name="Scilab_building_modes_nobuilder_mode">36.6.1 No-builder mode</a></H3>
 
 
 <p>
@@ -2034,7 +2034,7 @@
 </p>
 
 
-<H3><a name="Scilab_building_modes_builder_mode">35.6.2 Builder mode</a></H3>
+<H3><a name="Scilab_building_modes_builder_mode">36.6.2 Builder mode</a></H3>
 
 
 <p>
@@ -2074,14 +2074,14 @@
 $ swig -scilab -builder -buildercflags -I/opt/foo/include -builderldflags "-L/opt/foo/lib -lfoo" -buildersources baa1.cxx, baa2.cxx example.i
 </pre></div>
 
-<H2><a name="Scilab_generated_scripts">35.7 Generated scripts</a></H2>
+<H2><a name="Scilab_generated_scripts">36.7 Generated scripts</a></H2>
 
 
 <p>
 In this part we give some details about the generated Scilab scripts.
 </p>
 
-<H3><a name="Scilab_generated_scripts_builder_script">35.7.1 Builder script</a></H3>
+<H3><a name="Scilab_generated_scripts_builder_script">36.7.1 Builder script</a></H3>
 
 
 <p>
@@ -2106,7 +2106,7 @@
 <li><tt><b>table</b></tt>: two column string matrix containing a table of pairs of 'scilab function name', 'C function name'.</li>
 </ul>
 
-<H3><a name="Scilab_generated_scripts_loader_script">35.7.2 Loader script</a></H3>
+<H3><a name="Scilab_generated_scripts_loader_script">36.7.2 Loader script</a></H3>
 
 
 <p>
@@ -2145,7 +2145,7 @@
 </ul>
 
 
-<H2><a name="Scilab_other_resources">35.8 Other resources</a></H2>
+<H2><a name="Scilab_other_resources">36.8 Other resources</a></H2>
 
 
 <ul>
diff --git a/Doc/Manual/Sections.html b/Doc/Manual/Sections.html
index f571085..30b7429 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.2 (in progress)
 </p>
 
 <H2><a name="Sections_Sections">Sections</a></H2>
@@ -24,6 +24,7 @@
 <li><a href="CPlusPlus11.html#CPlusPlus11">SWIG and C++11</a></li>
 <li><a href="CPlusPlus14.html#CPlusPlus14">SWIG and C++14</a></li>
 <li><a href="CPlusPlus17.html#CPlusPlus17">SWIG and C++17</a></li>
+<li><a href="CPlusPlus20.html#CPlusPlus20">SWIG and C++20</a></li>
 <li><a href="Preprocessor.html#Preprocessor">The SWIG preprocessor</a></li>
 <li><a href="Library.html#Library">The SWIG library</a></li>
 <li><a href="Arguments.html#Arguments">Argument handling</a></li>
diff --git a/Doc/Manual/Tcl.html b/Doc/Manual/Tcl.html
index ba5ca38..0a22afb 100644
--- a/Doc/Manual/Tcl.html
+++ b/Doc/Manual/Tcl.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Tcl">36 SWIG and Tcl</a></H1>
+<H1><a name="Tcl">37 SWIG and Tcl</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -84,7 +84,7 @@
 this is no longer supported.
 </p>
 
-<H2><a name="Tcl_nn2">36.1 Preliminaries</a></H2>
+<H2><a name="Tcl_nn2">37.1 Preliminaries</a></H2>
 
 
 <p>
@@ -110,7 +110,7 @@
 need to compile this file and link it with the rest of your program.
 </p>
 
-<H3><a name="Tcl_nn3">36.1.1 Getting the right header files</a></H3>
+<H3><a name="Tcl_nn3">37.1.1 Getting the right header files</a></H3>
 
 
 <p>
@@ -128,7 +128,7 @@
 header file.
 </p>
 
-<H3><a name="Tcl_nn4">36.1.2 Compiling a dynamic module</a></H3>
+<H3><a name="Tcl_nn4">37.1.2 Compiling a dynamic module</a></H3>
 
 
 <p>
@@ -164,7 +164,7 @@
  <tt>-module</tt> command line option.
 </p>
 
-<H3><a name="Tcl_nn5">36.1.3 Static linking</a></H3>
+<H3><a name="Tcl_nn5">37.1.3 Static linking</a></H3>
 
 
 <p>
@@ -230,7 +230,7 @@
 hassle in the opinion of this author). 
 </p>
 
-<H3><a name="Tcl_nn6">36.1.4 Using your module</a></H3>
+<H3><a name="Tcl_nn6">37.1.4 Using your module</a></H3>
 
 
 <p>
@@ -358,7 +358,7 @@
 the man pages). 
 </p>
 
-<H3><a name="Tcl_nn7">36.1.5 Compilation of C++ extensions</a></H3>
+<H3><a name="Tcl_nn7">37.1.5 Compilation of C++ extensions</a></H3>
 
 
 <p>
@@ -441,7 +441,7 @@
 might want to investigate using a more formal standard such as COM.
 </p>
 
-<H3><a name="Tcl_nn8">36.1.6 Compiling for 64-bit platforms</a></H3>
+<H3><a name="Tcl_nn8">37.1.6 Compiling for 64-bit platforms</a></H3>
 
 
 <p>
@@ -468,7 +468,7 @@
 linking standard (e.g., -o32 and -n32 on Irix).
 </p>
 
-<H3><a name="Tcl_nn9">36.1.7 Setting a package prefix</a></H3>
+<H3><a name="Tcl_nn9">37.1.7 Setting a package prefix</a></H3>
 
 
 <p>
@@ -487,7 +487,7 @@
 call it "<tt>Foo_bar</tt>".
 </p>
 
-<H3><a name="Tcl_nn10">36.1.8 Using namespaces</a></H3>
+<H3><a name="Tcl_nn10">37.1.8 Using namespaces</a></H3>
 
 
 <p>
@@ -509,7 +509,7 @@
 are always accessed with the namespace name such as <tt>Foo::bar</tt>.
 </p>
 
-<H2><a name="Tcl_nn11">36.2 Building Tcl/Tk Extensions under Windows 95/NT</a></H2>
+<H2><a name="Tcl_nn11">37.2 Building Tcl/Tk Extensions under Windows 95/NT</a></H2>
 
 
 <p>
@@ -520,7 +520,7 @@
 although the procedure may be similar with other compilers.
 </p>
 
-<H3><a name="Tcl_nn12">36.2.1 Running SWIG from Developer Studio</a></H3>
+<H3><a name="Tcl_nn12">37.2.1 Running SWIG from Developer Studio</a></H3>
 
 
 <p>
@@ -578,7 +578,7 @@
 %
 </pre></div>
 
-<H3><a name="Tcl_nn13">36.2.2 Using NMAKE</a></H3>
+<H3><a name="Tcl_nn13">37.2.2 Using NMAKE</a></H3>
 
 
 <p>
@@ -641,7 +641,7 @@
 Tcl extensions.
 </p>
 
-<H2><a name="Tcl_nn14">36.3 A tour of basic C/C++ wrapping</a></H2>
+<H2><a name="Tcl_nn14">37.3 A tour of basic C/C++ wrapping</a></H2>
 
 
 <p>
@@ -652,7 +652,7 @@
 wrapping.
 </p>
 
-<H3><a name="Tcl_nn15">36.3.1 Modules</a></H3>
+<H3><a name="Tcl_nn15">37.3.1 Modules</a></H3>
 
 
 <p>
@@ -686,7 +686,7 @@
 </pre>
 </div>
 
-<H3><a name="Tcl_nn16">36.3.2 Functions</a></H3>
+<H3><a name="Tcl_nn16">37.3.2 Functions</a></H3>
 
 
 <p>
@@ -711,7 +711,7 @@
 %
 </pre></div>
 
-<H3><a name="Tcl_nn17">36.3.3 Global variables</a></H3>
+<H3><a name="Tcl_nn17">37.3.3 Global variables</a></H3>
 
 
 <p>
@@ -791,7 +791,7 @@
 </pre>
 </div>
 
-<H3><a name="Tcl_nn18">36.3.4 Constants and enums</a></H3>
+<H3><a name="Tcl_nn18">37.3.4 Constants and enums</a></H3>
 
 
 <p>
@@ -875,7 +875,7 @@
 conversion.  This allows the <tt>global</tt> statement to be omitted.
 </p>
 
-<H3><a name="Tcl_nn19">36.3.5 Pointers</a></H3>
+<H3><a name="Tcl_nn19">37.3.5 Pointers</a></H3>
 
 
 <p>
@@ -971,7 +971,7 @@
 <tt>None</tt> if the conversion can't be performed.
 </p>
 
-<H3><a name="Tcl_nn20">36.3.6 Structures</a></H3>
+<H3><a name="Tcl_nn20">37.3.6 Structures</a></H3>
 
 
 <p>
@@ -1253,7 +1253,7 @@
 memory management section that appears shortly.
 </p>
 
-<H3><a name="Tcl_nn21">36.3.7 C++ classes</a></H3>
+<H3><a name="Tcl_nn21">37.3.7 C++ classes</a></H3>
 
 
 <p>
@@ -1319,7 +1319,7 @@
 </pre>
 </div>
 
-<H3><a name="Tcl_nn22">36.3.8 C++ inheritance</a></H3>
+<H3><a name="Tcl_nn22">37.3.8 C++ inheritance</a></H3>
 
 
 <p>
@@ -1368,7 +1368,7 @@
 It is safe to use multiple inheritance with SWIG.
 </p>
 
-<H3><a name="Tcl_nn23">36.3.9 Pointers, references, values, and arrays</a></H3>
+<H3><a name="Tcl_nn23">37.3.9 Pointers, references, values, and arrays</a></H3>
 
 
 <p>
@@ -1422,7 +1422,7 @@
 when the return value is garbage collected).
 </p>
 
-<H3><a name="Tcl_nn24">36.3.10 C++ overloaded functions</a></H3>
+<H3><a name="Tcl_nn24">37.3.10 C++ overloaded functions</a></H3>
 
 
 <p>
@@ -1545,7 +1545,7 @@
 Please refer to the "SWIG and C++" chapter for more information about overloading. 
 </p>
 
-<H3><a name="Tcl_nn25">36.3.11 C++ operators</a></H3>
+<H3><a name="Tcl_nn25">37.3.11 C++ operators</a></H3>
 
 
 <p>
@@ -1647,7 +1647,7 @@
 Keep reading.
 </p>
 
-<H3><a name="Tcl_nn26">36.3.12 C++ namespaces</a></H3>
+<H3><a name="Tcl_nn26">37.3.12 C++ namespaces</a></H3>
 
 
 <p>
@@ -1711,7 +1711,7 @@
 identical symbol names, well, then you get what you deserve.
 </p>
 
-<H3><a name="Tcl_nn27">36.3.13 C++ templates</a></H3>
+<H3><a name="Tcl_nn27">37.3.13 C++ templates</a></H3>
 
 
 <p>
@@ -1763,7 +1763,7 @@
 examples will appear later.
 </p>
 
-<H3><a name="Tcl_nn28">36.3.14 C++ Smart Pointers</a></H3>
+<H3><a name="Tcl_nn28">37.3.14 C++ Smart Pointers</a></H3>
 
 
 <p>
@@ -1847,7 +1847,7 @@
 </pre>
 </div>
 
-<H2><a name="Tcl_nn29">36.4 Further details on the Tcl class interface</a></H2>
+<H2><a name="Tcl_nn29">37.4 Further details on the Tcl class interface</a></H2>
 
 
 <p>
@@ -1860,7 +1860,7 @@
 of how the proxy classes work.
 </p>
 
-<H3><a name="Tcl_nn30">36.4.1 Proxy classes</a></H3>
+<H3><a name="Tcl_nn30">37.4.1 Proxy classes</a></H3>
 
 
 <p>
@@ -1925,7 +1925,7 @@
 as shown in the last section.
 </p>
 
-<H3><a name="Tcl_nn31">36.4.2 Memory management</a></H3>
+<H3><a name="Tcl_nn31">37.4.2 Memory management</a></H3>
 
 
 <p>
@@ -2113,7 +2113,7 @@
 </p>
 
 
-<H2><a name="Tcl_nn32">36.5 Input and output parameters</a></H2>
+<H2><a name="Tcl_nn32">37.5 Input and output parameters</a></H2>
 
 
 <p>
@@ -2301,7 +2301,7 @@
 </pre>
 </div>
 
-<H2><a name="Tcl_nn33">36.6 Exception handling </a></H2>
+<H2><a name="Tcl_nn33">37.6 Exception handling </a></H2>
 
 
 <p>
@@ -2435,7 +2435,7 @@
 See the chapter on "<a href="Customization.html#Customization">Customization Features</a>" for more examples.
 </p>
 
-<H2><a name="Tcl_nn34">36.7 Typemaps</a></H2>
+<H2><a name="Tcl_nn34">37.7 Typemaps</a></H2>
 
 
 <p>
@@ -2452,7 +2452,7 @@
 C-Tcl interface.
 </p>
 
-<H3><a name="Tcl_nn35">36.7.1 What is a typemap?</a></H3>
+<H3><a name="Tcl_nn35">37.7.1 What is a typemap?</a></H3>
 
 
 <p>
@@ -2572,7 +2572,7 @@
 </pre>
 </div>
 
-<H3><a name="Tcl_nn36">36.7.2 Tcl typemaps</a></H3>
+<H3><a name="Tcl_nn36">37.7.2 Tcl typemaps</a></H3>
 
 
 <p>
@@ -2710,7 +2710,7 @@
 Examples of these methods will appear shortly.
 </p>
 
-<H3><a name="Tcl_nn37">36.7.3 Typemap variables</a></H3>
+<H3><a name="Tcl_nn37">37.7.3 Typemap variables</a></H3>
 
 
 <p>
@@ -2781,7 +2781,7 @@
 The Tcl name of the wrapper function being created.
 </div>
 
-<H3><a name="Tcl_nn38">36.7.4 Converting  a Tcl list to a char ** </a></H3>
+<H3><a name="Tcl_nn38">37.7.4 Converting  a Tcl list to a char ** </a></H3>
 
 
 <p>
@@ -2843,7 +2843,7 @@
 3
 </pre></div>
 
-<H3><a name="Tcl_nn39">36.7.5 Returning values in arguments</a></H3>
+<H3><a name="Tcl_nn39">37.7.5 Returning values in arguments</a></H3>
 
 
 <p>
@@ -2885,7 +2885,7 @@
 %
 </pre></div>
 
-<H3><a name="Tcl_nn40">36.7.6 Useful functions</a></H3>
+<H3><a name="Tcl_nn40">37.7.6 Useful functions</a></H3>
 
 
 <p>
@@ -2961,7 +2961,7 @@
 </pre>
 </div>
 
-<H3><a name="Tcl_nn41">36.7.7 Standard  typemaps</a></H3>
+<H3><a name="Tcl_nn41">37.7.7 Standard  typemaps</a></H3>
 
 
 <p>
@@ -3045,7 +3045,7 @@
 </pre>
 </div>
 
-<H3><a name="Tcl_nn42">36.7.8 Pointer handling</a></H3>
+<H3><a name="Tcl_nn42">37.7.8 Pointer handling</a></H3>
 
 
 <p>
@@ -3127,7 +3127,7 @@
 </pre>
 </div>
 
-<H2><a name="Tcl_nn43">36.8 Turning a SWIG module into a Tcl Package.</a></H2>
+<H2><a name="Tcl_nn43">37.8 Turning a SWIG module into a Tcl Package.</a></H2>
 
 
 <p>
@@ -3199,7 +3199,7 @@
 to use the <tt>load</tt> command instead.
 </p>
 
-<H2><a name="Tcl_nn44">36.9 Building new kinds of Tcl interfaces (in Tcl)</a></H2>
+<H2><a name="Tcl_nn44">37.9 Building new kinds of Tcl interfaces (in Tcl)</a></H2>
 
 
 <p>
@@ -3298,7 +3298,7 @@
 with an out of bounds array access).
 </p>
 
-<H3><a name="Tcl_nn45">36.9.1 Proxy classes</a></H3>
+<H3><a name="Tcl_nn45">37.9.1 Proxy classes</a></H3>
 
 
 <p>
@@ -3419,7 +3419,7 @@
 interesting things.
 </p>
 
-<H2><a name="Tcl_nn46">36.10 Tcl/Tk Stubs</a></H2>
+<H2><a name="Tcl_nn46">37.10 Tcl/Tk Stubs</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Typemaps.html b/Doc/Manual/Typemaps.html
index d34bb28..a12ede5 100644
--- a/Doc/Manual/Typemaps.html
+++ b/Doc/Manual/Typemaps.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Typemaps">13 Typemaps</a></H1>
+<H1><a name="Typemaps">14 Typemaps</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -102,7 +102,7 @@
 
 
 
-<H2><a name="Typemaps_nn2">13.1 Introduction</a></H2>
+<H2><a name="Typemaps_nn2">14.1 Introduction</a></H2>
 
 
 <p>
@@ -119,7 +119,7 @@
 chapter with only a vague idea of what SWIG already does by default.
 </p>
 
-<H3><a name="Typemaps_nn3">13.1.1 Type conversion</a></H3>
+<H3><a name="Typemaps_nn3">14.1.1 Type conversion</a></H3>
 
 
 <p>
@@ -212,7 +212,7 @@
 how it works (an exercise left to the reader).
 </p>
 
-<H3><a name="Typemaps_nn4">13.1.2 Typemaps</a></H3>
+<H3><a name="Typemaps_nn4">14.1.2 Typemaps</a></H3>
 
 
 <p>
@@ -313,7 +313,7 @@
 possible to completely change the way in which values are converted.
 </p>
 
-<H3><a name="Typemaps_nn5">13.1.3 Pattern matching</a></H3>
+<H3><a name="Typemaps_nn5">14.1.3 Pattern matching</a></H3>
 
 
 <p>
@@ -415,7 +415,7 @@
 provides a hint to the unusual variable naming scheme involving <tt>$1</tt>, <tt>$2</tt>, and so forth.
 </p>
 
-<H3><a name="Typemaps_nn6">13.1.4 Reusing typemaps</a></H3>
+<H3><a name="Typemaps_nn6">14.1.4 Reusing typemaps</a></H3>
 
 
 <p>
@@ -493,7 +493,7 @@
 then SWIG already knows that the <tt>int</tt> typemaps apply.  You don't have to do anything.
 </p>
 
-<H3><a name="Typemaps_nn7">13.1.5 What can be done with typemaps?</a></H3>
+<H3><a name="Typemaps_nn7">14.1.5 What can be done with typemaps?</a></H3>
 
 
 <p>
@@ -605,7 +605,7 @@
 aspects of the Java bindings.  Consult language specific documentation for further details.
 </p>
 
-<H3><a name="Typemaps_nn8">13.1.6 What can't be done with typemaps?</a></H3>
+<H3><a name="Typemaps_nn8">14.1.6 What can't be done with typemaps?</a></H3>
 
 
 <p>
@@ -668,12 +668,12 @@
 </pre>
 </div>
 
-<H3><a name="Typemaps_aspects">13.1.7 Similarities to Aspect Oriented Programming</a></H3>
+<H3><a name="Typemaps_aspects">14.1.7 Similarities to Aspect Oriented Programming</a></H3>
 
 
 <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++.
@@ -686,7 +686,7 @@
 Features such as <tt>%exception</tt> are also cross-cutting concerns as they encapsulate code that can be used to add logging or exception handling to any function.
 </p>
 
-<H3><a name="Typemaps_nn9">13.1.8 The rest of this chapter</a></H3>
+<H3><a name="Typemaps_nn9">14.1.8 The rest of this chapter</a></H3>
 
 
 <p>
@@ -706,14 +706,14 @@
 "The C++ Programming Language" by Stroustrup before going any further.
 </p>
 
-<H2><a name="Typemaps_nn10">13.2 Typemap specifications</a></H2>
+<H2><a name="Typemaps_nn10">14.2 Typemap specifications</a></H2>
 
 
 <p>
 This section describes the behavior of the <tt>%typemap</tt> directive itself.
 </p>
 
-<H3><a name="Typemaps_defining">13.2.1 Defining a typemap</a></H3>
+<H3><a name="Typemaps_defining">14.2.1 Defining a typemap</a></H3>
 
 
 <p>
@@ -826,7 +826,7 @@
 individual pieces will become clear.
 </p>
 
-<H3><a name="Typemaps_nn12">13.2.2 Typemap scope</a></H3>
+<H3><a name="Typemaps_nn12">14.2.2 Typemap scope</a></H3>
 
 
 <p>
@@ -876,7 +876,7 @@
 </pre>
 </div>
 
-<H3><a name="Typemaps_nn13">13.2.3 Copying a typemap</a></H3>
+<H3><a name="Typemaps_nn13">14.2.3 Copying a typemap</a></H3>
 
 
 <p>
@@ -934,7 +934,7 @@
 </pre>
 </div>
 
-<H3><a name="Typemaps_nn14">13.2.4 Deleting a typemap</a></H3>
+<H3><a name="Typemaps_nn14">14.2.4 Deleting a typemap</a></H3>
 
 
 <p>
@@ -968,7 +968,7 @@
 after the clear operation.
 </p>
 
-<H3><a name="Typemaps_nn15">13.2.5 Placement of typemaps</a></H3>
+<H3><a name="Typemaps_nn15">14.2.5 Placement of typemaps</a></H3>
 
 
 <p>
@@ -1048,7 +1048,7 @@
 within a particular namespace.  In this example, this is done using the forward class declaration <tt>class string</tt>.
 </p>
 
-<H2><a name="Typemaps_pattern_matching">13.3 Pattern matching rules</a></H2>
+<H2><a name="Typemaps_pattern_matching">14.3 Pattern matching rules</a></H2>
 
 
 <p>
@@ -1056,7 +1056,7 @@
 The matching rules can be observed in practice by using the debugging options also described.
 </p>
 
-<H3><a name="Typemaps_nn17">13.3.1 Basic matching rules</a></H3>
+<H3><a name="Typemaps_nn17">14.3.1 Basic matching rules</a></H3>
 
 
 <p>
@@ -1155,7 +1155,7 @@
 stripped all qualifiers in one step.
 </p>
 
-<H3><a name="Typemaps_typedef_reductions">13.3.2 Typedef reductions matching</a></H3>
+<H3><a name="Typemaps_typedef_reductions">14.3.2 Typedef reductions matching</a></H3>
 
 
 <p>
@@ -1330,7 +1330,7 @@
 </pre>
 </div>
 
-<H3><a name="Typemaps_nn19">13.3.3 Default typemap matching rules</a></H3>
+<H3><a name="Typemaps_nn19">14.3.3 Default typemap matching rules</a></H3>
 
 
 <p>
@@ -1468,7 +1468,7 @@
 simpler scheme to match the current C++ class template partial specialization matching rules.
 </p>
 
-<H3><a name="Typemaps_multi_argument_typemaps_patterns">13.3.4 Multi-arguments typemaps</a></H3>
+<H3><a name="Typemaps_multi_argument_typemaps_patterns">14.3.4 Multi-arguments typemaps</a></H3>
 
 
 <p>
@@ -1498,7 +1498,7 @@
 </p>
 
 
-<H3><a name="Typemaps_matching_template_comparison">13.3.5 Matching rules compared to C++ templates</a></H3>
+<H3><a name="Typemaps_matching_template_comparison">14.3.5 Matching rules compared to C++ templates</a></H3>
 
 
 <p>
@@ -1657,7 +1657,7 @@
 </p>
 
 
-<H3><a name="Typemaps_debugging_search">13.3.6 Debugging typemap pattern matching</a></H3>
+<H3><a name="Typemaps_debugging_search">14.3.6 Debugging typemap pattern matching</a></H3>
 
 
 <p>
@@ -1870,7 +1870,7 @@
 </li>
 </ul>
 
-<H2><a name="Typemaps_nn21">13.4 Code generation rules</a></H2>
+<H2><a name="Typemaps_nn21">14.4 Code generation rules</a></H2>
 
 
 <p>
@@ -1878,7 +1878,7 @@
 the generated wrapper code.
 </p>
 
-<H3><a name="Typemaps_nn22">13.4.1 Scope</a></H3>
+<H3><a name="Typemaps_nn22">14.4.1 Scope</a></H3>
 
 
 <p>
@@ -1956,7 +1956,7 @@
 Note that only the third of the three typemaps have the typemap code passed through the SWIG preprocessor.
 </p>
 
-<H3><a name="Typemaps_nn23">13.4.2 Declaring new local variables</a></H3>
+<H3><a name="Typemaps_nn23">14.4.2 Declaring new local variables</a></H3>
 
 
 <p>
@@ -2123,7 +2123,7 @@
 </div>
 
 
-<H3><a name="Typemaps_special_variables">13.4.3 Special variables</a></H3>
+<H3><a name="Typemaps_special_variables">14.4.3 Special variables</a></H3>
 
 
 <p>
@@ -2375,7 +2375,7 @@
 </pre>
 </div>
 
-<H3><a name="Typemaps_special_variable_macros">13.4.4 Special variable macros</a></H3>
+<H3><a name="Typemaps_special_variable_macros">14.4.4 Special variable macros</a></H3>
 
 
 <p>
@@ -2387,7 +2387,7 @@
 The following special variable macros are available across all language modules.
 </p>
 
-<H4><a name="Typemaps_special_macro_descriptor">13.4.4.1 $descriptor(type)</a></H4>
+<H4><a name="Typemaps_special_macro_descriptor">14.4.4.1 $descriptor(type)</a></H4>
 
 
 <p>
@@ -2398,7 +2398,7 @@
 This macro is mostly used in the scripting target languages and is demonstrated later in the <a href="#Typemaps_runtime_type_checker_usage">Run-time type checker usage</a> section.
 </p>
 
-<H4><a name="Typemaps_special_macro_typemap">13.4.4.2 $typemap(method, typepattern)</a></H4>
+<H4><a name="Typemaps_special_macro_typemap">14.4.4.2 $typemap(method, typepattern)</a></H4>
 
 
 <p>
@@ -2456,7 +2456,7 @@
 </div>
 
 
-<H3><a name="Typemaps_special_variable_attributes">13.4.5 Special variables and typemap attributes</a></H3>
+<H3><a name="Typemaps_special_variable_attributes">14.4.5 Special variables and typemap attributes</a></H3>
 
 
 <p>
@@ -2483,7 +2483,7 @@
 </pre>
 </div>
 
-<H3><a name="Typemaps_special_variables_and_macros">13.4.6 Special variables combined with special variable macros</a></H3>
+<H3><a name="Typemaps_special_variables_and_macros">14.4.6 Special variables combined with special variable macros</a></H3>
 
 
 <p>
@@ -2525,7 +2525,7 @@
 </div>
 
 
-<H2><a name="Typemaps_nn25">13.5 Common typemap methods</a></H2>
+<H2><a name="Typemaps_nn25">14.5 Common typemap methods</a></H2>
 
 
 <p>
@@ -2533,7 +2533,7 @@
 the following typemap methods are nearly universal:
 </p>
 
-<H3><a name="Typemaps_nn26">13.5.1 "in" typemap</a></H3>
+<H3><a name="Typemaps_nn26">14.5.1 "in" typemap</a></H3>
 
 
 <p>
@@ -2593,7 +2593,7 @@
 is the same as the old "ignore" typemap.
 </p>
 
-<H3><a name="Typemaps_nn27">13.5.2 "typecheck" typemap</a></H3>
+<H3><a name="Typemaps_nn27">14.5.2 "typecheck" typemap</a></H3>
 
 
 <p>
@@ -2620,7 +2620,7 @@
 "typecheck" typemaps.  More details about this follow in the <a href="#Typemaps_overloading">Typemaps and overloading</a> section.
 </p>
 
-<H3><a name="Typemaps_nn28">13.5.3 "out" typemap</a></H3>
+<H3><a name="Typemaps_nn28">14.5.3 "out" typemap</a></H3>
 
 
 <p>
@@ -2651,7 +2651,7 @@
 The "out" typemap supports an optional attribute flag called "optimal". This is for code optimisation and is detailed in the <a href="#Typemaps_optimal">Optimal code generation when returning by value</a> section.
 </p>
 
-<H3><a name="Typemaps_nn29">13.5.4 "arginit" typemap</a></H3>
+<H3><a name="Typemaps_nn29">14.5.4 "arginit" typemap</a></H3>
 
 
 <p>
@@ -2670,7 +2670,7 @@
 </pre>
 </div>
 
-<H3><a name="Typemaps_nn30">13.5.5 "default" typemap</a></H3>
+<H3><a name="Typemaps_nn30">14.5.5 "default" typemap</a></H3>
 
 
 <p>
@@ -2703,7 +2703,7 @@
 for further information on default argument wrapping.
 </p>
 
-<H3><a name="Typemaps_nn31">13.5.6 "check" typemap</a></H3>
+<H3><a name="Typemaps_nn31">14.5.6 "check" typemap</a></H3>
 
 
 <p>
@@ -2722,7 +2722,7 @@
 </pre>
 </div>
 
-<H3><a name="Typemaps_nn32">13.5.7 "argout" typemap</a></H3>
+<H3><a name="Typemaps_nn32">14.5.7 "argout" typemap</a></H3>
 
 
 <p>
@@ -2768,7 +2768,7 @@
 See the <tt>typemaps.i</tt> library file for examples.
 </p>
 
-<H3><a name="Typemaps_nn33">13.5.8 "freearg" typemap</a></H3>
+<H3><a name="Typemaps_nn33">14.5.8 "freearg" typemap</a></H3>
 
 
 <p>
@@ -2801,7 +2801,7 @@
 prematurely.
 </p>
 
-<H3><a name="Typemaps_nn34">13.5.9 "newfree" typemap</a></H3>
+<H3><a name="Typemaps_nn34">14.5.9 "newfree" typemap</a></H3>
 
 
 <p>
@@ -2830,7 +2830,7 @@
 See <a href="Customization.html#Customization_ownership">Object ownership and %newobject</a> for further details.
 </p>
 
-<H3><a name="Typemaps_ret">13.5.10 "ret" typemap</a></H3>
+<H3><a name="Typemaps_ret">14.5.10 "ret" typemap</a></H3>
 
 
 <p>
@@ -2869,7 +2869,7 @@
 is no need to list all the functions that require the memory cleanup, it is purely done on types.
 </p>
 
-<H3><a name="Typemaps_nn35">13.5.11 "memberin" typemap</a></H3>
+<H3><a name="Typemaps_nn35">14.5.11 "memberin" typemap</a></H3>
 
 
 <p>
@@ -2891,7 +2891,7 @@
 a default implementation for arrays, strings, and other objects.
 </p>
 
-<H3><a name="Typemaps_nn36">13.5.12 "varin" typemap</a></H3>
+<H3><a name="Typemaps_nn36">14.5.12 "varin" typemap</a></H3>
 
 
 <p>
@@ -2899,7 +2899,7 @@
 purposes of assigning to a C/C++ global variable.    This is implementation specific.
 </p>
 
-<H3><a name="Typemaps_nn37">13.5.13 "varout" typemap</a></H3>
+<H3><a name="Typemaps_nn37">14.5.13 "varout" typemap</a></H3>
 
 
 <p>
@@ -2907,7 +2907,7 @@
 language when reading a C/C++ global variable.  This is implementation specific.
 </p>
 
-<H3><a name="Typemaps_throws_typemap">13.5.14 "throws" typemap</a></H3>
+<H3><a name="Typemaps_throws_typemap">14.5.14 "throws" typemap</a></H3>
 
 
 <p>
@@ -2957,7 +2957,7 @@
 Please also see the <a href="Customization.html#Customization_exception">Exception handling with %exception</a> section for another way to handle exceptions.
 </p>
 
-<H2><a name="Typemaps_nn39">13.6 Some typemap examples</a></H2>
+<H2><a name="Typemaps_nn39">14.6 Some typemap examples</a></H2>
 
 
 <p>
@@ -2965,7 +2965,7 @@
 for more examples.
 </p>
 
-<H3><a name="Typemaps_nn40">13.6.1 Typemaps for arrays</a></H3>
+<H3><a name="Typemaps_nn40">14.6.1 Typemaps for arrays</a></H3>
 
 
 <p>
@@ -3224,7 +3224,7 @@
 useless and has since been eliminated.   To return structure members, simply use the "out" typemap.
 </p>
 
-<H3><a name="Typemaps_nn41">13.6.2 Implementing constraints with typemaps</a></H3>
+<H3><a name="Typemaps_nn41">14.6.2 Implementing constraints with typemaps</a></H3>
 
 
 <p>
@@ -3272,7 +3272,7 @@
 segmentation faults or other run-time problems by raising an exception
 rather than blindly passing values to the underlying C/C++ program.</p>
 
-<H2><a name="Typemaps_nn43">13.7 Typemaps for multiple target languages</a></H2>
+<H2><a name="Typemaps_nn43">14.7 Typemaps for multiple target languages</a></H2>
 
 
 <p>
@@ -3302,7 +3302,7 @@
 <tt>%typemap(ruby, in) int "$1 = NUM2INT($input);"</tt>.
 </p>
 
-<H2><a name="Typemaps_optimal">13.8 Optimal code generation when returning by value</a></H2>
+<H2><a name="Typemaps_optimal">14.8 Optimal code generation when returning by value</a></H2>
 
 
 <p>
@@ -3491,7 +3491,7 @@
 However, it doesn't always get it right, for example when <tt>$1</tt> is within some commented out code.
 </p>
 
-<H2><a name="Typemaps_multi_argument_typemaps">13.9 Multi-argument typemaps</a></H2>
+<H2><a name="Typemaps_multi_argument_typemaps">14.9 Multi-argument typemaps</a></H2>
 
 
 <p>
@@ -3768,7 +3768,7 @@
 the arguments to make them consecutive will need to be written.
 </p>
 
-<H2><a name="Typemaps_warnings">13.10 Typemap warnings</a></H2>
+<H2><a name="Typemaps_warnings">14.10 Typemap warnings</a></H2>
 
 
 <p>
@@ -3777,7 +3777,7 @@
 </p>
 
 
-<H2><a name="Typemaps_fragments">13.11 Typemap fragments</a></H2>
+<H2><a name="Typemaps_fragments">14.11 Typemap fragments</a></H2>
 
 
 <p>
@@ -4113,7 +4113,7 @@
 with some powerful but tricky macro and fragment usage that is used in parts of the SWIG typemap library.
 </p>
 
-<H3><a name="Typemaps_fragment_type_specialization">13.11.1 Fragment type specialization</a></H3>
+<H3><a name="Typemaps_fragment_type_specialization">14.11.1 Fragment type specialization</a></H3>
 
 
 <p>
@@ -4146,7 +4146,7 @@
 </pre>
 </div>
 
-<H3><a name="Typemaps_automatic_specialization">13.11.2 Fragments and automatic typemap specialization</a></H3>
+<H3><a name="Typemaps_automatic_specialization">14.11.2 Fragments and automatic typemap specialization</a></H3>
 
 
 <p>
@@ -4192,7 +4192,7 @@
 </p>
 
 
-<H2><a name="Typemaps_runtime_type_checker">13.12 The run-time type checker</a></H2>
+<H2><a name="Typemaps_runtime_type_checker">14.12 The run-time type checker</a></H2>
 
 
 <p>
@@ -4218,7 +4218,7 @@
 <li>Modules can be unloaded from the type system.</li>
 </ul>
 
-<H3><a name="Typemaps_nn45">13.12.1 Implementation</a></H3>
+<H3><a name="Typemaps_nn45">14.12.1 Implementation</a></H3>
 
 
 <p>
@@ -4412,7 +4412,7 @@
 structures are chained together in a circularly linked list.
 </p>
 
-<H3><a name="Typemaps_runtime_type_checker_usage">13.12.2 Usage</a></H3>
+<H3><a name="Typemaps_runtime_type_checker_usage">14.12.2 Usage</a></H3>
 
 
 <p>This section covers how to use these functions from typemaps.  To learn how to
@@ -4508,7 +4508,7 @@
 managed.
 </p>
 
-<H2><a name="Typemaps_overloading">13.13 Typemaps and overloading</a></H2>
+<H2><a name="Typemaps_overloading">14.13 Typemaps and overloading</a></H2>
 
 
 <p>
@@ -4630,37 +4630,69 @@
 <pre>
 Symbolic Name                   Precedence Value
 ------------------------------  ------------------
-SWIG_TYPECHECK_POINTER           0  
-SWIG_TYPECHECK_VOIDPTR           10 
-SWIG_TYPECHECK_BOOL              15 
-SWIG_TYPECHECK_UINT8             20 
-SWIG_TYPECHECK_INT8              25 
-SWIG_TYPECHECK_UINT16            30 
-SWIG_TYPECHECK_INT16             35 
-SWIG_TYPECHECK_UINT32            40 
-SWIG_TYPECHECK_INT32             45 
-SWIG_TYPECHECK_UINT64            50 
-SWIG_TYPECHECK_INT64             55 
-SWIG_TYPECHECK_UINT128           60 
-SWIG_TYPECHECK_INT128            65 
-SWIG_TYPECHECK_INTEGER           70 
-SWIG_TYPECHECK_FLOAT             80 
-SWIG_TYPECHECK_DOUBLE            90 
-SWIG_TYPECHECK_COMPLEX           100 
-SWIG_TYPECHECK_UNICHAR           110 
-SWIG_TYPECHECK_UNISTRING         120 
-SWIG_TYPECHECK_CHAR              130 
-SWIG_TYPECHECK_STRING            140 
-SWIG_TYPECHECK_BOOL_ARRAY        1015 
-SWIG_TYPECHECK_INT8_ARRAY        1025 
-SWIG_TYPECHECK_INT16_ARRAY       1035 
-SWIG_TYPECHECK_INT32_ARRAY       1045 
-SWIG_TYPECHECK_INT64_ARRAY       1055 
-SWIG_TYPECHECK_INT128_ARRAY      1065 
-SWIG_TYPECHECK_FLOAT_ARRAY       1080 
-SWIG_TYPECHECK_DOUBLE_ARRAY      1090 
-SWIG_TYPECHECK_CHAR_ARRAY        1130 
-SWIG_TYPECHECK_STRING_ARRAY      1140 
+SWIG_TYPECHECK_POINTER           0
+SWIG_TYPECHECK_ITERATOR          5
+SWIG_TYPECHECK_VOIDPTR           10
+SWIG_TYPECHECK_BOOL              15
+SWIG_TYPECHECK_UINT8             20
+SWIG_TYPECHECK_INT8              25
+SWIG_TYPECHECK_UINT16            30
+SWIG_TYPECHECK_INT16             35
+SWIG_TYPECHECK_UINT32            40
+SWIG_TYPECHECK_INT32             45
+SWIG_TYPECHECK_SIZE              47
+SWIG_TYPECHECK_PTRDIFF           48
+SWIG_TYPECHECK_UINT64            50
+SWIG_TYPECHECK_INT64             55
+SWIG_TYPECHECK_UINT128           60
+SWIG_TYPECHECK_INT128            65
+SWIG_TYPECHECK_INTEGER           70
+SWIG_TYPECHECK_FLOAT             80
+SWIG_TYPECHECK_DOUBLE            90
+SWIG_TYPECHECK_CPLXFLT           95
+SWIG_TYPECHECK_CPLXDBL           100
+SWIG_TYPECHECK_COMPLEX           105
+SWIG_TYPECHECK_UNICHAR           110
+SWIG_TYPECHECK_STDUNISTRING      115
+SWIG_TYPECHECK_UNISTRING         120
+SWIG_TYPECHECK_CHAR              130
+SWIG_TYPECHECK_STDSTRING         135
+SWIG_TYPECHECK_STRING            140
+SWIG_TYPECHECK_PAIR              150
+SWIG_TYPECHECK_STDARRAY          155
+SWIG_TYPECHECK_VECTOR            160
+SWIG_TYPECHECK_DEQUE             170
+SWIG_TYPECHECK_LIST              180
+SWIG_TYPECHECK_SET               190
+SWIG_TYPECHECK_MULTISET          200
+SWIG_TYPECHECK_MAP               210
+SWIG_TYPECHECK_MULTIMAP          220
+SWIG_TYPECHECK_STACK             230
+SWIG_TYPECHECK_QUEUE             240
+SWIG_TYPECHECK_BOOL_ARRAY        1015
+SWIG_TYPECHECK_INT8_ARRAY        1025
+SWIG_TYPECHECK_INT16_ARRAY       1035
+SWIG_TYPECHECK_INT32_ARRAY       1045
+SWIG_TYPECHECK_INT64_ARRAY       1055
+SWIG_TYPECHECK_INT128_ARRAY      1065
+SWIG_TYPECHECK_FLOAT_ARRAY       1080
+SWIG_TYPECHECK_DOUBLE_ARRAY      1090
+SWIG_TYPECHECK_CHAR_ARRAY        1130
+SWIG_TYPECHECK_STRING_ARRAY      1140
+SWIG_TYPECHECK_OBJECT_ARRAY      1150
+SWIG_TYPECHECK_BOOL_PTR          2015
+SWIG_TYPECHECK_UINT8_PTR         2020
+SWIG_TYPECHECK_INT8_PTR          2025
+SWIG_TYPECHECK_UINT16_PTR        2030
+SWIG_TYPECHECK_INT16_PTR         2035
+SWIG_TYPECHECK_UINT32_PTR        2040
+SWIG_TYPECHECK_INT32_PTR         2045
+SWIG_TYPECHECK_UINT64_PTR        2050
+SWIG_TYPECHECK_INT64_PTR         2055
+SWIG_TYPECHECK_FLOAT_PTR         2080
+SWIG_TYPECHECK_DOUBLE_PTR        2090
+SWIG_TYPECHECK_CHAR_PTR          2130
+SWIG_TYPECHECK_SWIGOBJECT        5000
 </pre>
 </div>
 
@@ -4815,7 +4847,7 @@
 </li>
 </ul>
 
-<H3><a name="Typemaps_typecheck_pointer">13.13.1 SWIG_TYPECHECK_POINTER precedence level and the typecheck typemap</a></H3>
+<H3><a name="Typemaps_typecheck_pointer">14.13.1 SWIG_TYPECHECK_POINTER precedence level and the typecheck typemap</a></H3>
 
 
 <p>
@@ -4917,7 +4949,7 @@
 The 'equivalent' attribute is used in the implementation for the <a href="Library.html#Library_std_shared_ptr">shared_ptr smart pointer</a> library.
 </p>
 
-<H2><a name="Typemaps_nn48">13.14 More about %apply and %clear</a></H2>
+<H2><a name="Typemaps_nn48">14.14 More about %apply and %clear</a></H2>
 
 
 <p>
@@ -5022,7 +5054,7 @@
 </pre>
 </div>
 
-<H2><a name="Typemaps_nn47">13.15 Passing data between typemaps</a></H2>
+<H2><a name="Typemaps_nn47">14.15 Passing data between typemaps</a></H2>
 
 
 <p>
@@ -5059,7 +5091,7 @@
 </p>
 
 
-<H2><a name="Typemaps_nn52">13.16 C++ "this" pointer</a></H2>
+<H2><a name="Typemaps_nn52">14.16 C++ "this" pointer</a></H2>
 
 
 <p>
@@ -5119,7 +5151,7 @@
 the method, but gives the argument a name other than <tt>self</tt>.
 </p>
 
-<H2><a name="Typemaps_nn51">13.17 Where to go for more information?</a></H2>
+<H2><a name="Typemaps_nn51">14.17 Where to go for more information?</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Varargs.html b/Doc/Manual/Varargs.html
index 9f20469..620f2e5 100644
--- a/Doc/Manual/Varargs.html
+++ b/Doc/Manual/Varargs.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Varargs">16 Variable Length Arguments</a></H1>
+<H1><a name="Varargs">17 Variable Length Arguments</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -43,7 +43,7 @@
 wisely chosen to avoid this issue.
 </p>
 
-<H2><a name="Varargs_nn2">16.1 Introduction</a></H2>
+<H2><a name="Varargs_nn2">17.1 Introduction</a></H2>
 
 
 <p>
@@ -140,7 +140,7 @@
 </pre>
 </div>
 
-<H2><a name="Varargs_nn3">16.2 The Problem</a></H2>
+<H2><a name="Varargs_nn3">17.2 The Problem</a></H2>
 
 
 <p>
@@ -233,7 +233,7 @@
 are willing to get hands dirty.  Keep reading.
 </p>
 
-<H2><a name="Varargs_nn4">16.3 Default varargs support</a></H2>
+<H2><a name="Varargs_nn4">17.3 Default varargs support</a></H2>
 
 
 <p>
@@ -302,7 +302,7 @@
 </p>
 
 
-<H2><a name="Varargs_nn5">16.4 Argument replacement using %varargs</a></H2>
+<H2><a name="Varargs_nn5">17.4 Argument replacement using %varargs</a></H2>
 
 
 <p>
@@ -413,7 +413,7 @@
 wrappers to such functions presents special problems (covered shortly).  
 </p>
 
-<H2><a name="Varargs_nn6">16.5 Varargs and typemaps</a></H2>
+<H2><a name="Varargs_nn6">17.5 Varargs and typemaps</a></H2>
 
 
 <p>
@@ -593,7 +593,7 @@
 security, continue to the next section.
 </p>
 
-<H2><a name="Varargs_nn7">16.6 Varargs wrapping with libffi</a></H2>
+<H2><a name="Varargs_nn7">17.6 Varargs wrapping with libffi</a></H2>
 
 
 <p>
@@ -845,7 +845,7 @@
 values.   Please consult the chapter on each language module for more details.
 </p>
 
-<H2><a name="Varargs_nn8">16.7 Wrapping of va_list</a></H2>
+<H2><a name="Varargs_nn8">17.7 Wrapping of va_list</a></H2>
 
 
 <p>
@@ -899,7 +899,7 @@
 </pre>
 </div>
 
-<H2><a name="Varargs_nn9">16.8 C++ Issues</a></H2>
+<H2><a name="Varargs_nn9">17.8 C++ Issues</a></H2>
 
 
 <p>
@@ -968,7 +968,7 @@
 fully general wrapper to a varargs C++ member function.
 </p>
 
-<H2><a name="Varargs_nn10">16.9 Discussion</a></H2>
+<H2><a name="Varargs_nn10">17.9 Discussion</a></H2>
 
 
 <p>
diff --git a/Doc/Manual/Warnings.html b/Doc/Manual/Warnings.html
index c63d7de..0cf2a10 100644
--- a/Doc/Manual/Warnings.html
+++ b/Doc/Manual/Warnings.html
@@ -7,7 +7,7 @@
 </head>
 
 <body bgcolor="#ffffff">
-<H1><a name="Warnings">18 Warning Messages</a></H1>
+<H1><a name="Warnings">19 Warning Messages</a></H1>
 <!-- INDEX -->
 <div class="sectiontoc">
 <ul>
@@ -37,7 +37,7 @@
 
 
 
-<H2><a name="Warnings_nn2">18.1 Introduction</a></H2>
+<H2><a name="Warnings_nn2">19.1 Introduction</a></H2>
 
 
 <p>
@@ -57,7 +57,7 @@
 work like you expect.
 </p>
 
-<H2><a name="Warnings_suppression">18.2 Warning message suppression</a></H2>
+<H2><a name="Warnings_suppression">19.2 Warning message suppression</a></H2>
 
 
 <p>
@@ -149,7 +149,7 @@
 </p>
 
 
-<H2><a name="Warnings_nn4">18.3 Enabling extra warnings</a></H2>
+<H2><a name="Warnings_nn4">19.3 Enabling extra warnings</a></H2>
 
 
 <p>
@@ -222,7 +222,7 @@
 or the <tt>-w</tt> option.
 </p>
 
-<H2><a name="Warnings_nn5">18.4 Issuing a warning message</a></H2>
+<H2><a name="Warnings_nn5">19.4 Issuing a warning message</a></H2>
 
 
 <p>
@@ -276,7 +276,7 @@
 </pre>
 </div>
 
-<H2><a name="Warnings_symbolic_symbols">18.5 Symbolic symbols</a></H2>
+<H2><a name="Warnings_symbolic_symbols">19.5 Symbolic symbols</a></H2>
 
 
 <p>
@@ -311,7 +311,7 @@
 </pre>
 </div>
 
-<H2><a name="Warnings_nn6">18.6 Commentary</a></H2>
+<H2><a name="Warnings_nn6">19.6 Commentary</a></H2>
 
 
 <p>
@@ -328,7 +328,7 @@
 messages.
 </p>
 
-<H2><a name="Warnings_nn7">18.7 Warnings as errors</a></H2>
+<H2><a name="Warnings_nn7">19.7 Warnings as errors</a></H2>
 
 
 <p>
@@ -337,7 +337,7 @@
 warning is encountered.
 </p>
 
-<H2><a name="Warnings_nn8">18.8 Message output format</a></H2>
+<H2><a name="Warnings_nn8">19.8 Message output format</a></H2>
 
 
 <p>
@@ -356,10 +356,10 @@
 example.i(4) : Syntax error in input(1).
 </pre></div>
 
-<H2><a name="Warnings_nn9">18.9 Warning number reference</a></H2>
+<H2><a name="Warnings_nn9">19.9 Warning number reference</a></H2>
 
 
-<H3><a name="Warnings_nn10">18.9.1 Deprecated features (100-199)</a></H3>
+<H3><a name="Warnings_nn10">19.9.1 Deprecated features (100-199)</a></H3>
 
 
 <ul>
@@ -387,7 +387,7 @@
 <li>126. The 'nestedworkaround' feature is deprecated.
 </ul>
 
-<H3><a name="Warnings_nn11">18.9.2 Preprocessor (200-299)</a></H3>
+<H3><a name="Warnings_nn11">19.9.2 Preprocessor (200-299)</a></H3>
 
 
 <ul>
@@ -399,7 +399,7 @@
 <li>206. Unexpected tokens after #<em>directive</em> directive.
 </ul>
 
-<H3><a name="Warnings_nn12">18.9.3 C/C++ Parser (300-399)</a></H3>
+<H3><a name="Warnings_nn12">19.9.3 C/C++ Parser (300-399)</a></H3>
 
 
 <ul>
@@ -476,7 +476,7 @@
 <li>395. operator delete[] ignored.
 </ul>
 
-<H3><a name="Warnings_nn13">18.9.4 Types and typemaps (400-499) </a></H3>
+<H3><a name="Warnings_nn13">19.9.4 Types and typemaps (400-499) </a></H3>
 
 
 <ul>
@@ -507,7 +507,7 @@
 
 
 
-<H3><a name="Warnings_nn14">18.9.5 Code generation (500-559)</a></H3>
+<H3><a name="Warnings_nn14">19.9.5 Code generation (500-559)</a></H3>
 
 
 <ul>
@@ -538,7 +538,7 @@
 <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>
+<H3><a name="Warnings_doxygen">19.9.6 Doxygen comments (560-599)</a></H3>
 
 
 <ul>
@@ -549,7 +549,7 @@
   <li>564: Error parsing Doxygen command <em>command</em>: <em>error text</em>. Command ignored."</li>
 </ul>
 
-<H3><a name="Warnings_nn15">18.9.7 Language module specific (700-899) </a></H3>
+<H3><a name="Warnings_nn15">19.9.7 Language module specific (700-899) </a></H3>
 
 
 <ul>
@@ -600,14 +600,14 @@
 <li>871. Unrecognized pragma <em>pragma</em>.   (Php).
 </ul>
 
-<H3><a name="Warnings_nn16">18.9.8 User defined (900-999)</a></H3>
+<H3><a name="Warnings_nn16">19.9.8 User defined (900-999)</a></H3>
 
 
 <p>
 These numbers can be used by your own application.
 </p>
 
-<H2><a name="Warnings_nn17">18.10 History</a></H2>
+<H2><a name="Warnings_nn17">19.10 History</a></H2>
 
 
 <p>
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/Doc/Manual/chapters b/Doc/Manual/chapters
index 2cb2b18..994b288 100644
--- a/Doc/Manual/chapters
+++ b/Doc/Manual/chapters
@@ -7,6 +7,7 @@
 CPlusPlus11.html
 CPlusPlus14.html
 CPlusPlus17.html
+CPlusPlus20.html
 Preprocessor.html
 Library.html
 Arguments.html
diff --git a/Doc/Manual/style.css b/Doc/Manual/style.css
index 45e51e3..ffadb87 100644
--- a/Doc/Manual/style.css
+++ b/Doc/Manual/style.css
@@ -65,6 +65,10 @@
   font-family: "Courier New", Courier, "Courier 10 Pitch", monospace;
 }
 
+div.diagram li {
+    margin-left: 0;
+}
+
 ul li p {
   margin-left: 0;
   margin-right: 0;
diff --git a/Examples/Makefile.in b/Examples/Makefile.in
index b2cbb65..6fbca29 100644
--- a/Examples/Makefile.in
+++ b/Examples/Makefile.in
@@ -1436,79 +1436,41 @@
 GO = @GO@
 GOGCC = @GOGCC@
 GCCGO = @GCCGO@
-GO1 = @GO1@
-GO12 = @GO12@
-GO13 = @GO13@
-GO15 = @GO15@
-GOC = @GOC@
 GOOPT = @GOOPT@
 GCCGOOPT = @GCCGOOPT@
 GOVERSIONOPTION = @GOVERSIONOPTION@
 
 GOSWIGARG = `if $(GOGCC) ; then echo -gccgo; fi`
-GOCOMPILEARG = `if $(GO15); then echo tool compile; elif $(GO1) ; then echo tool $(GOC:c=g) ; fi` `if $(GO13) || $(GO15); then echo -pack ; fi`
 
 GOSRCS = $(INTERFACE:.i=.go)
 GOCSRCS = $(INTERFACE:.i=_gc.c)
 
-GOLD = `if $(GO15); then echo link; else echo $(GOC:c=l); fi`
-GOTOOL = `if $(GO1) ; then echo go tool; fi`
-GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; fi`
-
 GOPACKAGE = $(notdir $(INTERFACE:.i=.a))
 
-GOPATHDIR = gopath/src/$(INTERFACE:.i=)
-
-GOOBJEXT = `if $(GO15); then echo o; else echo $(GOC:c=); fi`
-GOGCOBJS = $(GOSRCS:.go=.$(GOOBJEXT))
-GOGCCOBJS = $(GOSRCS:.go=.@OBJEXT@)
+GOPATHPARENTDIR = gopath/$(GOMOD)/src
+GOPATHDIR = $(GOPATHPARENTDIR)/$(INTERFACE:.i=)
 
 # ----------------------------------------------------------------
 # Build a Go module (C)
 # ----------------------------------------------------------------
 
-go_nocgo: $(SRCDIR_SRCS)
-	$(SWIG) -go $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
-	if $(GO12) || $(GO13) || $(GO15) || $(GOGCC); then \
-	  $(CC) -g -c $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \
-	else \
-	  $(CC) -g -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \
-	  $(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO); \
-	fi
-	if $(GOGCC) ; then \
-	  $(COMPILETOOL) $(GCCGO) -g -c -I . $(GOSRCS); \
-	else \
-	  $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(GOSRCS); \
-	  $(COMPILETOOL) $(GOTOOL) $(GOC) -I $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`} $(GOCSRCS); \
-	  rm -f $(GOPACKAGE); \
-	  if $(GO13) || $(GO15); then \
-	    cp $(GOGCOBJS) $(GOPACKAGE); \
-	    $(COMPILETOOL) $(GOPACK) r $(GOPACKAGE) $(GOCSRCS:.c=.$(GOOBJEXT)) $(OBJS) $(IOBJS); \
-	  elif $(GO12); then \
-	    $(COMPILETOOL) $(GOPACK) grc $(GOPACKAGE) $(GOGCOBJS) $(GOCSRCS:.c=.$(GOOBJEXT)) $(OBJS) $(IOBJS); \
-	  else \
-	    $(COMPILETOOL) $(GOPACK) grc $(GOPACKAGE) $(GOGCOBJS) $(GOCSRCS:.c=.$(GOOBJEXT)); \
-	  fi; \
-	fi
-	if test -f $(SRCDIR)$(RUNME).go; then \
-	  if $(GOGCC) ; then \
-	    $(COMPILETOOL) $(GCCGO) -g -c $(SRCDIR)$(RUNME).go; \
-	    $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOGCCOBJS) $(OBJS) $(IOBJS); \
-	  elif $(GO12) || $(GO13) || $(GO15); then \
-	    $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
-	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
-	  else \
-	    $(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); \
-	  fi; \
-	fi
-
-go: $(SRCDIR_SRCS)
-	$(SWIG) -go -cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
+$(GOPATHPARENTDIR)/go.mod:
 	@mkdir gopath 2>/dev/null || true
-	@mkdir gopath/src 2>/dev/null || true
-	@mkdir gopath/src/$(INTERFACE:.i=) 2>/dev/null || true
-	rm -f $(GOPATHDIR)/*
+	@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: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod
+	$(SWIG) -go -import-prefix swigtests $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
+	@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
+	rm -rf $(GOPATHDIR)/*
 	cp $(ISRCS) $(GOPATHDIR)/
 	if test -f $(IWRAP:.i=.h); then \
 	  cp $(IWRAP:.i=.h) $(GOPATHDIR)/; \
@@ -1517,7 +1479,14 @@
 	  cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \
 	fi
 	cp $(GOSRCS) $(GOPATHDIR)/
-	GOPATH=`pwd`/gopath; \
+	@if test -f $(SRCDIR)$(RUNME).go; then \
+	  mkdir gopath/$(GOMOD)/src/runme 2>/dev/null || true; \
+	  rm -f gopath/$(GOMOD)/src/runme/*; \
+	fi
+	if test -f $(SRCDIR)$(RUNME).go; then \
+	  cp $(SRCDIR)$(RUNME).go gopath/$(GOMOD)/src/runme/; \
+	fi
+	GOPATH=`pwd`/gopath/$(GOMOD); \
 	export GOPATH; \
 	CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
 	export CGO_CPPFLAGS; \
@@ -1525,82 +1494,29 @@
 	export CGO_CFLAGS; \
 	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)
+	(cd $(GOPATHDIR)/ && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE)); \
 	if $(GOGCC); then \
-	  cp $(dir $(INTERFACE))/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE:.a=.gox); \
-	fi
+	  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); \
-	  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); \
-	  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); \
-	  fi; \
+	  mkdir gopath/$(GOMOD)/src/swigtests 2>/dev/null || true; \
+	  mkdir gopath/$(GOMOD)/src/swigtests/$(INTERFACE:.i=) 2>/dev/null || true; \
+	  cp $(GOPATHDIR)/* gopath/$(GOMOD)/src/swigtests/$(INTERFACE:.i=)/; \
+	  (cd gopath/$(GOMOD)/src/runme && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o runme $(RUNME).go); \
+	  cp gopath/$(GOMOD)/src/runme/runme $(RUNME); \
 	fi
 
 # ----------------------------------------------------------------
 # Build a Go module (C++)
 # ----------------------------------------------------------------
 
-go_cpp_nocgo: $(SRCDIR_SRCS)
-	$(SWIG) -go -c++ $(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); \
-	  fi; \
-	  $(foreach f,$(ICXXSRCS), \
-	    $(CXX) -g -c $(CPPFLAGS) $(CXXFLAGS) -o $(addsuffix .@OBJEXT@,$(basename $f)) $f $(INCLUDES); \
-	  ) \
-	else \
-	  $(CXX) -g -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) $(ICXXSRCS) $(INCLUDES); \
-	  $(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO); \
-	fi
-	if ! $(GOGCC) ; then \
-	  $(foreach f,$(GOSRCS), \
-	    $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . -o $(addsuffix .$(GOOBJEXT),$(basename $f)) $f \
-	  ); \
-	  $(foreach f,$(GOCSRCS), \
-	    $(COMPILETOOL) $(GOTOOL) $(GOC) -I $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`} \
-	    -o $(addsuffix .$(GOOBJEXT),$(basename $f)) $f; \
-	  ) \
-	  rm -f $(GOPACKAGE); \
-	  if $(GO13) || $(GO15); then \
-	    cp $(GOGCOBJS) $(GOPACKAGE); \
-	    $(COMPILETOOL) $(GOPACK) r $(GOPACKAGE) $(GOCSRCS:.c=.$(GOOBJEXT)) $(OBJS) $(IOBJS); \
-	  elif $(GO12); then \
-	    $(COMPILETOOL) $(GOPACK) grc $(GOPACKAGE) $(GOGCOBJS) $(GOCSRCS:.c=.$(GOOBJEXT)) $(OBJS) $(IOBJS); \
-	  else \
-	    $(COMPILETOOL) $(GOPACK) grc $(GOPACKAGE) $(GOGCOBJS) $(GOCSRCS:.c=.$(GOOBJEXT)); \
-	  fi; \
-	else \
-	  $(foreach f,$(GOSRCS), \
-	    $(COMPILETOOL) $(GCCGO) -g -c -I . -o $(addsuffix .@OBJEXT@,$(basename $f)) $f \
-	  ); \
-	fi
-	if test -f $(SRCDIR)$(RUNME).go; then \
-	  if $(GOGCC) ; then \
-	    $(COMPILETOOL) $(GCCGO) -g -c $(SRCDIR)$(RUNME).go; \
-	    $(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOGCCOBJS) $(OBJS) $(IOBJS) -lstdc++; \
-	  elif $(GO12) || $(GO13) || $(GO15); then \
-	    $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
-	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
-	  else \
-	    $(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); \
-	  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
-	rm -f $(GOPATHDIR)/*
+	@mkdir gopath/$(GOMOD) 2>/dev/null || true
+	@mkdir gopath/$(GOMOD)/src 2>/dev/null || true
+	@mkdir $(GOPATHDIR) 2>/dev/null || true
+	rm -rf $(GOPATHDIR)/*
 	cp $(ICXXSRCS) $(GOPATHDIR)/
 	if test -f $(IWRAP:.i=.h); then \
 	  cp $(IWRAP:.i=.h) $(GOPATHDIR)/; \
@@ -1612,7 +1528,14 @@
 	  cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \
 	fi
 	cp $(GOSRCS) $(GOPATHDIR)/
-	GOPATH=`pwd`/gopath; \
+	@if test -f $(SRCDIR)$(RUNME).go; then \
+	  mkdir gopath/$(GOMOD)/src/runme 2>/dev/null || true; \
+	  rm -f gopath/$(GOMOD)/src/runme/*; \
+	fi
+	if test -f $(SRCDIR)$(RUNME).go; then \
+	  cp $(SRCDIR)$(RUNME).go gopath/$(GOMOD)/src/runme/; \
+	fi
+	GOPATH=`pwd`/gopath/$(GOMOD); \
 	export GOPATH; \
 	CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
 	export CGO_CPPFLAGS; \
@@ -1622,22 +1545,16 @@
 	export CGO_CXXFLAGS; \
 	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)
+	(cd $(GOPATHDIR) && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE)); \
 	if $(GOGCC); then \
-	  cp $(dir $(INTERFACE))/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE:.a=.gox); \
-	fi
+	  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++; \
-	  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); \
-	  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); \
-	  fi; \
+	  mkdir gopath/$(GOMOD)/src/swigtests 2>/dev/null || true; \
+	  mkdir gopath/$(GOMOD)/src/swigtests/$(INTERFACE:.i=) 2>/dev/null || true; \
+	  cp $(GOPATHDIR)/* gopath/$(GOMOD)/src/swigtests/$(INTERFACE:.i=)/; \
+	  (cd gopath/$(GOMOD)/src/runme && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o runme $(RUNME).go); \
+	  cp gopath/$(GOMOD)/src/runme/runme $(RUNME); \
 	fi
 
 # -----------------------------------------------------------------
diff --git a/Examples/go/callback/runme.go b/Examples/go/callback/runme.go
index 03ab0c5..7c9ffd6 100644
--- a/Examples/go/callback/runme.go
+++ b/Examples/go/callback/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/class/runme.go b/Examples/go/class/runme.go
index 8d68afb..a09a182 100644
--- a/Examples/go/class/runme.go
+++ b/Examples/go/class/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/constants/runme.go b/Examples/go/constants/runme.go
index 1427997..57ef21a 100644
--- a/Examples/go/constants/runme.go
+++ b/Examples/go/constants/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	"./example"
 	"fmt"
+
+	"swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/director/runme.go b/Examples/go/director/runme.go
index 0d839bc..e28eccb 100644
--- a/Examples/go/director/runme.go
+++ b/Examples/go/director/runme.go
@@ -1,9 +1,10 @@
 package main
 
 import (
-	"./example"
 	"fmt"
 	"os"
+
+	"swigtests/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..c0642e0 100644
--- a/Examples/go/enum/runme.go
+++ b/Examples/go/enum/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/extend/runme.go b/Examples/go/extend/runme.go
index a569689..716af52 100644
--- a/Examples/go/extend/runme.go
+++ b/Examples/go/extend/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/funcptr/runme.go b/Examples/go/funcptr/runme.go
index 44dae3c..87ec7d4 100644
--- a/Examples/go/funcptr/runme.go
+++ b/Examples/go/funcptr/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/multimap/runme.go b/Examples/go/multimap/runme.go
index 390205a..2f8b205 100644
--- a/Examples/go/multimap/runme.go
+++ b/Examples/go/multimap/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/pointer/runme.go b/Examples/go/pointer/runme.go
index 1414d34..73c6b2b 100644
--- a/Examples/go/pointer/runme.go
+++ b/Examples/go/pointer/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/reference/runme.go b/Examples/go/reference/runme.go
index 004a04c..7391d9c 100644
--- a/Examples/go/reference/runme.go
+++ b/Examples/go/reference/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/simple/runme.go b/Examples/go/simple/runme.go
index 9eb0ff4..5bc055f 100644
--- a/Examples/go/simple/runme.go
+++ b/Examples/go/simple/runme.go
@@ -1,8 +1,9 @@
 package main
 
 import (
-	"./example"
 	"fmt"
+
+	"swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/template/runme.go b/Examples/go/template/runme.go
index fca2f1b..e000b15 100644
--- a/Examples/go/template/runme.go
+++ b/Examples/go/template/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	. "./example"
 	"fmt"
+
+	. "swigtests/example"
 )
 
 func main() {
diff --git a/Examples/go/variables/runme.go b/Examples/go/variables/runme.go
index 3d9737f..85ca8c6 100644
--- a/Examples/go/variables/runme.go
+++ b/Examples/go/variables/runme.go
@@ -3,8 +3,9 @@
 package main
 
 import (
-	"./example"
 	"fmt"
+
+	"swigtests/example"
 )
 
 func main() {
diff --git a/Examples/guile/std_vector/example.h b/Examples/guile/std_vector/example.h
index 4f0dac7..52e260d 100644
--- a/Examples/guile/std_vector/example.h
+++ b/Examples/guile/std_vector/example.h
@@ -17,9 +17,8 @@
 }
 
 void halve_in_place(std::vector<double>& v) {
-    // would you believe this is the same as the above?
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 
diff --git a/Examples/javascript/check.list b/Examples/javascript/check.list
index 9707e77..9778357 100644
--- a/Examples/javascript/check.list
+++ b/Examples/javascript/check.list
@@ -3,6 +3,7 @@
 enum
 exception
 functor
+native
 nspace
 operator
 overload
diff --git a/Examples/javascript/native/Makefile b/Examples/javascript/native/Makefile
new file mode 100644
index 0000000..0402f8d
--- /dev/null
+++ b/Examples/javascript/native/Makefile
@@ -0,0 +1,3 @@
+SRCS =
+
+include $(SRCDIR)../example.mk
diff --git a/Examples/javascript/native/binding.gyp.in b/Examples/javascript/native/binding.gyp.in
new file mode 100644
index 0000000..59779ae
--- /dev/null
+++ b/Examples/javascript/native/binding.gyp.in
@@ -0,0 +1,9 @@
+{
+  "targets": [
+    {
+      "target_name": "example",
+      "sources": [ "example_wrap.cxx" ],
+      "include_dirs": ["$srcdir"]
+    }
+  ]
+}
diff --git a/Examples/javascript/native/example.i b/Examples/javascript/native/example.i
new file mode 100644
index 0000000..8c61600
--- /dev/null
+++ b/Examples/javascript/native/example.i
@@ -0,0 +1,47 @@
+/* File : example.i */
+%module example
+
+// placeholder() used to help SWIG generate "SWIG_From_int" call
+%{
+    int placeholder();
+%}
+int placeholder() { return 0; }
+
+// actual demo code
+%wrapper
+%{
+#ifdef SWIG_V8_VERSION /* Engine: Node || V8 */
+    
+    static SwigV8ReturnValue JavaScript_do_work(const SwigV8Arguments &args) {
+        SWIGV8_HANDLESCOPE();
+        const int MY_MAGIC_NUMBER = 5;
+        v8::Handle<v8::Value> jsresult =
+            SWIG_From_int(static_cast< int >(MY_MAGIC_NUMBER));
+        if (args.Length() != 0)
+            SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments.");
+        SWIGV8_RETURN(jsresult);
+    fail:
+        SWIGV8_RETURN(SWIGV8_UNDEFINED());
+    }
+
+#else /* Engine: JavaScriptCore */
+
+    static JSValueRef JavaScript_do_work(JSContextRef context,
+        JSObjectRef function, JSObjectRef thisObject, size_t argc,
+        const JSValueRef argv[], JSValueRef* exception) {
+        const int MY_MAGIC_NUMBER = 5;
+        JSValueRef jsresult =
+            SWIG_From_int SWIG_JSC_FROM_CALL_ARGS(
+                static_cast< int >(MY_MAGIC_NUMBER));
+        if (argc != 0)
+            SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments.");
+        return jsresult;
+    fail:
+        return JSValueMakeUndefined(context);
+    }
+
+#endif
+%}
+
+
+%native(magicNumber) void JavaScript_do_work();
diff --git a/Examples/javascript/native/example.js b/Examples/javascript/native/example.js
new file mode 100644
index 0000000..2e7f83a
--- /dev/null
+++ b/Examples/javascript/native/example.js
@@ -0,0 +1 @@
+module.exports = require("build/Release/example");
diff --git a/Examples/javascript/native/index.html b/Examples/javascript/native/index.html
new file mode 100644
index 0000000..7c7d6b0
--- /dev/null
+++ b/Examples/javascript/native/index.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+<title>SWIG:Examples:javascript:native</title>
+</head>
+
+<body bgcolor="#ffffff">
+
+
+<tt>SWIG/Examples/javascript/native/</tt>
+<hr>
+
+<H2>Manually wrapped callback function in JavaScript</H2>
+
+<p>
+This example demonstrates how to manually add callback feature support to a SWIG module.
+</p>
+
+<ul>
+<li><a href="example.i">example.i</a>. Interface file containing the API function and async behind-the-scenes functions. 
+<li><a href="runme.java">runme.js</a>. Sample JavaScript program showing the API function being called with a callback function parameter.
+</ul>
+
+<h2>Notes</h2>
+
+The V8 code queues the callback request for processing using the UV interface. An async function callback is invoked when the system is ready to process the next request. When the async function finishes, a completion function callback is invoked to finalize the request. Here the callback function parameter is invoked.
+<br/><br/>
+UV request queueing is only necessary for operations that would take a really long or otherwise unpredictable amount of time (async operations). A callback parameter could also be invoked immediately within the API function.
+
+<hr>
+</body>
+</html>
diff --git a/Examples/javascript/native/runme.js b/Examples/javascript/native/runme.js
new file mode 100644
index 0000000..b5e14d0
--- /dev/null
+++ b/Examples/javascript/native/runme.js
@@ -0,0 +1,3 @@
+var example = require("example");
+
+console.log("My magic number is: ", example.magicNumber());
diff --git a/Examples/mzscheme/std_vector/example.h b/Examples/mzscheme/std_vector/example.h
index 4f0dac7..52e260d 100644
--- a/Examples/mzscheme/std_vector/example.h
+++ b/Examples/mzscheme/std_vector/example.h
@@ -17,9 +17,8 @@
 }
 
 void halve_in_place(std::vector<double>& v) {
-    // would you believe this is the same as the above?
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 
diff --git a/Examples/ocaml/std_vector/example.h b/Examples/ocaml/std_vector/example.h
index b753592..d968f69 100644
--- a/Examples/ocaml/std_vector/example.h
+++ b/Examples/ocaml/std_vector/example.h
@@ -17,9 +17,8 @@
 }
 
 void halve_in_place(std::vector<double>& v) {
-    // would you believe this is the same as the above?
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 
diff --git a/Examples/php/pragmas/example.i b/Examples/php/pragmas/example.i
index f9307a6..ea9590b 100644
--- a/Examples/php/pragmas/example.i
+++ b/Examples/php/pragmas/example.i
@@ -25,7 +25,7 @@
 
 %pragma(php) code="
 # This code is inserted into example.php
-echo \"this was php code\\n\";
+echo \"This was php code\\n\";
 "
 %pragma(php) version="1.5"
 
diff --git a/Examples/php/pragmas/include.php b/Examples/php/pragmas/include.php
index e19880a..11d985d 100644
--- a/Examples/php/pragmas/include.php
+++ b/Examples/php/pragmas/include.php
@@ -1,7 +1,7 @@
 <?php
 
 # This code is inserted into example.php
-echo "this is include.php\n";
+echo "This is include.php\n";
 
 
 ?>
diff --git a/Examples/php/pragmas/runme.php b/Examples/php/pragmas/runme.php
index b99cf37..7b2c179 100644
--- a/Examples/php/pragmas/runme.php
+++ b/Examples/php/pragmas/runme.php
@@ -1,6 +1,9 @@
 <?php
 
+# For finding include.php
+set_include_path(realpath(dirname(__FILE__)) . PATH_SEPARATOR . get_include_path());
+
 require "example.php";
 
-echo "Version - " . ((new ReflectionExtension('example'))->getVersion());
+echo "Version - " . ((new ReflectionExtension('example'))->getVersion()) . "\n";
 ?>
diff --git a/Examples/python/import_packages/namespace_pkg/normal.py b/Examples/python/import_packages/namespace_pkg/normal.py
index 924142f..0eb8f51 100644
--- a/Examples/python/import_packages/namespace_pkg/normal.py
+++ b/Examples/python/import_packages/namespace_pkg/normal.py
@@ -11,7 +11,7 @@
 print(" Starting subtest " + os.path.basename(__file__))
 
 # Package brave found under one path
-sys.path.insert(0, 'path1')
+sys.path.insert(0, "path1")
 
 from brave import robin
 print("  Finished from brave import robin")
diff --git a/Examples/python/import_packages/namespace_pkg/nstest.py b/Examples/python/import_packages/namespace_pkg/nstest.py
index e80289f..4d618a6 100644
--- a/Examples/python/import_packages/namespace_pkg/nstest.py
+++ b/Examples/python/import_packages/namespace_pkg/nstest.py
@@ -11,7 +11,7 @@
         print("  Finished running: " + commandline)
 
 def copyMods():
-    dirs = ['path1', 'path2', 'path3']
+    dirs = ["path1", "path2", "path3"]
 
     # Clean out any old package paths
     for d in dirs:
@@ -20,20 +20,20 @@
 
     for d in dirs:
         os.mkdir(d)
-        os.mkdir(os.path.join(d, 'brave'))
+        os.mkdir(os.path.join(d, "brave"))
 
-    shutil.copy('robin.py', os.path.join('path1', 'brave'))
-    subprocess.check_call('cp _robin.* ' + os.path.join('path1', 'brave'), shell=True)
+    shutil.copy("robin.py", os.path.join("path1", "brave"))
+    subprocess.check_call("cp _robin.* " + os.path.join("path1", "brave"), shell=True)
 
-    shutil.copy('robin.py', os.path.join('path2', 'brave'))
-    subprocess.check_call('cp _robin.* ' + os.path.join('path3', 'brave'), shell=True)
+    shutil.copy("robin.py", os.path.join("path2", "brave"))
+    subprocess.check_call("cp _robin.* " + os.path.join("path3", "brave"), shell=True)
 
     mkzip()
 
 def mkzip():
     zf = zipfile.ZipFile("path4.zip", "w")
-    zf.writestr("brave/", b'')
-    zf.write('robin.py', 'brave/robin.py')
+    zf.writestr("brave/", b"")
+    zf.write("robin.py", "brave/robin.py")
     zf.close()
 
 
diff --git a/Examples/python/import_packages/namespace_pkg/split.py b/Examples/python/import_packages/namespace_pkg/split.py
index 8989954..9d786dc 100644
--- a/Examples/python/import_packages/namespace_pkg/split.py
+++ b/Examples/python/import_packages/namespace_pkg/split.py
@@ -12,8 +12,8 @@
 
 # Package brave split into two paths.
 # path2/brave/robin.py and path3/brave/_robin.so
-sys.path.insert(0, 'path2')
-sys.path.insert(0, 'path3')
+sys.path.insert(0, "path2")
+sys.path.insert(0, "path3")
 
 from brave import robin
 print("  Finished from brave import robin")
diff --git a/Examples/python/import_packages/namespace_pkg/zipsplit.py b/Examples/python/import_packages/namespace_pkg/zipsplit.py
index 8af9cf0..30434f9 100644
--- a/Examples/python/import_packages/namespace_pkg/zipsplit.py
+++ b/Examples/python/import_packages/namespace_pkg/zipsplit.py
@@ -12,8 +12,8 @@
 
 # Package brave split into two paths.
 # brave/robin.py (in path4.zip) and path3/brave/_robin.so
-sys.path.insert(0, 'path4.zip')
-sys.path.insert(0, 'path3')
+sys.path.insert(0, "path4.zip")
+sys.path.insert(0, "path3")
 
 from brave import robin
 print("  Finished from brave import robin")
diff --git a/Examples/python/performance/constructor/runme.py b/Examples/python/performance/constructor/runme.py
index 1771fba..b00cd45 100644
--- a/Examples/python/performance/constructor/runme.py
+++ b/Examples/python/performance/constructor/runme.py
@@ -1,5 +1,5 @@
 import sys
-sys.path.append('..')
+sys.path.append("..")
 import harness
 
 
diff --git a/Examples/python/performance/func/runme.py b/Examples/python/performance/func/runme.py
index 760a8ab..3b14279 100644
--- a/Examples/python/performance/func/runme.py
+++ b/Examples/python/performance/func/runme.py
@@ -1,5 +1,5 @@
 import sys
-sys.path.append('..')
+sys.path.append("..")
 import harness
 
 
diff --git a/Examples/python/performance/harness.py b/Examples/python/performance/harness.py
index c3d38b4..3468faa 100644
--- a/Examples/python/performance/harness.py
+++ b/Examples/python/performance/harness.py
@@ -17,16 +17,16 @@
 
     except IndexError:
         proc = Popen(
-            [sys.executable, 'runme.py', 'Simple_baseline'], stdout=PIPE)
+            [sys.executable, "runme.py", "Simple_baseline"], stdout=PIPE)
         (stdout, stderr) = proc.communicate()
         print stdout
 
         proc = Popen(
-            [sys.executable, 'runme.py', 'Simple_optimized'], stdout=PIPE)
+            [sys.executable, "runme.py", "Simple_optimized"], stdout=PIPE)
         (stdout, stderr) = proc.communicate()
         print stdout
 
         proc = Popen(
-            [sys.executable, 'runme.py', 'Simple_builtin'], stdout=PIPE)
+            [sys.executable, "runme.py", "Simple_builtin"], stdout=PIPE)
         (stdout, stderr) = proc.communicate()
         print stdout
diff --git a/Examples/python/performance/hierarchy/runme.py b/Examples/python/performance/hierarchy/runme.py
index 8255cdc..3899582 100644
--- a/Examples/python/performance/hierarchy/runme.py
+++ b/Examples/python/performance/hierarchy/runme.py
@@ -1,5 +1,5 @@
 import sys
-sys.path.append('..')
+sys.path.append("..")
 import harness
 
 
diff --git a/Examples/python/performance/hierarchy_operator/runme.py b/Examples/python/performance/hierarchy_operator/runme.py
index eabfae8..48241d4 100644
--- a/Examples/python/performance/hierarchy_operator/runme.py
+++ b/Examples/python/performance/hierarchy_operator/runme.py
@@ -1,5 +1,5 @@
 import sys
-sys.path.append('..')
+sys.path.append("..")
 import harness
 
 
diff --git a/Examples/python/performance/operator/runme.py b/Examples/python/performance/operator/runme.py
index d75ae40..798dd8b 100644
--- a/Examples/python/performance/operator/runme.py
+++ b/Examples/python/performance/operator/runme.py
@@ -1,5 +1,5 @@
 import sys
-sys.path.append('..')
+sys.path.append("..")
 import harness
 
 
diff --git a/Examples/python/std_vector/example.h b/Examples/python/std_vector/example.h
index 4f0dac7..52e260d 100644
--- a/Examples/python/std_vector/example.h
+++ b/Examples/python/std_vector/example.h
@@ -17,9 +17,8 @@
 }
 
 void halve_in_place(std::vector<double>& v) {
-    // would you believe this is the same as the above?
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 
diff --git a/Examples/ruby/exceptproxy/example.i b/Examples/ruby/exceptproxy/example.i
index 8e00751..ad0c23a 100644
--- a/Examples/ruby/exceptproxy/example.i
+++ b/Examples/ruby/exceptproxy/example.i
@@ -14,7 +14,7 @@
 %}
 
 
-/* The EmpytError doesn't appear in a throw declaration, and hence
+/* The EmptyError doesn't appear in a throw declaration, and hence
   we need to tell SWIG that the dequeue method throws it.  This can
   now be done via the %catchs feature. */
 %catches(FullError) *::enqueue;
diff --git a/Examples/ruby/std_vector/example.h b/Examples/ruby/std_vector/example.h
index 4f0dac7..52e260d 100644
--- a/Examples/ruby/std_vector/example.h
+++ b/Examples/ruby/std_vector/example.h
@@ -17,9 +17,8 @@
 }
 
 void halve_in_place(std::vector<double>& v) {
-    // would you believe this is the same as the above?
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 
diff --git a/Examples/scilab/std_vector/example.h b/Examples/scilab/std_vector/example.h
index 4f0dac7..52e260d 100644
--- a/Examples/scilab/std_vector/example.h
+++ b/Examples/scilab/std_vector/example.h
@@ -17,9 +17,8 @@
 }
 
 void halve_in_place(std::vector<double>& v) {
-    // would you believe this is the same as the above?
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 
diff --git a/Examples/tcl/std_vector/example.h b/Examples/tcl/std_vector/example.h
index 4f0dac7..52e260d 100644
--- a/Examples/tcl/std_vector/example.h
+++ b/Examples/tcl/std_vector/example.h
@@ -17,9 +17,8 @@
 }
 
 void halve_in_place(std::vector<double>& v) {
-    // would you believe this is the same as the above?
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 
diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk
index 67a6328..115747e 100644
--- a/Examples/test-suite/common.mk
+++ b/Examples/test-suite/common.mk
@@ -159,6 +159,7 @@
 	cpp_enum \
 	cpp_namespace \
 	cpp_nodefault \
+	cpp_parameters \
 	cpp_static \
 	cpp_typedef \
 	cpp14_binary_integer_literals \
@@ -250,6 +251,7 @@
 	funcptr_cpp \
 	functors \
 	fvirtual \
+	global_immutable_vars_cpp \
 	global_namespace \
 	global_ns_arg \
 	global_scope_types \
@@ -324,6 +326,7 @@
 	nested_directors \
 	nested_comment \
 	nested_ignore \
+	nested_inheritance_interface \
 	nested_in_template \
 	nested_scope \
 	nested_template_base \
@@ -609,17 +612,23 @@
 #	cpp11_reference_wrapper \     # No typemaps
 
 # Doxygen support test cases: can only be used with languages supporting
-# Doxygen comment translation, currently only Python and Java.
+# Doxygen comment translation (currently Python and Java) and only if not
+# disabled by configure via SKIP_DOXYGEN_TEST_CASES.
+ifneq ($(SKIP_DOXYGEN_TEST_CASES),1)
 python_HAS_DOXYGEN := 1
 java_HAS_DOXYGEN := 1
 
 $(eval HAS_DOXYGEN := $($(LANGUAGE)_HAS_DOXYGEN))
+endif
 
 ifdef HAS_DOXYGEN
 DOXYGEN_TEST_CASES += \
 	doxygen_alias \
 	doxygen_basic_notranslate \
 	doxygen_basic_translate \
+	doxygen_basic_translate_style2 \
+	doxygen_basic_translate_style3 \
+	doxygen_code_blocks \
 	doxygen_ignore \
 	doxygen_misc_constructs \
 	doxygen_nested_class \
@@ -641,6 +650,7 @@
 	director_string \
 	ignore_template_constructor \
 	li_std_combinations \
+	li_std_containers_overload \
 	li_std_deque \
 	li_std_except \
 	li_std_except_as_class \
@@ -653,6 +663,7 @@
 	li_std_vector_enum \
 	li_std_vector_member_var\
 	li_std_vector_ptr \
+	li_std_wstring \
 	smart_pointer_inherit \
 	template_typedef_fnc \
 	template_type_namespace \
@@ -685,6 +696,7 @@
 	funcptr \
 	function_typedef \
 	global_functions \
+	global_immutable_vars \
 	immutable_values \
 	inctest \
 	infinity \
diff --git a/Examples/test-suite/constant_directive.i b/Examples/test-suite/constant_directive.i
index b102ffe..3e4775d 100644
--- a/Examples/test-suite/constant_directive.i
+++ b/Examples/test-suite/constant_directive.i
@@ -14,6 +14,11 @@
   Type1(int val = 0) : val(val) {}
   int val;
 };
+enum EnumType
+{
+  EnumValue
+};
+EnumType enumValue = EnumValue;
 /* Typedefs for const Type and its pointer */
 typedef const Type1 Type1Const;
 typedef const Type1* Type1Cptr;
@@ -46,3 +51,4 @@
 %constant Type1Cfptr TYPE1CFPTR1DEF_CONSTANT1 = getType1Instance;
 /* Regular constant */
 %constant int TYPE_INT = 0;
+%constant enum EnumType newValue = enumValue;
diff --git a/Examples/test-suite/cpp11_constexpr.i b/Examples/test-suite/cpp11_constexpr.i
index 755efb0..420db4f 100644
--- a/Examples/test-suite/cpp11_constexpr.i
+++ b/Examples/test-suite/cpp11_constexpr.i
@@ -4,6 +4,15 @@
 %module cpp11_constexpr
 
 
+%{
+#if defined(__clang__)
+#pragma clang diagnostic push
+// Suppress: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior
+// For MMM() and NNN()
+#pragma clang diagnostic ignored "-Wconstexpr-not-const"
+#endif
+%}
+
 %inline %{
 #ifdef SWIG
 #define SWIGTESTCONST const
diff --git a/Examples/test-suite/cpp11_default_delete.i b/Examples/test-suite/cpp11_default_delete.i
index b5e84ed..0c20fb7 100644
--- a/Examples/test-suite/cpp11_default_delete.i
+++ b/Examples/test-suite/cpp11_default_delete.i
@@ -28,7 +28,13 @@
 
 struct A2 {
   void funk(int i) {}
+
+// Workaround clang 10.0.1 -std=c++17 linker error (oddly for Java and not Python):
+// Undefined symbols for architecture x86_64:"___cxa_deleted_virtual", referenced from: vtable for A2
+#if !(defined(__clang__) && __cplusplus >= 201703L)
   virtual void fff(int) = delete;
+#endif
+
   virtual ~A2() = default;
   template<class T> void funk(T) = delete;
 };
diff --git a/Examples/test-suite/cpp11_final_override.i b/Examples/test-suite/cpp11_final_override.i
index 8d275b3..c31ae73 100644
--- a/Examples/test-suite/cpp11_final_override.i
+++ b/Examples/test-suite/cpp11_final_override.i
@@ -138,3 +138,31 @@
 DerivedNoVirtualStruct::~DerivedNoVirtualStruct() {}
 %}
 
+%inline %{
+namespace Outer {
+  namespace final {
+    template <typename T> struct smart_ptr {
+      typedef T type;
+    };
+  }
+  namespace override {
+    template <typename T> struct dumb_ptr {
+      typedef T type;
+    };
+  }
+}
+%}
+
+%template(SmartPtrBaseStruct) Outer::final::smart_ptr<DerivedStruct>;
+
+%inline %{
+class ObjectDB
+{
+public:
+  static void smart1(typename Outer::final::smart_ptr<DerivedStruct>::type *objectT) {}
+  static void smart2(Outer::final::smart_ptr<DerivedStruct>::type *objectT) {}
+  static void dumb1(typename Outer::override::dumb_ptr<DerivedStruct>::type *objectT) {}
+  static void dumb2(Outer::override::dumb_ptr<DerivedStruct>::type *objectT) {}
+  static Outer::final::smart_ptr<DerivedStruct>::type get() { return DerivedStruct(); }
+};
+%}
diff --git a/Examples/test-suite/cpp11_initializer_list.i b/Examples/test-suite/cpp11_initializer_list.i
index 58d2ecc..b309576 100644
--- a/Examples/test-suite/cpp11_initializer_list.i
+++ b/Examples/test-suite/cpp11_initializer_list.i
@@ -6,12 +6,21 @@
 %ignore A::A(std::initializer_list<int>);
 %ignore B::method;
 
-%typemap(in) std::initializer_list<const char *> {
+%typemap(in) std::initializer_list<const char *> %{
   $1 = {"Ab", "Fab"};
-}
+%}
+
+%begin %{
+#if __GNUC__ >= 9
+/* warning: ‘new’ of initializer_list does not extend the lifetime of the underlying array [-Winit-list-lifetime] */
+/* incorrect warning for C::C(std::initializer_list<const char *>) */
+#pragma GCC diagnostic ignored "-Winit-list-lifetime"
+#endif
+%}
 
 %inline %{
 #include <initializer_list>
+#include <string>
 
 class A {
 public:
@@ -26,9 +35,16 @@
   void method(std::initializer_list<int> init) {}
 };
 class C {
+  std::string joined;
 public:
-  C(std::initializer_list<const char *>) {}
+  C(std::initializer_list<const char *> init) {
+    for (auto& val : init)
+      joined += val;
+  }
   C() {}
+  const char * get_joined_string() {
+    return joined.c_str();
+  }
 };
 %}
 
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_noexcept.i b/Examples/test-suite/cpp11_noexcept.i
index a77eb04..8aa0baa 100644
--- a/Examples/test-suite/cpp11_noexcept.i
+++ b/Examples/test-suite/cpp11_noexcept.i
@@ -31,8 +31,13 @@
   void noo1() const noexcept {}
   static void noo2() noexcept {}
   virtual void noo3() const noexcept {}
+
+// Workaround clang 10.0.1 -std=c++17 linker error (oddly for Java and not Python):
+// Undefined symbols for architecture x86_64: "___cxa_deleted_virtual", referenced from: vtable for NoExceptClass
+#if !(defined(__clang__) && __cplusplus >= 201703L)
   virtual void noo4() const noexcept = delete;
   virtual void noo5() const throw() = delete;
+#endif
 };
 
 struct NoExceptAbstract {
diff --git a/Examples/test-suite/cpp11_rvalue_reference2.i b/Examples/test-suite/cpp11_rvalue_reference2.i
index 9aaf4ac..a2a0020 100644
--- a/Examples/test-suite/cpp11_rvalue_reference2.i
+++ b/Examples/test-suite/cpp11_rvalue_reference2.i
@@ -31,7 +31,7 @@
   // test both primitive and user defined rvalue reference default arguments and compactdefaultargs
   void compactDefaultArgs(const bool &&b = (const bool &&)PublicGlobalTrue, const UserDef &&u  = (const UserDef &&)PublicUserDef) {}
   void privateDefaultArgs(const bool &&b = (const bool &&)PrivateTrue) {}
-  operator int &&() { return std::move(0); }
+  operator int &&() { return std::move(val); }
   Thingy(const Thingy& rhs) : val(rhs.val), lvalref(rhs.lvalref), rvalref(std::move(rhs.rvalref)) {}
   Thingy& operator=(const Thingy& rhs) {
     val = rhs.val;
diff --git a/Examples/test-suite/cpp11_rvalue_reference3.i b/Examples/test-suite/cpp11_rvalue_reference3.i
index 6dfe4c0..8ebf453 100644
--- a/Examples/test-suite/cpp11_rvalue_reference3.i
+++ b/Examples/test-suite/cpp11_rvalue_reference3.i
@@ -26,10 +26,10 @@
 
 struct Containing {
   Thing && member_rvalue_ref;
-  Thing *&& member_rvalue_ref_ptr1 = 0;
-  Thing const*&& member_rvalue_ref_ptr2 = 0;
-  Thing *const&& member_rvalue_ref_ptr3 = 0;
-  Thing const*const &&member_rvalue_ref_ptr4 = 0;
+  Thing *&& member_rvalue_ref_ptr1;
+  Thing const*&& member_rvalue_ref_ptr2;
+  Thing *const&& member_rvalue_ref_ptr3;
+  Thing const*const &&member_rvalue_ref_ptr4;
 
   Containing(Thing&&r, Thing*&& r1, Thing const*&& r2, Thing *const&& r3, Thing const*const && r4) :
     member_rvalue_ref(std::move(r)), 
@@ -63,10 +63,10 @@
 
 struct IntContaining {
   int && member_rvalue_ref;
-  int *&& member_rvalue_ref_ptr1 = 0;
-  int const*&& member_rvalue_ref_ptr2 = 0;
-  int *const&& member_rvalue_ref_ptr3 = 0;
-  int const*const &&member_rvalue_ref_ptr4 = 0;
+  int *&& member_rvalue_ref_ptr1;
+  int const*&& member_rvalue_ref_ptr2;
+  int *const&& member_rvalue_ref_ptr3;
+  int const*const &&member_rvalue_ref_ptr4;
 
   IntContaining(int&& r, int*&& r1, int const*&& r2, int *const&& r3, int const*const && r4) :
     member_rvalue_ref(std::move(r)),
diff --git a/Examples/test-suite/cpp11_shared_ptr_template_upcast.i b/Examples/test-suite/cpp11_shared_ptr_template_upcast.i
new file mode 100644
index 0000000..38968bb
--- /dev/null
+++ b/Examples/test-suite/cpp11_shared_ptr_template_upcast.i
@@ -0,0 +1,88 @@
+%module cpp11_shared_ptr_template_upcast
+
+%{
+#include <memory>
+#include <string>
+%}
+
+%include <std_shared_ptr.i>
+%include <std_string.i>
+
+%{
+class Base {
+public:
+    Base() : value(0) {}
+    Base(int v) : value(v) {}
+    virtual ~Base() {}
+    
+    virtual int GetResult() = 0;
+    
+    int value;
+};
+
+class Derived : public Base {
+public:
+    Derived() : Base() {}
+    Derived(int v) : Base(v) {}
+    virtual ~Derived() {}
+    
+    int GetResult() { return value*2; }
+};
+
+template <class T> class Printable : virtual public T {
+public:
+    Printable(int param) : T(param) {}
+    ~Printable() {}
+
+    std::string GetFormatted() { return std::string("The formatted result is: ").append(std::to_string(this->GetResult())); }
+};
+
+std::shared_ptr<Printable<Derived> > MakePrintableDerived(int param) {
+    return std::make_shared<Printable<Derived> >(param);
+}
+
+%}
+
+%shared_ptr(Base);
+%shared_ptr(Derived);
+%shared_ptr(Printable<Derived>)
+
+class Base {
+public:
+    Base();
+    Base(int v);
+    virtual ~Base();
+    
+    virtual int GetResult() = 0;
+    
+    int value;
+};
+
+class Derived : public Base {
+public:
+    Derived();
+    Derived(int v);
+    virtual ~Derived();
+    
+    int GetResult();
+};
+
+/*
+    Virtual inheritance is contrived for this case, but exposes whether SWIGSmartPtrUpcast generated a correctly typed shared pointer of the upcasted class type -
+    if the pointer type is incorrect, this will result in a segmentation fault (on Windows, this could manifest as undefined behavior) when trying to access members 
+    inherited from T through a shared_ptr<Printable<T> >.
+*/
+template <class T> class Printable : virtual public T {
+public:
+    Printable(int param);
+    ~Printable();
+
+    std::string GetFormatted();
+};
+
+std::shared_ptr<Printable<Derived> > MakePrintableDerived(int param);
+
+
+%template(PrintableDerived) Printable<Derived>;
+
+
diff --git a/Examples/test-suite/cpp11_template_typedefs.i b/Examples/test-suite/cpp11_template_typedefs.i
index 02cb8ac..5f1f2e6 100644
--- a/Examples/test-suite/cpp11_template_typedefs.i
+++ b/Examples/test-suite/cpp11_template_typedefs.i
@@ -15,7 +15,7 @@
   using type2_t = T2;
   T1 a;
   T2 b;
-  constexpr int get_n() { return N; }
+  constexpr int get_n() const { return N; }
 };
 
 // Specialization for T1=const char*, T2=bool
@@ -26,7 +26,7 @@
   using type2_t = bool;
   type1_t a;
   type2_t b;
-  constexpr int get_n() { return 3 * N; }
+  constexpr int get_n() const { return 3 * N; }
 };
 
 // alias templates
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_parameters.i b/Examples/test-suite/cpp_parameters.i
new file mode 100644
index 0000000..e8a4c94
--- /dev/null
+++ b/Examples/test-suite/cpp_parameters.i
@@ -0,0 +1,46 @@
+%module cpp_parameters
+
+%{
+// For Perl
+#ifdef Zero
+#undef Zero
+#endif
+%}
+%inline %{
+
+// Zero arguments
+struct Zero {
+  Zero() {}
+  int zero() { return 0; }
+  static int stat_zero() { return 0; }
+};
+// One mandatory argument
+struct One {
+  One(int a) {}
+  int one(int a) { return a; }
+  static int stat_one(int a) { return a; }
+};
+// Two mandatory arguments
+struct Two {
+  Two(int a, int b) {}
+  int two(int a, int b) { return a + b; }
+  static int stat_two(int a, int b) { return a + b; }
+};
+// Single optional argument
+struct Single {
+  Single(int a=0) {}
+  int single(int a=0) { return a; }
+  static int stat_single(int a=0) { return a; }
+};
+
+int global_zero() { return 0; }
+int global_one(int a) { return a; }
+int global_two(int a, int b) { return a + b; }
+int global_single(int a=0) { return a; }
+
+#ifdef SWIGPYTHON_BUILTIN
+bool is_python_builtin() { return true; }
+#else
+bool is_python_builtin() { return false; }
+#endif
+%}
diff --git a/Examples/test-suite/csharp/Makefile.in b/Examples/test-suite/csharp/Makefile.in
index c9e48f8..b0ad0c7 100644
--- a/Examples/test-suite/csharp/Makefile.in
+++ b/Examples/test-suite/csharp/Makefile.in
@@ -16,9 +16,11 @@
 	complextest \
 	csharp_attributes \
 	csharp_swig2_compatibility \
+	csharp_director_typemaps \
 	csharp_exceptions \
 	csharp_features \
 	csharp_lib_arrays \
+	csharp_lib_arrays_bool \
 	csharp_namespace_system_collision \
 	csharp_prepost \
 	csharp_typemaps \
@@ -33,6 +35,7 @@
 	cpp11_shared_ptr_const \
 	cpp11_shared_ptr_nullptr_in_containers \
 	cpp11_shared_ptr_overload \
+	cpp11_shared_ptr_template_upcast \
 	cpp11_shared_ptr_upcast \
 	cpp11_strongly_typed_enumerations_simple \
 
@@ -48,6 +51,7 @@
 intermediary_classname.cpptest: SWIGOPT += -dllimport intermediary_classname
 complextest.cpptest: CSHARPFLAGSSPECIAL = -r:System.Numerics.dll
 csharp_lib_arrays.cpptest: CSHARPFLAGSSPECIAL = -unsafe
+csharp_lib_arrays_bool.cpptest: CSHARPFLAGSSPECIAL = -unsafe
 csharp_swig2_compatibility.cpptest: SWIGOPT += -DSWIG2_CSHARP
 
 # Rules for the different types of tests
diff --git a/Examples/test-suite/csharp/cpp11_shared_ptr_template_upcast_runme.cs b/Examples/test-suite/csharp/cpp11_shared_ptr_template_upcast_runme.cs
new file mode 100644
index 0000000..e76d2ba
--- /dev/null
+++ b/Examples/test-suite/csharp/cpp11_shared_ptr_template_upcast_runme.cs
@@ -0,0 +1,15 @@
+// This is the cpp11_shared_ptr_template_upcast runtime testcase. It checks that SWIG generates the appropriate upcasted shared_ptr type for a template instantiation deriving from a base class.
+// For this case, the expected behavior is: given a cptr with underlying type shared_ptr<Printable<Derived> >, PrintableDerived_SWIGSmartPtrUpcast returns a cptr with 
+// underlying type std::shared_ptr< Derived >, where Printable<Derived> inherits from Derived.
+using System;
+using cpp11_shared_ptr_template_upcastNamespace;
+
+public class cpp11_shared_ptr_template_upcast_runme
+{
+    static void Main()
+    {
+        PrintableDerived pd = cpp11_shared_ptr_template_upcast.MakePrintableDerived(20);
+        pd.GetResult();
+        pd.GetFormatted();
+    }
+}
diff --git a/Examples/test-suite/csharp/csharp_director_typemaps_runme.cs b/Examples/test-suite/csharp/csharp_director_typemaps_runme.cs
new file mode 100644
index 0000000..6143332
--- /dev/null
+++ b/Examples/test-suite/csharp/csharp_director_typemaps_runme.cs
@@ -0,0 +1,53 @@
+
+using System;
+using System.Reflection;
+using csharp_director_typemapsNamespace;
+
+public class csharp_director_typemaps_runme {
+
+  class CSharpDirectorTypemaps_InStreamDerived : InStream
+  {
+    private int constant;
+    public CSharpDirectorTypemaps_InStreamDerived(int constant) { this.constant = constant; }
+    public override int Read(global::System.IntPtr buf, int len, out int readLen) {
+      readLen = (buf == global::System.IntPtr.Zero) ? -len - constant : len + constant;
+      return readLen;
+    }
+    public override int Write(global::System.IntPtr buf, int len, out int writeLen) {
+      writeLen = (buf == global::System.IntPtr.Zero) ? -len - constant : len + constant;
+      return writeLen;
+    }
+  }
+  public static void Main() {
+    int outLen = -1;
+    int k = 100;
+    int j = 23;
+    InStream instream = new CSharpDirectorTypemaps_InStreamDerived(k);
+
+    {
+      int ret = csharp_director_typemaps.callRead(instream, InStream.getCPtr(instream).Handle, j, out outLen);
+      Assert(outLen, j + k);
+      Assert(ret, j + k);
+    }
+    {
+      int ret = csharp_director_typemaps.callRead(instream, global::System.IntPtr.Zero, j, out outLen);
+      Assert(outLen, -j - k);
+      Assert(ret, -j - k);
+    }
+
+    {
+      int ret = csharp_director_typemaps.callWrite(instream, InStream.getCPtr(instream).Handle, j, out outLen);
+      Assert(outLen, j + k);
+      Assert(ret, j + k);
+    }
+    {
+      int ret = csharp_director_typemaps.callWrite(instream, global::System.IntPtr.Zero, j, out outLen);
+      Assert(outLen, -j - k);
+      Assert(ret, -j - k);
+    }
+  }
+  private static void Assert(int i1, int i2) {
+    if (i1 != i2)
+      throw new Exception("assertion failure. " + i1 + " != " + i2);
+  }
+}
diff --git a/Examples/test-suite/csharp/csharp_lib_arrays_bool_runme.cs b/Examples/test-suite/csharp/csharp_lib_arrays_bool_runme.cs
new file mode 100644
index 0000000..3b19b57
--- /dev/null
+++ b/Examples/test-suite/csharp/csharp_lib_arrays_bool_runme.cs
@@ -0,0 +1,90 @@
+using System;
+using csharp_lib_arrays_boolNamespace;
+
+public class runme
+{
+  static void Main() 
+  {
+    {
+      bool[] source = { true, false, false, true, false, true, true, false };
+      bool[] target = new bool[ source.Length ];
+
+      csharp_lib_arrays_bool.myArrayCopyUsingFixedArraysBool( source, target, target.Length );
+      CompareArrays(source, target, "bool[] INPUT/OUTPUT Fixed");
+    }
+    
+    {
+      bool[] source = { true, false, false, true, false, true, true, false };
+      bool[] target = { false, true, true, false, true, false, false, true };
+
+      csharp_lib_arrays_bool.myArraySwapUsingFixedArraysBool( source, target, target.Length );
+
+      for (int i=0; i<target.Length; ++i)
+        target[i] = !target[i];
+
+      CompareArrays(source, target, "bool[] INOUT");
+    }
+
+    if( runtimeIsMono() )
+    {
+//      Console.Error.WriteLine("Tests are running on mono, failing bool[] tests skipped");
+//      See Mono bug report https://github.com/mono/mono/issues/15592
+      return;
+    }
+
+    {
+      bool[] source = { true, false, false, true, false, true, true, false };
+      bool[] target = new bool[ source.Length ];
+
+      if( !csharp_lib_arrays_bool.checkBoolArrayCorrect( source, source.Length ) )
+      {
+        throw new Exception("bool[] INPUT incorrect");
+      }
+
+      csharp_lib_arrays_bool.myArrayCopyBool( source, target, target.Length );
+      CompareArrays(source, target, "bool[] INPUT/OUTPUT");
+    }
+
+    {
+      bool[] source = { true, false, false, true, false, true, true, false };
+      bool[] target = { false, true, true, false, true, false, false, true };
+
+      csharp_lib_arrays_bool.myArraySwapBool( source, target, target.Length );
+
+      for (int i=0; i<target.Length; ++i)
+        target[i] = !target[i];
+
+      CompareArrays(source, target, "bool[] INOUT");
+    }
+  }
+  
+  static void CompareArrays<T>( T[] a, T[] b, string testName ) 
+  {
+    if (a.Length != b.Length)
+      throw new Exception("size mismatch");
+
+    for(int i=0; i<a.Length; ++i) {
+      if (a[i].Equals(b[i]) == false) {
+        Console.Error.WriteLine("C# Array mismatch: " + testName);
+        Console.Error.WriteLine("a:");
+        PrintArray(a);
+        Console.Error.WriteLine("b:");
+        PrintArray(b);
+        throw new Exception("element mismatch");
+      }
+    }
+  }
+
+  static void PrintArray<T>( T[] a )
+  {
+    foreach ( T i in a )
+      Console.Error.Write( "{0} ", i );
+    Console.Error.WriteLine();
+  }
+
+  static bool runtimeIsMono()
+  {
+    return Type.GetType ("Mono.Runtime") != null;
+  }
+}
+
diff --git a/Examples/test-suite/csharp/li_std_set_runme.cs b/Examples/test-suite/csharp/li_std_set_runme.cs
index 6519e8c..e9cd2c2 100644
--- a/Examples/test-suite/csharp/li_std_set_runme.cs
+++ b/Examples/test-suite/csharp/li_std_set_runme.cs
@@ -85,5 +85,21 @@
         ss = new StringSet{"foo", "bar", "baz"};
         ss.UnionWith(new[] {"baz", "quux"});
         checkThat(ss.SetEquals(new[] {"foo", "bar", "baz", "quux"}), "UnionWith works");
+
+        // Check a set of another type.
+        FooSet fooSet = new FooSet();
+        ISet<Foo> fooISet = fooSet;
+        checkThat(fooISet.Count == 0, "is initially empty");
+        checkThat(fooISet.Add(new Foo(17)), "added successfully");
+        checkThat(fooISet.Count == 1, "is not empty any more");
+
+        // And a set of primitive type.
+        IntSet intSet = new IntSet();
+        checkThat(intSet.Count == 0, "is initially empty");
+        checkThat(intSet.Add(17), "17 added successfully");
+        checkThat(!intSet.Add(17), "17 not added again");
+        checkThat(intSet.Count == 1, "not empty any more");
+        checkThat(intSet.Add(289), "289 added successfully");
+        checkThat(intSet.Count == 2, "even less empty now");
     }
 }
diff --git a/Examples/test-suite/csharp/li_std_wstring_runme.cs b/Examples/test-suite/csharp/li_std_wstring_runme.cs
index fe663a3..8b7ba1b 100644
--- a/Examples/test-suite/csharp/li_std_wstring_runme.cs
+++ b/Examples/test-suite/csharp/li_std_wstring_runme.cs
@@ -3,74 +3,116 @@
 
 public class runme
 {
+    static private void check_equal(char a, char b)
+    {
+      if (a != b)
+        throw new Exception("char failed '" + a + "' != '" + b + "'");
+    }
+
+    static private void check_equal(string a, string b)
+    {
+      if (a != b)
+        throw new Exception("string failed '" + a + "' != '" + b + "'");
+    }
+
     static void Main() 
     {
-      char y='h';
+        char h = 'h';
+        check_equal(li_std_wstring.test_wcvalue(h), h);
 
-      if (li_std_wstring.test_wcvalue(y) != y)
-        throw new Exception("bad string mapping:" + li_std_wstring.test_wcvalue(y));
+        string x = "abc";
+        check_equal(li_std_wstring.test_ccvalue(x), x);
+        check_equal(li_std_wstring.test_cvalue(x), x);
 
-      if (li_std_wstring.test_wcvalue_w() != 'W')
-        throw new Exception("bad string mapping:" + li_std_wstring.test_wcvalue_w());
+        check_equal(li_std_wstring.test_wchar_overload(x), x);
+        check_equal(li_std_wstring.test_wchar_overload(), null);
 
-      string x="hello";
+        li_std_wstring.test_pointer(null);
+        li_std_wstring.test_const_pointer(null);
 
-      if (li_std_wstring.test_ccvalue(x) != x)
-        throw new Exception("bad string mapping");
+        try {
+            li_std_wstring.test_value(null);
+            throw new Exception("NULL check failed");
+        } catch (ArgumentNullException) {
+        }
 
-      if (li_std_wstring.test_cvalue(x) != x)
-        throw new Exception("bad string mapping");
+        try {
+              li_std_wstring.test_reference(null);
+              throw new Exception("NULL check failed");
+        } catch (ArgumentNullException e) {
+            if (!e.Message.Contains("type is null"))
+                throw new Exception("Missing text " + e);
+        }
+        try {
+            li_std_wstring.test_const_reference(null);
+            throw new Exception("NULL check failed");
+        } catch (ArgumentNullException e) {
+            if (!e.Message.Contains("null wstring"))
+                throw new Exception("Missing text " + e);
+        }
 
+        x = "hello";
+        check_equal(li_std_wstring.test_const_reference(x), x);
 
-      if (li_std_wstring.test_value(x) != x)
-        throw new Exception("bad string mapping: " + x + li_std_wstring.test_value(x));
+        /* Postpone, tricky, std::wstring portability problem.
+         * std::wstring is 2 bytes on Windows, 4 bytes on Linux, LPWSTR is 2 bytes.
+         * .NET marshalling should work on Windows but not Linux.
+        string s = "abc";
+        if (!li_std_wstring.test_equal_abc(s))
+            throw new Exception("Not equal " + s);
+        */
 
-      if (li_std_wstring.test_const_reference(x) != x)
-        throw new Exception("bad string mapping");
+        try {
+            li_std_wstring.test_throw();
+        } catch (Exception e) {
+            check_equal(e.Message, "throwing test_throw");
+        }
 
+        x = "abc\0def";
+        // Unlike other languages, embedded NULL in std::string not supported
+        // check_equal(li_std_wstring.test_value(x), x);
+        check_equal(li_std_wstring.test_value(x), "abc");
+        check_equal(li_std_wstring.test_ccvalue(x), "abc");
+        check_equal(li_std_wstring.test_wchar_overload(x), "abc");
 
-      string s = "he";
-      s = s + "llo";
+        {
+            // Unicode strings
+            string[] test_strings = {
+                "JP: 日本語", "DE: Kröpeliner Straße" , "RU: Война и мир", "EN: War and Peace"
+            };
 
-      if (s != x)
-        throw new Exception("bad string mapping: " + s + x);
+            foreach (string expected in test_strings)
+            {
+                string received = li_std_wstring.test_value(expected);
+                check_equal(received, expected);
+            }
 
-      if (li_std_wstring.test_value(s) != x)
-        throw new Exception("bad string mapping");
+            foreach (string expected in test_strings)
+            {
+                string received = li_std_wstring.test_const_reference(expected);
+                check_equal(received, expected);
+            }
 
-      if (li_std_wstring.test_const_reference(s) != x)
-        throw new Exception("bad string mapping");
+            foreach (string expected in test_strings)
+            {
+                string received = li_std_wstring.test_ccvalue(expected);
+                check_equal(received, expected);
+            }
 
-      string a = s;
-
-      if (li_std_wstring.test_value(a) != x)
-        throw new Exception("bad string mapping");
-
-      if (li_std_wstring.test_const_reference(a) != x)
-        throw new Exception("bad string mapping");
-
-      string b = " world";
-
-      if (a + b != "hello world")
-        throw new Exception("bad string mapping");
-
-      if (a + " world" != "hello world")
-        throw new Exception("bad string mapping");
-
-      if ("hello" + b != "hello world")
-        throw new Exception("bad string mapping");
-
-      s = "hello world";
-
-      B myB = new B("hi");
-
-      myB.name = "hello";
-      if (myB.name != "hello")
-        throw new Exception("bad string mapping");
-
-      myB.a = "hello";
-      if (myB.a != "hello")
-        throw new Exception("bad string mapping");
+            /* Not working for Japanese and Russian characters on Windows, okay on Linux
+             * Is fixed by adding CharSet=CharSet.Unicode to the DllImport, so change to:
+             * [global::System.Runtime.InteropServices.DllImport("li_std_wstring", CharSet=global::System.Runtime.InteropServices.CharSet.Unicode, EntryPoint="CSharp_li_std_wstringNamespace_test_wcvalue")]
+             * Needs a SWIG code change to support this
+            foreach (string test_string in test_strings)
+            {
+                foreach (char expected in test_string)
+                {
+                    char received = li_std_wstring.test_wcvalue(expected);
+                    check_equal(received, expected);
+                }
+            }
+            */
+        }
     }
 }
 
diff --git a/Examples/test-suite/csharp/nested_inheritance_interface_runme.cs b/Examples/test-suite/csharp/nested_inheritance_interface_runme.cs
new file mode 100644
index 0000000..810b7db
--- /dev/null
+++ b/Examples/test-suite/csharp/nested_inheritance_interface_runme.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using nested_inheritance_interfaceNamespace;
+
+public class nested_inheritance_interface_runme {
+
+  static string SortArrayToString(string[] types) {
+    Array.Sort<string>(types);
+    return string.Join(" ", types);
+  }
+
+  static string SortArrayToString(Type[] types) {
+    List<string> stypes = new List<string>();
+    foreach (Type t in types)
+      stypes.Add(t.Name);
+    return SortArrayToString(stypes.ToArray());
+  }
+
+  private static void takeIA(IASwigInterface ia) {
+  }
+
+  public static void Main() {
+    Type[] BNInterfaces = typeof(B.N).GetInterfaces();
+    string expectedInterfacesString = "IASwigInterface IDisposable";
+    string actualInterfacesString = SortArrayToString(BNInterfaces);
+    if (expectedInterfacesString != actualInterfacesString)
+      throw new Exception("Expected interfaces for " + typeof(B.N).Name + ": \n" + expectedInterfacesString + "\n" + "Actual interfaces: \n" + actualInterfacesString);
+
+    if (!typeof(IASwigInterface).IsInterface)
+      throw new Exception(typeof(IASwigInterface).Name + " should be an interface but is not");
+
+    // overloaded methods check
+    B.N d = new B.N();
+    takeIA(d);
+  }
+}
diff --git a/Examples/test-suite/csharp_director_typemaps.i b/Examples/test-suite/csharp_director_typemaps.i
new file mode 100644
index 0000000..614bdbf
--- /dev/null
+++ b/Examples/test-suite/csharp_director_typemaps.i
@@ -0,0 +1,37 @@
+%module (directors="1") csharp_director_typemaps
+
+// This tests that the csout typemap is handled correctly in the director code.
+// The 'out' needs stripping in some parts of the generated director code.
+
+%feature("director") InStream;
+
+%apply void *VOID_INT_PTR { void * }
+
+%typemap(ctype)         int* readLen, int* writeLen "/*ctype*/ int*"
+%typemap(imtype)        int* readLen, int* writeLen "/*imtype*/ out int"
+%typemap(cstype)        int* readLen                "/*cstype*/ out int"
+// Note for below: 'out' used in typemap comment
+%typemap(cstype)                      int* writeLen "/*out cstype out*/ out int"
+%typemap(csin)          int* readLen, int* writeLen "/*csin*/ out $csinput"
+%typemap(in)            int* readLen, int* writeLen %{/*in*/  $1 = ($1_ltype)$input; %}
+%typemap(out)           int* readLen, int* writeLen %{/*out*/ $result = (void *)$1; %}
+%typemap(csdirectorin)  int* readLen, int* writeLen "/*csdirectorin*/ out $iminput"
+%typemap(csdirectorout) int* readLen, int* writeLen "/*csdirectorout*/ $cscall"
+%typemap(directorin)    int* readLen, int* writeLen "/*directorin*/ $input = $1;"
+%typemap(directorout)   int* readLen, int* writeLen %{/*directorout*/  $result = ($1_ltype)$input; %}
+
+%inline %{
+class InStream
+{
+public:
+    virtual int Read(void* buf, int len, int* readLen) = 0;
+    virtual int Write(void* buf, int len, int* writeLen) = 0;
+    virtual ~InStream() {}
+};
+int callRead(InStream* stream, void* buf, int len, int* readLen) {
+  return stream->Read(buf, len, readLen);
+}
+int callWrite(InStream* stream, void* buf, int len, int* writeLen) {
+  return stream->Write(buf, len, writeLen);
+}
+%}
diff --git a/Examples/test-suite/csharp_lib_arrays_bool.i b/Examples/test-suite/csharp_lib_arrays_bool.i
new file mode 100644
index 0000000..58cee9d
--- /dev/null
+++ b/Examples/test-suite/csharp_lib_arrays_bool.i
@@ -0,0 +1,78 @@
+%module csharp_lib_arrays_bool
+
+%include "arrays_csharp.i"
+
+%apply bool INPUT[] { bool* sourceArray }
+%apply bool OUTPUT[] { bool* targetArray }
+
+%apply bool INOUT[] { bool* array1 }
+%apply bool INOUT[] { bool* array2 }
+
+%inline %{
+#include <iostream>
+
+/* copy the contents of the first array to the second */
+void myArrayCopyBool( bool* sourceArray, bool* targetArray, int nitems ) {
+  int i;
+  for ( i = 0; i < nitems; i++ ) {
+    targetArray[ i ] = sourceArray[ i ];
+  }
+}
+
+/* swap the contents of the two arrays */
+void myArraySwapBool( bool* array1, bool* array2, int nitems ) {
+  int i;
+  bool temp;
+  for ( i = 0; i < nitems; i++ ) {
+    temp = array1[ i ];
+    array1[ i ] = array2[ i ];
+    array2[ i ] = temp;
+  }
+}
+
+bool checkBoolArrayCorrect( bool* sourceArray, int sourceArraySize ) {
+  if( sourceArraySize != 8 ) {
+    std::cout << "checkBoolArrayCorrect: Expected array with 8 elements" << std::endl;
+    return false;
+  }
+  return sourceArray[0] == true &&
+         sourceArray[1] == false &&
+         sourceArray[2] == false &&
+         sourceArray[3] == true &&
+         sourceArray[4] == false &&
+         sourceArray[5] == true &&
+         sourceArray[6] == true &&
+         sourceArray[7] == false;
+}
+%}
+
+%clear bool* sourceArray;
+%clear bool* targetArray;
+
+%clear bool* array1;
+%clear bool* array2;
+
+// Below replicates the above array handling but this time using the pinned (fixed) array typemaps
+%csmethodmodifiers myArrayCopyUsingFixedArraysBool "public unsafe";
+%csmethodmodifiers myArraySwapUsingFixedArraysBool "public unsafe";
+
+%apply bool FIXED[] { bool* sourceArray }
+%apply bool FIXED[] { bool* targetArray }
+
+%inline %{
+void myArrayCopyUsingFixedArraysBool( bool *sourceArray, bool* targetArray, int nitems ) {
+  myArrayCopyBool(sourceArray, targetArray, nitems);
+}
+%}
+
+%apply bool FIXED[] { bool* array1 }
+%apply bool FIXED[] { bool* array2 }
+
+%inline %{
+void myArraySwapUsingFixedArraysBool( bool* array1, bool* array2, int nitems ) {
+  myArraySwapBool(array1, array2, nitems);
+}
+%}
+
+
+
diff --git a/Examples/test-suite/doxygen_basic_translate.i b/Examples/test-suite/doxygen_basic_translate.i
index 0a8b047..4e543fe 100644
--- a/Examples/test-suite/doxygen_basic_translate.i
+++ b/Examples/test-suite/doxygen_basic_translate.i
@@ -57,6 +57,8 @@
  * \warning This may not work as expected
  * \code
  * int main() { while(true); }
+ *
+ * // Test blank line in code block
  * \endcode
  * \endif
  */
@@ -105,6 +107,23 @@
     return 0;
 }
 
+/* Regression test for crash with empty comment: */
+/**/ 
+
+/**
+ * @brief Test variadic function
+ * @param ... extra args
+ */
+void function8(...) {
+}
+
+/**
+ * @brief Test unnamed argument
+ * @param baz Description of baz
+ */
+void function9(int) {
+} 
+
 /**
  * Comment at the end of file should be ignored.
  */
diff --git a/Examples/test-suite/doxygen_basic_translate_style2.i b/Examples/test-suite/doxygen_basic_translate_style2.i
new file mode 100644
index 0000000..32e3cfc
--- /dev/null
+++ b/Examples/test-suite/doxygen_basic_translate_style2.i
@@ -0,0 +1,107 @@
+%module doxygen_basic_translate_style2
+
+%include "doxygen_basic_translate.h"
+
+// This test demonstrates a doxygen comment style that starts on the
+// first line and so uses extra spacing in subsequent lines.
+
+%inline %{
+
+/** \brief
+ *  Brief description.
+ * 
+ *  The comment text.
+ *
+ *  \author Some author
+ *
+ *  \return Some number
+ *
+ *  \sa function2
+ */
+int function()
+{
+    return 0;
+}
+
+/** A test of a very very very very very very very very very very very very very very very very
+ *  very very very very very long comment string.
+ */
+void function2()
+{
+}
+
+/** A test for overloaded functions
+ *  This is function \b one
+ */
+void function3(int a)
+{
+}
+
+/** A test for overloaded functions
+ *  This is function \b two
+ */
+void function3(int a, int b)
+{
+}
+
+/** A test of some mixed tag usage
+ *  \if CONDITION
+ *  This \a code fragment shows us something \.
+ *  \par Minuses:
+ *  \arg it's senseless
+ *  \arg it's stupid
+ *  \arg it's null
+ *
+ *  \warning This may not work as expected
+ *  \code
+ *  int main() { while(true); }
+ *
+ *  // Test blank line in code block
+ *  \endcode
+ *  \endif
+ */
+void function4()
+{
+}
+
+
+void function5(int a)
+{
+}
+/**< This is a post comment. */
+
+/** Test for default args
+ *  @param a Some parameter, default is 42
+ */
+void function6(int a=42)
+{
+}
+
+class Shape
+{
+public:
+  typedef Shape* superType;
+};
+
+/** Test for a parameter with difficult type
+ *  (mostly for python)
+ *  @param a Very strange param
+ */
+void function7(Shape::superType *a[10])
+{
+}
+
+/** Multiple parameters test.
+ *
+ *  @param y Vertical coordinate.
+ *  @param x Horizontal coordinate.
+ *  @return Arc tangent of @c y/x.
+ */
+double Atan2(double y, double x)
+{
+    return 0;
+}
+
+/** Comment at the end of file should be ignored.
+ */
+%}
diff --git a/Examples/test-suite/doxygen_basic_translate_style3.i b/Examples/test-suite/doxygen_basic_translate_style3.i
new file mode 100644
index 0000000..e364b16
--- /dev/null
+++ b/Examples/test-suite/doxygen_basic_translate_style3.i
@@ -0,0 +1,102 @@
+%module doxygen_basic_translate_style3
+
+%include "doxygen_basic_translate.h"
+
+%inline %{
+
+/// \brief
+/// Brief description.
+///
+/// The comment text.
+///
+/// \author Some author
+///
+/// \return Some number
+///
+/// \sa function2
+int function()
+{
+    return 0;
+}
+
+/// A test of a very very very very very very very very very very very very very very very very
+/// very very very very very long comment string.
+void function2()
+{
+}
+
+/// A test for overloaded functions
+/// This is function \b one
+void function3(int a)
+{
+}
+
+/// A test for overloaded functions
+/// This is function \b two
+void function3(int a, int b)
+{
+}
+
+/// A test of some mixed tag usage
+/// \if CONDITION
+/// This \a code fragment shows us something \.
+/// \par Minuses:
+/// \arg it's senseless
+/// \arg it's stupid
+/// \arg it's null
+///
+/// \warning This may not work as expected
+/// \code
+/// int main() { while(true); }
+///
+/// int testBlankLine() {}
+/// \endcode
+/// \endif
+void function4()
+{
+  // Note: a comment in the above code block will not get processed
+  // correctly with this doxygen comment style, because
+  // DoxygenParser::tokenizeDoxygenComment strips out the leading
+  // comment characters.  Whereas it works in the other doxygen
+  // comment styles (as shown in the other variations of
+  // doxygen_basic_translate), this test is modified to remove the
+  // comment within the code block.
+}
+
+
+void function5(int a)
+{
+}
+///< This is a post comment.
+
+/// Test for default args
+/// @param a Some parameter, default is 42
+void function6(int a=42)
+{
+}
+
+class Shape
+{
+public:
+  typedef Shape* superType;
+};
+
+/// Test for a parameter with difficult type
+/// (mostly for python)
+/// @param a Very strange param
+void function7(Shape::superType *a[10])
+{
+}
+
+/// Multiple parameters test.
+///
+/// @param y Vertical coordinate.
+/// @param x Horizontal coordinate.
+/// @return Arc tangent of @c y/x.
+double Atan2(double y, double x)
+{
+    return 0;
+}
+
+/// Comment at the end of file should be ignored.
+%}
diff --git a/Examples/test-suite/doxygen_code_blocks.i b/Examples/test-suite/doxygen_code_blocks.i
new file mode 100644
index 0000000..900e8f9
--- /dev/null
+++ b/Examples/test-suite/doxygen_code_blocks.i
@@ -0,0 +1,62 @@
+%module doxygen_code_blocks
+
+// This test is only used with Python
+
+%inline %{
+
+/**
+ * \brief Test for code blocks
+ *
+ * \code
+ * simple code block
+ * \endcode
+ *
+ * More advanced usage with C++ characters:
+ * \code
+ * std::vector<int> first;                                // empty vector of ints
+ * std::vector<int> second (4,100);                       // four ints with value 100
+ * std::vector<int> third (second.begin(),second.end());  // iterating through second
+ * std::vector<int> fourth (third);                       // a copy of third
+ *  // the iterator constructor can also be used to construct from arrays:
+ * int myints[] = {16,2,77,29};
+ * std::vector<int> fifth (myints, myints + sizeof(myints) / sizeof(int) );
+ *
+ * std::cout << "The contents of fifth are:";
+ * for (std::vector<int>::iterator it = fifth.begin(); it != fifth.end(); ++it)
+ *   std::cout << ' ' << *it;
+ * std::cout << '\n'; 
+ * \endcode
+ *
+ * A code block for C:
+ * \code{.c}
+ * printf("hello world");
+ * \endcode
+ *
+ * A code block for Java:
+ * \code{.java}
+ * public class HelloWorld {
+ *     public static void main(String[] args) {
+ *         // Prints "Hello, World" to the terminal window.
+ *         System.out.println("Hello, World");
+ *     }
+ * }
+ * \endcode
+ * 
+ * A code block for python:
+ * \code{.py}
+ * print('hello world')
+ * \endcode
+ *
+ * A python doctest example:
+ * \code{.py}
+ * >>> 1 + 1
+ * 2
+ * \endcode
+ */
+int function()
+{
+    return 0;
+}  
+
+
+%}
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_all_tags.i b/Examples/test-suite/doxygen_translate_all_tags.i
index 6e96a57..6cefd8d 100644
--- a/Examples/test-suite/doxygen_translate_all_tags.i
+++ b/Examples/test-suite/doxygen_translate_all_tags.i
@@ -38,6 +38,10 @@
  * \cite citationword
  * \class someClass headerFile.h headerName
  * \code some test code \endcode
+ *
+ * Code immediately following text.  Pydoc translation must add an
+ * empty line before:
+ * \code more test code \endcode
  */
 void func01(int a)
 {
@@ -121,6 +125,12 @@
  *     \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
  * \f}
  *
+ * Math immediately following text.  Pydoc translation must add an
+ * empty line before:
+ * \f[
+ *     \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
+ * \f]
+ *
  * \file file.h
  *
  * \fn someFn
@@ -252,6 +262,9 @@
  * \paragraph someParagraph Paragraph title
  *
  * \param a the first param
+ * \param[in] b parameter with intent(in)
+ * \param[out] c parameter with intent(out)
+ * \param[in,out] d parameter with intent(in,out)
  * 
  * \post Some description
  *
@@ -263,7 +276,7 @@
  *
  * \property someVar
  */
-void func07(int a)
+void func07(int a, int b, int c, int d)
 {
 }
 
diff --git a/Examples/test-suite/errors/Makefile.in b/Examples/test-suite/errors/Makefile.in
index 10e5bdd..7137a68 100644
--- a/Examples/test-suite/errors/Makefile.in
+++ b/Examples/test-suite/errors/Makefile.in
@@ -45,6 +45,11 @@
 # whatever we do here.
 $(DOXYGEN_ERROR_TEST_CASES): SWIGOPT += -doxygen
 
+# Unique module names are obtained from the .i file name (required for parallel make).
+# Note: -module overrides %module in the .i file.
+MODULE_OPTION=-module $*
+nomodule.ctest: MODULE_OPTION =
+
 # Portable dos2unix / todos for stripping CR
 TODOS        = tr -d '\r'
 #TODOS        = sed -e 's/\r$$//' # On Mac OS X behaves as if written 's/r$$//'
@@ -55,12 +60,12 @@
 # Rules for the different types of tests
 %.cpptest:
 	echo "$(ACTION)ing errors testcase $*"
-	-$(SWIGINVOKE) -c++ -python -Wall -Fstandard $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
+	-$(SWIGINVOKE) -c++ -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
 	$(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT)
 
 %.ctest:
 	echo "$(ACTION)ing errors testcase $*"
-	-$(SWIGINVOKE) -python -Wall -Fstandard $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
+	-$(SWIGINVOKE) -python -Wall -Fstandard $(MODULE_OPTION) $(SWIGOPT) $(SRCDIR)$*.i 2>&1 | $(TODOS) | $(STRIP_SRCDIR) > $*.$(ERROR_EXT)
 	$(COMPILETOOL) diff -c $(SRCDIR)$*.stderr $*.$(ERROR_EXT)
 
 %.clean:
diff --git a/Examples/test-suite/errors/cpp_extra_brackets.i b/Examples/test-suite/errors/cpp_extra_brackets.i
index 32cf7f7..81fdb29 100644
--- a/Examples/test-suite/errors/cpp_extra_brackets.i
+++ b/Examples/test-suite/errors/cpp_extra_brackets.i
@@ -1,4 +1,4 @@
-%module cpp_extra_brackets
+%module xxx
 
 // Extra brackets was segfaulting in SWIG-3.0.0
 struct ABC {
diff --git a/Examples/test-suite/errors/cpp_extra_brackets2.i b/Examples/test-suite/errors/cpp_extra_brackets2.i
index 17a5d59..194dea4 100644
--- a/Examples/test-suite/errors/cpp_extra_brackets2.i
+++ b/Examples/test-suite/errors/cpp_extra_brackets2.i
@@ -1,4 +1,4 @@
-%module cpp_extra_brackets
+%module xxx
 
 // Extra brackets was segfaulting in SWIG-3.0.0
 struct ABC {
diff --git a/Examples/test-suite/errors/cpp_invalid_qualifiers.i b/Examples/test-suite/errors/cpp_invalid_qualifiers.i
index fd3b363..d0723df 100644
--- a/Examples/test-suite/errors/cpp_invalid_qualifiers.i
+++ b/Examples/test-suite/errors/cpp_invalid_qualifiers.i
@@ -1,4 +1,4 @@
-%module cpp_invalid_qualifiers
+%module xxx
 
 // Constructors, destructors and static methods cannot have qualifiers
 struct A {
diff --git a/Examples/test-suite/errors/cpp_invalid_template.i b/Examples/test-suite/errors/cpp_invalid_template.i
index ea0d7be..45ad739 100644
--- a/Examples/test-suite/errors/cpp_invalid_template.i
+++ b/Examples/test-suite/errors/cpp_invalid_template.i
@@ -1,4 +1,4 @@
-%module cpp_invalid_scope
+%module xxx
 
 %template(abc) SSS::AAA<int>;
 
diff --git a/Examples/test-suite/errors/cpp_namespace_template_bad.i b/Examples/test-suite/errors/cpp_namespace_template_bad.i
index 5c42d6d..f41918f 100644
--- a/Examples/test-suite/errors/cpp_namespace_template_bad.i
+++ b/Examples/test-suite/errors/cpp_namespace_template_bad.i
@@ -1,4 +1,4 @@
-%module namespace_template
+%module xxx
 
 namespace test {
   template<typename T> T max(T a, T b) { return (a > b) ? a : b; }
diff --git a/Examples/test-suite/errors/cpp_nested_namespace_alias.i b/Examples/test-suite/errors/cpp_nested_namespace_alias.i
index b7cbceb..058d344 100644
--- a/Examples/test-suite/errors/cpp_nested_namespace_alias.i
+++ b/Examples/test-suite/errors/cpp_nested_namespace_alias.i
@@ -1,4 +1,4 @@
-%module cpp_nested_namespace_alias
+%module xxx
 
 // C++17 nested namespaces
 
diff --git a/Examples/test-suite/errors/cpp_recursive_typedef.i b/Examples/test-suite/errors/cpp_recursive_typedef.i
index 3d65a88..82d9f7a 100644
--- a/Examples/test-suite/errors/cpp_recursive_typedef.i
+++ b/Examples/test-suite/errors/cpp_recursive_typedef.i
@@ -1,4 +1,4 @@
-%module cpp_recursive_typedef
+%module xxx
 
 typedef std::set<pds> pds;
 
diff --git a/Examples/test-suite/errors/cpp_refqualifier.i b/Examples/test-suite/errors/cpp_refqualifier.i
index afd6632..3980a81 100644
--- a/Examples/test-suite/errors/cpp_refqualifier.i
+++ b/Examples/test-suite/errors/cpp_refqualifier.i
@@ -1,4 +1,4 @@
-%module cpp_refqualifier
+%module xxx
 
 %ignore Host::h_ignored;
 %ignore Host::i_ignored() &&;
diff --git a/Examples/test-suite/errors/cpp_shared_ptr.i b/Examples/test-suite/errors/cpp_shared_ptr.i
index edbd0cf..bdcd30f 100644
--- a/Examples/test-suite/errors/cpp_shared_ptr.i
+++ b/Examples/test-suite/errors/cpp_shared_ptr.i
@@ -1,4 +1,4 @@
-%module cpp_shared_ptr
+%module xxx
 
 %include <boost_shared_ptr.i>
 
diff --git a/Examples/test-suite/errors/cpp_template_duplicate_names.i b/Examples/test-suite/errors/cpp_template_duplicate_names.i
index 67f21d7..9607696 100644
--- a/Examples/test-suite/errors/cpp_template_duplicate_names.i
+++ b/Examples/test-suite/errors/cpp_template_duplicate_names.i
@@ -1,4 +1,4 @@
-%module cpp_template_duplicate_names
+%module xxx
 
 // From test-suite/template_class_reuse.i test
 
diff --git a/Examples/test-suite/errors/cpp_template_friend.i b/Examples/test-suite/errors/cpp_template_friend.i
index c9d1c9d..3b8d85e 100644
--- a/Examples/test-suite/errors/cpp_template_friend.i
+++ b/Examples/test-suite/errors/cpp_template_friend.i
@@ -1,4 +1,4 @@
-%module cpp_template_friend
+%module xxx
 
 template<typename T> T template_friend1(T);
 template<typename T> T template_friend1(T);
diff --git a/Examples/test-suite/errors/pp_missing_file.i b/Examples/test-suite/errors/pp_missing_file.i
index 5e3f0ea..366f159 100644
--- a/Examples/test-suite/errors/pp_missing_file.i
+++ b/Examples/test-suite/errors/pp_missing_file.i
@@ -1,3 +1,3 @@
-%module test
+%module xxx
 
 %include "missing_filename.i"
diff --git a/Examples/test-suite/global_immutable_vars.i b/Examples/test-suite/global_immutable_vars.i
new file mode 100644
index 0000000..ab0d4f7
--- /dev/null
+++ b/Examples/test-suite/global_immutable_vars.i
@@ -0,0 +1,33 @@
+%module global_immutable_vars
+
+// Test immutable and mutable global variables,
+// see http://www.swig.org/Doc4.0/SWIGDocumentation.html#SWIG_readonly_variables
+
+%inline %{
+  int default_mutable_var = 40;
+%}
+
+%immutable;
+%feature("immutable", "0") specific_mutable_var;
+
+%inline %{
+  int global_immutable_var = 41;
+  int specific_mutable_var = 42;
+%}
+
+%mutable;
+%immutable specific_immutable_var;
+%inline %{
+  int global_mutable_var = 43;
+  int specific_immutable_var = 44;
+
+  int check_values(int default_mutable, int global_immutable, int specific_mutable, int global_mutable, int specific_immutable) {
+    return
+      default_mutable    == default_mutable_var &&
+      global_immutable   == global_immutable_var &&
+      specific_mutable   == specific_mutable_var &&
+      global_mutable     == global_mutable_var &&
+      specific_immutable == specific_immutable_var;
+  }
+%}
+
diff --git a/Examples/test-suite/global_immutable_vars_cpp.i b/Examples/test-suite/global_immutable_vars_cpp.i
new file mode 100644
index 0000000..40cc08e
--- /dev/null
+++ b/Examples/test-suite/global_immutable_vars_cpp.i
@@ -0,0 +1,33 @@
+%module global_immutable_vars_cpp
+
+// Test immutable and mutable global variables,
+// see http://www.swig.org/Doc4.0/SWIGDocumentation.html#SWIG_readonly_variables
+
+%inline %{
+  int default_mutable_var = 40;
+%}
+
+%immutable;
+%feature("immutable", "0") specific_mutable_var;
+
+%inline %{
+  int global_immutable_var = 41;
+  int specific_mutable_var = 42;
+%}
+
+%mutable;
+%immutable specific_immutable_var;
+%inline %{
+  int global_mutable_var = 43;
+  int specific_immutable_var = 44;
+
+  int check_values(int default_mutable, int global_immutable, int specific_mutable, int global_mutable, int specific_immutable) {
+    return
+      default_mutable    == default_mutable_var &&
+      global_immutable   == global_immutable_var &&
+      specific_mutable   == specific_mutable_var &&
+      global_mutable     == global_mutable_var &&
+      specific_immutable == specific_immutable_var;
+  }
+%}
+
diff --git a/Examples/test-suite/go/Makefile.in b/Examples/test-suite/go/Makefile.in
index b7be554..8283327 100644
--- a/Examples/test-suite/go/Makefile.in
+++ b/Examples/test-suite/go/Makefile.in
@@ -6,24 +6,10 @@
 GO		= @GO@
 GOGCC		= @GOGCC@
 GCCGO		= @GCCGO@
-GO1		= @GO1@
-GO12		= @GO12@
-GO13		= @GO13@
-GO15		= @GO15@
-GOC		= @GOC@
 GOVERSIONOPTION	= @GOVERSIONOPTION@
 host		= @host@
 SCRIPTSUFFIX	= _runme.go
 
-GOCOMPILEARG = `if $(GO15); then echo tool compile; elif $(GO1); then echo tool $(GOC:c=g); fi`
-GOLD = `if $(GO15); then echo link; else echo $(GOC:c=l); fi`
-GOTOOL = `if $(GO1) ; then echo go tool; fi`
-GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; fi`
-
-GOOBJEXT = `if $(GO15); then echo o; else echo $(GOC:c=); fi`
-
-OSXOLDGOLINKFLAGS	= `if [ -n "\`$(GO) $(GOVERSIONOPTION) | grep -E 'go1($|.0|.1|.2|.3)'\`" ] && [ -n "\`echo $(host) | grep darwin\`" ]; then echo "-Wl,-U,__cgo_topofstack"; fi`
-
 SO = @SO@
 
 srcdir         = @srcdir@
@@ -49,31 +35,26 @@
 	$(setup)
 	+$(swig_and_compile_cpp)
 	$(run_testcase_cpp)
-	if ! $(GO15); then \
-	  $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
-	  SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
-	  INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
-	  TARGET='$(TARGETPREFIX)$*$(TARGETSUFFIX)' INTERFACEDIR='$(INTERFACEDIR)' INTERFACE='$*.i' \
-	  $(LANGUAGE)$(VARIANT)_cpp_nocgo && \
-	  $(run_testcase_cpp); \
-	fi
 
 %.ctest:
 	$(setup)
 	+$(swig_and_compile_c)
 	$(run_testcase)
-	if ! $(GO15); then \
-	  $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CSRCS='$(CSRCS)' \
-	  SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
-	  INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
-	  TARGET='$(TARGETPREFIX)$*$(TARGETSUFFIX)' INTERFACEDIR='$(INTERFACEDIR)' INTERFACE='$*.i' \
-	  $(LANGUAGE)$(VARIANT)_nocgo && \
-	  $(run_testcase); \
-	fi
 
 %.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,85 +63,108 @@
 
 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; \
-	  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); \
-	  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 && \
+	  GOPATH=`pwd`/gopath/; \
+	  export GOPATH; \
+	  CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
+	  export CGO_CPPFLAGS; \
+	  CGO_CFLAGS="$(CFLAGS)"; \
+	  export CGO_CFLAGS; \
+	  CGO_CXXFLAGS="$(CXXFLAGS)"; \
+	  export CGO_CXXFLAGS; \
+	  CGO_LDFLAGS="$(LDFLAGS) -lm"; \
+	  export CGO_LDFLAGS; \
+	  mkdir gopath/src/swigtests 2>/dev/null || true; \
+	  mkdir gopath/src/swigtests/$* 2>/dev/null || true; \
+	  cp gopath/src/$*/* gopath/src/swigtests/$*/; \
+	  mkdir gopath/src/$*/runme 2>/dev/null || true; \
+	  cp $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) gopath/src/$*/runme/runme.go; \
+	  (cd gopath/src/$*/runme && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o runme runme.go); \
+	  cp gopath/src/$*/runme/runme $*_runme; \
 	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \
 	fi
 
 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++; \
-	  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); \
-	  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 && \
+	  GOPATH=`pwd`/gopath/; \
+	  export GOPATH; \
+	  CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
+	  export CGO_CPPFLAGS; \
+	  CGO_CFLAGS="$(CFLAGS)"; \
+	  export CGO_CFLAGS; \
+	  CGO_CXXFLAGS="$(CXXFLAGS)"; \
+	  export CGO_CXXFLAGS; \
+	  CGO_LDFLAGS="$(LDFLAGS) -lm"; \
+	  export CGO_LDFLAGS; \
+	  mkdir gopath/src/swigtests 2>/dev/null || true; \
+	  mkdir gopath/src/swigtests/$* 2>/dev/null || true; \
+	  cp gopath/src/$*/* gopath/src/swigtests/$*/; \
+	  mkdir gopath/src/$*/runme 2>/dev/null || true; \
+	  cp $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) gopath/src/$*/runme/runme.go; \
+	  (cd gopath/src/$*/runme && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o runme runme.go); \
+	  cp gopath/src/$*/runme/runme $*_runme; \
 	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \
 	fi
 
 run_multi_testcase = \
 	if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
-	  if $(GOGCC) ; then \
-	    $(COMPILETOOL) $(GCCGO) -c -g -I . -I gopath/src $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
-	    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 && \
+	  files=`cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list`; \
+	  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
 
diff --git a/Examples/test-suite/go/abstract_access_runme.go b/Examples/test-suite/go/abstract_access_runme.go
index a2cfeda..0a0e56f 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 "swigtests/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..5e2ed1e 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 "swigtests/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..1ad49f5 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 "swigtests/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..d333d50 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 "swigtests/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..b2edf54 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 "swigtests/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..d8c3896 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 . "swigtests/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..9c4a9e5 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 . "swigtests/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..3c8c2d7 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 . "swigtests/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..11cf81d 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 "swigtests/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..4776990 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 "swigtests/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..c9e9008 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 . "swigtests/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..51d965e 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"
+
+	"swigtests/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..ca47255 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 . "swigtests/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..7c9d097 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 "swigtests/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..926b6f7 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 . "swigtests/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..9b8930a 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 "swigtests/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..71affc5 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 "swigtests/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..d482298 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 . "swigtests/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..5b6f404 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 "swigtests/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..90d9601 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 "swigtests/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..2df31db 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 . "swigtests/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..c308f25 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 "swigtests/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..d8acc13 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 . "swigtests/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..557d5c5 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 . "swigtests/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..f82a0c0 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 "swigtests/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..3e67417 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 "swigtests/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..167d751 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 . "swigtests/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..adfb6dd 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 . "swigtests/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..5cd9d95 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 . "swigtests/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..7354fa7 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 . "swigtests/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..b048935 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 . "swigtests/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..da0ea21 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 "swigtests/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..0012ccd 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 . "swigtests/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..0c73b6a 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 . "swigtests/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..560034c 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 "swigtests/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..ba072a8 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 . "swigtests/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..213bc0c 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 "swigtests/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..f093103 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 _ "swigtests/empty_c"
 
 func main() {
 }
diff --git a/Examples/test-suite/go/empty_runme.go b/Examples/test-suite/go/empty_runme.go
index f74285c..03f423b 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 _ "swigtests/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..7f43eab 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 "swigtests/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..4a879a0 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 "swigtests/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..ee67712 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 . "swigtests/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..8795896 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 "swigtests/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..b1dd43a 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 . "swigtests/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..4a6b709 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 "swigtests/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..278bffe 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 . "swigtests/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..1cbfd9d 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 "swigtests/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..b6b9e93 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 "swigtests/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..01b94f4 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 . "swigtests/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..aeacd91 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 . "swigtests/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..171b3c2 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 "swigtests/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..2dc5b99 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"
+	"swigtests/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..d5f3475 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 "swigtests/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..2368015 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 . "swigtests/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..490721e 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 "swigtests/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..10dabad 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 "swigtests/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..b4706e9 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 "swigtests/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..c5eb9e4 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 . "swigtests/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..28f6ddd 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 "swigtests/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..f93c7ab 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 "swigtests/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..0702b89 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 "swigtests/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..a96291c 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 . "swigtests/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..eefc6ad 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 . "swigtests/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..5849c50 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 . "swigtests/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..0c3e591 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 . "swigtests/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..fb1b009 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 . "swigtests/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..f422b23 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 . "swigtests/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..1a83bc6 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 . "swigtests/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..019ac6e 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 "swigtests/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..9a62d37 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 . "swigtests/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..0278938 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 . "swigtests/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..696f08a 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 "swigtests/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..f1504af 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 "swigtests/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..435ee86 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 . "swigtests/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..6da4333 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 . "swigtests/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..7ac4d33 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 "swigtests/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..458745e 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 . "swigtests/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..f42b487 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 . "swigtests/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..c238d97 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 . "swigtests/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..9815d76 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 . "swigtests/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..d549098 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 "swigtests/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..93b91d9 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 "swigtests/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..c1435f3 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 "swigtests/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..6a4301f 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 "swigtests/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..982b178 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 "swigtests/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..23a80bf 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 . "swigtests/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..09f7a83 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 . "swigtests/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..3b348f3 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 . "swigtests/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..b85afb4 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 . "swigtests/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..8783054 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 "swigtests/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..8dcf9f5 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 . "swigtests/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..68509f5 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 "swigtests/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..76e30dd 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 . "swigtests/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..f8c1258 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 . "swigtests/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..4ad7549 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 . "swigtests/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..efe1edc 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 . "swigtests/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..74a0dba 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 . "swigtests/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..345868d 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 "swigtests/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..fc6baa2 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 "swigtests/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..f91c9ac 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 . "swigtests/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..ca2ac2c 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 . "swigtests/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..a8ec39f 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 . "swigtests/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..6bfd21e 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 . "swigtests/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..c28ce61 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 . "swigtests/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..22c0eb1 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 . "swigtests/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..8a14dcf 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 . "swigtests/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..8f7102d 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 . "swigtests/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..5468a29 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 . "swigtests/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..c17f0ff 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 "swigtests/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..597c487 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 "swigtests/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..7586eb4 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 . "swigtests/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..d5eb4e9 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 . "swigtests/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..6d619e0 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 "swigtests/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..c43a67a 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 "swigtests/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..9558c74 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 "swigtests/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..f2469ab 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 "swigtests/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..c3669bc 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 "swigtests/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..10071b1 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 . "swigtests/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..c1b356b 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 . "swigtests/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..e77c17b 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 . "swigtests/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..b3bf610 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 "swigtests/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..516b6c7 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 "swigtests/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..08cf3fb 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 "swigtests/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..205813d 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 . "swigtests/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..a483243 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 . "swigtests/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..562fae7 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 . "swigtests/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..52a9bc7 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 . "swigtests/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..84347e4 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 . "swigtests/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..b554f0e 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 "swigtests/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..157a917 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 "swigtests/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..f76f088 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 . "swigtests/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..f2dbb32 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 "swigtests/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..9c845bb 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 "swigtests/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..f086080 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 . "swigtests/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..00e1131 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 "swigtests/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..0cccd97 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 . "swigtests/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..1e1696d 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 "swigtests/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..6e29811 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 "swigtests/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..09cc381 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 "swigtests/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..8109037 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 "swigtests/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..7ef09fe 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 . "swigtests/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..dac300b 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 . "swigtests/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..c875590 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 . "swigtests/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..4c86ef5 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 . "swigtests/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..4310818 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 . "swigtests/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 5978be0..50a4308 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 "swigtests/varargs_overload"
 
 func main() {
 	if varargs_overload.Vararg_over1("Hello") != "Hello" {
diff --git a/Examples/test-suite/go/varargs_runme.go b/Examples/test-suite/go/varargs_runme.go
index 4009c3e..eb2fa94 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 "swigtests/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..2113530 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 . "swigtests/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..9973f24 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 "swigtests/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..35c5289 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 "swigtests/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..d792d4f 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 "swigtests/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/CommentParser.java b/Examples/test-suite/java/CommentParser.java
index 7dc6d59..1fc6f64 100644
--- a/Examples/test-suite/java/CommentParser.java
+++ b/Examples/test-suite/java/CommentParser.java
@@ -1,5 +1,6 @@
 
-import com.sun.javadoc.*;
+import com.sun.source.doctree.*;
+import com.sun.source.util.DocTrees;
 import java.util.HashMap;
 import java.util.Map.Entry;
 import java.util.Map;
@@ -9,45 +10,120 @@
 import java.io.OutputStreamWriter;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.util.*;
+import java.util.spi.ToolProvider;
+import javax.lang.model.*;
+import javax.lang.model.element.*;
+import javax.lang.model.util.*;
+import jdk.javadoc.doclet.*;
 
 
-public class CommentParser {
+public class CommentParser implements Doclet {
     private static Map<String, String> m_parsedComments = new HashMap<String, String>();
 
-    public static boolean start(RootDoc root) {
+    // We need to implement these base class pure virtual methods.
 
+    @Override
+    public void init(Locale locale, Reporter reporter) {
+    }
+
+    @Override
+    public Set<? extends Option> getSupportedOptions() {
+        return new HashSet<>();
+    }
+
+    @Override
+    public SourceVersion getSupportedSourceVersion() {
+        return SourceVersion.latest();
+    }
+
+    @Override
+    public String getName() {
+        return "CommentParser";
+    }
+
+    // Element name must be the fully qualified name of the element.
+    //
+    // If there is no comment associated with this element, simply do nothing.
+    private void storeCommentFor(DocTrees docTrees, String fullName, Element e) {
+        DocCommentTree docCommentTree = docTrees.getDocCommentTree(e);
+        if (docCommentTree == null)
+            return;
+
+        StringBuilder name = new StringBuilder(fullName);
+
+        // We must use signature in the key for methods for compatibility with
+        // the existing tests and to allow distinguishing between overloaded
+        // methods.
+        if (e instanceof ExecutableElement) {
+            ExecutableElement ex = (ExecutableElement)e;
+            name.append("(");
+
+            boolean firstParam = true;
+            for (VariableElement p : ex.getParameters()) {
+                if (firstParam) {
+                    firstParam = false;
+                } else {
+                    name.append(", ");
+                }
+
+                name.append(p.asType().toString());
+            }
+
+            name.append(")");
+        }
+
+        // For some reason the comment in the source is split into "body" and
+        // "block tags" parts, so we need to concatenate them back together.
+        StringBuilder comment = new StringBuilder();
+        for (DocTree d : docCommentTree.getFullBody()) {
+            comment.append(d.toString());
+            comment.append("\n");
+        }
+
+        boolean firstBlockTag = true;
+        for (DocTree d : docCommentTree.getBlockTags()) {
+            if (firstBlockTag) {
+                firstBlockTag = false;
+                comment.append("\n");
+            }
+
+            comment.append(d.toString());
+            comment.append("\n");
+        }
+
+        m_parsedComments.put(name.toString(), comment.toString());
+    }
+
+    @Override
+    public boolean run(DocletEnvironment docEnv) {
         /*
          * This method is called by 'javadoc' and gets the whole parsed java
          * file, we get comments and store them
          */
+        DocTrees docTrees = docEnv.getDocTrees();
+        for (TypeElement t : ElementFilter.typesIn(docEnv.getIncludedElements())) {
+            String typeName = t.getQualifiedName().toString();
 
-        for (ClassDoc classDoc : root.classes()) {
+            storeCommentFor(docTrees, typeName, t);
 
-            if (classDoc.getRawCommentText().length() > 0)
-                m_parsedComments.put(classDoc.qualifiedName(), classDoc.getRawCommentText());
+            for (Element e : t.getEnclosedElements()) {
+                // Omit the method name for ctors: this is a bit weird, but
+                // this is what the existing tests expect.
+                String fullName = typeName;
+                if (e.getKind() != ElementKind.CONSTRUCTOR) {
+                    fullName = fullName + "." + e.getSimpleName();
+                }
 
-            for (FieldDoc f : classDoc.enumConstants()) {
-                if (f.getRawCommentText().length() > 0)
-                    m_parsedComments.put(f.qualifiedName(), f.getRawCommentText());
-            }
-            for (FieldDoc f : classDoc.fields()) {
-                if (f.getRawCommentText().length() > 0)
-                    m_parsedComments.put(f.qualifiedName(), f.getRawCommentText());
-            }
-            for (ConstructorDoc c : classDoc.constructors()) {
-                if (c.getRawCommentText().length() > 0)
-                    m_parsedComments.put(c.toString(), c.getRawCommentText());
-            }
-            for (MethodDoc m : classDoc.methods()) {
-                if (m.getRawCommentText().length() > 0)
-                    m_parsedComments.put(m.toString(), m.getRawCommentText());
+                storeCommentFor(docTrees, fullName, e);
             }
         }
+
         return true;
     }
 
     
-    public int check(Map<String, String> wantedComments) {
+    public static int check(Map<String, String> wantedComments) {
         int errorCount=0;
         Iterator<Entry<String, String>> it = m_parsedComments.entrySet().iterator();
 
@@ -93,13 +169,14 @@
                 System.out.println("Output is also saved to files '" + expectedFileName +
                                    "' and '" + gotFileName + "'");
                 // here we print original strings, for nicer output
-                System.out.println("\n\n---\nexpected:\n" + wantedComments.get(e.getKey()));
+                System.out.println("\n\n---\nexpected:\n" + wantedStr);
                 System.out.println("\n\n---\ngot:\n" + e.getValue());
 
                 try {
                     // write expected string to file
                     BufferedWriter expectedFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(expectedFileName)));
-                    expectedFile.write(wantedComments.get(e.getKey()));
+                    if (wantedStr != null)
+                        expectedFile.write(wantedStr);
                     expectedFile.close();
 
                     // write translated string to file
@@ -130,7 +207,7 @@
     }
 
     
-    private void printKeys(Map<String, String> map) {
+    private static void printKeys(Map<String, String> map) {
         
         Set<String> keys = map.keySet();
         for (String key : keys) {
@@ -154,6 +231,15 @@
         }
     }
 
+    public static void parse(String sourcefile) {
+        ToolProvider javadoc = ToolProvider.findFirst("javadoc").orElseThrow();
+        int result = javadoc.run(System.out, System.err, new String[]{"-quiet", "-doclet", "CommentParser", sourcefile});
+        if (result != 0) {
+          System.err.println("Executing javadoc failed.");
+          System.exit(result);
+        }
+    }
+
     
     public static void main(String argv[]) {
 		
@@ -162,8 +248,7 @@
             System.exit(1);
         }
 		
-        com.sun.tools.javadoc.Main.execute("The comment parser program",
-                                           "CommentParser", new String[]{"-quiet", argv[0]});
+        parse(argv[0]);
 		
         // if we are run as standalone app, print the list of found comments as it would appear in java source
 		
diff --git a/Examples/test-suite/java/Makefile.in b/Examples/test-suite/java/Makefile.in
index 2e788fa..a449f28 100644
--- a/Examples/test-suite/java/Makefile.in
+++ b/Examples/test-suite/java/Makefile.in
@@ -9,6 +9,7 @@
 JAVA_CLASSPATH_SEP = @JAVA_CLASSPATH_SEP@
 JAVA_TOOLS_JAR     = @JAVA_TOOLS_JAR@
 SCRIPTSUFFIX = _runme.java
+SKIP_DOXYGEN_TEST_CASES = @JAVA_SKIP_DOXYGEN_TEST_CASES@
 
 srcdir       = @srcdir@
 top_srcdir   = ../@top_srcdir@
@@ -52,6 +53,7 @@
 	cpp11_shared_ptr_const \
 	cpp11_shared_ptr_nullptr_in_containers \
 	cpp11_shared_ptr_overload \
+	cpp11_shared_ptr_template_upcast \
 	cpp11_shared_ptr_upcast \
 	cpp11_std_unordered_map \
 	cpp11_std_unordered_set \
@@ -108,13 +110,11 @@
 	  mkdir $(JAVA_PACKAGE);							  \
 	fi
 
-# Doxygen test cases need to be compiled together with the CommentParser class
-# which depends on com.sun.javadoc package which is located in this JAR.
+# Doxygen test cases need to be compiled together with the CommentParser class.
 CommentParser.class:
 	$(COMPILETOOL) $(JAVAC) -classpath $(JAVA_CLASSPATH) -d . $(srcdir)/CommentParser.java
 
 JAVA_CLASSPATH := .
-$(DOXYGEN_TEST_CASES:=.cpptest): JAVA_CLASSPATH := "$(JAVA_TOOLS_JAR)$(JAVA_CLASSPATH_SEP)."
 $(DOXYGEN_TEST_CASES:=.cpptest): CommentParser.class
 
 # Compiles java files then runs the testcase. A testcase is only run if
diff --git a/Examples/test-suite/java/cpp11_initializer_list_runme.java b/Examples/test-suite/java/cpp11_initializer_list_runme.java
new file mode 100644
index 0000000..0318c9e
--- /dev/null
+++ b/Examples/test-suite/java/cpp11_initializer_list_runme.java
@@ -0,0 +1,21 @@
+
+import cpp11_initializer_list.*;
+
+public class cpp11_initializer_list_runme {
+
+  static {
+    try {
+	System.loadLibrary("cpp11_initializer_list");
+    } catch (UnsatisfiedLinkError e) {
+      System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
+      System.exit(1);
+    }
+  }
+
+  public static void main(String argv[]) {
+    C c = new C(null);
+    String joined = c.get_joined_string();
+    if (!joined.equals("AbFab"))
+      throw new RuntimeException("Wrong joined string " + joined);
+  }
+}
diff --git a/Examples/test-suite/java/cpp11_shared_ptr_template_upcast_runme.java b/Examples/test-suite/java/cpp11_shared_ptr_template_upcast_runme.java
new file mode 100644
index 0000000..2826f58
--- /dev/null
+++ b/Examples/test-suite/java/cpp11_shared_ptr_template_upcast_runme.java
@@ -0,0 +1,24 @@
+// This is the cpp11_shared_ptr_template_upcast runtime testcase. It checks that SWIG generates the appropriate upcasted shared_ptr type for a template instantiation deriving from a base class.
+// For this case, the expected behavior is: given a cptr with underlying type shared_ptr<Printable<Derived> >, PrintableDerived_SWIGSmartPtrUpcast returns a cptr with 
+// underlying type std::shared_ptr< Derived >, where Printable<Derived> inherits from Derived.
+
+import cpp11_shared_ptr_template_upcast.*;
+
+public class cpp11_shared_ptr_template_upcast_runme {
+
+  static {
+    try {
+	System.loadLibrary("cpp11_shared_ptr_template_upcast");
+    } catch (UnsatisfiedLinkError e) {
+      System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
+      System.exit(1);
+    }
+  }
+
+  public static void main(String argv[]) {
+    PrintableDerived pd = cpp11_shared_ptr_template_upcast.MakePrintableDerived(20);
+    pd.GetResult();
+    pd.GetFormatted();
+  }
+}
+
diff --git a/Examples/test-suite/java/director_string_runme.java b/Examples/test-suite/java/director_string_runme.java
index a6ed671..67cb0fe 100644
--- a/Examples/test-suite/java/director_string_runme.java
+++ b/Examples/test-suite/java/director_string_runme.java
@@ -19,7 +19,7 @@
     director_string_A c = new director_string_A("hi");
     for (int i=0; i<3; i++) {
       s = c.call_get(i);
-      if (!s.equals(new Integer(i).toString())) throw new RuntimeException("director_string_A.get(" + i + ") failed. Got:" + s);
+      if (!s.equals(Integer.valueOf(i).toString())) throw new RuntimeException("director_string_A.get(" + i + ") failed. Got:" + s);
     }
 
     director_string_B b = new director_string_B("hello");
@@ -50,7 +50,7 @@
       super(first);
     }
     public String get(int n) {
-      return new Integer(n).toString();
+      return Integer.valueOf(n).toString();
     }
 }
 
diff --git a/Examples/test-suite/java/doxygen_alias_runme.java b/Examples/test-suite/java/doxygen_alias_runme.java
index e21ed6d..98cd977 100644
--- a/Examples/test-suite/java/doxygen_alias_runme.java
+++ b/Examples/test-suite/java/doxygen_alias_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_alias.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_alias_runme {
@@ -15,10 +14,7 @@
 
   public static void main(String argv[])
   {
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_alias runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_alias"});
+    CommentParser.parse("doxygen_alias");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     wantedComments.put("doxygen_alias.doxygen_alias.make_something()",
@@ -27,6 +23,6 @@
       "     @return A new object which may be null.\n" +
       "");
 
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
diff --git a/Examples/test-suite/java/doxygen_basic_notranslate_runme.java b/Examples/test-suite/java/doxygen_basic_notranslate_runme.java
index e3d9b02..621cc9e 100644
--- a/Examples/test-suite/java/doxygen_basic_notranslate_runme.java
+++ b/Examples/test-suite/java/doxygen_basic_notranslate_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_basic_notranslate.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_basic_notranslate_runme {
@@ -15,14 +14,7 @@
   
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_basic_notranslate runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_basic_notranslate"});
+    CommentParser.parse("doxygen_basic_notranslate");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     wantedComments.put("doxygen_basic_notranslate.doxygen_basic_notranslate.function3(int)",
@@ -97,6 +89,6 @@
     		"");
     
     // and ask the parser to check comments for us
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
diff --git a/Examples/test-suite/java/doxygen_basic_translate_runme.java b/Examples/test-suite/java/doxygen_basic_translate_runme.java
index f307b3a..c64262a 100644
--- a/Examples/test-suite/java/doxygen_basic_translate_runme.java
+++ b/Examples/test-suite/java/doxygen_basic_translate_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_basic_translate.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_basic_translate_runme {
@@ -15,14 +14,7 @@
   
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_basic_translate runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_basic_translate"});
+    CommentParser.parse("doxygen_basic_translate");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     
@@ -54,6 +46,8 @@
     		" \n" +
     		" {@code \n" +
     		"int main() { while(true); } \n" +
+		"\n" +
+		"// Test blank line in code block \n" +
     		" }\n" +
     		" }\n" +
     		" \n" +
@@ -92,8 +86,15 @@
     		" @param x Horizontal coordinate.\n" +
     		" @return Arc tangent of <code>y/x</code>.\n" +
     		"");
+    wantedComments.put("doxygen_basic_translate.doxygen_basic_translate.function8()",
+		" Test variadic function\n" +
+		"");
+
+    wantedComments.put("doxygen_basic_translate.doxygen_basic_translate.function9(int)",
+		" Test unnamed argument\n" +
+		"");    
 
     // and ask the parser to check comments for us
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
diff --git a/Examples/test-suite/java/doxygen_basic_translate_style2_runme.java b/Examples/test-suite/java/doxygen_basic_translate_style2_runme.java
new file mode 100644
index 0000000..28cf2da
--- /dev/null
+++ b/Examples/test-suite/java/doxygen_basic_translate_style2_runme.java
@@ -0,0 +1,93 @@
+
+import doxygen_basic_translate_style2.*;
+import java.util.HashMap;
+
+public class doxygen_basic_translate_style2_runme {
+  static {
+    try {
+      System.loadLibrary("doxygen_basic_translate_style2");
+    } catch (UnsatisfiedLinkError e) {
+      System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
+      System.exit(1);
+    }
+  }
+  
+  public static void main(String argv[]) 
+  {
+    CommentParser.parse("doxygen_basic_translate_style2");
+
+    HashMap<String, String> wantedComments = new HashMap<String, String>();
+    
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function()",
+    		" \n" +
+    		" Brief description.\n" +
+    		" \n" +
+    		" The comment text.\n" +
+    		" @author Some author\n" +
+    		" @return Some number\n" +
+    		" @see function2\n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function2()",
+    		" A test of a very very very very very very very very very very very very very very very very \n" +
+    		" very very very very very long comment string. \n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function4()",
+    		" A test of some mixed tag usage \n" +
+    		" If: CONDITION {\n" +
+    		" This <i>code </i>fragment shows us something . \n" +
+    		" <p alt=\"Minuses: \">\n" +
+    		" <li>it's senseless \n" +
+    		" </li><li>it's stupid \n" +
+    		" </li><li>it's null \n" +
+    		" \n" +
+    		" </li></p>Warning: This may not work as expected \n" +
+    		" \n" +
+    		" {@code \n" +
+    		"int main() { while(true); } \n" +
+		"\n" +
+		"// Test blank line in code block \n" +
+    		" }\n" +
+    		" }\n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function3(int)",
+    		" A test for overloaded functions \n" +
+    		" This is function <b>one </b>\n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function5(int)",
+    		" This is a post comment. \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function6(int)",
+    		" Test for default args \n" +
+    		" @param a Some parameter, default is 42" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function6()",
+    		" Test for default args \n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function7(doxygen_basic_translate_style2.SWIGTYPE_p_p_p_Shape)",
+    		" Test for a parameter with difficult type \n" +
+    		" (mostly for python) \n" +
+    		" @param a Very strange param \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function3(int, int)",
+    		" A test for overloaded functions \n" +
+    		" This is function <b>two </b>\n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.Atan2(double, double)",
+    		" Multiple parameters test.\n" +
+    		" \n" +
+    		" @param y Vertical coordinate.\n" +
+    		" @param x Horizontal coordinate.\n" +
+    		" @return Arc tangent of <code>y/x</code>.\n" +
+    		"");
+
+    // and ask the parser to check comments for us
+    System.exit(CommentParser.check(wantedComments));
+  }
+}
diff --git a/Examples/test-suite/java/doxygen_basic_translate_style3_runme.java b/Examples/test-suite/java/doxygen_basic_translate_style3_runme.java
new file mode 100644
index 0000000..a095364
--- /dev/null
+++ b/Examples/test-suite/java/doxygen_basic_translate_style3_runme.java
@@ -0,0 +1,93 @@
+
+import doxygen_basic_translate_style3.*;
+import java.util.HashMap;
+
+public class doxygen_basic_translate_style3_runme {
+  static {
+    try {
+      System.loadLibrary("doxygen_basic_translate_style3");
+    } catch (UnsatisfiedLinkError e) {
+      System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
+      System.exit(1);
+    }
+  }
+  
+  public static void main(String argv[]) 
+  {
+    CommentParser.parse("doxygen_basic_translate_style3");
+
+    HashMap<String, String> wantedComments = new HashMap<String, String>();
+    
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.function()",
+    		" \n" +
+    		" Brief description.\n" +
+    		" \n" +
+    		" The comment text.\n" +
+    		" @author Some author\n" +
+    		" @return Some number\n" +
+    		" @see function2\n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.function2()",
+    		" A test of a very very very very very very very very very very very very very very very very \n" +
+    		" very very very very very long comment string. \n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.function4()",
+    		" A test of some mixed tag usage \n" +
+    		" If: CONDITION {\n" +
+    		" This <i>code </i>fragment shows us something . \n" +
+    		" <p alt=\"Minuses: \">\n" +
+    		" <li>it's senseless \n" +
+    		" </li><li>it's stupid \n" +
+    		" </li><li>it's null \n" +
+    		" \n" +
+    		" </li></p>Warning: This may not work as expected \n" +
+    		" \n" +
+    		" {@code \n" +
+    		"int main() { while(true); } \n" +
+		"\n" +
+		"int testBlankLine() {} \n" +
+    		" }\n" +
+    		" }\n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.function3(int)",
+    		" A test for overloaded functions \n" +
+    		" This is function <b>one </b>\n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.function5(int)",
+    		" This is a post comment. \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.function6(int)",
+    		" Test for default args \n" +
+    		" @param a Some parameter, default is 42" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.function6()",
+    		" Test for default args \n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.function7(doxygen_basic_translate_style3.SWIGTYPE_p_p_p_Shape)",
+    		" Test for a parameter with difficult type \n" +
+    		" (mostly for python) \n" +
+    		" @param a Very strange param \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.function3(int, int)",
+    		" A test for overloaded functions \n" +
+    		" This is function <b>two </b>\n" +
+    		" \n" +
+    		"");
+    wantedComments.put("doxygen_basic_translate_style3.doxygen_basic_translate_style3.Atan2(double, double)",
+    		" Multiple parameters test.\n" +
+    		" \n" +
+    		" @param y Vertical coordinate.\n" +
+    		" @param x Horizontal coordinate.\n" +
+    		" @return Arc tangent of <code>y/x</code>.\n" +
+    		"");
+
+    // and ask the parser to check comments for us
+    System.exit(CommentParser.check(wantedComments));
+  }
+}
diff --git a/Examples/test-suite/java/doxygen_code_blocks_runme.java b/Examples/test-suite/java/doxygen_code_blocks_runme.java
new file mode 100644
index 0000000..8e8373b
--- /dev/null
+++ b/Examples/test-suite/java/doxygen_code_blocks_runme.java
@@ -0,0 +1,75 @@
+
+import doxygen_code_blocks.*;
+import java.util.HashMap;
+
+public class doxygen_code_blocks_runme {
+  static {
+    try {
+      System.loadLibrary("doxygen_code_blocks");
+    } catch (UnsatisfiedLinkError e) {
+      System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
+      System.exit(1);
+    }
+  }
+  
+  public static void main(String argv[]) 
+  {
+    CommentParser.parse("doxygen_code_blocks");
+
+    HashMap<String, String> wantedComments = new HashMap<String, String>();
+    
+    wantedComments.put("doxygen_code_blocks.doxygen_code_blocks.function()",
+		       " Test for code blocks\n \n" +
+		       " \n \n" +
+		       " {@code  \n" +
+		       " simple code block \n" +
+		       " }\n \n" +
+		       " \n \n" +
+		       " More advanced usage with C++ characters:\n \n" +
+		       " {@code  \n" +
+		       " std::vector<int> first;                                // empty vector of ints \n" +
+		       " std::vector<int> second (4,100);                       // four ints with value 100 \n" +
+		       " std::vector<int> third (second.begin(),second.end());  // iterating through second \n" +
+		       " std::vector<int> fourth (third);                       // a copy of third \n" +
+		       " // the iterator constructor can also be used to construct from arrays: \n" +
+		       " int myints[] = {16,2,77,29}; \n" +
+		       " std::vector<int> fifth (myints, myints + sizeof(myints) / sizeof(int) ); \n" +
+		       "  \n" +
+		       " std::cout << \"The contents of fifth are:\"; \n" +
+		       " for (std::vector<int>::iterator it = fifth.begin(); it != fifth.end(); ++it) \n" +
+		       " std::cout << \' \' << *it; \n" +
+		       " std::cout << \'\\n\';  \n" +
+		       " }\n \n" +
+		       " \n \n" +
+		       " A code block for C:\n \n" +
+		       " {@code  \n" +
+		       " printf(\"hello world\"); \n" +
+		       " }\n \n" +
+		       " \n \n" +
+		       " A code block for Java:\n \n" +
+		       " {@code  \n" +
+		       " public class HelloWorld { \n" +
+		       " public static void main(String[] args) { \n" +
+		       " // Prints \"Hello, World\" to the terminal window. \n" +
+		       " System.out.println(\"Hello, World\"); \n" +
+		       " } \n" +
+		       " } \n" +
+		       " }\n \n" +
+		       " \n \n" +
+		       " A code block for python:\n \n" +
+		       " {@code  \n" +
+		       " print(\'hello world\') \n" +
+		       " }\n \n" +
+		       " \n \n" +
+		       " A python doctest example:\n \n" +
+		       " {@code  \n" +
+		       " >>> 1 + 1 \n" +
+		       " 2 \n" +
+		       " } \n" +
+		       " \n" +
+		       "");
+
+    // and ask the parser to check comments for us
+    System.exit(CommentParser.check(wantedComments));
+  }
+}
diff --git a/Examples/test-suite/java/doxygen_ignore_runme.java b/Examples/test-suite/java/doxygen_ignore_runme.java
index 6250ce5..29b6e06 100644
--- a/Examples/test-suite/java/doxygen_ignore_runme.java
+++ b/Examples/test-suite/java/doxygen_ignore_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_ignore.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_ignore_runme {
@@ -15,10 +14,7 @@
 
   public static void main(String argv[]) 
   {
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_ignore runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_ignore"});
+    CommentParser.parse("doxygen_ignore");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     wantedComments.put("doxygen_ignore.doxygen_ignore.func()",
@@ -39,6 +35,6 @@
       "\n" +
       "");
 
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
diff --git a/Examples/test-suite/java/doxygen_misc_constructs_runme.java b/Examples/test-suite/java/doxygen_misc_constructs_runme.java
index 6d018b9..b1f4e2e 100644
--- a/Examples/test-suite/java/doxygen_misc_constructs_runme.java
+++ b/Examples/test-suite/java/doxygen_misc_constructs_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_misc_constructs.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_misc_constructs_runme {
@@ -15,14 +14,7 @@
 
   public static void main(String argv[])
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_misc_constructs runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_misc_constructs"});
+    CommentParser.parse("doxygen_misc_constructs");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
 
@@ -117,6 +109,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" +
@@ -192,6 +187,6 @@
 
 
     // and ask the parser to check comments for us
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
diff --git a/Examples/test-suite/java/doxygen_nested_class_runme.java b/Examples/test-suite/java/doxygen_nested_class_runme.java
index 3ffa796..e9d1a06 100644
--- a/Examples/test-suite/java/doxygen_nested_class_runme.java
+++ b/Examples/test-suite/java/doxygen_nested_class_runme.java
@@ -1,5 +1,4 @@
 import doxygen_nested_class.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_nested_class_runme {
@@ -14,14 +13,7 @@
 
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_nested_class runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_nested_class"});
+    CommentParser.parse("doxygen_nested_class");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     
@@ -43,6 +35,6 @@
     		" doxShort const variable ");
     
     // and ask the parser to check comments for us
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
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..6b1e2b0 100644
--- a/Examples/test-suite/java/doxygen_parsing_enums_proper_runme.java
+++ b/Examples/test-suite/java/doxygen_parsing_enums_proper_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_parsing_enums_proper.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_parsing_enums_proper_runme {
@@ -15,14 +14,7 @@
   
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_parsing_enums_proper runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_parsing_enums_proper"});
+    CommentParser.parse("doxygen_parsing_enums_proper");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     
@@ -55,8 +47,12 @@
     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));
+    System.exit(CommentParser.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..1e0dd74 100644
--- a/Examples/test-suite/java/doxygen_parsing_enums_simple_runme.java
+++ b/Examples/test-suite/java/doxygen_parsing_enums_simple_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_parsing_enums_simple.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_parsing_enums_simple_runme {
@@ -15,14 +14,7 @@
   
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_parsing_enums_simple runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_parsing_enums_simple"});
+    CommentParser.parse("doxygen_parsing_enums_simple");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     
@@ -47,8 +39,12 @@
     		" 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));
+    System.exit(CommentParser.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..7cf3b17 100644
--- a/Examples/test-suite/java/doxygen_parsing_enums_typesafe_runme.java
+++ b/Examples/test-suite/java/doxygen_parsing_enums_typesafe_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_parsing_enums_typesafe.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_parsing_enums_typesafe_runme {
@@ -15,14 +14,7 @@
   
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_parsing_enums_typesafe runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_parsing_enums_typesafe"});
+    CommentParser.parse("doxygen_parsing_enums_typesafe");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     
@@ -55,9 +47,13 @@
     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
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
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..3a41fe5 100644
--- a/Examples/test-suite/java/doxygen_parsing_enums_typeunsafe_runme.java
+++ b/Examples/test-suite/java/doxygen_parsing_enums_typeunsafe_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_parsing_enums_typeunsafe.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_parsing_enums_typeunsafe_runme {
@@ -15,14 +14,7 @@
   
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_parsing_enums_typeunsafe runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_parsing_enums_typeunsafe"});
+    CommentParser.parse("doxygen_parsing_enums_typeunsafe");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     
@@ -55,8 +47,12 @@
     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));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
diff --git a/Examples/test-suite/java/doxygen_parsing_runme.java b/Examples/test-suite/java/doxygen_parsing_runme.java
index d58b1f4..10d65fc 100644
--- a/Examples/test-suite/java/doxygen_parsing_runme.java
+++ b/Examples/test-suite/java/doxygen_parsing_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_parsing.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_parsing_runme {
@@ -15,14 +14,7 @@
 
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_parsing runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_parsing"});
+    CommentParser.parse("doxygen_parsing");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     
@@ -136,6 +128,6 @@
     		"");
     
     // and ask the parser to check comments for us
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
diff --git a/Examples/test-suite/java/doxygen_translate_all_tags_runme.java b/Examples/test-suite/java/doxygen_translate_all_tags_runme.java
index 8bd6522..fda1fc3 100644
--- a/Examples/test-suite/java/doxygen_translate_all_tags_runme.java
+++ b/Examples/test-suite/java/doxygen_translate_all_tags_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_translate_all_tags.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_translate_all_tags_runme {
@@ -15,14 +14,7 @@
   
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_translate_all_tags runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_translate_all_tags"});
+    CommentParser.parse("doxygen_translate_all_tags");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     
@@ -40,7 +32,10 @@
     		" Not everything works right now...\n" +
     		" <code>codeword</code>\n\n\n\n\n\n" +
     		" <i>citationword</i>\n" +
-                " {@code some test code }\n");
+                " {@code some test code }\n\n" +
+    		" Code immediately following text.  Pydoc translation must add an\n" +
+    		" empty line before:\n" +
+    		" {@code more test code }");
     
     wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func02(int)",
     		" Conditional comment: SOMECONDITION \n" +
@@ -63,8 +58,11 @@
                        " @exception SuperError \n" +
                        " \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n" +
                        " \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n" +
-                       " \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n" +
-    		" This will only appear in hmtl \n");
+                       " \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n\n" +
+                       "Math immediately following text.  Pydoc translation must add an\n" +
+                       "empty line before:\n\n" +
+                       " \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\n" +
+                       " This will only appear in hmtl \n");
     
     wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func05(int)",
                        " If: ANOTHERCONDITION {\n" +
@@ -98,7 +96,7 @@
     		" {@link someMember Some description follows }\n" +
     		" This will only appear in man\n");
     
-    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func07(int)",
+    wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func07(int, int, int, int)",
                        " Comment for <b>func07()</b>.\n" +
                        " Note: Here \n" +
     		" is the note! \n" +
@@ -109,7 +107,10 @@
     		" The paragraph text. \n" +
     		" Maybe even multiline \n" +
     		" </p>\n" +
-                " @param a the first param\n");
+                " @param a the first param\n" +
+                " @param b parameter with intent(in)\n" +
+                " @param c parameter with intent(out)\n" +
+		" @param d parameter with intent(in,out)\n");
     
     wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func08(int)",
                        "<a id=\"someAnchor\"></a>\n" +
@@ -148,6 +149,6 @@
     		" And here goes simple text \n" +
     		"");
     // and ask the parser to check comments for us
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
diff --git a/Examples/test-suite/java/doxygen_translate_links_runme.java b/Examples/test-suite/java/doxygen_translate_links_runme.java
index 6d74e16..afee4ea 100644
--- a/Examples/test-suite/java/doxygen_translate_links_runme.java
+++ b/Examples/test-suite/java/doxygen_translate_links_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_translate_links.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 
 public class doxygen_translate_links_runme {
@@ -15,14 +14,7 @@
   
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_translate_links runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_translate_links"});
+    CommentParser.parse("doxygen_translate_links");
 
     HashMap<String, String> wantedComments = new HashMap<String, String>();
     
@@ -64,6 +56,6 @@
     		"");
     
     // and ask the parser to check comments for us
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
\ No newline at end of file
diff --git a/Examples/test-suite/java/doxygen_translate_runme.java b/Examples/test-suite/java/doxygen_translate_runme.java
index 55e5d23..b049a64 100644
--- a/Examples/test-suite/java/doxygen_translate_runme.java
+++ b/Examples/test-suite/java/doxygen_translate_runme.java
@@ -1,6 +1,5 @@
 
 import doxygen_translate.*;
-import com.sun.javadoc.*;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -16,14 +15,7 @@
   
   public static void main(String argv[]) 
   {
-    /*
-      Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
-      and calls the start() method of that class with parsed information.
-    */
-    CommentParser parser = new CommentParser();
-    com.sun.tools.javadoc.Main.execute("doxygen_translate runtime test",
-                                       "CommentParser",
-                                       new String[]{"-quiet", "doxygen_translate"});
+    CommentParser.parse("doxygen_translate");
 
     Map<String, String> wantedComments = new HashMap<String, String>();
     
@@ -274,6 +266,6 @@
                 "");
         
     // and ask the parser to check comments for us
-    System.exit(parser.check(wantedComments));
+    System.exit(CommentParser.check(wantedComments));
   }
 }
diff --git a/Examples/test-suite/java/java_enums_runme.java b/Examples/test-suite/java/java_enums_runme.java
index bc7d416..754d391 100644
--- a/Examples/test-suite/java/java_enums_runme.java
+++ b/Examples/test-suite/java/java_enums_runme.java
@@ -13,6 +13,12 @@
 
   public static void main(String argv[]) 
   {
+      if (WithTrailingComma.Second != 1)
+          throw new RuntimeException("Incorrect value for Second");
+
+      if (WithTrailingCommaAndIgnoredFirstItem.SecondNonIgnoredOne != 2)
+          throw new RuntimeException("Incorrect value for SecondNonIgnoredOne");
+
       int number = 200;
 
       // Switch statement will only compile if these enums are initialised 
diff --git a/Examples/test-suite/java/li_std_set_runme.java b/Examples/test-suite/java/li_std_set_runme.java
index 9763484..0e013eb 100644
--- a/Examples/test-suite/java/li_std_set_runme.java
+++ b/Examples/test-suite/java/li_std_set_runme.java
@@ -71,5 +71,20 @@
     checkThat(ss.removeAll(found));
     checkThat(ss.isEmpty());
     checkThat(ss.size() == 0);
+
+    // Check a set of another type.
+    java.util.AbstractSet<Foo> fooSet = new FooSet();
+    checkThat(fooSet.isEmpty());
+    checkThat(fooSet.add(new Foo(17)));
+    checkThat(fooSet.size() == 1);
+
+    // And a set of primitive type.
+    java.util.AbstractSet<Integer> intSet = new IntSet();
+    checkThat(intSet.isEmpty());
+    checkThat(intSet.add(17));
+    checkThat(!intSet.add(17));
+    checkThat(intSet.size() == 1);
+    checkThat(intSet.add(289));
+    checkThat(intSet.size() == 2);
   }
 }
diff --git a/Examples/test-suite/java/li_std_vector_runme.java b/Examples/test-suite/java/li_std_vector_runme.java
index fc8ba0f..d4c0c95 100644
--- a/Examples/test-suite/java/li_std_vector_runme.java
+++ b/Examples/test-suite/java/li_std_vector_runme.java
@@ -11,54 +11,61 @@
     }
   }
 
+  public static void checkThat(boolean mustBeTrue) throws Throwable {
+    if (!mustBeTrue) {
+      // Index [2], since this function is one hop away from main, and [1] is the current method.
+      throw new RuntimeException("Test failed at line number " + Thread.currentThread().getStackTrace()[2].getLineNumber());
+    }
+  }
+
   public static void main(String argv[]) throws Throwable
   {
     IntVector v1 = li_std_vector.vecintptr(new IntVector());
     IntPtrVector v2 = li_std_vector.vecintptr(new IntPtrVector());
     IntConstPtrVector v3 = li_std_vector.vecintconstptr(new IntConstPtrVector());
 
-    if (!v1.isEmpty()) throw new RuntimeException("v1 test (1) failed");
-    if (v1.size() != 0) throw new RuntimeException("v1 test (2) failed");
-    if (!v1.add(123)) throw new RuntimeException("v1 test (3) failed");
-    if (v1.size() != 1) throw new RuntimeException("v1 test (4) failed");
-    if (v1.isEmpty()) throw new RuntimeException("v1 test (5) failed");
+    checkThat(v1.isEmpty());
+    checkThat(v1.size() == 0);
+    checkThat(v1.add(123));
+    checkThat(v1.size() == 1);
+    checkThat(!v1.isEmpty());
 
     int sum = 0;
     for (int n : v1) {
-      if (n != 123) throw new RuntimeException("v1 loop test failed");
+      checkThat(n == 123);
       sum += n;
     }
-    if (sum != 123) throw new RuntimeException("v1 sum test failed");
-    if (v1.get(0) != 123) throw new RuntimeException("v1 test failed");
+    checkThat(sum == 123);
+    checkThat(v1.get(0) == 123);
     v1.clear();
-    if (!v1.isEmpty()) throw new RuntimeException("v1 test clear failed");
+    checkThat(v1.isEmpty());
     v1.add(123);
 
-    if (v1.set(0, 456) != 123) throw new RuntimeException("v1 test (6) failed");
-    if (v1.size() != 1) throw new RuntimeException("v1 test (7) failed");
-    if (v1.get(0) != 456) throw new RuntimeException("v1 test (8) failed");
+    checkThat(v1.set(0, 456) == 123);
+    checkThat(v1.size() == 1);
+    checkThat(v1.get(0) == 456);
 
     java.util.Iterator<Integer> v1_iterator = v1.iterator();
-    if (!v1_iterator.hasNext()) throw new RuntimeException("v1 test (9) failed");
-    if (v1_iterator.next() != 456) throw new RuntimeException("v1 test (10) failed");
-    if (v1_iterator.hasNext()) throw new RuntimeException("v1 test (11) failed");
+    checkThat(v1_iterator.hasNext());
+    checkThat(v1_iterator.next() == 456);
+    checkThat(!v1_iterator.hasNext());
     try {
       v1_iterator.next();
-      throw new RuntimeException("v1 test (12) failed");
+      checkThat(false);
     } catch (java.util.NoSuchElementException e) {
     }
 
-    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(Integer.valueOf(456))) throw new RuntimeException("v1 test (17) failed");
+    checkThat(!v1.remove(Integer.valueOf(123)));
+    checkThat(v1.remove(Integer.valueOf(456)));
+    checkThat(v1.isEmpty());
+    checkThat(v1.size() == 0);
+    checkThat(!v1.remove(Integer.valueOf(456)));
 
-    if (new IntVector(3, 0).size() != 3) throw new RuntimeException("constructor initial size test failed");
+    checkThat(new IntVector(3, 0).size() == 3);
     for (int n : new IntVector(10, 999))
-      if (n != 999) throw new RuntimeException("constructor initialization with value failed");
+      checkThat(n == 999);
     for (int n : new IntVector(new IntVector(10, 999)))
-      if (n != 999) throw new RuntimeException("copy constructor initialization with value failed");
+      checkThat(n == 999);
 
     StructVector v4 = li_std_vector.vecstruct(new StructVector());
     StructPtrVector v5 = li_std_vector.vecstructptr(new StructPtrVector());
@@ -68,18 +75,18 @@
     v5.add(new Struct(34));
     v6.add(new Struct(56));
 
-    if (v4.get(0).getNum() != 12) throw new RuntimeException("v4 test failed");
-    if (v5.get(0).getNum() != 34) throw new RuntimeException("v5 test failed");
-    if (v6.get(0).getNum() != 56) throw new RuntimeException("v6 test failed");
+    checkThat(v4.get(0).getNum() == 12);
+    checkThat(v5.get(0).getNum() == 34);
+    checkThat(v6.get(0).getNum() == 56);
 
     for (Struct s : v4) {
-      if (s.getNum() != 12) throw new RuntimeException("v4 loop test failed");
+      checkThat(s.getNum() == 12);
     }
     for (Struct s : v5) {
-      if (s.getNum() != 34) throw new RuntimeException("v5 loop test failed");
+      checkThat(s.getNum() == 34);
     }
     for (Struct s : v6) {
-      if (s.getNum() != 56) throw new RuntimeException("v6 loop test failed");
+      checkThat(s.getNum() == 56);
     }
 
     StructVector v7 = li_std_vector.vecstruct(new StructVector());
@@ -87,43 +94,43 @@
     v7.add(new Struct(23));
     v7.add(new Struct(456));
     v7.add(new Struct(7890));
-    if (v7.size() != 4) throw new RuntimeException("v7 test (1) failed");
+    checkThat(v7.size() == 4);
     {
       double[] a7 = {1, 23, 456, 7890};
       int i7 = 0;
       for (Struct s7 : v7) {
-        if (s7.getNum() != a7[i7]) throw new RuntimeException("v7 test (2) failed");
+        checkThat(s7.getNum() == a7[i7]);
         i7++;
       }
-      if (i7 != a7.length) throw new RuntimeException("v7 test (3) failed");
+      checkThat(i7 == a7.length);
     }
-    if (v7.remove(2).getNum() != 456) throw new RuntimeException("v7 test (4) failed");
+    checkThat(v7.remove(2).getNum() == 456);
     {
       double[] a7 = {1, 23, 7890};
       int i7 = 0;
       for (Struct s7 : v7) {
-        if (s7.getNum() != a7[i7]) throw new RuntimeException("v7 test (5) failed");
+        checkThat(s7.getNum() == a7[i7]);
         i7++;
       }
-      if (i7 != a7.length) throw new RuntimeException("v7 test (6) failed");
+      checkThat(i7 == a7.length);
     }
     v7.add(1, new Struct(123));
     {
       double[] a7 = {1, 123, 23, 7890};
       int i7 = 0;
       for (Struct s7 : v7) {
-        if (s7.getNum() != a7[i7]) throw new RuntimeException("v7 test (7) failed");
+        checkThat(s7.getNum() == a7[i7]);
         i7++;
       }
-      if (i7 != a7.length) throw new RuntimeException("v7 test (8) failed");
+      checkThat(i7 == a7.length);
     }
 
     BoolVector v8 = new BoolVector();
-    if (!v8.add(true)) throw new RuntimeException("v8 test (1) failed");;
-    if (v8.get(0) != true) throw new RuntimeException("v8 test (2) failed");;
-    if (v8.set(0, false) != true) throw new RuntimeException("v8 test (3) failed");;
-    if (v8.set(0, false) != false) throw new RuntimeException("v8 test (4) failed");;
-    if (v8.size() != 1) throw new RuntimeException("v8 test (5) failed");;
+    checkThat(v8.add(true));
+    checkThat(v8.get(0) == true);
+    checkThat(v8.set(0, false) == true);
+    checkThat(v8.set(0, false) == false);
+    checkThat(v8.size() == 1);
 
     java.util.ArrayList<Boolean> bl = new java.util.ArrayList<Boolean>(java.util.Arrays.asList(true, false, true, false));
     BoolVector bv = new BoolVector(java.util.Arrays.asList(true, false, true, false));
@@ -136,36 +143,41 @@
     v9.add(50);
     v9.add(60);
     v9.add(70);
-    if (v9.size() != 7) throw new RuntimeException("v9 test (1) 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");
+    checkThat(v9.size() == 7);
+    checkThat(v9.remove(Integer.valueOf(60)));
+    checkThat(v9.size() == 6);
 
     IntVector v10 = new IntVector(java.util.Arrays.asList(10, 20, 30, 40, 50));
     v10.subList(1, 4).clear(); // Recommended way to call protected method removeRange(1,3)
-    if (v10.size() != 2) throw new RuntimeException("v10 test (1) failed");
-    if (v10.get(0) != 10) throw new RuntimeException("v10 test (2) failed");
-    if (v10.get(1) != 50) throw new RuntimeException("v10 test (3) failed");
+    checkThat(v10.size() == 2);
+    checkThat(v10.get(0) == 10);
+    checkThat(v10.get(1) == 50);
     v10.addAll(1, java.util.Arrays.asList(22, 33));
-    if (v10.size() != 4) throw new RuntimeException("v10 test (4) failed");
-    if (v10.get(1) != 22) throw new RuntimeException("v10 test (5) failed");
-    if (v10.get(2) != 33) throw new RuntimeException("v10 test (6) failed");
+    checkThat(v10.size() == 4);
+    checkThat(v10.get(1) == 22);
+    checkThat(v10.get(2) == 33);
 
     v10.add(v10.size(), 55);
-    if (v10.size() != 5) throw new RuntimeException("v10 test (7) failed");
-    if (v10.get(4) != 55) throw new RuntimeException("v10 test (8) failed");
+    checkThat(v10.size() == 5);
+    checkThat(v10.get(4) == 55);
 
     IntVector v11 = new IntVector(java.util.Arrays.asList(11, 22, 33, 44));
     v11.listIterator(0);
     v11.listIterator(v11.size());
     try {
       v11.listIterator(v11.size() + 1);
-      throw new RuntimeException("v11 test (1) failed");
+      checkThat(false);
     } catch (IndexOutOfBoundsException e) {
     }
     try {
       v11.listIterator(-1);
-      throw new RuntimeException("v11 test (2) failed");
+      checkThat(false);
     } catch (IndexOutOfBoundsException e) {
     }
+
+    IntVector arrayInit = new IntVector(new int[]{1, 2, 3, 4, 5});
+    checkThat(arrayInit.size() == 5);
+    checkThat(arrayInit.get(0) == 1);
+    checkThat(arrayInit.get(4) == 5);
   }
 }
diff --git a/Examples/test-suite/java/nested_inheritance_interface_runme.java b/Examples/test-suite/java/nested_inheritance_interface_runme.java
new file mode 100644
index 0000000..8436ec2
--- /dev/null
+++ b/Examples/test-suite/java/nested_inheritance_interface_runme.java
@@ -0,0 +1,32 @@
+import nested_inheritance_interface.*;
+import java.util.Arrays;
+
+public class nested_inheritance_interface_runme {
+
+  static {
+    try {
+      System.loadLibrary("nested_inheritance_interface");
+    } catch (UnsatisfiedLinkError e) {
+      System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
+      System.exit(1);
+    }
+  }
+
+  private static void takeIA(IASwigInterface ia) {
+  }
+
+  public static void main(String argv[]) {
+	Class[] BNInterfaces = B.N.class.getInterfaces();
+    String expectedInterfacesString = "[interface nested_inheritance_interface.IASwigInterface]";
+    String actualInterfacesString = Arrays.toString(BNInterfaces);
+    if (!expectedInterfacesString.equals(actualInterfacesString))
+      throw new RuntimeException("Expected interfaces for " + B.N.class.getName() + ": \n" + expectedInterfacesString + "\n" + "Actual interfaces: \n" + actualInterfacesString);
+
+    if (!IASwigInterface.class.isInterface())
+      throw new RuntimeException(IASwigInterface.class.getName() + " should be an interface but is not");
+
+    // overloaded methods check
+    B.N d = new B.N();
+    takeIA(d);
+  }
+}
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_enums.i b/Examples/test-suite/java_enums.i
index 855913d..cad4926 100644
--- a/Examples/test-suite/java_enums.i
+++ b/Examples/test-suite/java_enums.i
@@ -18,6 +18,21 @@
 // Set default Java const code generation
 %javaconst(1);
 
+// Test enums with trailing comma after the last item.
+enum WithTrailingComma
+{
+    First,
+    Second,
+};
+
+%ignore ReallyFirstOneIsIgnored;
+enum WithTrailingCommaAndIgnoredFirstItem
+{
+    ReallyFirstOneIsIgnored,
+    FirstNonIgnoredOne,
+    SecondNonIgnoredOne,
+};
+
 // Change the default generation so that these enums are generated into an interface instead of a class
 %typemap(javaclassmodifiers) enum stuff "public interface"
 
diff --git a/Examples/test-suite/javascript/native_directive_runme.js b/Examples/test-suite/javascript/native_directive_runme.js
new file mode 100644
index 0000000..5c1d69c
--- /dev/null
+++ b/Examples/test-suite/javascript/native_directive_runme.js
@@ -0,0 +1,9 @@
+var native_directive = require("native_directive");
+
+(function main() {
+  var s = "abc.DEF-123";
+  if (native_directive.CountAlphas(s) !== 6)
+    throw "CountAlphas failed";
+  if (native_directive.CountAlphaCharacters(s) !== 6)
+    throw "CountAlphaCharacters failed";
+})();
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/kwargs_feature.i b/Examples/test-suite/kwargs_feature.i
index a8d1c38..2b662ca 100644
--- a/Examples/test-suite/kwargs_feature.i
+++ b/Examples/test-suite/kwargs_feature.i
@@ -100,3 +100,29 @@
 
   int foo_mm(int min = 1, int max = 2) {return min + max; }
 %}
+
+
+// Extended constructors
+%extend Extending0 {
+  Extending0() { return new Extending0(); }
+}
+%extend Extending1 {
+  Extending1(int one) { return new Extending1(); }
+}
+%extend Extending2 {
+  Extending2(int one, const char *two) { return new Extending2(); }
+}
+%extend ExtendingOptArgs1 {
+  ExtendingOptArgs1(int one = 0) { return new ExtendingOptArgs1(); }
+}
+%extend ExtendingOptArgs2 {
+  ExtendingOptArgs2(int one = 0, const char* two = NULL) { return new ExtendingOptArgs2(); }
+}
+
+%inline %{
+struct Extending0 {};
+struct Extending1 {};
+struct Extending2 {};
+struct ExtendingOptArgs1 {};
+struct ExtendingOptArgs2 {};
+%}
diff --git a/Examples/test-suite/li_std_auto_ptr.i b/Examples/test-suite/li_std_auto_ptr.i
index 5fdc5fa..5bde387 100644
--- a/Examples/test-suite/li_std_auto_ptr.i
+++ b/Examples/test-suite/li_std_auto_ptr.i
@@ -4,6 +4,12 @@
 #if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" // auto_ptr deprecation
 #endif
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+// Suppress 'auto_ptr<>' is deprecated
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
 %}
 
 #if defined(SWIGCSHARP) || defined(SWIGJAVA) || defined(SWIGPYTHON)
@@ -12,11 +18,29 @@
 
 %auto_ptr(Klass)
 
-%inline %{
-
+%{
+#if __cplusplus < 201703L
 #include <memory>
+#else
+// Simple std::auto_ptr implementation for testing after its removal in C++17
+namespace std {
+  template <class T> class auto_ptr {
+    T *ptr;
+    public:
+      auto_ptr(T *ptr = 0) : ptr(ptr) {}
+      auto_ptr(auto_ptr&& a) : ptr(a.ptr) { a.ptr = 0;}
+      ~auto_ptr() { delete ptr; }
+      T *release() { T *p = ptr; ptr = 0; return p; }
+      auto_ptr& operator=(auto_ptr&& a) { if (&a != this) { delete ptr; ptr = a.ptr; a.ptr = 0; } return *this; }
+  };
+}
+#endif
+
 #include <string>
 #include "swig_examples_lock.h"
+%}
+
+%inline %{
 
 class Klass {
 public:
diff --git a/Examples/test-suite/li_std_containers_overload.i b/Examples/test-suite/li_std_containers_overload.i
new file mode 100644
index 0000000..5e7c28e
--- /dev/null
+++ b/Examples/test-suite/li_std_containers_overload.i
@@ -0,0 +1,33 @@
+%module li_std_containers_overload
+
+// Suppress warning that ought not to appear, but there is no easy fix
+%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) VectorOverload;
+
+%include <std_string.i>
+%include <std_vector.i>
+
+%inline %{
+struct X {};
+struct Y {};
+%}
+
+%template(VectorX) std::vector<X>;
+%template(VectorY) std::vector<Y>;
+%template(VectorString) std::vector<std::string>;
+%template(VectorInt) std::vector<int>;
+
+%inline %{
+using namespace std;
+string VectorOverload(vector<X> v) {
+  return "vector<X>";
+}
+string VectorOverload(vector<Y> v) {
+  return "vector<Y>";
+}
+string VectorOverload(vector<string> v) {
+  return "vector<string>";
+}
+string VectorOverload(vector<int> v) {
+  return "vector<int>";
+}
+%}
diff --git a/Examples/test-suite/li_std_deque.i b/Examples/test-suite/li_std_deque.i
index 152bc86..c2f4a7f 100644
--- a/Examples/test-suite/li_std_deque.i
+++ b/Examples/test-suite/li_std_deque.i
@@ -36,8 +36,8 @@
 }
 
 void halve_in_place(std::deque<double>& v) {
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::deque<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 %}
diff --git a/Examples/test-suite/li_std_list.i b/Examples/test-suite/li_std_list.i
index 9cc6220..2ed5b9a 100644
--- a/Examples/test-suite/li_std_list.i
+++ b/Examples/test-suite/li_std_list.i
@@ -30,8 +30,8 @@
 
 
 void halve_in_place(std::list<double>& v) {
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::list<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 struct Struct {
diff --git a/Examples/test-suite/li_std_set.i b/Examples/test-suite/li_std_set.i
index bb952cd..507272d 100644
--- a/Examples/test-suite/li_std_set.i
+++ b/Examples/test-suite/li_std_set.i
@@ -23,7 +23,26 @@
     %template(v_int) std::vector<int>;
     %template(set_string) std::set<std::string>;
 #elif defined(SWIGJAVA) || defined(SWIGCSHARP)
+    // This operator is only defined because it's needed to store objects of
+    // type Foo in std::set in C++, we don't need to wrap it.
+    %ignore operator<;
+    %inline %{
+        struct Foo
+        {
+            explicit Foo(int n) : n(n) {}
+
+            int n;
+
+            friend bool operator<(Foo foo1, Foo foo2)
+            {
+                return foo1.n < foo2.n;
+            }
+        };
+    %}
+
+    %template(IntSet) std::set<int>;
     %template(StringSet) std::set<std::string>;
+    %template(FooSet) std::set<Foo>;
 #endif
 
 #if defined(SWIGRUBY)
diff --git a/Examples/test-suite/li_std_vector.i b/Examples/test-suite/li_std_vector.i
index ada146c..33fb797 100644
--- a/Examples/test-suite/li_std_vector.i
+++ b/Examples/test-suite/li_std_vector.i
@@ -48,8 +48,8 @@
 }
 
 void halve_in_place(std::vector<double>& v) {
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 struct Struct {
diff --git a/Examples/test-suite/li_std_vector_extra.i b/Examples/test-suite/li_std_vector_extra.i
index 103242b..70b776b 100644
--- a/Examples/test-suite/li_std_vector_extra.i
+++ b/Examples/test-suite/li_std_vector_extra.i
@@ -62,8 +62,8 @@
 }
 
 void halve_in_place(std::vector<double>& v) {
-    std::transform(v.begin(),v.end(),v.begin(),
-                   std::bind2nd(std::divides<double>(),2.0));
+    for (std::vector<double>::iterator it = v.begin(); it != v.end(); ++it)
+        *it /= 2.0;
 }
 
 %}
diff --git a/Examples/test-suite/li_std_wstring.i b/Examples/test-suite/li_std_wstring.i
index b2b7305..55d4538 100644
--- a/Examples/test-suite/li_std_wstring.i
+++ b/Examples/test-suite/li_std_wstring.i
@@ -1,7 +1,9 @@
 %module li_std_wstring
-%include <std_basic_string.i>
-%include <std_wstring.i>
 
+// The languages below are yet to provide std_wstring.i
+#if !(defined(SWIGD) || defined(SWIGGO) || defined(SWIGGUILE) || defined(SWIGJAVASCRIPT) || defined(SWIGLUA) || defined(SWIGMZSCHEME) || defined(SWIGOCAML) || defined(SWIGOCTAVE) || defined(SWIGPERL) || defined(SWIGPHP) || defined(SWIGR) || defined(SWIGSCILAB))
+
+%include <std_wstring.i>
 
 // throw is invalid in C++17 and later, only SWIG to use it
 #define TESTCASE_THROW1(T1) throw(T1)
@@ -10,26 +12,7 @@
 %}
 
 %inline %{
-
-struct A : std::wstring 
-{
-  A(const std::wstring& s) : std::wstring(s)
-  {
-  }
-};
-
-struct B 
-{
-  B(const std::wstring& s) : cname(0), name(s), a(s)
-  {
-  }
-  
-  char *cname;
-  std::wstring name;
-  A a;
-
-};
- 
+#include <string>
 
 wchar_t test_wcvalue(wchar_t x) {
    return x;
@@ -63,33 +46,18 @@
 void test_pointer(std::wstring *x) {
 }
 
-std::wstring *test_pointer_out() {
-   static std::wstring x = L"x";
-   return &x;
-}
-
 void test_const_pointer(const std::wstring *x) {
 }
 
-const std::wstring *test_const_pointer_out() {
-   static std::wstring x = L"x";
-   return &x;
-}
-
 void test_reference(std::wstring &x) {
 }
 
-std::wstring& test_reference_out() {
-   static std::wstring x = L"x";
-   return x;
-}
-
 bool test_equal_abc(const std::wstring &s) {
   return L"abc" == s;
 }
 
 void test_throw() TESTCASE_THROW1(std::wstring){
-  static std::wstring x = L"x";
+  static std::wstring x = L"throwing test_throw";
   
   throw x;
 }
@@ -102,12 +70,7 @@
   return s.size();
 }
 
-#ifdef SWIGPYTHON_BUILTIN
-bool is_python_builtin() { return true; }
-#else
-bool is_python_builtin() { return false; }
-#endif
-
 %}
 
+#endif
 
diff --git a/Examples/test-suite/li_std_wstring_inherit.i b/Examples/test-suite/li_std_wstring_inherit.i
new file mode 100644
index 0000000..54c6bd8
--- /dev/null
+++ b/Examples/test-suite/li_std_wstring_inherit.i
@@ -0,0 +1,39 @@
+%module li_std_wstring_inherit
+%include <std_basic_string.i>
+%include <std_wstring.i>
+
+
+%inline %{
+
+struct A : std::wstring 
+{
+  A(const std::wstring& s) : std::wstring(s)
+  {
+  }
+};
+
+struct B 
+{
+  B(const std::wstring& s) : cname(0), name(s), a(s)
+  {
+  }
+  
+  char *cname;
+  std::wstring name;
+  A a;
+
+};
+ 
+std::wstring test_value(std::wstring x) {
+   return x;
+}
+
+#ifdef SWIGPYTHON_BUILTIN
+bool is_python_builtin() { return true; }
+#else
+bool is_python_builtin() { return false; }
+#endif
+
+%}
+
+
diff --git a/Examples/test-suite/multivalue.i b/Examples/test-suite/multivalue.i
index f92e6c7..3bc3471 100644
--- a/Examples/test-suite/multivalue.i
+++ b/Examples/test-suite/multivalue.i
@@ -26,6 +26,11 @@
 
 void divide_mv(int a, int b, int *OUTPUT, int *OUTPUT);
 
+#else
+%include "typemaps.i"
+void divide_l(int a, int b, int *OUTPUT, int *OUTPUT);
+void divide_v(int a, int b, int *OUTPUT, int *OUTPUT);
+void divide_mv(int a, int b, int *OUTPUT, int *OUTPUT);
 #endif
 
 %{
@@ -49,4 +54,3 @@
 }
 
 %}
-
diff --git a/Examples/test-suite/native_directive.i b/Examples/test-suite/native_directive.i
index d08c9a9..9ae76e0 100644
--- a/Examples/test-suite/native_directive.i
+++ b/Examples/test-suite/native_directive.i
@@ -41,3 +41,62 @@
 %}
 #endif
 
+
+// TODO: C#
+// TODO: Python
+
+
+#ifdef SWIGJAVASCRIPT
+%native(CountAlphaCharacters) void JavaScript_alpha_count();
+%{
+#ifdef SWIG_V8_VERSION /* engine = node || v8 */
+
+static SwigV8ReturnValue JavaScript_alpha_count(const SwigV8Arguments &args) {
+  SWIGV8_HANDLESCOPE();
+  v8::Handle<v8::Value> jsresult;
+  char *arg1 = (char *)0;
+  int res1;
+  char *buf1 = 0;
+  int alloc1 = 0;
+  int result;
+  if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_alpha_count.");
+  res1 = SWIG_AsCharPtrAndSize(args[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1))
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "alpha_count" "', argument " "1"" of type '" "char const *""'");
+  arg1 = reinterpret_cast< char * >(buf1);
+  result = (int)alpha_count((char const *)arg1);
+  jsresult = SWIG_From_int(static_cast< int >(result));
+  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+  SWIGV8_RETURN(jsresult);
+fail:
+  SWIGV8_RETURN(SWIGV8_UNDEFINED());
+}
+
+#else /* engine = jsc */
+
+static JSValueRef JavaScript_alpha_count(JSContextRef context, JSObjectRef function,
+  JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception)
+{
+  char *arg1 = (char *)0;
+  int res1;
+  char *buf1 = 0;
+  int alloc1 = 0;
+  int result;
+  JSValueRef jsresult;
+  if (argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments.");
+  res1 = SWIG_JSC_AsCharPtrAndSize(context, argv[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1))
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "alpha_count" "', argument " "1"" of type '" "char const *""'");
+  arg1 = reinterpret_cast< char * >(buf1);
+  result = (int)alpha_count((char const *)arg1);
+  jsresult = SWIG_From_int  SWIG_JSC_FROM_CALL_ARGS(static_cast< int >(result));
+  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+  return jsresult;
+fail:
+  return JSValueMakeUndefined(context);
+}
+
+#endif /* engine */
+%}
+#endif /* SWIGJAVASCRIPT */
+
diff --git a/Examples/test-suite/nested_inheritance_interface.i b/Examples/test-suite/nested_inheritance_interface.i
new file mode 100644
index 0000000..f8335c0
--- /dev/null
+++ b/Examples/test-suite/nested_inheritance_interface.i
@@ -0,0 +1,20 @@
+%module  nested_inheritance_interface
+
+%warnfilter(SWIGWARN_RUBY_MULTIPLE_INHERITANCE,
+	    SWIGWARN_D_MULTIPLE_INHERITANCE,
+	    SWIGWARN_PHP_MULTIPLE_INHERITANCE); /* languages not supporting multiple inheritance or %interface */
+
+#if defined(SWIGJAVA) || defined(SWIGCSHARP)
+%include "swiginterface.i"
+%interface(IA)
+#endif
+
+#if !defined(SWIGCSHARP) && !defined(SWIGJAVA)
+%feature ("flatnested");
+#endif
+
+
+%inline %{
+struct IA {};
+struct B { struct N : IA {}; };
+%}
diff --git a/Examples/test-suite/ocaml/Makefile.in b/Examples/test-suite/ocaml/Makefile.in
index fd1daed..775b1ea 100644
--- a/Examples/test-suite/ocaml/Makefile.in
+++ b/Examples/test-suite/ocaml/Makefile.in
@@ -34,6 +34,12 @@
 enums \
 preproc_constants_c \
 
+CPP_TEST_CASES += \
+	inout \
+
+C_TEST_CASES += \
+	multivalue \
+
 ml_runme = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
 
 run_testcase = \
diff --git a/Examples/test-suite/ocaml/inout_runme.ml b/Examples/test-suite/ocaml/inout_runme.ml
new file mode 100644
index 0000000..767bb43
--- /dev/null
+++ b/Examples/test-suite/ocaml/inout_runme.ml
@@ -0,0 +1,8 @@
+open Swig
+open Inout
+
+let _ =
+  assert (_AddOne1 '(1.) as float = 2.);
+  assert (_AddOne3 '(1, 1, 1) = C_list ['2.;'2.;'2.]);
+  assert (_AddOne1r '(1.) as float = 2.);
+;;
diff --git a/Examples/test-suite/ocaml/multivalue_runme.ml b/Examples/test-suite/ocaml/multivalue_runme.ml
new file mode 100644
index 0000000..d7e19e7
--- /dev/null
+++ b/Examples/test-suite/ocaml/multivalue_runme.ml
@@ -0,0 +1,8 @@
+open Swig
+open Multivalue
+
+let _ =
+  assert (_divide_l '(37, 5) = C_list ['7;'2]);
+  assert (_divide_v '(41, 7) = C_list ['5;'6]);
+  assert (_divide_mv '(91, 13) = C_list ['7;'0]);
+;;
diff --git a/Examples/test-suite/octave/li_std_containers_overload_runme.m b/Examples/test-suite/octave/li_std_containers_overload_runme.m
new file mode 100644
index 0000000..786d634
--- /dev/null
+++ b/Examples/test-suite/octave/li_std_containers_overload_runme.m
@@ -0,0 +1,37 @@
+# do not dump Octave core
+if exist("crash_dumps_octave_core", "builtin")
+  crash_dumps_octave_core(0);
+endif
+
+li_std_containers_overload
+
+function check(got, expected)
+  if (!strcmp(got, expected))
+    error("Failed check. '%s' != '%s'", got, expected)
+  endif
+end
+
+v = VectorX();
+check(VectorOverload(v), "vector<X>");
+
+v = VectorY();
+check(VectorOverload(v), "vector<Y>");
+
+v = VectorInt();
+check(VectorOverload(v), "vector<int>");
+
+v = VectorString();
+check(VectorOverload(v), "vector<string>");
+
+# TODO: Conversion from an Octave sequence not implemented yet
+# v = {X()};
+# check(VectorOverload(v), "vector<X>");
+
+# v = {Y()};
+# check(VectorOverload(v), "vector<Y>");
+
+# v = {1, 2, 3};
+# check(VectorOverload(v), "vector<int>");
+
+# v = {"aaa", "bbb", "ccc"};
+# check(VectorOverload(v), "vector<string>");
diff --git a/Examples/test-suite/octave/li_std_wstring_runme.m b/Examples/test-suite/octave/li_std_wstring_runme.m
deleted file mode 100644
index cbccc0c..0000000
--- a/Examples/test-suite/octave/li_std_wstring_runme.m
+++ /dev/null
@@ -1,95 +0,0 @@
-# do not dump Octave core
-if exist("crash_dumps_octave_core", "builtin")
-  crash_dumps_octave_core(0);
-endif
-
-li_std_wstring
-
-x="h";
-
-if (li_std_wstring.test_wcvalue(x) != x)
-  error("bad string mapping")
-endif
-
-x="hello";
-if (li_std_wstring.test_ccvalue(x) != x)
-  error("bad string mapping")
-endif
-
-if (li_std_wstring.test_cvalue(x) != x)
-  error("bad string mapping")
-endif
-
-if (li_std_wstring.test_value(x) != x)
-  error("bad string mapping")
-endif
-
-if (li_std_wstring.test_const_reference(x) != x)
-  error("bad string mapping")
-endif
-
-
-s = li_std_wstring.wstring("he");
-s = s + "llo";
-
-if (s != x)
-  error("bad string mapping")
-endif
-
-if (s(1:4) != x(1:4))
-  error("bad string mapping")
-endif
-
-if (li_std_wstring.test_value(s) != x)
-  error("bad string mapping")
-endif
-
-if (li_std_wstring.test_const_reference(s) != x)
-  error("bad string mapping")
-endif
-
-a = li_std_wstring.A(s);
-
-if (li_std_wstring.test_value(a) != x)
-  error("bad string mapping")
-endif
-
-if (li_std_wstring.test_const_reference(a) != x)
-  error("bad string mapping")
-endif
-
-b = li_std_wstring.wstring(" world");
-
-if (a + b != "hello world")
-  error("bad string mapping")
-endif
-  
-if (a + " world" != "hello world")
-  error("bad string mapping")
-endif
-
-if ("hello" + b != "hello world")
-  error("bad string mapping")
-endif
-
-c = "hello" + b;
-if (c.find_last_of("l") != 9)
-  error("bad string mapping")
-endif
-  
-s = "hello world";
-
-b = li_std_wstring.B("hi");
-
-b.name = li_std_wstring.wstring("hello");
-if (b.name != "hello")
-  error("bad string mapping")
-endif
-
-
-b.a = li_std_wstring.A("hello");
-if (b.a != "hello")
-  error("bad string mapping")
-endif
-
-
diff --git a/Examples/test-suite/octave/template_typedef_cplx2_runme.m b/Examples/test-suite/octave/template_typedef_cplx2_runme.m
index 94d3beb..a72e0f1 100644
--- a/Examples/test-suite/octave/template_typedef_cplx2_runme.m
+++ b/Examples/test-suite/octave/template_typedef_cplx2_runme.m
@@ -12,7 +12,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(d)) != 1)
+if (strfind('ArithUnaryFunction',swig_type(d)) != 1)
   d
   error("is not an ArithUnaryFunction")
   error
@@ -26,7 +26,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(e)) != 1)
+if (strfind('ArithUnaryFunction',swig_type(e)) != 1)
   e
   error("is not an ArithUnaryFunction")
 endif
@@ -44,7 +44,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(c)) != 1)
+if (strfind('ArithUnaryFunction',swig_type(c)) != 1)
   c
   error("is not an ArithUnaryFunction")
 endif
@@ -57,7 +57,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(f)) != 1)
+if (strfind('ArithUnaryFunction',swig_type(f)) != 1)
   f
   error("is not an ArithUnaryFunction")
 endif
@@ -74,7 +74,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(g)) != 1)
+if (strfind('ArithUnaryFunction',swig_type(g)) != 1)
   g
   error("is not an ArithUnaryFunction")
   error
@@ -89,7 +89,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(h)) == -1)
+if (strfind('ArithUnaryFunction',swig_type(h)) == -1)
   h
   error("is not an ArithUnaryFunction")
 endif
diff --git a/Examples/test-suite/octave/template_typedef_cplx_runme.m b/Examples/test-suite/octave/template_typedef_cplx_runme.m
index d00981c..9e3e388 100644
--- a/Examples/test-suite/octave/template_typedef_cplx_runme.m
+++ b/Examples/test-suite/octave/template_typedef_cplx_runme.m
@@ -12,7 +12,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr("ArithUnaryFunction",swig_type(d)) != 1)
+if (strfind("ArithUnaryFunction",swig_type(d)) != 1)
   d
   error("is not an ArithUnaryFunction")
 endif
@@ -24,7 +24,7 @@
   error(e, "is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(e)) != 1);
+if (strfind('ArithUnaryFunction',swig_type(e)) != 1);
   c
   error("is not an ArithUnaryFunction")
 endif
@@ -42,7 +42,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(c)) != 1)
+if (strfind('ArithUnaryFunction',swig_type(c)) != 1)
   c
   error("is not an ArithUnaryFunction")
 endif
@@ -55,7 +55,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(f)) != 1)
+if (strfind('ArithUnaryFunction',swig_type(f)) != 1)
   f
   error("is not an ArithUnaryFunction")
 endif
@@ -72,7 +72,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(g)) != 1)
+if (strfind('ArithUnaryFunction',swig_type(g)) != 1)
   g
   error("is not an ArithUnaryFunction")
 endif
@@ -86,7 +86,7 @@
   error("is not an instance")
 end_try_catch
 
-if (findstr('ArithUnaryFunction',swig_type(h)) != 1)
+if (strfind('ArithUnaryFunction',swig_type(h)) != 1)
   h
   error("is not an ArithUnaryFunction")
 endif
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/python/Makefile.in b/Examples/test-suite/python/Makefile.in
index 0151f59..be06f7e 100644
--- a/Examples/test-suite/python/Makefile.in
+++ b/Examples/test-suite/python/Makefile.in
@@ -55,7 +55,7 @@
 	li_std_vectora \
 	li_std_vector_extra \
 	li_std_wstream \
-	li_std_wstring \
+	li_std_wstring_inherit \
 	primitive_types \
 	python_abstractbase \
 	python_append \
diff --git a/Examples/test-suite/python/argcargvtest_runme.py b/Examples/test-suite/python/argcargvtest_runme.py
index 38843b9..b034574 100644
--- a/Examples/test-suite/python/argcargvtest_runme.py
+++ b/Examples/test-suite/python/argcargvtest_runme.py
@@ -1,21 +1,21 @@
 from argcargvtest import *
 
-largs = ['hi', 'hola', 'hello']
+largs = ["hi", "hola", "hello"]
 if mainc(largs) != 3:
     raise RuntimeError("bad main typemap")
 
-targs = ('hi', 'hola')
-if mainv(targs, 1) != 'hola':
+targs = ("hi", "hola")
+if mainv(targs, 1) != "hola":
     print(mainv(targs, 1))
     raise RuntimeError("bad main typemap")
 
-targs = ('hi', 'hola')
-if mainv(targs, 1) != 'hola':
+targs = ("hi", "hola")
+if mainv(targs, 1) != "hola":
     raise RuntimeError("bad main typemap")
 
 try:
     error = 0
-    mainv('hello', 1)
+    mainv("hello", 1)
     error = 1
 except TypeError:
     pass
diff --git a/Examples/test-suite/python/char_binary_runme.py b/Examples/test-suite/python/char_binary_runme.py
index 34caa32..0425fe1 100644
--- a/Examples/test-suite/python/char_binary_runme.py
+++ b/Examples/test-suite/python/char_binary_runme.py
@@ -1,26 +1,26 @@
 from char_binary import *
 
 t = Test()
-if t.strlen('hile') != 4:
-    print t.strlen('hile')
+if t.strlen("hile") != 4:
+    print t.strlen("hile")
     raise RuntimeError, "bad multi-arg typemap"
-if t.ustrlen('hile') != 4:
-    print t.ustrlen('hile')
+if t.ustrlen("hile") != 4:
+    print t.ustrlen("hile")
     raise RuntimeError, "bad multi-arg typemap"
 
-if t.strlen('hil\0') != 4:
+if t.strlen("hil\0") != 4:
     raise RuntimeError, "bad multi-arg typemap"
-if t.ustrlen('hil\0') != 4:
+if t.ustrlen("hil\0") != 4:
     raise RuntimeError, "bad multi-arg typemap"
 
 #
 # creating a raw char*
 #
 pc = new_pchar(5)
-pchar_setitem(pc, 0, 'h')
-pchar_setitem(pc, 1, 'o')
-pchar_setitem(pc, 2, 'l')
-pchar_setitem(pc, 3, 'a')
+pchar_setitem(pc, 0, "h")
+pchar_setitem(pc, 1, "o")
+pchar_setitem(pc, 2, "l")
+pchar_setitem(pc, 3, "a")
 pchar_setitem(pc, 4, 0)
 
 
diff --git a/Examples/test-suite/python/comment_verifier.py b/Examples/test-suite/python/comment_verifier.py
index 57ac0b7..653cb49 100644
--- a/Examples/test-suite/python/comment_verifier.py
+++ b/Examples/test-suite/python/comment_verifier.py
@@ -1,10 +1,10 @@
 def check(got, expected, expected_builtin=None):
   if got is None:  # Absence of comment is equivalent to empty comment.
-      got = ''
+      got = ""
 
   if got != expected:
     import re
-    p = re.compile(r'^[+-]([^+-].*\S)?(\s+)$', re.M)
+    p = re.compile(r"^[+-]([^+-].*\S)?(\s+)$", re.M)
 
     def make_trailing_spaces_visible(str):
         def replace_trailing_spaces(match):
diff --git a/Examples/test-suite/python/cpp11_shared_ptr_template_upcast_runme.py b/Examples/test-suite/python/cpp11_shared_ptr_template_upcast_runme.py
new file mode 100644
index 0000000..08a95c2
--- /dev/null
+++ b/Examples/test-suite/python/cpp11_shared_ptr_template_upcast_runme.py
@@ -0,0 +1,5 @@
+from cpp11_shared_ptr_template_upcast import *
+
+pd = MakePrintableDerived(20)
+pd.GetResult()
+pd.GetFormatted()
diff --git a/Examples/test-suite/python/cpp17_u8_char_literals_runme.py b/Examples/test-suite/python/cpp17_u8_char_literals_runme.py
index 81f34f1..e2f8897 100644
--- a/Examples/test-suite/python/cpp17_u8_char_literals_runme.py
+++ b/Examples/test-suite/python/cpp17_u8_char_literals_runme.py
@@ -1,10 +1,10 @@
 from cpp17_u8_char_literals import *
 
-if cvar.a != 'a':
+if cvar.a != "a":
     raise RuntimeError
 
-if cvar.u != 'u':
+if cvar.u != "u":
     raise RuntimeError
 
-if cvar.u8 != '8':
+if cvar.u8 != "8":
     raise RuntimeError
diff --git a/Examples/test-suite/python/cpp_parameters_runme.py b/Examples/test-suite/python/cpp_parameters_runme.py
new file mode 100644
index 0000000..99d14ad
--- /dev/null
+++ b/Examples/test-suite/python/cpp_parameters_runme.py
@@ -0,0 +1,296 @@
+from cpp_parameters import *
+
+# Testing correct and incorrect parameter counts being passed (kwargs and non-kwargs)
+# Note that the implementation depends a lot on whether zero, one, two or more args are being wrapped
+
+def is_python_fastproxy():
+    """Return True if SWIG is generating Python code using -fastproxy."""
+    import cpp_parameters
+    # Note: _swig_new_instance_method is only generated when using -fastproxy
+    return hasattr(cpp_parameters, "_swig_new_instance_method")
+
+# Zero parameters expected
+x = Zero()
+try:
+    x = Zero(z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    x = Zero(0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    x.zero(z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    x.zero(0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    Zero.stat_zero(z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    Zero.stat_zero(0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    global_zero(z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    global_zero(0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+# One mandatory parameter expected
+x = One(1)
+try:
+    x = One(a=1, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    x = One(1, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    x.one(a=1, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    x.one(1, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    One.stat_one(a=1, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    One.stat_one(1, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    global_one(a=1, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    global_one(1, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+# Two mandatory parameters expected
+x = Two(1, 2)
+try:
+    x = Two(a=1, b=2, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    x = Two(1, 2, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    x.two(a=1, b=2, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    x.two(1, 2, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    Two.stat_two(a=1, b=2, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    Two.stat_two(1, 2, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    global_two(a=1, b=2, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    global_two(1, 2, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+# Single optional parameter expected
+x = Single(1)
+try:
+    x = Single(a=1, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    x = Single(1, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    x.single(a=1, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    x.single(1, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    Single.stat_single(a=1, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    Single.stat_single(1, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+try:
+    global_single(a=1, z=0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+try:
+    global_single(1, 0)
+    raise RuntimeError("Missed throw")
+except TypeError:
+    pass
+
+# Test that -builtin option throws TypeError if kwargs are used even when they look like they should work, kwargs are not supported unless using -keyword.
+# Also same for -fastproxy option except that kwargs are supported by default for constructors. TODO: Fix inconsistency.
+
+if is_python_builtin() or is_python_fastproxy():
+    # One mandatory parameter in API
+    x = One(1)
+    if is_python_fastproxy():
+        x = One(a=1)
+    else:
+        try:
+            x = One(a=1)
+            raise RuntimeError("Missed throw")
+        except TypeError:
+            pass
+    try:
+        x.one(a=1)
+        raise RuntimeError("Missed throw")
+    except TypeError:
+        pass
+    try:
+        One.stat_one(a=1)
+        raise RuntimeError("Missed throw")
+    except TypeError:
+        pass
+    try:
+        global_one(a=1)
+        raise RuntimeError("Missed throw")
+    except TypeError:
+        pass
+
+    # Two mandatory parameters in API
+    x = Two(1, 2)
+    if is_python_fastproxy():
+        x = Two(a=1, b=2)
+    else:
+        try:
+            x = Two(a=1, b=2)
+            raise RuntimeError("Missed throw")
+        except TypeError:
+            pass
+    try:
+        x.two(a=1, b=2)
+        raise RuntimeError("Missed throw")
+    except TypeError:
+        pass
+    try:
+        Two.stat_two(a=1, b=2)
+        raise RuntimeError("Missed throw")
+    except TypeError:
+        pass
+    try:
+        global_two(a=1, b=2)
+        raise RuntimeError("Missed throw")
+    except TypeError:
+        pass
+
+    # Single optional parameter in API
+    x = Single(1)
+    if is_python_fastproxy():
+        x = Single(a=1)
+    else:
+        try:
+            x = Single(a=1)
+            raise RuntimeError("Missed throw")
+        except TypeError:
+            pass
+    try:
+        x.single(a=1)
+        raise RuntimeError("Missed throw")
+    except TypeError:
+        pass
+    try:
+        Single.stat_single(a=1)
+        raise RuntimeError("Missed throw")
+    except TypeError:
+        pass
+    try:
+        global_single(a=1)
+        raise RuntimeError("Missed throw")
+    except TypeError:
+        pass
+
+else:
+    # Non-builtin should work as expected
+    # One mandatory parameter in API
+    x = One(a=1)
+    x.one(a=1)
+    One.stat_one(a=1)
+    global_one(a=1)
+
+    # Two mandatory parameters in API
+    x = Two(a=1, b=2)
+    x.two(a=1, b=2)
+    Two.stat_two(a=1, b=2)
+    global_two(a=1, b=2)
+
+    # Single optional parameter in API
+    x = Single(a=1)
+    x.single(a=1)
+    Single.stat_single(a=1)
+    global_single(a=1)
diff --git a/Examples/test-suite/python/default_args_runme.py b/Examples/test-suite/python/default_args_runme.py
index 683314d..14ef8c5 100644
--- a/Examples/test-suite/python/default_args_runme.py
+++ b/Examples/test-suite/python/default_args_runme.py
@@ -170,23 +170,23 @@
     if default_args.CDA().cdefaultargs_test2() != 1:
         raise RuntimeError
 
-    if default_args.chartest1() != 'x':
+    if default_args.chartest1() != "x":
         raise RuntimeError
 
-    if default_args.chartest2() != '\0':
+    if default_args.chartest2() != "\0":
         raise RuntimeError
 
-    if default_args.chartest3() != '\1':
+    if default_args.chartest3() != "\1":
         raise RuntimeError
 
-    if default_args.chartest4() != '\n':
+    if default_args.chartest4() != "\n":
         raise RuntimeError
 
-    if default_args.chartest5() != 'B':
+    if default_args.chartest5() != "B":
         raise RuntimeError
 
-    if default_args.chartest6() != 'C':
+    if default_args.chartest6() != "C":
         raise RuntimeError
 
 if __name__ == "__main__":
-    run('default_args')
+    run("default_args")
diff --git a/Examples/test-suite/python/director_exception_runme.py b/Examples/test-suite/python/director_exception_runme.py
index aa9d490..06856f3 100644
--- a/Examples/test-suite/python/director_exception_runme.py
+++ b/Examples/test-suite/python/director_exception_runme.py
@@ -75,7 +75,7 @@
 try:
     b.pong()
 except MyException, e:
-    if e.msg == 'foobar':
+    if e.msg == "foobar":
         ok = 1
     else:
         print "Unexpected error message: %s" % str(e)
diff --git a/Examples/test-suite/python/director_wstring_runme.py b/Examples/test-suite/python/director_wstring_runme.py
index 242b275..b7929c0 100644
--- a/Examples/test-suite/python/director_wstring_runme.py
+++ b/Examples/test-suite/python/director_wstring_runme.py
@@ -9,8 +9,8 @@
     def get_first(self):
         return A.get_first(self) + u" world!"
 
-    def process_text(self, string):
-        self.smem = u"hello"
+    def process_text(self, s):
+        self.smem = s
 
 
 b = B(u"hello")
diff --git a/Examples/test-suite/python/doxygen_basic_translate_runme.py b/Examples/test-suite/python/doxygen_basic_translate_runme.py
index e664e06..4cd5001 100644
--- a/Examples/test-suite/python/doxygen_basic_translate_runme.py
+++ b/Examples/test-suite/python/doxygen_basic_translate_runme.py
@@ -49,9 +49,9 @@
 
 .. code-block:: c++
 
-
     int main() { while(true); }
 
+    // Test blank line in code block
 }"""
 )
 comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function5),
@@ -60,7 +60,7 @@
 comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function6),
     """\
 Test for default args
-:type a: int
+:type a: int, optional
 :param a: Some parameter, default is 42"""
 )
 comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function7),
@@ -70,6 +70,16 @@
 :type a: :py:class:`Shape`
 :param a: Very strange param"""
 )
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function8),
+    """\
+Test variadic function
+:param ...: extra args"""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function9),
+    """\
+Test unnamed argument
+:param baz: Description of baz"""
+)
 
 comment_verifier.check(inspect.getdoc(doxygen_basic_translate.Atan2),
     """\
diff --git a/Examples/test-suite/python/doxygen_basic_translate_style2_runme.py b/Examples/test-suite/python/doxygen_basic_translate_style2_runme.py
new file mode 100644
index 0000000..a24f5de
--- /dev/null
+++ b/Examples/test-suite/python/doxygen_basic_translate_style2_runme.py
@@ -0,0 +1,82 @@
+import doxygen_basic_translate_style2
+import inspect
+import string
+import sys
+import comment_verifier
+
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function),
+    """\
+Brief description.
+
+The comment text.
+
+Author: Some author
+
+:rtype: int
+:return: Some number
+
+See also: function2"""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function2),
+    """\
+A test of a very very very very very very very very very very very very very very very very
+very very very very very long comment string."""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function3),
+    """*Overload 1:*
+A test for overloaded functions
+This is function **one**
+
+|
+
+*Overload 2:*
+A test for overloaded functions
+This is function **two**"""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function4),
+    """\
+A test of some mixed tag usage
+If: CONDITION {
+This *code* fragment shows us something .
+Title: Minuses:
+* it\'s senseless
+* it\'s stupid
+* it\'s null
+
+Warning: This may not work as expected
+
+.. code-block:: c++
+
+    int main() { while(true); }
+
+    // Test blank line in code block
+}"""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function5),
+    """This is a post comment."""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function6),
+    """\
+Test for default args
+:type a: int, optional
+:param a: Some parameter, default is 42"""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function7),
+    """\
+Test for a parameter with difficult type
+(mostly for python)
+:type a: :py:class:`Shape`
+:param a: Very strange param"""
+)
+
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.Atan2),
+    """\
+Multiple parameters test.
+
+:type y: float
+:param y: Vertical coordinate.
+:type x: float
+:param x: Horizontal coordinate.
+:rtype: float
+:return: Arc tangent of ``y/x``."""
+)
diff --git a/Examples/test-suite/python/doxygen_basic_translate_style3_runme.py b/Examples/test-suite/python/doxygen_basic_translate_style3_runme.py
new file mode 100644
index 0000000..6872703
--- /dev/null
+++ b/Examples/test-suite/python/doxygen_basic_translate_style3_runme.py
@@ -0,0 +1,82 @@
+import doxygen_basic_translate_style3
+import inspect
+import string
+import sys
+import comment_verifier
+
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style3.function),
+    """\
+Brief description.
+
+The comment text.
+
+Author: Some author
+
+:rtype: int
+:return: Some number
+
+See also: function2"""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style3.function2),
+    """\
+A test of a very very very very very very very very very very very very very very very very
+very very very very very long comment string."""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style3.function3),
+    """*Overload 1:*
+A test for overloaded functions
+This is function **one**
+
+|
+
+*Overload 2:*
+A test for overloaded functions
+This is function **two**"""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style3.function4),
+    """\
+A test of some mixed tag usage
+If: CONDITION {
+This *code* fragment shows us something .
+Title: Minuses:
+* it\'s senseless
+* it\'s stupid
+* it\'s null
+
+Warning: This may not work as expected
+
+.. code-block:: c++
+
+    int main() { while(true); }
+
+    int testBlankLine() {}
+}"""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style3.function5),
+    """This is a post comment."""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style3.function6),
+    """\
+Test for default args
+:type a: int, optional
+:param a: Some parameter, default is 42"""
+)
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style3.function7),
+    """\
+Test for a parameter with difficult type
+(mostly for python)
+:type a: :py:class:`Shape`
+:param a: Very strange param"""
+)
+
+comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style3.Atan2),
+    """\
+Multiple parameters test.
+
+:type y: float
+:param y: Vertical coordinate.
+:type x: float
+:param x: Horizontal coordinate.
+:rtype: float
+:return: Arc tangent of ``y/x``."""
+)
diff --git a/Examples/test-suite/python/doxygen_code_blocks_runme.py b/Examples/test-suite/python/doxygen_code_blocks_runme.py
new file mode 100644
index 0000000..46a0a3d
--- /dev/null
+++ b/Examples/test-suite/python/doxygen_code_blocks_runme.py
@@ -0,0 +1,58 @@
+import doxygen_code_blocks
+import inspect
+import string
+import sys
+import comment_verifier
+
+comment_verifier.check(inspect.getdoc(doxygen_code_blocks.function),
+    """\
+Test for code blocks
+
+.. code-block:: c++
+
+    simple code block
+
+More advanced usage with C++ characters:
+
+.. code-block:: c++
+
+    std::vector<int> first;                                // empty vector of ints
+    std::vector<int> second (4,100);                       // four ints with value 100
+    std::vector<int> third (second.begin(),second.end());  // iterating through second
+    std::vector<int> fourth (third);                       // a copy of third
+     // the iterator constructor can also be used to construct from arrays:
+    int myints[] = {16,2,77,29};
+    std::vector<int> fifth (myints, myints + sizeof(myints) / sizeof(int) );
+
+    std::cout << "The contents of fifth are:";
+    for (std::vector<int>::iterator it = fifth.begin(); it != fifth.end(); ++it)
+      std::cout << ' ' << *it;
+    std::cout << '\\n';
+
+A code block for C:
+
+.. code-block:: c
+
+    printf("hello world");
+
+A code block for Java:
+
+.. code-block:: java
+
+    public class HelloWorld {
+        public static void main(String[] args) {
+            // Prints "Hello, World" to the terminal window.
+            System.out.println("Hello, World");
+        }
+    }
+
+A code block for python:
+
+.. code-block:: python
+
+    print('hello world')
+
+A python doctest example:
+
+>>> 1 + 1
+2""")
diff --git a/Examples/test-suite/python/doxygen_misc_constructs_runme.py b/Examples/test-suite/python/doxygen_misc_constructs_runme.py
index c441c3d..c0b5c16 100644
--- a/Examples/test-suite/python/doxygen_misc_constructs_runme.py
+++ b/Examples/test-suite/python/doxygen_misc_constructs_runme.py
@@ -12,7 +12,7 @@
 :param fileName: name of the file, where the source line is located
 :type line: int
 :param line: line number
-:type isGetSize: boolean
+:type isGetSize: boolean, optional
 :param isGetSize: if set, for every object location both address and size are returned
 
 Connection::getId() """)
@@ -44,7 +44,7 @@
 
 
 comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.getFirstLetter),
-    r''
+    r""
 )
 
 comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.ClassWithNestedEnum),
@@ -73,7 +73,7 @@
 )
 
 comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.isNoSpaceValidC),
-    r''
+    r""
 )
 
 comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.backslashA),
diff --git a/Examples/test-suite/python/doxygen_translate_all_tags_runme.py b/Examples/test-suite/python/doxygen_translate_all_tags_runme.py
index 53d087e..2b5b3b8 100644
--- a/Examples/test-suite/python/doxygen_translate_all_tags_runme.py
+++ b/Examples/test-suite/python/doxygen_translate_all_tags_runme.py
@@ -34,10 +34,16 @@
 
 'citationword'
 
+.. code-block:: c++
+
+    some test code
+
+Code immediately following text.  Pydoc translation must add an
+empty line before:
 
 .. code-block:: c++
 
-     some test code""")
+    more test code""")
 
 comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func02),
 r"""Conditional comment: SOMECONDITION
@@ -76,7 +82,7 @@
 
 *italicword*
 
-emphazedWord
+*emphazedWord*
 
 
 
@@ -90,12 +96,16 @@
 
 :math:`\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}`
 
+.. math::
+
+    \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
 
 .. math::
 
     \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
 
-
+Math immediately following text.  Pydoc translation must add an
+empty line before:
 
 .. math::
 
@@ -111,7 +121,6 @@
 
 
 
-
 This will only appear in hmtl""")
 
 comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func05),
@@ -187,7 +196,7 @@
 This is an overloaded member function, provided for convenience.
 It differs from the above function only in what argument(s) it accepts.
 
-someword
+``someword``
 
 
 
@@ -200,7 +209,13 @@
 
 
 :type a: int
-:param a: the first param""")
+:param a: the first param
+:type b: int, in
+:param b: parameter with intent(in)
+:type c: int, out
+:param c: parameter with intent(out)
+:type d: int, in/out
+:param d: parameter with intent(in,out)""")
 
 comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func08),
 r"""Text after anchor.
@@ -283,13 +298,11 @@
 
 
 
-
 very long
 text with tags <sometag>
 
 
 
-
 Version: 0.0.0.2
 
 Warning: This is senseless!
diff --git a/Examples/test-suite/python/doxygen_translate_runme.py b/Examples/test-suite/python/doxygen_translate_runme.py
index 2d0840a..38dca2e 100644
--- a/Examples/test-suite/python/doxygen_translate_runme.py
+++ b/Examples/test-suite/python/doxygen_translate_runme.py
@@ -20,11 +20,9 @@
 
 'citationword'
 
-
 .. code-block:: c++
 
-     some test code
-
+    some test code
 
 Conditional comment: SOMECONDITION
 Some conditional comment
@@ -82,7 +80,7 @@
 This is an overloaded member function, provided for convenience.
 It differs from the above function only in what argument(s) it accepts.
 
-someword
+``someword``
 
 
 
@@ -121,11 +119,9 @@
 :type b: float
 :param b: B is mentioned again...
 
-
 very long
 text with tags <sometag>
 
-
 Version: 0.0.0.2
 
 Warning: This is senseless!
diff --git a/Examples/test-suite/python/ignore_parameter_runme.py b/Examples/test-suite/python/ignore_parameter_runme.py
index 5f1342e..2b5c212 100644
--- a/Examples/test-suite/python/ignore_parameter_runme.py
+++ b/Examples/test-suite/python/ignore_parameter_runme.py
@@ -2,7 +2,7 @@
 
 def check(a, b):
     if a != b:
-        raise RuntimeError('"%s" != "%s"' % (a, b))
+        raise RuntimeError("'%s' != '%s'" % (a, b))
 
 check(jaguar(200, 0), "hello")
 check(lotus("foo", 1), 101)
diff --git a/Examples/test-suite/python/kwargs_feature_runme.py b/Examples/test-suite/python/kwargs_feature_runme.py
index a2d4731..31d49d2 100644
--- a/Examples/test-suite/python/kwargs_feature_runme.py
+++ b/Examples/test-suite/python/kwargs_feature_runme.py
@@ -79,3 +79,46 @@
 
 if rfoo(x=11, n=22) != 11:
     raise RuntimeError
+
+# Extended constructors
+e = Extending0()
+e = Extending1(one=1)
+e = Extending1(1)
+e = Extending2(1, "two")
+e = Extending2(1, two="two")
+e = Extending2(two="two", one=1)
+e = ExtendingOptArgs1()
+e = ExtendingOptArgs1(1)
+e = ExtendingOptArgs2(one=1)
+e = ExtendingOptArgs2()
+e = ExtendingOptArgs2(one=1)
+e = ExtendingOptArgs2(two="two")
+e = ExtendingOptArgs2(two="two", one=1)
+
+# Invalid kwargs test
+h = Hello()
+try:
+    h = Hello(nonexistent=10)
+    raise RuntimeError("missed exception")
+except TypeError as e:
+    pass
+
+f = Foo(1)
+f = Foo(a=1)
+try:
+    f = Foo(nonexistent=10)
+    raise RuntimeError("missed exception")
+except TypeError as e:
+    pass
+
+try:
+    f = Foo(a=1, nonexistent=10)
+    raise RuntimeError("missed exception")
+except TypeError as e:
+    pass
+
+try:
+    f = Foo(1, nonexistent=10)
+    raise RuntimeError("missed exception")
+except TypeError as e:
+    pass
diff --git a/Examples/test-suite/python/li_cstring_runme.py b/Examples/test-suite/python/li_cstring_runme.py
index 6fec536..b718f13 100644
--- a/Examples/test-suite/python/li_cstring_runme.py
+++ b/Examples/test-suite/python/li_cstring_runme.py
@@ -18,10 +18,10 @@
     print test4("hello")
     raise RuntimeError
 
-if test5(4) != 'xxxx':
+if test5(4) != "xxxx":
     raise RuntimeError
 
-if test6(10) != 'xxxxx':
+if test6(10) != "xxxxx":
     raise RuntimeError
 
 if test7() != "Hello world!":
diff --git a/Examples/test-suite/python/li_cwstring_runme.py b/Examples/test-suite/python/li_cwstring_runme.py
index b2b23a8..5dd7b9b 100644
--- a/Examples/test-suite/python/li_cwstring_runme.py
+++ b/Examples/test-suite/python/li_cwstring_runme.py
@@ -15,10 +15,10 @@
 if test4("hello") != u"hello-suffix":
     raise RuntimeError
 
-if test5(4) != u'xxxx':
+if test5(4) != u"xxxx":
     raise RuntimeError
 
-if test6(10) != u'xxxxx':
+if test6(10) != u"xxxxx":
     raise RuntimeError
 
 if test7() != u"Hello world!":
diff --git a/Examples/test-suite/python/li_std_containers_overload_runme.py b/Examples/test-suite/python/li_std_containers_overload_runme.py
new file mode 100644
index 0000000..dcb3835
--- /dev/null
+++ b/Examples/test-suite/python/li_std_containers_overload_runme.py
@@ -0,0 +1,29 @@
+from li_std_containers_overload import *
+
+def check(got, expected):
+    if got != expected:
+        raise RuntimeError("Failed check. '{}' != '{}'".format(got, expected))
+
+v = VectorX()
+check(VectorOverload(v), "vector<X>")
+
+v = VectorY()
+check(VectorOverload(v), "vector<Y>")
+
+v = VectorInt()
+check(VectorOverload(v), "vector<int>")
+
+v = VectorString()
+check(VectorOverload(v), "vector<string>")
+
+v = [X()]
+check(VectorOverload(v), "vector<X>")
+
+v = [Y()]
+check(VectorOverload(v), "vector<Y>")
+
+v = [1, 2, 3]
+check(VectorOverload(v), "vector<int>")
+
+v = ["aaa", "bbb", "ccc"]
+check(VectorOverload(v), "vector<string>")
diff --git a/Examples/test-suite/python/li_std_set_runme.py b/Examples/test-suite/python/li_std_set_runme.py
index f6fad55..5e5b724 100644
--- a/Examples/test-suite/python/li_std_set_runme.py
+++ b/Examples/test-suite/python/li_std_set_runme.py
@@ -90,5 +90,5 @@
 for i in s:
     sum = sum + (i,)
 
-if (len(sum) != 3 or (not 1 in sum) or (not 'hello' in sum) or (not (1, 2) in sum)):
+if (len(sum) != 3 or (not 1 in sum) or (not "hello" in sum) or (not (1, 2) in sum)):
     raise RuntimeError
diff --git a/Examples/test-suite/python/li_std_string_extra_runme.py b/Examples/test-suite/python/li_std_string_extra_runme.py
index 53d2bdc..087d92b 100644
--- a/Examples/test-suite/python/li_std_string_extra_runme.py
+++ b/Examples/test-suite/python/li_std_string_extra_runme.py
@@ -19,7 +19,7 @@
 
 s = li_std_string_extra.string("he")
 #s += "ll"
-# s.append('o')
+# s.append("o")
 s = s + "llo"
 
 if s != x:
diff --git a/Examples/test-suite/python/li_std_vector_extra_runme.py b/Examples/test-suite/python/li_std_vector_extra_runme.py
index 88105ea..59e729a 100644
--- a/Examples/test-suite/python/li_std_vector_extra_runme.py
+++ b/Examples/test-suite/python/li_std_vector_extra_runme.py
@@ -91,7 +91,7 @@
 
 
 v = vecStr(["hello ", "world"])
-if v[0] != 'hello world':
+if v[0] != "hello world":
     raise RuntimeError, "bad std::string+std::vector"
 
 
diff --git a/Examples/test-suite/python/li_std_wstring_inherit_runme.py b/Examples/test-suite/python/li_std_wstring_inherit_runme.py
new file mode 100644
index 0000000..558914e
--- /dev/null
+++ b/Examples/test-suite/python/li_std_wstring_inherit_runme.py
@@ -0,0 +1,45 @@
+import li_std_wstring_inherit
+import sys
+
+x = u"hello"
+
+s = li_std_wstring_inherit.wstring(u"he")
+s = s + u"llo"
+
+if s != x:
+    print s, x
+    raise RuntimeError("bad string mapping")
+
+if s[1:4] != x[1:4]:
+    raise RuntimeError("bad string mapping")
+
+a = li_std_wstring_inherit.A(s)
+b = li_std_wstring_inherit.wstring(" world")
+
+if a + b != "hello world":
+    raise RuntimeError("bad string mapping")
+
+if a + " world" != "hello world":
+    raise RuntimeError("bad string mapping")
+
+# This is expected to fail if -builtin is used
+# Reverse operators not supported in builtin types
+if not li_std_wstring_inherit.is_python_builtin():
+    if "hello" + b != "hello world":
+        raise RuntimeError("bad string mapping")
+
+    c = "hello" + b
+    if c.find_last_of("l") != 9:
+        raise RuntimeError("bad string mapping")
+
+b = li_std_wstring_inherit.B("hi")
+
+b.name = li_std_wstring_inherit.wstring(u"hello")
+if b.name != "hello":
+    raise RuntimeError("bad string mapping")
+
+
+b.a = li_std_wstring_inherit.A("hello")
+if b.a != u"hello":
+    raise RuntimeError("bad string mapping")
+
diff --git a/Examples/test-suite/python/li_std_wstring_runme.py b/Examples/test-suite/python/li_std_wstring_runme.py
index bd49a43..c6210e2 100644
--- a/Examples/test-suite/python/li_std_wstring_runme.py
+++ b/Examples/test-suite/python/li_std_wstring_runme.py
@@ -1,87 +1,60 @@
 import li_std_wstring
 import sys
 
-x = u"h"
+def check_equal(a, b):
+    if a != b:
+        raise RuntimeError("failed {} {}".format(a, b))
 
-if li_std_wstring.test_wcvalue(x) != x:
-    print li_std_wstring.test_wcvalue(x)
-    raise RuntimeError("bad string mapping")
+h = u"h"
+check_equal(li_std_wstring.test_wcvalue(h), h)
 
-x = u"hello"
-if li_std_wstring.test_ccvalue(x) != x:
-    raise RuntimeError("bad string mapping")
+x = u"abc"
+check_equal(li_std_wstring.test_ccvalue(x), x)
+check_equal(li_std_wstring.test_cvalue(x), x)
 
-if li_std_wstring.test_cvalue(x) != x:
-    raise RuntimeError("bad string mapping")
+check_equal(li_std_wstring.test_wchar_overload(x), x)
+check_equal(li_std_wstring.test_wchar_overload(), None)
 
-if li_std_wstring.test_wchar_overload(x) != x:
-    raise RuntimeError("bad string mapping")
+li_std_wstring.test_pointer(None)
+li_std_wstring.test_const_pointer(None)
 
-if li_std_wstring.test_wchar_overload("not unicode") != "not unicode":
-    raise RuntimeError("bad string mapping")
+try:
+    li_std_wstring.test_value(None)
+    raise RuntimeError("NULL check failed")
+except TypeError as e:
+    pass
 
-if li_std_wstring.test_value(x) != x:
-    print x, li_std_wstring.test_value(x)
-    raise RuntimeError("bad string mapping")
+try:
+      li_std_wstring.test_reference(None)
+      raise RuntimeError("NULL check failed")
+except ValueError as e:
+    if "invalid null reference" not in str(e):
+        raise RuntimeError("Missing text {}".format(e))
+try:
+    li_std_wstring.test_const_reference(None)
+    raise RuntimeError("NULL check failed")
+except ValueError as e:
+    if "invalid null reference" not in str(e):
+        raise RuntimeError("Missing text {}".format(e))
 
-if li_std_wstring.test_const_reference(x) != x:
-    raise RuntimeError("bad string mapping")
+x = "hello"
+check_equal(li_std_wstring.test_const_reference(x), x)
 
+s = "abc"
+if not li_std_wstring.test_equal_abc(s):
+    raise RuntimeError("Not equal {}".format(s))
 
-s = li_std_wstring.wstring(u"he")
-s = s + u"llo"
+try:
+    li_std_wstring.test_throw
+except RuntimeError as e:
+    check_equal(e.message, "throwing test_throw")
 
-if s != x:
-    print s, x
-    raise RuntimeError("bad string mapping")
+x = "abc\0def"
+check_equal(li_std_wstring.test_value(x), x)
+check_equal(li_std_wstring.test_ccvalue(x), "abc")
+check_equal(li_std_wstring.test_wchar_overload(x), "abc")
 
-if s[1:4] != x[1:4]:
-    raise RuntimeError("bad string mapping")
-
-if li_std_wstring.test_value(s) != x:
-    raise RuntimeError("bad string mapping")
-
-if li_std_wstring.test_const_reference(s) != x:
-    raise RuntimeError("bad string mapping")
-
-a = li_std_wstring.A(s)
-
-if li_std_wstring.test_value(a) != x:
-    raise RuntimeError("bad string mapping")
-
-if li_std_wstring.test_const_reference(a) != x:
-    raise RuntimeError("bad string mapping")
-
-b = li_std_wstring.wstring(" world")
-
-if a + b != "hello world":
-    raise RuntimeError("bad string mapping")
-
-if a + " world" != "hello world":
-    raise RuntimeError("bad string mapping")
-
-# This is expected to fail if -builtin is used
-# Reverse operators not supported in builtin types
-if not li_std_wstring.is_python_builtin():
-    if "hello" + b != "hello world":
-        raise RuntimeError("bad string mapping")
-
-    c = "hello" + b
-    if c.find_last_of("l") != 9:
-        raise RuntimeError("bad string mapping")
-
-s = "hello world"
-
-b = li_std_wstring.B("hi")
-
-b.name = li_std_wstring.wstring(u"hello")
-if b.name != "hello":
-    raise RuntimeError("bad string mapping")
-
-
-b.a = li_std_wstring.A("hello")
-if b.a != u"hello":
-    raise RuntimeError("bad string mapping")
+################### Python specific
 
 # Byte strings only converted in Python 2
 if sys.version_info[0:2] < (3, 0):
diff --git a/Examples/test-suite/python/primitive_ref_runme.py b/Examples/test-suite/python/primitive_ref_runme.py
index f3a6403..2f1a514 100644
--- a/Examples/test-suite/python/primitive_ref_runme.py
+++ b/Examples/test-suite/python/primitive_ref_runme.py
@@ -33,7 +33,7 @@
 if ref_bool(True) != True:
     raise RuntimeError
 
-if ref_char('x') != 'x':
+if ref_char("x") != "x":
     raise RuntimeError
 
 if ref_over(0) != 0:
diff --git a/Examples/test-suite/python/primitive_types_runme.py b/Examples/test-suite/python/primitive_types_runme.py
index c5009f6..04588dd 100644
--- a/Examples/test-suite/python/primitive_types_runme.py
+++ b/Examples/test-suite/python/primitive_types_runme.py
@@ -227,7 +227,7 @@
 t.v_check()
 
 # this value contains a '0' char!
-if def_namet != 'hola':
+if def_namet != "hola":
     print "bad namet", def_namet
     raise RuntimeError
 
@@ -236,54 +236,54 @@
     print "bad namet", t.var_namet, def_namet
     raise RuntimeError
 
-t.var_namet = 'hola'
+t.var_namet = "hola"
 
-if t.var_namet != 'hola':
+if t.var_namet != "hola":
     print "bad namet", t.var_namet
     raise RuntimeError
 
-t.var_namet = 'hol'
+t.var_namet = "hol"
 
-if t.var_namet != 'hol':
-    # if t.var_namet != 'hol\0\0':
+if t.var_namet != "hol":
+    # if t.var_namet != "hol\0\0":
     print "bad namet", t.var_namet
     raise RuntimeError
 
 
-cvar.var_char = '\0'
-if cvar.var_char != '\0':
+cvar.var_char = "\0"
+if cvar.var_char != "\0":
     raise RuntimeError, "bad char '0' case"
 
 cvar.var_char = 0
-if cvar.var_char != '\0':
+if cvar.var_char != "\0":
     raise RuntimeError, "bad char '0' case"
 
-cvar.var_namet = '\0'
-# if cvar.var_namet != '\0\0\0\0\0':
-if cvar.var_namet != '':
-    print 'hola', '', cvar.var_namet
+cvar.var_namet = "\0"
+# if cvar.var_namet != "\0\0\0\0\0":
+if cvar.var_namet != "":
+    print "hola", "", cvar.var_namet
     raise RuntimeError, "bad char '\0' case"
 
-cvar.var_namet = ''
-# if cvar.var_namet != '\0\0\0\0\0':
-if cvar.var_namet != '':
+cvar.var_namet = ""
+# if cvar.var_namet != "\0\0\0\0\0":
+if cvar.var_namet != "":
     raise RuntimeError, "bad char empty case"
 
 cvar.var_pchar = None
 if cvar.var_pchar != None:
     raise RuntimeError, "bad None case"
 
-cvar.var_pchar = ''
-if cvar.var_pchar != '':
-    print '%c' % (cvar.var_pchar[0],)
+cvar.var_pchar = ""
+if cvar.var_pchar != "":
+    print "%c" % (cvar.var_pchar[0],)
     raise RuntimeError, "bad char empty case"
 
 cvar.var_pcharc = None
 if cvar.var_pcharc != None:
     raise RuntimeError, "bad None case"
 
-cvar.var_pcharc = ''
-if cvar.var_pcharc != '':
+cvar.var_pcharc = ""
+if cvar.var_pcharc != "":
     raise RuntimeError, "bad char empty case"
 
 
@@ -291,10 +291,10 @@
 # creating a raw char*
 #
 pc = new_pchar(5)
-pchar_setitem(pc, 0, 'h')
-pchar_setitem(pc, 1, 'o')
-pchar_setitem(pc, 2, 'l')
-pchar_setitem(pc, 3, 'a')
+pchar_setitem(pc, 0, "h")
+pchar_setitem(pc, 1, "o")
+pchar_setitem(pc, 2, "l")
+pchar_setitem(pc, 3, "a")
 pchar_setitem(pc, 4, 0)
 
 
@@ -331,7 +331,7 @@
 try:
     error = 0
     a = t.var_char
-    t.var_char = '23'
+    t.var_char = "23"
     error = 1
 except TypeError:
     if a != t.var_char:
@@ -393,7 +393,7 @@
 try:
     error = 0
     a = t.var_namet
-    t.var_namet = '123456'
+    t.var_namet = "123456"
     error = 1
 except TypeError:
     if a != t.var_namet:
@@ -410,11 +410,11 @@
     raise RuntimeError, "bad SWIGTYPE* typemap"
 
 
-if cvar.fixsize != 'ho\0la\0\0\0':
+if cvar.fixsize != "ho\0la\0\0\0":
     raise RuntimeError, "bad FIXSIZE typemap"
 
-cvar.fixsize = 'ho'
-if cvar.fixsize != 'ho\0\0\0\0\0\0':
+cvar.fixsize = "ho"
+if cvar.fixsize != "ho\0\0\0\0\0\0":
     raise RuntimeError, "bad FIXSIZE typemap"
 
 
@@ -487,26 +487,26 @@
     """t = Test object, e = type name (e.g. ulong), val = max or min allowed value, delta = +1 for max, -1 for min"""
     error = 0
     # Set the extreme valid value for var_*
-    setattr(t, 'var_' + e, val)
+    setattr(t, "var_" + e, val)
     # Make sure it was set properly and works properly in the val_* and ref_* methods
-    if getattr(t, 'var_' + e) != val or getattr(t, 'val_' + e)(val) != val or getattr(t, 'ref_' + e)(val) != val:
+    if getattr(t, "var_" + e) != val or getattr(t, "val_" + e)(val) != val or getattr(t, "ref_" + e)(val) != val:
         error = 1
     # Make sure setting a more extreme value fails without changing the value
     try:
-        a = getattr(t, 'var_' + e)
-        setattr(t, 'var_' + e, val + delta)
+        a = getattr(t, "var_" + e)
+        setattr(t, "var_" + e, val + delta)
         error = 1
     except OverflowError:
-        if a != getattr(t, 'var_' + e):
+        if a != getattr(t, "var_" + e):
             error = 1
     # Make sure the val_* and ref_* methods fail with a more extreme value
     try:
-        getattr(t, 'val_' + e)(val + delta)
+        getattr(t, "val_" + e)(val + delta)
         error = 1
     except OverflowError:
         pass
     try:
-        getattr(t, 'ref_' + e)(val + delta)
+        getattr(t, "ref_" + e)(val + delta)
         error = 1
     except OverflowError:
         pass
@@ -518,16 +518,16 @@
     checkType(t, e, maxval,  1)
     checkType(t, e, minval, -1)
 
-checkFull(t, 'llong',  maxllong,  minllong)
-checkFull(t, 'long',   maxlong,   minlong)
-checkFull(t, 'int',    maxint,    minint)
-checkFull(t, 'short',  maxshort,  minshort)
-checkFull(t, 'schar',  maxchar,   minchar)
-checkFull(t, 'ullong', maxullong, 0)
-checkFull(t, 'ulong',  maxulong,  0)
-checkFull(t, 'uint',   maxuint,   0)
-checkFull(t, 'ushort', maxushort, 0)
-checkFull(t, 'uchar',  maxuchar,  0)
+checkFull(t, "llong",  maxllong,  minllong)
+checkFull(t, "long",   maxlong,   minlong)
+checkFull(t, "int",    maxint,    minint)
+checkFull(t, "short",  maxshort,  minshort)
+checkFull(t, "schar",  maxchar,   minchar)
+checkFull(t, "ullong", maxullong, 0)
+checkFull(t, "ulong",  maxulong,  0)
+checkFull(t, "uint",   maxuint,   0)
+checkFull(t, "ushort", maxushort, 0)
+checkFull(t, "uchar",  maxuchar,  0)
 
 def checkOverload(t, name, val, delta, prevval, limit):
     """
@@ -556,16 +556,16 @@
                 raise RuntimeError, "bad " + name + " typemap"
 
 # Check that overloading works: uchar > schar > ushort > short > uint > int > ulong > long > ullong > llong
-checkOverload(t, 'uchar',  maxuchar,  +1, 0,         maxullong)
-checkOverload(t, 'ushort', maxushort, +1, maxuchar,  maxullong)
-checkOverload(t, 'uint',   maxuint,   +1, maxushort, maxullong)
-checkOverload(t, 'ulong',  maxulong,  +1, maxuint,   maxullong)
-checkOverload(t, 'ullong', maxullong, +1, maxulong,  maxullong)
-checkOverload(t, 'schar',  minchar,   -1, 0,         minllong)
-checkOverload(t, 'short',  minshort,  -1, minchar,   minllong)
-checkOverload(t, 'int',    minint,    -1, minshort,  minllong)
-checkOverload(t, 'long',   minlong,   -1, minint,    minllong)
-checkOverload(t, 'llong',  minllong,  -1, minlong,   minllong)
+checkOverload(t, "uchar",  maxuchar,  +1, 0,         maxullong)
+checkOverload(t, "ushort", maxushort, +1, maxuchar,  maxullong)
+checkOverload(t, "uint",   maxuint,   +1, maxushort, maxullong)
+checkOverload(t, "ulong",  maxulong,  +1, maxuint,   maxullong)
+checkOverload(t, "ullong", maxullong, +1, maxulong,  maxullong)
+checkOverload(t, "schar",  minchar,   -1, 0,         minllong)
+checkOverload(t, "short",  minshort,  -1, minchar,   minllong)
+checkOverload(t, "int",    minint,    -1, minshort,  minllong)
+checkOverload(t, "long",   minlong,   -1, minint,    minllong)
+checkOverload(t, "llong",  minllong,  -1, minlong,   minllong)
 
 # Make sure that large ints can be converted to doubles properly
 if val_double(sys.maxint + 1) != float(sys.maxint + 1):
diff --git a/Examples/test-suite/python/python_pybuffer_runme.py b/Examples/test-suite/python/python_pybuffer_runme.py
index 85cfb75..8ecdb52 100644
--- a/Examples/test-suite/python/python_pybuffer_runme.py
+++ b/Examples/test-suite/python/python_pybuffer_runme.py
@@ -14,13 +14,13 @@
     k = 1000000  # number of times to execute the functions
 
     t = time.time()
-    a = bytearray(b'hello world')
+    a = bytearray(b"hello world")
     for i in range(k):
         python_pybuffer.title1(a)
     print "Time used by bytearray:", time.time() - t
 
     t = time.time()
-    b = 'hello world'
+    b = "hello world"
     for i in range(k):
         python_pybuffer.title2(b)
     print "Time used by string:", time.time() - t
@@ -30,7 +30,7 @@
     buf2 = bytearray(50)
 
     python_pybuffer.func1(buf1)
-    check(buf1 == b'a' * 10)
+    check(buf1 == b"a" * 10)
 
     python_pybuffer.func2(buf2)
     check(buf2.startswith(b"Hello world!\x00"))
@@ -43,4 +43,4 @@
 
     buf3 = bytearray(b"hello")
     python_pybuffer.title1(buf3)
-    check(buf3 == b'Hello')
+    check(buf3 == b"Hello")
diff --git a/Examples/test-suite/python/python_strict_unicode_runme.py b/Examples/test-suite/python/python_strict_unicode_runme.py
index afb9e89..e7fae25 100644
--- a/Examples/test-suite/python/python_strict_unicode_runme.py
+++ b/Examples/test-suite/python/python_strict_unicode_runme.py
@@ -1,8 +1,8 @@
 import python_strict_unicode
 
-test_bytes   = b'hello \x01world\x99'
-BYTES        = b'BYTES'
-test_unicode = u'h\udce9llo w\u00f6rld'
+test_bytes   = b"hello \x01world\x99"
+BYTES        = b"BYTES"
+test_unicode = u"h\udce9llo w\u00f6rld"
 
 # Test that byte string inputs and outputs work as expected
 bdbl = python_strict_unicode.double_str(test_bytes)
@@ -20,12 +20,12 @@
 udbl = python_strict_unicode.double_wstr(test_unicode)
 if udbl != test_unicode + test_unicode:
     raise RuntimeError("Failed to double wide string")
-if type(udbl) != type(u''):
+if type(udbl) != type(u""):
     raise RuntimeError("Wrong type output for wide string")
 uout = python_strict_unicode.same_wstr(test_unicode)
 if uout != test_unicode:
     raise RuntimeError("Failed to copy wchar_t*")
-if type(uout) != type(u''):
+if type(uout) != type(u""):
     raise RuntimeError("Wrong type output for wchar_t*")
 
 # Test that overloading is handled properly
@@ -35,9 +35,9 @@
 if type(bovr) != type(BYTES):
     raise RuntimeError("Wrong type output from overload")
 uovr = python_strict_unicode.overload(test_unicode)
-if uovr != u'UNICODE':
+if uovr != u"UNICODE":
     raise RuntimeError("Failed to return unicode from overload")
-if type(uovr) != type(u''):
+if type(uovr) != type(u""):
     raise RuntimeERror("Wrong type output from overload")
 
 # Test that bytes aren't accepted as wide strings and unicode isn't accepted as narrow strings
diff --git a/Examples/test-suite/python/reference_global_vars_runme.py b/Examples/test-suite/python/reference_global_vars_runme.py
index 6c2d181..6f86527 100644
--- a/Examples/test-suite/python/reference_global_vars_runme.py
+++ b/Examples/test-suite/python/reference_global_vars_runme.py
@@ -13,8 +13,8 @@
 if value_bool(cvar.var_bool) != True:
     raise RuntimeError
 
-cvar.var_char = createref_char('w')
-if value_char(cvar.var_char) != 'w':
+cvar.var_char = createref_char("w")
+if value_char(cvar.var_char) != "w":
     raise RuntimeError
 
 cvar.var_unsigned_char = createref_unsigned_char(10)
diff --git a/Examples/test-suite/python/std_containers_runme.py b/Examples/test-suite/python/std_containers_runme.py
index 63ff74c..7404cd5 100644
--- a/Examples/test-suite/python/std_containers_runme.py
+++ b/Examples/test-suite/python/std_containers_runme.py
@@ -60,9 +60,9 @@
 
 
 map = {}
-map['hello'] = 1
-map['hi'] = 2
-map['3'] = 2
+map["hello"] = 1
+map["hi"] = 2
+map["3"] = 2
 
 imap = std_containers.mapident(map)
 for k in map:
@@ -70,13 +70,13 @@
         raise RuntimeError, "bad map"
 
 # Test __contains__ (required for 'x in y' to work)
-if not imap.__contains__('hello'):
+if not imap.__contains__("hello"):
     raise RuntimeError("hello imap.__contains__")
-if 'hello' not in imap:
+if "hello" not in imap:
     raise RuntimeError("hello not in imap")
-if imap.__contains__('oops'):
+if imap.__contains__("oops"):
     raise RuntimeError("oops imap.__contains__")
-if 'oops' in imap:
+if "oops" in imap:
     raise RuntimeError("oops in imap")
 
 mapc = {}
diff --git a/Examples/test-suite/python/swigobject_runme.py b/Examples/test-suite/python/swigobject_runme.py
index 346b05d..de232f5 100644
--- a/Examples/test-suite/python/swigobject_runme.py
+++ b/Examples/test-suite/python/swigobject_runme.py
@@ -15,11 +15,11 @@
 # match pointer value, but deal with leading zeros on 8/16 bit systems and
 # different C++ compilers interpretation of %p
 xstr1 = "%016X" % (lthis,)
-xstr1 = str.lstrip(xstr1, '0')
+xstr1 = str.lstrip(xstr1, "0")
 xstr2 = pointer_str(a)
 xstr2 = str.replace(xstr2, "0x", "")
 xstr2 = str.replace(xstr2, "0X", "")
-xstr2 = str.lstrip(xstr2, '0')
+xstr2 = str.lstrip(xstr2, "0")
 xstr2 = str.upper(xstr2)
 
 if xstr1 != xstr2:
diff --git a/Examples/test-suite/python/template_typedef_cplx2_runme.py b/Examples/test-suite/python/template_typedef_cplx2_runme.py
index 3043d42..161bd51 100644
--- a/Examples/test-suite/python/template_typedef_cplx2_runme.py
+++ b/Examples/test-suite/python/template_typedef_cplx2_runme.py
@@ -11,8 +11,8 @@
     print d, "is not an instance"
     raise RuntimeError
 
-s = '%s' % d
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % d
+if str.find(s, "ArithUnaryFunction") == -1:
     print d, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -23,8 +23,8 @@
     print e, "is not an instance"
     raise RuntimeError
 
-s = '%s' % e
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % e
+if str.find(s, "ArithUnaryFunction") == -1:
     print e, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -40,8 +40,8 @@
     print c, "is not an instance"
     raise RuntimeError
 
-s = '%s' % c
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % c
+if str.find(s, "ArithUnaryFunction") == -1:
     print c, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -52,8 +52,8 @@
     print f, "is not an instance"
     raise RuntimeError
 
-s = '%s' % f
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % f
+if str.find(s, "ArithUnaryFunction") == -1:
     print f, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -68,8 +68,8 @@
     print g, "is not an instance"
     raise RuntimeError
 
-s = '%s' % g
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % g
+if str.find(s, "ArithUnaryFunction") == -1:
     print g, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -81,8 +81,8 @@
     print h, "is not an instance"
     raise RuntimeError
 
-s = '%s' % h
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % h
+if str.find(s, "ArithUnaryFunction") == -1:
     print h, "is not an ArithUnaryFunction"
     raise RuntimeError
 
diff --git a/Examples/test-suite/python/template_typedef_cplx_runme.py b/Examples/test-suite/python/template_typedef_cplx_runme.py
index afb97d0..1846739 100644
--- a/Examples/test-suite/python/template_typedef_cplx_runme.py
+++ b/Examples/test-suite/python/template_typedef_cplx_runme.py
@@ -11,8 +11,8 @@
     print d, "is not an instance"
     raise RuntimeError
 
-s = '%s' % d
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % d
+if str.find(s, "ArithUnaryFunction") == -1:
     print d, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -23,8 +23,8 @@
     print e, "is not an instance"
     raise RuntimeError
 
-s = '%s' % e
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % e
+if str.find(s, "ArithUnaryFunction") == -1:
     print e, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -40,8 +40,8 @@
     print c, "is not an instance"
     raise RuntimeError
 
-s = '%s' % c
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % c
+if str.find(s, "ArithUnaryFunction") == -1:
     print c, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -52,8 +52,8 @@
     print f, "is not an instance"
     raise RuntimeError
 
-s = '%s' % f
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % f
+if str.find(s, "ArithUnaryFunction") == -1:
     print f, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -68,8 +68,8 @@
     print g, "is not an instance"
     raise RuntimeError
 
-s = '%s' % g
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % g
+if str.find(s, "ArithUnaryFunction") == -1:
     print g, "is not an ArithUnaryFunction"
     raise RuntimeError
 
@@ -81,7 +81,7 @@
     print h, "is not an instance"
     raise RuntimeError
 
-s = '%s' % h
-if str.find(s, 'ArithUnaryFunction') == -1:
+s = "%s" % h
+if str.find(s, "ArithUnaryFunction") == -1:
     print h, "is not an ArithUnaryFunction"
     raise RuntimeError
diff --git a/Examples/test-suite/python/unicode_strings_runme.py b/Examples/test-suite/python/unicode_strings_runme.py
index 39e93b0..4e661f0 100644
--- a/Examples/test-suite/python/unicode_strings_runme.py
+++ b/Examples/test-suite/python/unicode_strings_runme.py
@@ -5,13 +5,13 @@
 # The 'u' string prefix isn't valid in Python 3.0 - 3.2 and is redundant
 # in 3.3+. Since this file is run through 2to3 before testing, though,
 # mark this as a unicode string in 2.x so it'll become a str in 3.x.
-test_string = u'h\udce9llo w\u00f6rld'
+test_string = u"h\udce9llo w\u00f6rld"
 
 if sys.version_info[0:2] >= (3, 1):
     if unicode_strings.non_utf8_c_str() != test_string:
-        raise ValueError('Test comparison mismatch')
+        raise ValueError("Test comparison mismatch")
     if unicode_strings.non_utf8_std_string() != test_string:
-        raise ValueError('Test comparison mismatch')
+        raise ValueError("Test comparison mismatch")
 
 def check(s1, s2):
     if s1 != s2:
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 6393026..2c59029 100644
--- a/Examples/test-suite/ruby/Makefile.in
+++ b/Examples/test-suite/ruby/Makefile.in
@@ -20,9 +20,10 @@
 	li_std_queue \
 	li_std_set \
 	li_std_stack \
-	li_std_wstring \
+	li_std_wstring_inherit \
 	primitive_types \
 	ruby_alias_method \
+	ruby_global_immutable_vars_cpp \
 	ruby_keywords \
 	ruby_minherit_shared_ptr \
 	ruby_naming \
@@ -48,6 +49,7 @@
 	li_cstring \
 	ruby_alias_global_function \
 	ruby_alias_module_function \
+	ruby_global_immutable_vars \
 	ruby_manual_proxy \
 
 include $(srcdir)/../common.mk
@@ -57,6 +59,8 @@
 
 # Custom tests - tests with additional commandline options
 ruby_alias_global_function.ctest: SWIGOPT += -globalmodule
+ruby_global_immutable_vars.ctest: SWIGOPT += -globalmodule
+ruby_global_immutable_vars_cpp.cpptest: SWIGOPT += -globalmodule
 ruby_naming.cpptest: SWIGOPT += -autorename
 
 # Rules for the different types of tests
diff --git a/Examples/test-suite/ruby/global_immutable_vars_cpp_runme.rb b/Examples/test-suite/ruby/global_immutable_vars_cpp_runme.rb
new file mode 100644
index 0000000..7897f7d
--- /dev/null
+++ b/Examples/test-suite/ruby/global_immutable_vars_cpp_runme.rb
@@ -0,0 +1,48 @@
+#!/usr/bin/env ruby
+#
+# C++ version of global_immutable_vars_runme.rb
+#
+
+require 'swig_assert'
+
+require 'global_immutable_vars_cpp'
+
+# first check if all variables can be read
+swig_assert_each_line( <<EOF )
+Global_immutable_vars_cpp::default_mutable_var == 40
+Global_immutable_vars_cpp::global_immutable_var == 41
+Global_immutable_vars_cpp::specific_mutable_var == 42
+Global_immutable_vars_cpp::global_mutable_var == 43
+Global_immutable_vars_cpp::specific_immutable_var == 44
+EOF
+
+# check that all mutable variables can be modified
+swig_assert_each_line( <<EOF )
+Global_immutable_vars_cpp::default_mutable_var = 80
+Global_immutable_vars_cpp::default_mutable_var == 80
+Global_immutable_vars_cpp::specific_mutable_var = 82
+Global_immutable_vars_cpp::specific_mutable_var == 82
+Global_immutable_vars_cpp::global_mutable_var = 83
+Global_immutable_vars_cpp::global_mutable_var == 83
+EOF
+
+# now check that immutable variables cannot be modified
+had_exception = false
+begin
+  Global_immutable_vars_cpp::global_immutable_var = 81
+rescue NoMethodError => e
+  had_exception = true
+end
+swig_assert(had_exception, nil,
+            "Global_immutable_vars_cpp::global_immutable_var is writable (expected to be immutable)")
+
+had_exception = false
+begin
+  Global_immutable_vars_cpp::specific_immutable_var = 81
+rescue NoMethodError => e
+  had_exception = true
+end
+swig_assert(had_exception, nil,
+            "Global_immutable_vars_cpp::specific_immutable_var is writable (expected to be immutable)")
+
+swig_assert(Global_immutable_vars_cpp::check_values(80, 41, 82, 83, 44) == 1, nil, "Check values failed")
diff --git a/Examples/test-suite/ruby/global_immutable_vars_runme.rb b/Examples/test-suite/ruby/global_immutable_vars_runme.rb
new file mode 100644
index 0000000..ffbea27
--- /dev/null
+++ b/Examples/test-suite/ruby/global_immutable_vars_runme.rb
@@ -0,0 +1,52 @@
+#!/usr/bin/env ruby
+#
+# Here the proper generation of mutable and immutable variables is tested
+# in the target language.
+# Immutable variables do not have "<var>=" methods generated by SWIG,
+# therefore trying to assign these variables shall throw a NoMethodError
+# exception.
+#
+
+require 'swig_assert'
+
+require 'global_immutable_vars'
+
+# first check if all variables can be read
+swig_assert_each_line( <<EOF )
+Global_immutable_vars::default_mutable_var == 40
+Global_immutable_vars::global_immutable_var == 41
+Global_immutable_vars::specific_mutable_var == 42
+Global_immutable_vars::global_mutable_var == 43
+Global_immutable_vars::specific_immutable_var == 44
+EOF
+
+# check that all mutable variables can be modified
+swig_assert_each_line( <<EOF )
+Global_immutable_vars::default_mutable_var = 80
+Global_immutable_vars::default_mutable_var == 80
+Global_immutable_vars::specific_mutable_var = 82
+Global_immutable_vars::specific_mutable_var == 82
+Global_immutable_vars::global_mutable_var = 83
+Global_immutable_vars::global_mutable_var == 83
+EOF
+
+# now check that immutable variables cannot be modified
+had_exception = false
+begin
+  Global_immutable_vars::global_immutable_var = 81
+rescue NoMethodError => e
+  had_exception = true
+end
+swig_assert(had_exception, nil,
+            "Global_immutable_vars::global_immutable_var is writable (expected to be immutable)")
+
+had_exception = false
+begin
+  Global_immutable_vars::specific_immutable_var = 81
+rescue NoMethodError => e
+  had_exception = true
+end
+swig_assert(had_exception, nil,
+            "Global_immutable_vars::specific_immutable_var is writable (expected to be immutable)")
+
+swig_assert(Global_immutable_vars::check_values(80, 41, 82, 83, 44) == 1, nil, "Check values failed")
diff --git a/Examples/test-suite/ruby/li_std_containers_overload_runme.rb b/Examples/test-suite/ruby/li_std_containers_overload_runme.rb
new file mode 100644
index 0000000..913b611
--- /dev/null
+++ b/Examples/test-suite/ruby/li_std_containers_overload_runme.rb
@@ -0,0 +1,44 @@
+#!/usr/bin/env ruby
+#
+# Put description here
+#
+# 
+# 
+# 
+#
+
+require 'swig_assert'
+
+require 'li_std_containers_overload'
+
+include Li_std_containers_overload
+
+def check(got, expected)
+  if (got != expected)
+    raise RuntimeError, "Failed check. '#{got}' != '#{expected}'"
+  end
+end
+
+v = VectorX.new()
+check(VectorOverload(v), "vector<X>")
+
+v = VectorY.new()
+check(VectorOverload(v), "vector<Y>")
+
+v = VectorInt.new()
+check(VectorOverload(v), "vector<int>")
+
+v = VectorString.new()
+check(VectorOverload(v), "vector<string>")
+
+v = [X.new()]
+check(VectorOverload(v), "vector<X>")
+
+v = [Y.new()]
+check(VectorOverload(v), "vector<Y>")
+
+v = [1, 2, 3]
+check(VectorOverload(v), "vector<int>")
+
+v = ["aaa", "bbb", "ccc"]
+check(VectorOverload(v), "vector<string>")
diff --git a/Examples/test-suite/ruby/li_std_wstring_inherit_runme.rb b/Examples/test-suite/ruby/li_std_wstring_inherit_runme.rb
new file mode 100644
index 0000000..b5a90d8
--- /dev/null
+++ b/Examples/test-suite/ruby/li_std_wstring_inherit_runme.rb
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+require 'swig_assert'
+require 'li_std_wstring_inherit'
+x = "abc"
+swig_assert_equal("Li_std_wstring_inherit.test_value(Li_std_wstring_inherit::Wstring.new(x))", "x", binding)
+
+
+x = "y"
+swig_assert_equal("Li_std_wstring_inherit.test_value(x)", "x", binding)
+a = Li_std_wstring_inherit::A.new(x)
+swig_assert_equal("Li_std_wstring_inherit.test_value(a)", "x", binding)
+
diff --git a/Examples/test-suite/ruby/li_std_wstring_runme.rb b/Examples/test-suite/ruby/li_std_wstring_runme.rb
index 0cf38ae..4922d8d 100644
--- a/Examples/test-suite/ruby/li_std_wstring_runme.rb
+++ b/Examples/test-suite/ruby/li_std_wstring_runme.rb
@@ -2,38 +2,48 @@
 require 'swig_assert'
 require 'li_std_wstring'
 
-x = "abc"
-swig_assert_equal("Li_std_wstring.test_wchar_overload(x)", "x", binding)
-swig_assert_equal("Li_std_wstring.test_ccvalue(x)", "x", binding)
-swig_assert_equal("Li_std_wstring.test_value(Li_std_wstring::Wstring.new(x))", "x", binding)
+h = "h"
+swig_assert_equal("Li_std_wstring.test_wcvalue(h)", "h", binding)
 
+x = "abc"
+swig_assert_equal("Li_std_wstring.test_ccvalue(x)", "x", binding)
+swig_assert_equal("Li_std_wstring.test_cvalue(x)", "x", binding)
+
+swig_assert_equal("Li_std_wstring.test_wchar_overload(x)", "x", binding)
 swig_assert_equal("Li_std_wstring.test_wchar_overload()", "nil", binding)
 
-swig_assert_equal("Li_std_wstring.test_pointer(Li_std_wstring::Wstring.new(x))", "nil", binding)
-swig_assert_equal("Li_std_wstring.test_const_pointer(Li_std_wstring::Wstring.new(x))", "nil", binding)
-swig_assert_equal("Li_std_wstring.test_const_pointer(Li_std_wstring::Wstring.new(x))", "nil", binding)
-swig_assert_equal("Li_std_wstring.test_reference(Li_std_wstring::Wstring.new(x))", "nil", binding)
+Li_std_wstring.test_pointer(nil)
+Li_std_wstring.test_const_pointer(nil)
 
-x = "y"
-swig_assert_equal("Li_std_wstring.test_value(x)", "x", binding)
-a = Li_std_wstring::A.new(x)
-swig_assert_equal("Li_std_wstring.test_value(a)", "x", binding)
+begin
+  Li_std_wstring.test_value(nil)
+  raise RuntimeError, "NULL check failed"
+rescue TypeError => e
+end
+
+begin
+  Li_std_wstring.test_reference(nil)
+  raise RuntimeError, "NULL check failed"
+rescue ArgumentError => e
+  swig_assert_simple(e.message.include? "invalid null reference")
+end
+begin
+  Li_std_wstring.test_const_reference(nil)
+  raise RuntimeError, "NULL check failed"
+rescue ArgumentError => e
+  swig_assert_simple(e.message.include? "invalid null reference")
+end
 
 x = "hello"
 swig_assert_equal("Li_std_wstring.test_const_reference(x)", "x", binding)
 
-
-swig_assert_equal("Li_std_wstring.test_pointer_out", "'x'", binding)
-swig_assert_equal("Li_std_wstring.test_const_pointer_out", "'x'", binding)
-swig_assert_equal("Li_std_wstring.test_reference_out()", "'x'", binding)
-
 s = "abc"
 swig_assert("Li_std_wstring.test_equal_abc(s)", binding)
 
 begin
   Li_std_wstring.test_throw
 rescue RuntimeError => e
-  swig_assert_equal("e.message", "'x'", binding)
+  swig_assert_equal("e.message", "'throwing test_throw'", binding)
 end
 
 x = "abc\0def"
diff --git a/Examples/test-suite/ruby/ruby_global_immutable_vars_cpp_runme.rb b/Examples/test-suite/ruby/ruby_global_immutable_vars_cpp_runme.rb
new file mode 100644
index 0000000..5523b59
--- /dev/null
+++ b/Examples/test-suite/ruby/ruby_global_immutable_vars_cpp_runme.rb
@@ -0,0 +1,48 @@
+#!/usr/bin/env ruby
+#
+# C++ version of ruby_global_immutable_vars_runme.rb.
+#
+
+require 'swig_assert'
+
+require 'ruby_global_immutable_vars_cpp'
+
+# first check if all variables can be read
+swig_assert_each_line( <<EOF )
+$default_mutable_var == 40
+$global_immutable_var == 41
+$specific_mutable_var == 42
+$global_mutable_var == 43
+$specific_immutable_var == 44
+EOF
+
+# check that all mutable variables can be modified
+swig_assert_each_line( <<EOF )
+$default_mutable_var = 80
+$default_mutable_var == 80
+$specific_mutable_var = 82
+$specific_mutable_var == 82
+$global_mutable_var = 83
+$global_mutable_var == 83
+EOF
+
+# now check that immutable variables cannot be modified
+had_exception = false
+begin
+  $global_immutable_var = 81
+rescue NameError => e
+  had_exception = true
+end
+swig_assert(had_exception, nil,
+            "$global_immutable_var is writable (expected to be immutable)")
+
+had_exception = false
+begin
+  $specific_immutable_var = 81
+rescue NameError => e
+  had_exception = true
+end
+swig_assert(had_exception, nil,
+            "$specific_immutable_var is writable (expected to be immutable)")
+
+swig_assert(check_values(80, 41, 82, 83, 44) == 1, nil, "Check values failed")
diff --git a/Examples/test-suite/ruby/ruby_global_immutable_vars_runme.rb b/Examples/test-suite/ruby/ruby_global_immutable_vars_runme.rb
new file mode 100644
index 0000000..45a8506
--- /dev/null
+++ b/Examples/test-suite/ruby/ruby_global_immutable_vars_runme.rb
@@ -0,0 +1,52 @@
+#!/usr/bin/env ruby
+#
+# This test program is similar to global_immutable_vars_runme.rb
+# with the difference that the global variables to check are also
+# Ruby global variables (SWIG Ruby option "-globalmodule").
+#
+# Immutable global variables shall throw a NameError exception.
+#
+
+require 'swig_assert'
+
+require 'ruby_global_immutable_vars'
+
+# first check if all variables can be read
+swig_assert_each_line( <<EOF )
+$default_mutable_var == 40
+$global_immutable_var == 41
+$specific_mutable_var == 42
+$global_mutable_var == 43
+$specific_immutable_var == 44
+EOF
+
+# check that all mutable variables can be modified
+swig_assert_each_line( <<EOF )
+$default_mutable_var = 80
+$default_mutable_var == 80
+$specific_mutable_var = 82
+$specific_mutable_var == 82
+$global_mutable_var = 83
+$global_mutable_var == 83
+EOF
+
+# now check that immutable variables cannot be modified
+had_exception = false
+begin
+  $global_immutable_var = 81
+rescue NameError => e
+  had_exception = true
+end
+swig_assert(had_exception, nil,
+            "$global_immutable_var is writable (expected to be immutable)")
+
+had_exception = false
+begin
+  $specific_immutable_var = 81
+rescue NameError => e
+  had_exception = true
+end
+swig_assert(had_exception, nil,
+            "$specific_immutable_var is writable (expected to be immutable)")
+
+swig_assert(check_values(80, 41, 82, 83, 44) == 1, nil, "Check values failed")
diff --git a/Examples/test-suite/ruby_global_immutable_vars.i b/Examples/test-suite/ruby_global_immutable_vars.i
new file mode 100644
index 0000000..6f067d2
--- /dev/null
+++ b/Examples/test-suite/ruby_global_immutable_vars.i
@@ -0,0 +1,34 @@
+%module ruby_global_immutable_vars
+
+// This copy of global_immutable_vars.i shall be compiled with the
+// SWIG Ruby option "-globalmodule" in order to check the code path
+// for registering global methods (in contrast to module methods).
+
+%inline %{
+  int default_mutable_var = 40;
+%}
+
+%immutable;
+%feature("immutable", "0") specific_mutable_var;
+
+%inline %{
+  int global_immutable_var = 41;
+  int specific_mutable_var = 42;
+%}
+
+%mutable;
+%immutable specific_immutable_var;
+%inline %{
+  int global_mutable_var = 43;
+  int specific_immutable_var = 44;
+
+  int check_values(int default_mutable, int global_immutable, int specific_mutable, int global_mutable, int specific_immutable) {
+    return
+      default_mutable    == default_mutable_var &&
+      global_immutable   == global_immutable_var &&
+      specific_mutable   == specific_mutable_var &&
+      global_mutable     == global_mutable_var &&
+      specific_immutable == specific_immutable_var;
+  }
+%}
+
diff --git a/Examples/test-suite/ruby_global_immutable_vars_cpp.i b/Examples/test-suite/ruby_global_immutable_vars_cpp.i
new file mode 100644
index 0000000..511390e
--- /dev/null
+++ b/Examples/test-suite/ruby_global_immutable_vars_cpp.i
@@ -0,0 +1,32 @@
+%module ruby_global_immutable_vars_cpp
+
+// C++ version of ruby_global_immutable_vars.i
+
+%inline %{
+  int default_mutable_var = 40;
+%}
+
+%immutable;
+%feature("immutable", "0") specific_mutable_var;
+
+%inline %{
+  int global_immutable_var = 41;
+  int specific_mutable_var = 42;
+%}
+
+%mutable;
+%immutable specific_immutable_var;
+%inline %{
+  int global_mutable_var = 43;
+  int specific_immutable_var = 44;
+
+  int check_values(int default_mutable, int global_immutable, int specific_mutable, int global_mutable, int specific_immutable) {
+    return
+      default_mutable    == default_mutable_var &&
+      global_immutable   == global_immutable_var &&
+      specific_mutable   == specific_mutable_var &&
+      global_mutable     == global_mutable_var &&
+      specific_immutable == specific_immutable_var;
+  }
+%}
+
diff --git a/Examples/test-suite/typemap_template_parms.i b/Examples/test-suite/typemap_template_parms.i
index fd0f7f5..90231e8 100644
--- a/Examples/test-suite/typemap_template_parms.i
+++ b/Examples/test-suite/typemap_template_parms.i
@@ -26,3 +26,16 @@
 %}
 
 %template(Xint) X<int>;
+
+
+// The function name and parameter name are both 'labels'
+%inline %{
+template <typename T>
+void labels(T labels) {}
+void voido(int vooo) {}
+%}
+
+// TODO: R has a problem with parameter names clashing with the function name
+#if !defined(SWIGR)
+%template(ShortLabels) labels<short>;
+#endif
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/arrays_csharp.i b/Lib/csharp/arrays_csharp.i
index 237067a..861da83 100644
--- a/Lib/csharp/arrays_csharp.i
+++ b/Lib/csharp/arrays_csharp.i
@@ -103,7 +103,47 @@
 CSHARP_ARRAYS(unsigned long long, ulong)
 CSHARP_ARRAYS(float, float)
 CSHARP_ARRAYS(double, double)
-CSHARP_ARRAYS(bool, bool)
+
+// By default C# will marshal bools as 4 bytes
+// UnmanagedType.I1 will change this to 1 byte
+// FIXME - When running on mono ArraySubType appears to be ignored and bools will be marshalled as 4-byte
+// https://github.com/mono/mono/issues/15592
+
+// input only arrays
+%typemap(ctype)   bool INPUT[] "bool*"
+%typemap(cstype)  bool INPUT[] "bool[]"
+%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool INPUT[] "bool[]"
+%typemap(csin)    bool INPUT[] "$csinput"
+
+%typemap(in)      bool INPUT[] %{
+$1 = $input;
+%}
+%typemap(freearg) bool INPUT[] ""
+%typemap(argout)  bool INPUT[] ""
+
+// output only arrays
+%typemap(ctype)   bool OUTPUT[] "bool*"
+%typemap(cstype)  bool OUTPUT[] "bool[]"
+%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool OUTPUT[] "bool[]"
+%typemap(csin)    bool OUTPUT[] "$csinput"
+
+%typemap(in)      bool OUTPUT[] %{
+$1 = $input;
+%}
+%typemap(freearg) bool OUTPUT[] ""
+%typemap(argout)  bool OUTPUT[] ""
+
+// inout arrays
+%typemap(ctype)   bool INOUT[] "bool*"
+%typemap(cstype)  bool INOUT[] "bool[]"
+%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray,ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]") bool INOUT[] "bool[]"
+%typemap(csin)    bool INOUT[] "$csinput"
+
+%typemap(in)      bool INOUT[] %{
+$1 = $input;
+%}
+%typemap(freearg) bool INOUT[] ""
+%typemap(argout)  bool INOUT[] ""
 
 
 %define CSHARP_ARRAYS_FIXED( CTYPE, CSTYPE )
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_set.i b/Lib/csharp/std_set.i
index 3b2492e..82f010a 100644
--- a/Lib/csharp/std_set.i
+++ b/Lib/csharp/std_set.i
@@ -30,7 +30,7 @@
 
 %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) {
+  void global::System.Collections.Generic.ICollection<$typemap(cstype, T)>.Add($typemap(cstype, T) item) {
       ((global::System.Collections.Generic.ISet<$typemap(cstype, T)>)this).Add(item);
   }
 
@@ -192,7 +192,7 @@
     private $csclassname collectionRef;
     private global::System.Collections.Generic.IList<$typemap(cstype, T)> ItemsCollection;
     private int currentIndex;
-    private $typemap(cstype, T) currentObject;
+    private object currentObject;
     private int currentSize;
 
     public $csclassnameEnumerator($csclassname collection) {
@@ -212,7 +212,7 @@
           throw new global::System.InvalidOperationException("Enumeration finished.");
         if (currentObject == null)
           throw new global::System.InvalidOperationException("Collection modified.");
-        return currentObject;
+        return ($typemap(cstype, T))currentObject;
       }
     }
 
diff --git a/Lib/csharp/std_vector.i b/Lib/csharp/std_vector.i
index e8eeb84..e281129 100644
--- a/Lib/csharp/std_vector.i
+++ b/Lib/csharp/std_vector.i
@@ -239,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");
       }
@@ -351,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)
   };
 }
@@ -384,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/csharp/std_wstring.i b/Lib/csharp/std_wstring.i
index 09bdaaa..162b90e 100644
--- a/Lib/csharp/std_wstring.i
+++ b/Lib/csharp/std_wstring.i
@@ -23,7 +23,10 @@
 
 // wstring
 %typemap(ctype, out="void *") wstring "wchar_t *"
-%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]") wstring "string"
+%typemap(imtype,
+         inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]",
+         outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]"
+         ) wstring "string"
 %typemap(cstype) wstring "string"
 %typemap(csdirectorin) wstring "$iminput"
 %typemap(csdirectorout) wstring "$cscall"
@@ -60,7 +63,10 @@
 
 // const wstring &
 %typemap(ctype, out="void *") const wstring & "wchar_t *"
-%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]") const wstring & "string"  
+%typemap(imtype,
+         inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]",
+         outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]"
+         ) const wstring & "string"
 %typemap(cstype) const wstring & "string"
 
 %typemap(csdirectorin) const wstring & "$iminput"
diff --git a/Lib/csharp/wchar.i b/Lib/csharp/wchar.i
index 9361edf..7981941 100644
--- a/Lib/csharp/wchar.i
+++ b/Lib/csharp/wchar.i
@@ -20,6 +20,7 @@
 %pragma(csharp) imclasscode=%{
   protected class SWIGWStringHelper {
 
+    [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]
     public delegate string SWIGWStringDelegate(global::System.IntPtr message);
     static SWIGWStringDelegate wstringDelegate = new SWIGWStringDelegate(CreateWString);
 
@@ -52,7 +53,7 @@
 
 // wchar_t
 %typemap(ctype) wchar_t "wchar_t"
-%typemap(imtype) wchar_t "char"
+%typemap(imtype) wchar_t "char" // Requires adding CharSet=CharSet.Unicode to the DllImport to correctly marshal Unicode characters
 %typemap(cstype) wchar_t "char"
 
 %typemap(csin) wchar_t "$csinput"
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/javahead.swg b/Lib/java/javahead.swg
index 685bba1..2e10254 100644
--- a/Lib/java/javahead.swg
+++ b/Lib/java/javahead.swg
@@ -5,7 +5,7 @@
  * ----------------------------------------------------------------------------- */
 
 
-/* JNI function calls require different calling conventions for C and C++. These JCALL macros are used so 
+/* JNI function calls require different calling conventions for C and C++. These JCALL macros are used so
  * that the same typemaps can be used for generating code for both C and C++. The SWIG preprocessor can expand
  * the macros thereby generating the correct calling convention. It is thus essential that all typemaps that
  * use the macros are not within %{ %} brackets as they won't be run through the SWIG preprocessor. */
@@ -50,15 +50,16 @@
 %insert(runtime) %{
 /* Support for throwing Java exceptions */
 typedef enum {
-  SWIG_JavaOutOfMemoryError = 1, 
-  SWIG_JavaIOException, 
-  SWIG_JavaRuntimeException, 
+  SWIG_JavaOutOfMemoryError = 1,
+  SWIG_JavaIOException,
+  SWIG_JavaRuntimeException,
   SWIG_JavaIndexOutOfBoundsException,
   SWIG_JavaArithmeticException,
   SWIG_JavaIllegalArgumentException,
   SWIG_JavaNullPointerException,
   SWIG_JavaDirectorPureVirtual,
-  SWIG_JavaUnknownError
+  SWIG_JavaUnknownError,
+  SWIG_JavaIllegalStateException,
 } SWIG_JavaExceptionCodes;
 
 typedef struct {
@@ -80,6 +81,7 @@
     { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
     { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
     { SWIG_JavaUnknownError,  "java/lang/UnknownError" },
+    { SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" },
     { (SWIG_JavaExceptionCodes)0,  "java/lang/UnknownError" }
   };
   const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
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_set.i b/Lib/java/std_set.i
index 04658f7..73e0c2c 100644
--- a/Lib/java/std_set.i
+++ b/Lib/java/std_set.i
@@ -57,6 +57,10 @@
     return sizeImpl();
   }
 
+  public boolean add($typemap(jboxtype, T) key) {
+    return addImpl(key);
+  }
+
   public boolean addAll(java.util.Collection<? extends $typemap(jboxtype, T)> collection) {
     boolean didAddElement = false;
     for (java.lang.Object object : collection) {
@@ -172,7 +176,7 @@
       %fragment("SWIG_SetSize");
 
       // Returns whether item was inserted.
-      bool add(const T& key) {
+      bool addImpl(const T& key) {
         return self->insert(key).second;
       }
 
diff --git a/Lib/java/std_vector.i b/Lib/java/std_vector.i
index 88de46f..60ee23e 100644
--- a/Lib/java/std_vector.i
+++ b/Lib/java/std_vector.i
@@ -29,6 +29,8 @@
 %proxycode %{
   public $javaclassname($typemap(jstype, CTYPE)[] initialElements) {
     this();
+    reserve(initialElements.length);
+
     for ($typemap(jstype, CTYPE) element : initialElements) {
       add(element);
     }
@@ -105,14 +107,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");
         }
@@ -137,11 +139,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
@@ -169,7 +171,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
@@ -181,4 +183,3 @@
 %define specialize_std_vector(T)
 #warning "specialize_std_vector - specialization for type T no longer needed"
 %enddef
-
diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg
index 9636cdc..bd764d6 100644
--- a/Lib/lua/luarun.swg
+++ b/Lib/lua/luarun.swg
@@ -289,7 +289,7 @@
 typedef struct {
   swig_type_info   *type;
   int     own;  /* 1 if owned & must be destroyed */
-  char data[1];       /* arbitrary amount of data */    
+  char data[1];       /* arbitrary amount of data */
 } swig_lua_rawdata;
 
 /* Common SWIG API */
@@ -341,7 +341,7 @@
 #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
 
 #ifdef __cplusplus
-/* Special helper for member function pointers 
+/* Special helper for member function pointers
 it gets the address, casts it, then dereferences it */
 /*#define SWIG_mem_fn_as_voidptr(a)  (*((char**)&(a))) */
 #endif
@@ -444,7 +444,7 @@
           lua_pop(L,1); /*remove nil */
           lua_newtable(L);
           SWIG_Lua_elua_emulate_register(L,entry->value.value.table);
-        } 
+        }
         if(is_metatable) {
           assert(lua_istable(L,-1));
           lua_pushvalue(L,-1);
@@ -453,11 +453,11 @@
 
         break;
       case LUA_TUSERDATA:
-        if(entry->value.value.userdata.member) 
+        if(entry->value.value.userdata.member)
           SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue,
               entry->value.value.userdata.lvalue,
               *(entry->value.value.userdata.ptype));
-        else 
+        else
           SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue,
               *(entry->value.value.userdata.ptype),0);
         break;
@@ -502,7 +502,7 @@
   }
   assert(lua_gettop(L) == 2);
   return 1;
-  
+
 fail:
   lua_error(L);
   return 0;
@@ -520,7 +520,7 @@
   lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable);
   lua_rawset(L,-3);
   lua_pop(L,2);
-      
+
 }
 /* END OF REMOVE */
 
@@ -1039,17 +1039,11 @@
 {
 /*  there should be 1 param passed in
   (1) userdata (not the metatable) */
-  const char *className;
-  void* userData;
+  swig_lua_userdata* userData;
   assert(lua_isuserdata(L,1));  /* just in case */
-  userData = lua_touserdata(L,1); /* get the userdata address for later */
-  lua_getmetatable(L,1);    /* get the meta table */
-  assert(lua_istable(L,-1));  /* just in case */
+  userData = (swig_lua_userdata*)lua_touserdata(L,1); /* get the userdata address */
 
-  lua_getfield(L, -1, ".type");
-  className = lua_tostring(L, -1);
-
-  lua_pushfstring(L, "<%s userdata: %p>", className, userData);
+  lua_pushfstring(L, "<userdata of type '%s' at %p>", userData->type->str, userData->ptr);
   return 1;
 }
 
@@ -1061,7 +1055,7 @@
   swig_lua_userdata *usr;
   assert(lua_isuserdata(L,-1));  /* just in case */
   usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
-  
+
   usr->own = 0; /* clear our ownership */
   return 0;
 }
@@ -1170,7 +1164,7 @@
 Each class structure has a list of pointers to the base class structures.
 This function fills them.
 It cannot be done at compile time, as this will not work with hireachies
-spread over more than one swig file. 
+spread over more than one swig file.
 Therefore it must be done at runtime, querying the SWIG type system.
 */
 SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss)
@@ -1404,11 +1398,11 @@
 
   lua_checkstack(L,5);
   numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */
-  
+
   /* Get upvalues from closure */
   lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/
   metamethod_name_idx = lua_gettop(L);
-  
+
   lua_pushvalue(L, lua_upvalueindex(2));
   clss = (const swig_lua_class*)(lua_touserdata(L,-1));
   lua_pop(L,1); /* remove lightuserdata with clss from stack */
@@ -1440,7 +1434,7 @@
 
   /* metamethod name - on the top of the stack */
   assert(lua_isstring(L,-1));
-  
+
   key_index = lua_gettop(L);
 
   /* Check whether method is already defined in metatable */
@@ -1450,7 +1444,7 @@
     lua_pop(L,1);
     return -1;
   }
-  lua_pop(L,1); 
+  lua_pop(L,1);
 
   /* Iterating over immediate bases */
   for(i=0;clss->bases[i];i++)
@@ -1460,13 +1454,13 @@
     lua_pushvalue(L, key_index);
     lua_rawget(L, -2);
     if( !lua_isnil(L,-1) ) {
-      lua_pushvalue(L, key_index); 
+      lua_pushvalue(L, key_index);
 
       /* Add proxy function */
       lua_pushvalue(L, key_index); /* first closure value is function name */
       lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */
       lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2);
-      
+
       lua_rawset(L, metatable_index);
       success = 1;
     }
@@ -1477,7 +1471,7 @@
       break;
   }
 
-  return success; 
+  return success;
 }
 
 SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss)
@@ -1816,7 +1810,7 @@
   memcpy(raw->data,ptr,size); /* copy the data */
   SWIG_Lua_AddMetatable(L,type); /* add metatable */
 }
-    
+
 /* converts a packed userdata. user for member fn pointers only */
 SWIGRUNTIME int  SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type)
 {
@@ -1915,7 +1909,7 @@
 In lua 5.0.X it's lua_dostring()
 In lua 5.1.X it's luaL_dostring()
 */
-SWIGINTERN int 
+SWIGINTERN int
 SWIG_Lua_dostring(lua_State *L, const char *str) {
   int ok,top;
   if (str==0 || str[0]==0) return 0; /* nothing to do */
@@ -1930,7 +1924,7 @@
   }
   lua_settop(L,top); /* restore the stack */
   return ok;
-}    
+}
 
 #ifdef __cplusplus
 }
diff --git a/Lib/ocaml/carray.i b/Lib/ocaml/carray.i
index 5e74c3d..4378f73 100644
--- a/Lib/ocaml/carray.i
+++ b/Lib/ocaml/carray.i
@@ -77,7 +77,7 @@
 
 %typemap(out) SWIGTYPE [] {
     int i;
-    CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr");
+    const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr");
     $result = caml_array_new($1_dim0);
 
     for( i = 0; i < $1_dim0; i++ ) {
diff --git a/Lib/ocaml/ocaml.i b/Lib/ocaml/ocaml.i
index 96a36c8..cc26d18 100644
--- a/Lib/ocaml/ocaml.i
+++ b/Lib/ocaml/ocaml.i
@@ -8,7 +8,7 @@
 %insert(runtime) "swigrun.swg"
 
 /* Include headers */
-%insert(runtime) "ocamldec.swg"
+%insert(runtime) "ocamlrundec.swg"
 
 /* Type registration */
 %insert(init) "swiginit.swg"
@@ -28,18 +28,14 @@
 %}
 
 /*#ifndef SWIG_NOINCLUDE*/
-%insert(runtime) "ocaml.swg"
+%insert(runtime) "ocamlrun.swg"
 /*#endif*/
 
 %insert(classtemplate) "class.swg"
 
-/* Definitions */
-#define SWIG_malloc(size) swig_malloc(size, FUNC_NAME)
-#define SWIG_free(mem) free(mem)
-
 /* Read in standard typemaps. */
 %include <swig.swg>
-%include <typemaps.i>
+%include <ocaml.swg>
 %include <typecheck.i>
 %include <exception.i>
 %include <preamble.swg>
diff --git a/Lib/ocaml/ocaml.swg b/Lib/ocaml/ocaml.swg
index 3d552cc..afb01da 100644
--- a/Lib/ocaml/ocaml.swg
+++ b/Lib/ocaml/ocaml.swg
@@ -1,607 +1,311 @@
-/* -*-c-*- */
+/* -----------------------------------------------------------------------------
+ * ocaml.swg
+ *
+ * The Ocaml module handles all types uniformly via typemaps. Here
+ * are the definitions.
+ * ----------------------------------------------------------------------------- */
 
-/* SWIG pointer structure */
+/* Pointers */
 
-#include <string.h>
-#include <assert.h>
+%typemap(in) void ""
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+%typemap(out) void "$result = Val_int(0);"
 
-#define C_bool 0
-#define C_char 1
-#define C_uchar 2
-#define C_short 3
-#define C_ushort 4
-#define C_int 5
-#define C_uint 6
-#define C_int32 7
-#define C_int64 8
-#define C_float 9
-#define C_double 10
-#define C_ptr 11
-#define C_array 12
-#define C_list 13
-#define C_obj 14
-#define C_string 15
-#define C_enum 16
-#define C_director_core 17
+%typemap(in) void * {
+    $1 = caml_ptr_val($input,$descriptor);
+}
 
+%typemap(varin) void * {
+    $1 = ($ltype)caml_ptr_val($input,$descriptor);
+}
 
-/* Cast a pointer if possible; returns 1 if successful */
-    
-    SWIGINTERN int
-    SWIG_Cast (void *source, swig_type_info *source_type,
-	       void **ptr, swig_type_info *dest_type)
-    {
-	if( !source ) { /* Special case for NULL.  This is a popular question
-	     for other modules on the list, so I want an easy way out... */
-	    *ptr = 0;
-	    return 0;
-	}
+%typemap(out) void * {
+    $result = caml_val_ptr($1,$descriptor);
+}
 
-#ifdef TYPE_CAST_VERBOSE
-	fprintf( stderr, "Trying to cast %s to %s\n", 
-		 source_type ? source_type->str : "<none>",
-		 dest_type ? dest_type->str : "<none>" );
-#endif
-	if (dest_type != source_type) {
-	    /* We have a type mismatch.  Will have to look through our type
-	       mapping table to figure out whether or not we can accept this
-	       datatype. 
-	       --
-	       Ignore typechecks for void *.  Allow any conversion. */
-	    if( !dest_type || !source_type || 
-		!strcmp(dest_type->name,"_p_void") ||
-		!strcmp(source_type->name,"_p_void") ) {
-		*ptr = source;
-		return 0;
-	    } else {
-		swig_cast_info *tc = 
-		    SWIG_TypeCheckStruct(source_type, dest_type );
-#ifdef TYPE_CAST_VERBOSE
-		fprintf( stderr, "Typecheck -> %s\n",
-			 tc ? tc->type->str : "<none>" );
-#endif
-		if( tc ) {
-		    int newmemory = 0;
-		    *ptr = SWIG_TypeCast(tc, source, &newmemory);
-		    assert(!newmemory); /* newmemory handling not yet implemented */
-		    return 0;
-		} else
-		    return -1;
-	    }
-	} else {
-	    *ptr = source;
-	    return 0;
-	}
+%typemap(varout) void * {
+    $result = caml_val_ptr($1,$descriptor);
+}
+
+%typemap(in) char *& (char *temp) {
+  temp = (char*)caml_val_ptr($1,$descriptor);
+  $1 = &temp;
+}
+
+%typemap(argout) char *& {
+  swig_result =	caml_list_append(swig_result,caml_val_string_len(*$1, strlen(*$1)));
+}
+
+%typemap(in) SWIGTYPE & {
+    $1 = ($ltype) caml_ptr_val($input,$1_descriptor);
+}
+
+%typemap(in) SWIGTYPE && {
+    $1 = ($ltype) caml_ptr_val($input,$1_descriptor);
+}
+
+%typemap(varin) SWIGTYPE & {
+    $1 = *(($ltype) caml_ptr_val($input,$1_descriptor));
+}
+
+%typemap(varin) SWIGTYPE && {
+    $1 = *(($ltype) caml_ptr_val($input,$1_descriptor));
+}
+
+%typemap(varout) SWIGTYPE &, SWIGTYPE && {
+    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)&$1, $1_descriptor);
+}
+
+%typemap(out) SWIGTYPE &, SWIGTYPE && {
+    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor);
+}
+
+#if 0
+%typemap(argout) SWIGTYPE & {
+    const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr");
+    if( fromval ) {
+	swig_result =
+	    caml_list_append(swig_result,
+			     caml_callback(*fromval,caml_val_ptr((void *) $1,
+							    $1_descriptor)));
+    } else {
+	swig_result =
+	    caml_list_append(swig_result,
+			     caml_val_ptr ((void *) $1,$1_descriptor));
     }
-
-/* Return 0 if successful. */
-    SWIGINTERN int
-    SWIG_GetPtr(void *inptr, void **outptr, 
-		swig_type_info *intype, swig_type_info *outtype) {
-	if (intype) {
-	    return SWIG_Cast(inptr, intype,
-			     outptr, outtype) == -1;
-	} else {
-	    *outptr = inptr;
-	    return 0;
-	}
+}
+%typemap(argout) SWIGTYPE && {
+    const CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr");
+    if( fromval ) {
+	swig_result =
+	    caml_list_append(swig_result,
+			     caml_callback(*fromval,caml_val_ptr((void *) $1,
+							    $1_descriptor)));
+    } else {
+	swig_result =
+	    caml_list_append(swig_result,
+			     caml_val_ptr ((void *) $1,$1_descriptor));
     }
-
-    SWIGINTERN void caml_print_list( CAML_VALUE v );
-
-    SWIGINTERN void caml_print_val( CAML_VALUE v ) {
-	switch( SWIG_Tag_val(v) ) {
-	case C_bool:
-	    if( Bool_val(SWIG_Field(v,0)) ) fprintf( stderr, "true " );
-	    else fprintf( stderr, "false " );
-	    break;
-	case C_char:
-	case C_uchar:
-	    fprintf( stderr, "'%c' (\\%03d) ", 
-		     (Int_val(SWIG_Field(v,0)) >= ' ' &&
-		      Int_val(SWIG_Field(v,0)) < 127) ? Int_val(SWIG_Field(v,0)) : '.',
-		     Int_val(SWIG_Field(v,0)) );
-	    break;
-	case C_short:
-	case C_ushort:
-	case C_int:
-	    fprintf( stderr, "%d ", (int)caml_long_val(v) );
-	    break;
-
-	case C_uint:
-	case C_int32:
-	    fprintf( stderr, "%ud ", (unsigned int)caml_long_val(v) );
-	    break;
-	case C_int64:
-	    fprintf( stderr, "%ld ", caml_long_val(v) );
-	    break;
-	case C_float:
-	case C_double:
-	    fprintf( stderr, "%f ", caml_double_val(v) );
-	    break;
-
-	case C_ptr:
-	{
-	    void *vout = 0;
-	    swig_type_info *ty = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1));
-	    caml_ptr_val_internal(v,&vout,0);
-	    fprintf( stderr, "PTR(%p,%s) ", 
-		     vout,
-		     ty ? ty->name : "(null)" );
-	}
-	break;
-	case C_array:
-	{
-	    unsigned int i;
-	    for( i = 0; i < Wosize_val( SWIG_Field(v,0) ); i++ ) 
-		caml_print_val( SWIG_Field(SWIG_Field(v,0),i) );
-	}
-	break;
-	case C_list:
-	    caml_print_list( SWIG_Field(v,0) );
-	    break;
-	case C_obj:
-	    fprintf( stderr, "OBJ(%p) ", (void *)SWIG_Field(v,0) );
-	    break;
-	case C_string:
-	{
-	    void *cout;
-	    caml_ptr_val_internal(v,&cout,0);
-	    fprintf( stderr, "'%s' ", (char *)cout );
-	} 
-	break;
-	}
-    }
-
-    SWIGINTERN void caml_print_list( CAML_VALUE v ) {
-	CAMLparam1(v);
-	while( v && Is_block(v) ) {
-	    fprintf( stderr, "[ " );
-	    caml_print_val( SWIG_Field(v,0) );
-	    fprintf( stderr, "]\n" );
-	    v = SWIG_Field(v,1);
-	}
-	CAMLreturn0;
-    }
-
-    SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) {
-	CAMLparam1(lst);
-	int i = 0;
-	while( i < n && lst && Is_block(lst) ) {
-	    i++; lst = SWIG_Field(lst,1);
-	}
-	if( lst == Val_unit ) CAMLreturn(Val_unit);
-	else CAMLreturn(SWIG_Field(lst,0));
-    }
-    
-    SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) {
-	CAMLparam2(lst,elt);
-	SWIG_CAMLlocal3(v,vt,lh);
-	lh = Val_unit;
-	v = Val_unit;
-
-	/* Appending C_void should have no effect */
-	if( !Is_block(elt) ) return lst;
-
-	while( lst && Is_block(lst) ) {
-	    if( v && v != Val_unit ) {
-		vt = caml_alloc_tuple(2);
-		SWIG_Store_field(v,1,vt);
-		v = vt;
-	    } else {
-		v = lh = caml_alloc_tuple(2);
-	    }
-	    SWIG_Store_field(v,0,SWIG_Field(lst,0));
-	    lst = SWIG_Field(lst,1);
-	}
-
-	if( v && Is_block(v) ) {
-	    vt = caml_alloc_tuple(2);
-	    SWIG_Store_field(v,1,vt);
-	    v = vt;
-	} else {
-	    v = lh = caml_alloc_tuple(2);
-	}
-	SWIG_Store_field(v,0,elt);
-	SWIG_Store_field(v,1,Val_unit);
-
-	CAMLreturn(lh);
-    }
-
-    SWIGINTERN int caml_list_length( CAML_VALUE lst ) {
-	CAMLparam1(lst);
-	int i = 0;
-	while( lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); }
-	CAMLreturn(i);
-    }
-
-    SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) {
-	CAMLparam2(arr,item);
-	SWIG_Store_field(SWIG_Field(arr,0),n,item);
-	CAMLreturn0;
-    }
-
-    SWIGINTERN value caml_array_nth( CAML_VALUE arr, int n ) {
-	CAMLparam1(arr);
-	if( SWIG_Tag_val(arr) == C_array )
-	    CAMLreturn(SWIG_Field(SWIG_Field(arr,0),n));
-	else if( SWIG_Tag_val(arr) == C_list )
-	    CAMLreturn(caml_list_nth(arr,0));
-	else
-	    caml_failwith("Need array or list");
-    }
-
-    SWIGINTERN int caml_array_len( CAML_VALUE arr ) {
-	CAMLparam1(arr);
-	if( SWIG_Tag_val(arr) == C_array )
-	    CAMLreturn(Wosize_val(SWIG_Field(arr,0)));
-	else if( SWIG_Tag_val(arr) == C_list )
-	    CAMLreturn(caml_list_length(arr));
-	else
-	    caml_failwith("Need array or list");
-    }
-
-    SWIGINTERN CAML_VALUE caml_swig_alloc(int x,int y) {
-	return caml_alloc(x,y);
-    }
-
-    SWIGINTERN value caml_array_new( int n ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(vv);
-	vv = caml_swig_alloc(1,C_array);
-	SWIG_Store_field(vv,0,caml_alloc_tuple(n));
-	CAMLreturn(vv);
-    }
-    
-    SWIGINTERN CAML_VALUE caml_val_bool( int b ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(bv);
-	bv = caml_swig_alloc(1,C_bool);
-	SWIG_Store_field(bv,0,Val_bool(b));
-	CAMLreturn(bv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_char( char c ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(cv);
-	cv = caml_swig_alloc(1,C_char);
-	SWIG_Store_field(cv,0,Val_int(c));
-	CAMLreturn(cv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char uc ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(ucv);
-	ucv = caml_swig_alloc(1,C_uchar);
-	SWIG_Store_field(ucv,0,Val_int(uc));
-	CAMLreturn(ucv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_short( short s ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(sv);
-	sv = caml_swig_alloc(1,C_short);
-	SWIG_Store_field(sv,0,Val_int(s));
-	CAMLreturn(sv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short us ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(usv);
-	usv = caml_swig_alloc(1,C_ushort);
-	SWIG_Store_field(usv,0,Val_int(us));
-	CAMLreturn(usv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_int( int i ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(iv);
-	iv = caml_swig_alloc(1,C_int);
-	SWIG_Store_field(iv,0,Val_int(i));
-	CAMLreturn(iv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_uint( unsigned int ui ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(uiv);
-	uiv = caml_swig_alloc(1,C_int);
-	SWIG_Store_field(uiv,0,Val_int(ui));
-	CAMLreturn(uiv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_long( long l ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(lv);
-	lv = caml_swig_alloc(1,C_int64);
-	SWIG_Store_field(lv,0,caml_copy_int64(l));
-	CAMLreturn(lv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long ul ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(ulv);
-	ulv = caml_swig_alloc(1,C_int64);
-	SWIG_Store_field(ulv,0,caml_copy_int64(ul));
-	CAMLreturn(ulv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_float( float f ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(fv);
-	fv = caml_swig_alloc(1,C_float);
-	SWIG_Store_field(fv,0,caml_copy_double((double)f));
-	CAMLreturn(fv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_double( double d ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(fv);
-	fv = caml_swig_alloc(1,C_double);
-	SWIG_Store_field(fv,0,caml_copy_double(d));
-	CAMLreturn(fv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(vv);
-	vv = caml_swig_alloc(2,C_ptr);
-	SWIG_Store_field(vv,0,caml_copy_int64((long)p));
-	SWIG_Store_field(vv,1,caml_copy_int64((long)info));
-	CAMLreturn(vv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_string( const char *p ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(vv);
-	if( !p ) CAMLreturn(caml_val_ptr( (void *)p, 0 ));
-	vv = caml_swig_alloc(1,C_string);
-	SWIG_Store_field(vv,0,caml_copy_string(p));
-	CAMLreturn(vv);
-    }
-
-    SWIGINTERN CAML_VALUE caml_val_string_len( const char *p, int len ) {
-	CAMLparam0();
-	SWIG_CAMLlocal1(vv);
-	if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 ));
-	vv = caml_swig_alloc(1,C_string);
-	SWIG_Store_field(vv,0,caml_alloc_string(len));
-	memcpy(String_val(SWIG_Field(vv,0)),p,len);
-	CAMLreturn(vv);
-    }
-
-    #define caml_val_obj(v, name) caml_val_obj_helper(v, SWIG_TypeQuery((name)), name)
-    SWIGINTERN CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) {
-	CAMLparam0();
-	CAMLreturn(caml_callback2(*caml_named_value("caml_create_object_fn"),
-			     caml_val_ptr(v,type),
-			     caml_copy_string(name)));
-    }
-
-    SWIGINTERN long caml_long_val_full( CAML_VALUE v, const char *name ) {
-	CAMLparam1(v);
-	if( !Is_block(v) ) return 0;
-
-	switch( SWIG_Tag_val(v) ) {
-	case C_bool:
-	case C_char:
-	case C_uchar:
-	case C_short:
-	case C_ushort:
-	case C_int:
-	    CAMLreturn(Int_val(SWIG_Field(v,0)));
-	case C_uint:
-	case C_int32:
-	    CAMLreturn(Int32_val(SWIG_Field(v,0)));
-	case C_int64:
-	    CAMLreturn((long)SWIG_Int64_val(SWIG_Field(v,0)));
-	case C_float:
-	case C_double:
-	    CAMLreturn((long)Double_val(SWIG_Field(v,0)));
-	case C_string:
-	    CAMLreturn((long)String_val(SWIG_Field(v,0)));
-	case C_ptr:
-	    CAMLreturn((long)SWIG_Int64_val(SWIG_Field(SWIG_Field(v,0),0)));
-	case C_enum: {
-	    SWIG_CAMLlocal1(ret);
-	    CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int");
-	    if( !name ) caml_failwith( "Not an enum conversion" );
-	    ret = caml_callback2(*enum_to_int,*caml_named_value(name),v);
-	    CAMLreturn(caml_long_val(ret));
-	}
-	default:
-	    caml_failwith("No conversion to int");
-	}
-    }
-
-    SWIGINTERN long caml_long_val( CAML_VALUE v ) {
-	return caml_long_val_full(v,0);
-    }
-
-    SWIGINTERN double caml_double_val( CAML_VALUE v ) {
-	CAMLparam1(v);
-	if( !Is_block(v) ) return 0.0;
-	switch( SWIG_Tag_val(v) ) {
-	case C_bool:
-	case C_char:
-	case C_uchar:
-	case C_short:
-	case C_ushort:
-	case C_int:
-	    CAMLreturn_type(Int_val(SWIG_Field(v,0)));
-	case C_uint:
-	case C_int32:
-	    CAMLreturn_type(Int32_val(SWIG_Field(v,0)));
-	case C_int64:
-	    CAMLreturn_type(SWIG_Int64_val(SWIG_Field(v,0)));
-	case C_float:
-	case C_double:
-	    CAMLreturn_type(Double_val(SWIG_Field(v,0)));
-	default:
-	    fprintf( stderr, "Unknown block tag %d\n", SWIG_Tag_val(v) );
-	    caml_failwith("No conversion to double");
-	}
-    }
-
-    SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out,
-					  swig_type_info *descriptor ) {
-	CAMLparam1(v);
-	void *outptr = NULL;
-        swig_type_info *outdescr = NULL;
-        static CAML_VALUE *func_val = NULL;
-
-	if( v == Val_unit ) {
-	    *out = 0;
-	    CAMLreturn_type(0);
-	}
-	if( !Is_block(v) ) return -1;
-	switch( SWIG_Tag_val(v) ) {
-	case C_obj:
-	    if (!func_val) {
-	        func_val = caml_named_value("caml_obj_ptr");
-	    }
-	    CAMLreturn_type(caml_ptr_val_internal(caml_callback(*func_val, v), out, descriptor));
-	case C_string:
-	    outptr = (void *)String_val(SWIG_Field(v,0));
-	    break;
-	case C_ptr:
-	    outptr = (void *)(long)SWIG_Int64_val(SWIG_Field(v,0));
-            outdescr = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1));
-	    break;
-	default:
-	    *out = 0;
-	    CAMLreturn_type(1);
-	    break;
-	}
-
-	CAMLreturn_type(SWIG_GetPtr(outptr, out, outdescr, descriptor));
-    }
-
-    SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) {
-        CAMLparam0();
-#ifdef TYPE_CAST_VERBOSE
-	caml_print_val( v );
-#endif
-	void *out = NULL;
-	if( !caml_ptr_val_internal( v, &out, descriptor ) )
-	    CAMLreturn_type(out);
-	else
-	    caml_failwith( "No appropriate conversion found." );
-    }
-
-    SWIGINTERN char *caml_string_val( CAML_VALUE v ) {
-	return (char *)caml_ptr_val( v, 0 );
-    }
-
-    SWIGINTERN int caml_string_len( CAML_VALUE v ) {
-	switch( SWIG_Tag_val(v) ) {
-	case C_string:
-	    return caml_string_length(SWIG_Field(v,0));
-	default:
-	    return strlen((char *)caml_ptr_val(v,0));
-	}
-    }
-
-    SWIGINTERN int caml_bool_check( CAML_VALUE v ) {
-	CAMLparam1(v);
-	
-	if( !Is_block(v) ) return 0;
-	
-	switch( SWIG_Tag_val(v) ) {
-	case C_bool:
-	case C_ptr:
-	case C_string:
-	    CAMLreturn(1);
-	default:
-	    CAMLreturn(0);
-	}
-    }
-
-    SWIGINTERN int caml_int_check( CAML_VALUE v ) {
-	CAMLparam1(v);
-	
-	if( !Is_block(v) ) return 0;
-	
-	switch( SWIG_Tag_val(v) ) {
-	case C_char:
-	case C_uchar:
-	case C_short:
-	case C_ushort:
-	case C_int:
-	case C_uint:
-	case C_int32:
-	case C_int64:
-	    CAMLreturn(1);
-
-	default:
-	    CAMLreturn(0);
-	}
-    }
-
-    SWIGINTERN int caml_float_check( CAML_VALUE v ) {
-	CAMLparam1(v);
-	if( !Is_block(v) ) return 0;
-
-	switch( SWIG_Tag_val(v) ) {
-	case C_float:
-	case C_double:
-	    CAMLreturn(1);
-
-	default:
-	    CAMLreturn(0);
-	}	
-    }
-
-    SWIGINTERN int caml_ptr_check( CAML_VALUE v ) {
-	CAMLparam1(v);
-	if( !Is_block(v) ) return 0;
-
-	switch( SWIG_Tag_val(v) ) {
-	case C_string:
-	case C_ptr:
-	case C_int64:
-	    CAMLreturn(1);
-
-	default:
-	    CAMLreturn(0);
-	}	
-    }
-
-    SWIGINTERN CAML_VALUE SWIG_Ocaml_ptr_to_val(const char *name, void *ptr, swig_type_info *descriptor) {
-        CAMLparam0();
-        SWIG_CAMLlocal1(result);
-
-        CAML_VALUE *fromval = caml_named_value(name);
-        if (fromval) {
-            result = caml_callback(*fromval, caml_val_ptr(ptr, descriptor));
-        } else {
-            result = caml_val_ptr(ptr, descriptor);
-        }
-        CAMLreturn(result);
-    }
-
-    static swig_module_info *SWIG_Ocaml_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
-      CAML_VALUE pointer;
-
-      pointer = caml_callback(*caml_named_value("swig_find_type_info"), caml_val_int(0));
-      if (Is_block(pointer) && SWIG_Tag_val(pointer) == C_ptr) {
-        return (swig_module_info *)(void *)(long)SWIG_Int64_val(SWIG_Field(pointer,0));
-      }
-      return 0;
-    }
-
-    static void SWIG_Ocaml_SetModule(swig_module_info *pointer) {
-      CAML_VALUE mod_pointer;
-
-      mod_pointer = caml_val_ptr(pointer, NULL);
-      caml_callback(*caml_named_value("swig_set_type_info"), mod_pointer);
-    }
-
-#ifdef __cplusplus
 }
 #endif
-#undef value
+
+%typemap(in) SWIGTYPE {
+    $1 = *(($&1_ltype) caml_ptr_val($input,$&1_descriptor)) ;
+}
+
+#ifdef __cplusplus
+
+%typemap(out) SWIGTYPE {
+    $&1_ltype temp = new $ltype((const $1_ltype &) $1);
+    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)temp, $&1_descriptor);
+}
+
+#else
+
+%typemap(out) SWIGTYPE {
+    void *temp = calloc(1,sizeof($ltype));
+    memmove(temp, &$1, sizeof($1_type));
+    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", temp, $&1_descriptor);
+}
+
+#endif
+
+%typemap(directorin) SWIGTYPE {
+    $&ltype temp = new $ltype((const $ltype &)$1);
+    swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)temp, $&1_descriptor);
+    args = caml_list_append(args, swig_result);
+}
+
+%typemap(directorin) SWIGTYPE *, SWIGTYPE [], SWIGTYPE &, SWIGTYPE && {
+    swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)&$1, $&1_descriptor);
+    args = caml_list_append(args, swig_result);
+}
+
+/* The SIMPLE_MAP macro below defines the whole set of typemaps needed
+   for simple types. */
+
+%define SIMPLE_MAP(C_NAME, C_TO_OCAML, OCAML_TO_C)
+/* In */
+%typemap(in) C_NAME {
+    $1 = OCAML_TO_C($input);
+}
+%typemap(varin) C_NAME {
+    $1 = OCAML_TO_C($input);
+}
+%typemap(in) const C_NAME & ($*1_ltype temp) {
+    temp = ($*1_ltype) OCAML_TO_C($input);
+    $1 = &temp;
+}
+%typemap(varin) const C_NAME & {
+    $1 = OCAML_TO_C($input);
+}
+%typemap(directorout) C_NAME {
+    $1 = OCAML_TO_C($input);
+}
+/* Out */
+%typemap(out) C_NAME {
+    $result = C_TO_OCAML($1);
+}
+%typemap(varout) C_NAME {
+    $result = C_TO_OCAML($1);
+}
+%typemap(varout) const C_NAME & {
+    $result = C_TO_OCAML($1);
+}
+%typemap(out) const C_NAME & {
+    $result = C_TO_OCAML(*$1);
+}
+%typemap(directorin) C_NAME {
+    args = caml_list_append(args, C_TO_OCAML($1));
+}
+%enddef
+
+SIMPLE_MAP(bool, caml_val_bool, caml_long_val);
+SIMPLE_MAP(char, caml_val_char, caml_long_val);
+SIMPLE_MAP(signed char, caml_val_char, caml_long_val);
+SIMPLE_MAP(unsigned char, caml_val_uchar, caml_long_val);
+SIMPLE_MAP(int, caml_val_int, caml_long_val);
+SIMPLE_MAP(short, caml_val_short, caml_long_val);
+SIMPLE_MAP(wchar_t, caml_val_short, caml_long_val);
+SIMPLE_MAP(long, caml_val_long, caml_long_val);
+SIMPLE_MAP(ptrdiff_t, caml_val_int, caml_long_val);
+SIMPLE_MAP(unsigned int, caml_val_uint, caml_long_val);
+SIMPLE_MAP(unsigned short, caml_val_ushort, caml_long_val);
+SIMPLE_MAP(unsigned long, caml_val_ulong, caml_long_val);
+SIMPLE_MAP(size_t, caml_val_int, caml_long_val);
+SIMPLE_MAP(float, caml_val_float, caml_double_val);
+SIMPLE_MAP(double, caml_val_double, caml_double_val);
+SIMPLE_MAP(long long,caml_val_ulong,caml_long_val);
+SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val);
+
+/* Void */
+
+%typemap(out) void "$result = Val_unit;";
+
+/* Pass through value */
+
+%typemap (in) CAML_VALUE "$1=$input;";
+%typemap (out) CAML_VALUE "$result=$1;";
+
+#if 0
+%include <carray.i>
+#endif
+
+/* Handle char arrays as strings */
+
+%define %char_ptr_in(how)
+%typemap(how)  char *, signed char *, unsigned char * {
+    $1 = ($ltype)caml_string_val($input);
+}
+/* Again work around the empty array bound bug */
+%typemap(how) char [ANY], signed char [ANY], unsigned char [ANY] {
+    char *temp = caml_string_val($input);
+    strcpy((char *)$1,temp); 
+}
+%enddef
+
+%char_ptr_in(in);
+%char_ptr_in(varin);
+%char_ptr_in(directorout);
+
+%define %char_ptr_out(how) 
+%typemap(how) 
+    char *, signed char *, unsigned char *, 
+    const char *, const signed char *, const unsigned char * {
+    $result = caml_val_string((char *)$1);
+}
+/* I'd like to use the length here but can't because it might be empty */
+%typemap(how)
+    char [ANY], signed char [ANY], unsigned char [ANY],
+    const char [ANY], const signed char [ANY], const unsigned char [ANY] {
+    $result = caml_val_string((char *)$1);
+}
+%enddef
+
+%char_ptr_out(out);
+%char_ptr_out(varout);
+%char_ptr_out(directorin);
+
+%define %swigtype_ptr_in(how)
+%typemap(how) SWIGTYPE * {
+    $1 = ($ltype)caml_ptr_val($input,$1_descriptor);
+}
+%typemap(how) SWIGTYPE (CLASS::*) {
+    void *v = caml_ptr_val($input,$1_descriptor);
+    memcpy(& $1, &v, sizeof(v));
+}
+%enddef
+
+%typemap(out) SWIGTYPE * {
+    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor);
+}
+
+%define %swigtype_ptr_out(how)
+%typemap(how) SWIGTYPE (CLASS::*) {
+    void *v;
+    memcpy(&v,& $1, sizeof(void *));
+    $result = caml_val_ptr (v,$1_descriptor);
+}
+%enddef
+
+%swigtype_ptr_in(in);
+%swigtype_ptr_in(varin);
+%swigtype_ptr_in(directorout);
+%swigtype_ptr_out(out);
+%swigtype_ptr_out(varout);
+%swigtype_ptr_out(directorin);
+
+%define %swigtype_array_fail(how,msg)
+%typemap(how) SWIGTYPE [] {
+    caml_failwith(msg);
+}
+%enddef
+
+%swigtype_array_fail(in,"Array arguments for arbitrary types need a typemap");
+%swigtype_array_fail(varin,"Assignment to global arrays for arbitrary types need a typemap");
+%swigtype_array_fail(out,"Array arguments for arbitrary types need a typemap");
+%swigtype_array_fail(varout,"Array variables need a typemap");
+%swigtype_array_fail(directorin,"Array results with arbitrary types need a typemap");
+%swigtype_array_fail(directorout,"Array arguments with arbitrary types need a typemap");
+
+/* C++ References */
+
+/* Enums */
+%define %swig_enum_in(how)
+%typemap(how) enum SWIGTYPE {
+    $1 = ($type)caml_long_val_full($input,"$type_marker");
+}
+%enddef
+
+%define %swig_enum_out(how)
+%typemap(how) enum SWIGTYPE {
+    $result = caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"),*caml_named_value("$type_marker"),Val_int((int)$1));
+}
+%enddef
+
+%swig_enum_in(in)
+%swig_enum_in(varin)
+%swig_enum_in(directorout)
+%swig_enum_out(out)
+%swig_enum_out(varout)
+%swig_enum_out(directorin)
+
+%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) {
+    $1 = ($1_ltype) caml_string_val($input);
+    $2 = ($2_ltype) caml_string_len($input);
+}
+
+%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC {
+    swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **)&$1);
+    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, ty);
+}
+
+/* Array reference typemaps */
+%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) }
+%apply SWIGTYPE && { SWIGTYPE ((&)[ANY]) }
+
+/* const pointers */
+%apply SWIGTYPE * { SWIGTYPE *const }
+%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
+%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
 
diff --git a/Lib/ocaml/ocamlrun.swg b/Lib/ocaml/ocamlrun.swg
new file mode 100644
index 0000000..5a923c5
--- /dev/null
+++ b/Lib/ocaml/ocamlrun.swg
@@ -0,0 +1,607 @@
+/* -*-c-*- */
+
+/* SWIG pointer structure */
+
+#include <string.h>
+#include <assert.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define C_bool 0
+#define C_char 1
+#define C_uchar 2
+#define C_short 3
+#define C_ushort 4
+#define C_int 5
+#define C_uint 6
+#define C_int32 7
+#define C_int64 8
+#define C_float 9
+#define C_double 10
+#define C_ptr 11
+#define C_array 12
+#define C_list 13
+#define C_obj 14
+#define C_string 15
+#define C_enum 16
+#define C_director_core 17
+
+
+/* Cast a pointer if possible; returns 1 if successful */
+    
+    SWIGINTERN int
+    SWIG_Cast (void *source, swig_type_info *source_type,
+	       void **ptr, swig_type_info *dest_type)
+    {
+	if( !source ) { /* Special case for NULL.  This is a popular question
+	     for other modules on the list, so I want an easy way out... */
+	    *ptr = 0;
+	    return 0;
+	}
+
+#ifdef TYPE_CAST_VERBOSE
+	fprintf( stderr, "Trying to cast %s to %s\n", 
+		 source_type ? source_type->str : "<none>",
+		 dest_type ? dest_type->str : "<none>" );
+#endif
+	if (dest_type != source_type) {
+	    /* We have a type mismatch.  Will have to look through our type
+	       mapping table to figure out whether or not we can accept this
+	       datatype. 
+	       --
+	       Ignore typechecks for void *.  Allow any conversion. */
+	    if( !dest_type || !source_type || 
+		!strcmp(dest_type->name,"_p_void") ||
+		!strcmp(source_type->name,"_p_void") ) {
+		*ptr = source;
+		return 0;
+	    } else {
+		swig_cast_info *tc = 
+		    SWIG_TypeCheckStruct(source_type, dest_type );
+#ifdef TYPE_CAST_VERBOSE
+		fprintf( stderr, "Typecheck -> %s\n",
+			 tc ? tc->type->str : "<none>" );
+#endif
+		if( tc ) {
+		    int newmemory = 0;
+		    *ptr = SWIG_TypeCast(tc, source, &newmemory);
+		    assert(!newmemory); /* newmemory handling not yet implemented */
+		    return 0;
+		} else
+		    return -1;
+	    }
+	} else {
+	    *ptr = source;
+	    return 0;
+	}
+    }
+
+/* Return 0 if successful. */
+    SWIGINTERN int
+    SWIG_GetPtr(void *inptr, void **outptr, 
+		swig_type_info *intype, swig_type_info *outtype) {
+	if (intype) {
+	    return SWIG_Cast(inptr, intype,
+			     outptr, outtype) == -1;
+	} else {
+	    *outptr = inptr;
+	    return 0;
+	}
+    }
+
+    SWIGINTERN void caml_print_list( CAML_VALUE v );
+
+    SWIGINTERN void caml_print_val( CAML_VALUE v ) {
+	switch( SWIG_Tag_val(v) ) {
+	case C_bool:
+	    if( Bool_val(SWIG_Field(v,0)) ) fprintf( stderr, "true " );
+	    else fprintf( stderr, "false " );
+	    break;
+	case C_char:
+	case C_uchar:
+	    fprintf( stderr, "'%c' (\\%03d) ", 
+		     (Int_val(SWIG_Field(v,0)) >= ' ' &&
+		      Int_val(SWIG_Field(v,0)) < 127) ? Int_val(SWIG_Field(v,0)) : '.',
+		     Int_val(SWIG_Field(v,0)) );
+	    break;
+	case C_short:
+	case C_ushort:
+	case C_int:
+	    fprintf( stderr, "%d ", (int)caml_long_val(v) );
+	    break;
+
+	case C_uint:
+	case C_int32:
+	    fprintf( stderr, "%ud ", (unsigned int)caml_long_val(v) );
+	    break;
+	case C_int64:
+	    fprintf( stderr, "%ld ", caml_long_val(v) );
+	    break;
+	case C_float:
+	case C_double:
+	    fprintf( stderr, "%f ", caml_double_val(v) );
+	    break;
+
+	case C_ptr:
+	{
+	    void *vout = 0;
+	    swig_type_info *ty = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1));
+	    caml_ptr_val_internal(v,&vout,0);
+	    fprintf( stderr, "PTR(%p,%s) ", 
+		     vout,
+		     ty ? ty->name : "(null)" );
+	}
+	break;
+	case C_array:
+	{
+	    unsigned int i;
+	    for( i = 0; i < Wosize_val( SWIG_Field(v,0) ); i++ ) 
+		caml_print_val( SWIG_Field(SWIG_Field(v,0),i) );
+	}
+	break;
+	case C_list:
+	    caml_print_list( SWIG_Field(v,0) );
+	    break;
+	case C_obj:
+	    fprintf( stderr, "OBJ(%p) ", (void *)SWIG_Field(v,0) );
+	    break;
+	case C_string:
+	{
+	    void *cout;
+	    caml_ptr_val_internal(v,&cout,0);
+	    fprintf( stderr, "'%s' ", (char *)cout );
+	} 
+	break;
+	}
+    }
+
+    SWIGINTERN void caml_print_list( CAML_VALUE v ) {
+	CAMLparam1(v);
+	while( v && Is_block(v) ) {
+	    fprintf( stderr, "[ " );
+	    caml_print_val( SWIG_Field(v,0) );
+	    fprintf( stderr, "]\n" );
+	    v = SWIG_Field(v,1);
+	}
+	CAMLreturn0;
+    }
+
+    SWIGINTERN CAML_VALUE caml_list_nth( CAML_VALUE lst, int n ) {
+	CAMLparam1(lst);
+	int i = 0;
+	while( i < n && lst && Is_block(lst) ) {
+	    i++; lst = SWIG_Field(lst,1);
+	}
+	if( lst == Val_unit ) CAMLreturn(Val_unit);
+	else CAMLreturn(SWIG_Field(lst,0));
+    }
+    
+    SWIGINTERN CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt ) {
+	CAMLparam2(lst,elt);
+	SWIG_CAMLlocal3(v,vt,lh);
+	lh = Val_unit;
+	v = Val_unit;
+
+	/* Appending C_void should have no effect */
+	if( !Is_block(elt) ) return lst;
+
+	while( lst && Is_block(lst) ) {
+	    if( v && v != Val_unit ) {
+		vt = caml_alloc_tuple(2);
+		SWIG_Store_field(v,1,vt);
+		v = vt;
+	    } else {
+		v = lh = caml_alloc_tuple(2);
+	    }
+	    SWIG_Store_field(v,0,SWIG_Field(lst,0));
+	    lst = SWIG_Field(lst,1);
+	}
+
+	if( v && Is_block(v) ) {
+	    vt = caml_alloc_tuple(2);
+	    SWIG_Store_field(v,1,vt);
+	    v = vt;
+	} else {
+	    v = lh = caml_alloc_tuple(2);
+	}
+	SWIG_Store_field(v,0,elt);
+	SWIG_Store_field(v,1,Val_unit);
+
+	CAMLreturn(lh);
+    }
+
+    SWIGINTERN int caml_list_length( CAML_VALUE lst ) {
+	CAMLparam1(lst);
+	int i = 0;
+	while( lst && Is_block(lst) ) { i++; lst = SWIG_Field(lst,1); }
+	CAMLreturn(i);
+    }
+
+    SWIGINTERN void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item ) {
+	CAMLparam2(arr,item);
+	SWIG_Store_field(SWIG_Field(arr,0),n,item);
+	CAMLreturn0;
+    }
+
+    SWIGINTERN value caml_array_nth( CAML_VALUE arr, int n ) {
+	CAMLparam1(arr);
+	if( SWIG_Tag_val(arr) == C_array )
+	    CAMLreturn(SWIG_Field(SWIG_Field(arr,0),n));
+	else if( SWIG_Tag_val(arr) == C_list )
+	    CAMLreturn(caml_list_nth(arr,0));
+	else
+	    caml_failwith("Need array or list");
+    }
+
+    SWIGINTERN int caml_array_len( CAML_VALUE arr ) {
+	CAMLparam1(arr);
+	if( SWIG_Tag_val(arr) == C_array )
+	    CAMLreturn(Wosize_val(SWIG_Field(arr,0)));
+	else if( SWIG_Tag_val(arr) == C_list )
+	    CAMLreturn(caml_list_length(arr));
+	else
+	    caml_failwith("Need array or list");
+    }
+
+    SWIGINTERN CAML_VALUE caml_swig_alloc(int x,int y) {
+	return caml_alloc(x,y);
+    }
+
+    SWIGINTERN value caml_array_new( int n ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(vv);
+	vv = caml_swig_alloc(1,C_array);
+	SWIG_Store_field(vv,0,caml_alloc_tuple(n));
+	CAMLreturn(vv);
+    }
+    
+    SWIGINTERN CAML_VALUE caml_val_bool( int b ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(bv);
+	bv = caml_swig_alloc(1,C_bool);
+	SWIG_Store_field(bv,0,Val_bool(b));
+	CAMLreturn(bv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_char( char c ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(cv);
+	cv = caml_swig_alloc(1,C_char);
+	SWIG_Store_field(cv,0,Val_int(c));
+	CAMLreturn(cv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_uchar( unsigned char uc ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(ucv);
+	ucv = caml_swig_alloc(1,C_uchar);
+	SWIG_Store_field(ucv,0,Val_int(uc));
+	CAMLreturn(ucv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_short( short s ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(sv);
+	sv = caml_swig_alloc(1,C_short);
+	SWIG_Store_field(sv,0,Val_int(s));
+	CAMLreturn(sv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_ushort( unsigned short us ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(usv);
+	usv = caml_swig_alloc(1,C_ushort);
+	SWIG_Store_field(usv,0,Val_int(us));
+	CAMLreturn(usv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_int( int i ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(iv);
+	iv = caml_swig_alloc(1,C_int);
+	SWIG_Store_field(iv,0,Val_int(i));
+	CAMLreturn(iv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_uint( unsigned int ui ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(uiv);
+	uiv = caml_swig_alloc(1,C_int);
+	SWIG_Store_field(uiv,0,Val_int(ui));
+	CAMLreturn(uiv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_long( long l ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(lv);
+	lv = caml_swig_alloc(1,C_int64);
+	SWIG_Store_field(lv,0,caml_copy_int64(l));
+	CAMLreturn(lv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_ulong( unsigned long ul ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(ulv);
+	ulv = caml_swig_alloc(1,C_int64);
+	SWIG_Store_field(ulv,0,caml_copy_int64(ul));
+	CAMLreturn(ulv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_float( float f ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(fv);
+	fv = caml_swig_alloc(1,C_float);
+	SWIG_Store_field(fv,0,caml_copy_double((double)f));
+	CAMLreturn(fv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_double( double d ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(fv);
+	fv = caml_swig_alloc(1,C_double);
+	SWIG_Store_field(fv,0,caml_copy_double(d));
+	CAMLreturn(fv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_ptr( void *p, swig_type_info *info ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(vv);
+	vv = caml_swig_alloc(2,C_ptr);
+	SWIG_Store_field(vv,0,caml_copy_int64((long)p));
+	SWIG_Store_field(vv,1,caml_copy_int64((long)info));
+	CAMLreturn(vv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_string( const char *p ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(vv);
+	if( !p ) CAMLreturn(caml_val_ptr( (void *)p, 0 ));
+	vv = caml_swig_alloc(1,C_string);
+	SWIG_Store_field(vv,0,caml_copy_string(p));
+	CAMLreturn(vv);
+    }
+
+    SWIGINTERN CAML_VALUE caml_val_string_len( const char *p, int len ) {
+	CAMLparam0();
+	SWIG_CAMLlocal1(vv);
+	if( !p || len < 0 ) CAMLreturn(caml_val_ptr( (void *)p, 0 ));
+	vv = caml_swig_alloc(1,C_string);
+	SWIG_Store_field(vv,0,caml_alloc_string(len));
+	memcpy(String_val(SWIG_Field(vv,0)),p,len);
+	CAMLreturn(vv);
+    }
+
+    #define caml_val_obj(v, name) caml_val_obj_helper(v, SWIG_TypeQuery((name)), name)
+    SWIGINTERN CAML_VALUE caml_val_obj_helper( void *v, swig_type_info *type, char *name) {
+	CAMLparam0();
+	CAMLreturn(caml_callback2(*caml_named_value("caml_create_object_fn"),
+			     caml_val_ptr(v,type),
+			     caml_copy_string(name)));
+    }
+
+    SWIGINTERN long caml_long_val_full( CAML_VALUE v, const char *name ) {
+	CAMLparam1(v);
+	if( !Is_block(v) ) return 0;
+
+	switch( SWIG_Tag_val(v) ) {
+	case C_bool:
+	case C_char:
+	case C_uchar:
+	case C_short:
+	case C_ushort:
+	case C_int:
+	    CAMLreturn(Int_val(SWIG_Field(v,0)));
+	case C_uint:
+	case C_int32:
+	    CAMLreturn(Int32_val(SWIG_Field(v,0)));
+	case C_int64:
+	    CAMLreturn((long)SWIG_Int64_val(SWIG_Field(v,0)));
+	case C_float:
+	case C_double:
+	    CAMLreturn((long)Double_val(SWIG_Field(v,0)));
+	case C_string:
+	    CAMLreturn((long)String_val(SWIG_Field(v,0)));
+	case C_ptr:
+	    CAMLreturn((long)SWIG_Int64_val(SWIG_Field(SWIG_Field(v,0),0)));
+	case C_enum: {
+	    SWIG_CAMLlocal1(ret);
+	    const CAML_VALUE *enum_to_int = caml_named_value(SWIG_MODULE "_enum_to_int");
+	    if( !name ) caml_failwith( "Not an enum conversion" );
+	    ret = caml_callback2(*enum_to_int,*caml_named_value(name),v);
+	    CAMLreturn(caml_long_val(ret));
+	}
+	default:
+	    caml_failwith("No conversion to int");
+	}
+    }
+
+    SWIGINTERN long caml_long_val( CAML_VALUE v ) {
+	return caml_long_val_full(v,0);
+    }
+
+    SWIGINTERN double caml_double_val( CAML_VALUE v ) {
+	CAMLparam1(v);
+	if( !Is_block(v) ) return 0.0;
+	switch( SWIG_Tag_val(v) ) {
+	case C_bool:
+	case C_char:
+	case C_uchar:
+	case C_short:
+	case C_ushort:
+	case C_int:
+	    CAMLreturn_type(Int_val(SWIG_Field(v,0)));
+	case C_uint:
+	case C_int32:
+	    CAMLreturn_type(Int32_val(SWIG_Field(v,0)));
+	case C_int64:
+	    CAMLreturn_type(SWIG_Int64_val(SWIG_Field(v,0)));
+	case C_float:
+	case C_double:
+	    CAMLreturn_type(Double_val(SWIG_Field(v,0)));
+	default:
+	    fprintf( stderr, "Unknown block tag %d\n", SWIG_Tag_val(v) );
+	    caml_failwith("No conversion to double");
+	}
+    }
+
+    SWIGINTERN int caml_ptr_val_internal( CAML_VALUE v, void **out,
+					  swig_type_info *descriptor ) {
+	CAMLparam1(v);
+	void *outptr = NULL;
+        swig_type_info *outdescr = NULL;
+        static const CAML_VALUE *func_val = NULL;
+
+	if( v == Val_unit ) {
+	    *out = 0;
+	    CAMLreturn_type(0);
+	}
+	if( !Is_block(v) ) return -1;
+	switch( SWIG_Tag_val(v) ) {
+	case C_obj:
+	    if (!func_val) {
+	        func_val = caml_named_value("caml_obj_ptr");
+	    }
+	    CAMLreturn_type(caml_ptr_val_internal(caml_callback(*func_val, v), out, descriptor));
+	case C_string:
+	    outptr = (void *)String_val(SWIG_Field(v,0));
+	    break;
+	case C_ptr:
+	    outptr = (void *)(long)SWIG_Int64_val(SWIG_Field(v,0));
+            outdescr = (swig_type_info *)(long)SWIG_Int64_val(SWIG_Field(v,1));
+	    break;
+	default:
+	    *out = 0;
+	    CAMLreturn_type(1);
+	    break;
+	}
+
+	CAMLreturn_type(SWIG_GetPtr(outptr, out, outdescr, descriptor));
+    }
+
+    SWIGINTERN void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor ) {
+        CAMLparam0();
+#ifdef TYPE_CAST_VERBOSE
+	caml_print_val( v );
+#endif
+	void *out = NULL;
+	if( !caml_ptr_val_internal( v, &out, descriptor ) )
+	    CAMLreturn_type(out);
+	else
+	    caml_failwith( "No appropriate conversion found." );
+    }
+
+    SWIGINTERN char *caml_string_val( CAML_VALUE v ) {
+	return (char *)caml_ptr_val( v, 0 );
+    }
+
+    SWIGINTERN int caml_string_len( CAML_VALUE v ) {
+	switch( SWIG_Tag_val(v) ) {
+	case C_string:
+	    return caml_string_length(SWIG_Field(v,0));
+	default:
+	    return strlen((char *)caml_ptr_val(v,0));
+	}
+    }
+
+    SWIGINTERN int caml_bool_check( CAML_VALUE v ) {
+	CAMLparam1(v);
+	
+	if( !Is_block(v) ) return 0;
+	
+	switch( SWIG_Tag_val(v) ) {
+	case C_bool:
+	case C_ptr:
+	case C_string:
+	    CAMLreturn(1);
+	default:
+	    CAMLreturn(0);
+	}
+    }
+
+    SWIGINTERN int caml_int_check( CAML_VALUE v ) {
+	CAMLparam1(v);
+	
+	if( !Is_block(v) ) return 0;
+	
+	switch( SWIG_Tag_val(v) ) {
+	case C_char:
+	case C_uchar:
+	case C_short:
+	case C_ushort:
+	case C_int:
+	case C_uint:
+	case C_int32:
+	case C_int64:
+	    CAMLreturn(1);
+
+	default:
+	    CAMLreturn(0);
+	}
+    }
+
+    SWIGINTERN int caml_float_check( CAML_VALUE v ) {
+	CAMLparam1(v);
+	if( !Is_block(v) ) return 0;
+
+	switch( SWIG_Tag_val(v) ) {
+	case C_float:
+	case C_double:
+	    CAMLreturn(1);
+
+	default:
+	    CAMLreturn(0);
+	}	
+    }
+
+    SWIGINTERN int caml_ptr_check( CAML_VALUE v ) {
+	CAMLparam1(v);
+	if( !Is_block(v) ) return 0;
+
+	switch( SWIG_Tag_val(v) ) {
+	case C_string:
+	case C_ptr:
+	case C_int64:
+	    CAMLreturn(1);
+
+	default:
+	    CAMLreturn(0);
+	}	
+    }
+
+    SWIGINTERN CAML_VALUE SWIG_Ocaml_ptr_to_val(const char *name, void *ptr, swig_type_info *descriptor) {
+        CAMLparam0();
+        SWIG_CAMLlocal1(result);
+
+        const CAML_VALUE *fromval = caml_named_value(name);
+        if (fromval) {
+            result = caml_callback(*fromval, caml_val_ptr(ptr, descriptor));
+        } else {
+            result = caml_val_ptr(ptr, descriptor);
+        }
+        CAMLreturn(result);
+    }
+
+    static swig_module_info *SWIG_Ocaml_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
+      CAML_VALUE pointer;
+
+      pointer = caml_callback(*caml_named_value("swig_find_type_info"), caml_val_int(0));
+      if (Is_block(pointer) && SWIG_Tag_val(pointer) == C_ptr) {
+        return (swig_module_info *)(void *)(long)SWIG_Int64_val(SWIG_Field(pointer,0));
+      }
+      return 0;
+    }
+
+    static void SWIG_Ocaml_SetModule(swig_module_info *pointer) {
+      CAML_VALUE mod_pointer;
+
+      mod_pointer = caml_val_ptr(pointer, NULL);
+      caml_callback(*caml_named_value("swig_set_type_info"), mod_pointer);
+    }
+
+#ifdef __cplusplus
+}
+#endif
+#undef value
+
diff --git a/Lib/ocaml/ocamldec.swg b/Lib/ocaml/ocamlrundec.swg
similarity index 99%
rename from Lib/ocaml/ocamldec.swg
rename to Lib/ocaml/ocamlrundec.swg
index 0c2faf7..555f9a4 100644
--- a/Lib/ocaml/ocamldec.swg
+++ b/Lib/ocaml/ocamlrundec.swg
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * ocamldec.swg
+ * ocamlrundec.swg
  *
  * Ocaml runtime code -- declarations
  * ----------------------------------------------------------------------------- */
diff --git a/Lib/ocaml/typemaps.i b/Lib/ocaml/typemaps.i
index 23e2955..39231e2 100644
--- a/Lib/ocaml/typemaps.i
+++ b/Lib/ocaml/typemaps.i
@@ -1,321 +1,44 @@
-/* -----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
  * typemaps.i
  *
- * The Ocaml module handles all types uniformly via typemaps. Here
- * are the definitions.
- * ----------------------------------------------------------------------------- */
+ * These typemaps provide support for input/output arguments for C/C++ pointers
+ * and C++ references.
+* ---------------------------------------------------------------------------- */
 
-/* Pointers */
-
-%typemap(in) void ""
-
-%typemap(out) void "$result = Val_int(0);"
-
-%typemap(in) void * {
-    $1 = caml_ptr_val($input,$descriptor);
-}
-
-%typemap(varin) void * {
-    $1 = ($ltype)caml_ptr_val($input,$descriptor);
-}
-
-%typemap(out) void * {
-    $result = caml_val_ptr($1,$descriptor);
-}
-
-%typemap(varout) void * {
-    $result = caml_val_ptr($1,$descriptor);
-}
-
-%typemap(in) char *& (char *temp) {
-  temp = (char*)caml_val_ptr($1,$descriptor);
+%define INPUT_OUTPUT_INOUT_TYPEMAPS(type, c_to_ocaml, ocaml_to_c)
+%typemap(in) type *INPUT(type temp), type &INPUT(type temp) {
+  temp = (type)ocaml_to_c($input);
   $1 = &temp;
 }
+%typemap(typecheck) type *INPUT = type;
+%typemap(typecheck) type &INPUT = type;
 
-%typemap(argout) char *& {
-  swig_result =	caml_list_append(swig_result,caml_val_string_len(*$1, strlen(*$1)));
+%typemap(in, numinputs=0) type *OUTPUT($*1_ltype temp), type &OUTPUT($*1_ltype temp) "$1 = &temp;"
+%typemap(argout) type *OUTPUT, type &OUTPUT {
+  swig_result = caml_list_append(swig_result, c_to_ocaml(*$1));
 }
+%typemap(in) type *INOUT = type *INPUT;
+%typemap(in) type &INOUT = type &INPUT;
 
-%typemap(in) SWIGTYPE & {
-    $1 = ($ltype) caml_ptr_val($input,$1_descriptor);
-}
+%typemap(argout) type *INOUT = type *OUTPUT;
+%typemap(argout) type &INOUT = type &OUTPUT;
 
-%typemap(in) SWIGTYPE && {
-    $1 = ($ltype) caml_ptr_val($input,$1_descriptor);
-}
-
-%typemap(varin) SWIGTYPE & {
-    $1 = *(($ltype) caml_ptr_val($input,$1_descriptor));
-}
-
-%typemap(varin) SWIGTYPE && {
-    $1 = *(($ltype) caml_ptr_val($input,$1_descriptor));
-}
-
-%typemap(varout) SWIGTYPE &, SWIGTYPE && {
-    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)&$1, $1_descriptor);
-}
-
-%typemap(out) SWIGTYPE &, SWIGTYPE && {
-    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor);
-}
-
-#if 0
-%typemap(argout) SWIGTYPE & {
-    CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr");
-    if( fromval ) {
-	swig_result =
-	    caml_list_append(swig_result,
-			     caml_callback(*fromval,caml_val_ptr((void *) $1,
-							    $1_descriptor)));
-    } else {
-	swig_result =
-	    caml_list_append(swig_result,
-			     caml_val_ptr ((void *) $1,$1_descriptor));
-    }
-}
-%typemap(argout) SWIGTYPE && {
-    CAML_VALUE *fromval = caml_named_value("create_$ntype_from_ptr");
-    if( fromval ) {
-	swig_result =
-	    caml_list_append(swig_result,
-			     caml_callback(*fromval,caml_val_ptr((void *) $1,
-							    $1_descriptor)));
-    } else {
-	swig_result =
-	    caml_list_append(swig_result,
-			     caml_val_ptr ((void *) $1,$1_descriptor));
-    }
-}
-#endif
-
-%typemap(in) SWIGTYPE {
-    $1 = *(($&1_ltype) caml_ptr_val($input,$&1_descriptor)) ;
-}
-
-#ifdef __cplusplus
-
-%typemap(out) SWIGTYPE {
-    $&1_ltype temp = new $ltype((const $1_ltype &) $1);
-    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)temp, $&1_descriptor);
-}
-
-#else
-
-%typemap(out) SWIGTYPE {
-    void *temp = calloc(1,sizeof($ltype));
-    memmove(temp, &$1, sizeof($1_type));
-    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", temp, $&1_descriptor);
-}
-
-#endif
-
-%typemap(directorin) SWIGTYPE {
-    $&ltype temp = new $ltype((const $ltype &)$1);
-    swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)temp, $&1_descriptor);
-    args = caml_list_append(args, swig_result);
-}
-
-%typemap(directorin) SWIGTYPE *, SWIGTYPE [], SWIGTYPE &, SWIGTYPE && {
-    swig_result = SWIG_Ocaml_ptr_to_val("create_$ltype_from_ptr", (void *)&$1, $&1_descriptor);
-    args = caml_list_append(args, swig_result);
-}
-
-/* The SIMPLE_MAP macro below defines the whole set of typemaps needed
-   for simple types. */
-
-%define SIMPLE_MAP(C_NAME, C_TO_OCAML, OCAML_TO_C)
-/* In */
-%typemap(in) C_NAME {
-    $1 = OCAML_TO_C($input);
-}
-%typemap(varin) C_NAME {
-    $1 = OCAML_TO_C($input);
-}
-%typemap(in) const C_NAME & ($*1_ltype temp) {
-    temp = ($*1_ltype) OCAML_TO_C($input);
-    $1 = &temp;
-}
-%typemap(varin) const C_NAME & {
-    $1 = OCAML_TO_C($input);
-}
-%typemap(directorout) C_NAME {
-    $1 = OCAML_TO_C($input);
-}
-%typemap(in) C_NAME *INPUT ($*1_ltype temp) {
-    temp = ($*1_ltype) OCAML_TO_C($input);
-    $1 = &temp;
-}
-%typemap(in,numinputs=0) C_NAME *OUTPUT ($*1_ltype temp) {
-    $1 = &temp;
-}
-/* Out */
-%typemap(out) C_NAME {
-    $result = C_TO_OCAML($1);
-}
-%typemap(varout) C_NAME {
-    $result = C_TO_OCAML($1);
-}
-%typemap(varout) const C_NAME & {
-    $result = C_TO_OCAML($1);
-}
-%typemap(argout) C_NAME *OUTPUT {
-    swig_result = caml_list_append(swig_result, C_TO_OCAML((long)*$1));
-}
-%typemap(out) const C_NAME & {
-    $result = C_TO_OCAML(*$1);
-}
-%typemap(directorin) C_NAME {
-    args = caml_list_append(args, C_TO_OCAML($1));
-}
+%typemap(typecheck) type *INOUT = type;
+%typemap(typecheck) type &INOUT = type;
 %enddef
 
-SIMPLE_MAP(bool, caml_val_bool, caml_long_val);
-SIMPLE_MAP(char, caml_val_char, caml_long_val);
-SIMPLE_MAP(signed char, caml_val_char, caml_long_val);
-SIMPLE_MAP(unsigned char, caml_val_uchar, caml_long_val);
-SIMPLE_MAP(int, caml_val_int, caml_long_val);
-SIMPLE_MAP(short, caml_val_short, caml_long_val);
-SIMPLE_MAP(wchar_t, caml_val_short, caml_long_val);
-SIMPLE_MAP(long, caml_val_long, caml_long_val);
-SIMPLE_MAP(ptrdiff_t, caml_val_int, caml_long_val);
-SIMPLE_MAP(unsigned int, caml_val_uint, caml_long_val);
-SIMPLE_MAP(unsigned short, caml_val_ushort, caml_long_val);
-SIMPLE_MAP(unsigned long, caml_val_ulong, caml_long_val);
-SIMPLE_MAP(size_t, caml_val_int, caml_long_val);
-SIMPLE_MAP(float, caml_val_float, caml_double_val);
-SIMPLE_MAP(double, caml_val_double, caml_double_val);
-SIMPLE_MAP(long long,caml_val_ulong,caml_long_val);
-SIMPLE_MAP(unsigned long long,caml_val_ulong,caml_long_val);
-
-/* Void */
-
-%typemap(out) void "$result = Val_unit;";
-
-/* Pass through value */
-
-%typemap (in) CAML_VALUE "$1=$input;";
-%typemap (out) CAML_VALUE "$result=$1;";
-
-#if 0
-%include <carray.i>
-#endif
-
-/* Handle char arrays as strings */
-
-%define %char_ptr_in(how)
-%typemap(how)  char *, signed char *, unsigned char * {
-    $1 = ($ltype)caml_string_val($input);
-}
-/* Again work around the empty array bound bug */
-%typemap(how) char [ANY], signed char [ANY], unsigned char [ANY] {
-    char *temp = caml_string_val($input);
-    strcpy((char *)$1,temp); 
-}
-%enddef
-
-%char_ptr_in(in);
-%char_ptr_in(varin);
-%char_ptr_in(directorout);
-
-%define %char_ptr_out(how) 
-%typemap(how) 
-    char *, signed char *, unsigned char *, 
-    const char *, const signed char *, const unsigned char * {
-    $result = caml_val_string((char *)$1);
-}
-/* I'd like to use the length here but can't because it might be empty */
-%typemap(how)
-    char [ANY], signed char [ANY], unsigned char [ANY],
-    const char [ANY], const signed char [ANY], const unsigned char [ANY] {
-    $result = caml_val_string((char *)$1);
-}
-%enddef
-
-%char_ptr_out(out);
-%char_ptr_out(varout);
-%char_ptr_out(directorin);
-
-%define %swigtype_ptr_in(how)
-%typemap(how) SWIGTYPE * {
-    $1 = ($ltype)caml_ptr_val($input,$1_descriptor);
-}
-%typemap(how) SWIGTYPE (CLASS::*) {
-    void *v = caml_ptr_val($input,$1_descriptor);
-    memcpy(& $1, &v, sizeof(v));
-}
-%enddef
-
-%typemap(out) SWIGTYPE * {
-    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, $1_descriptor);
-}
-
-%define %swigtype_ptr_out(how)
-%typemap(how) SWIGTYPE (CLASS::*) {
-    void *v;
-    memcpy(&v,& $1, sizeof(void *));
-    $result = caml_val_ptr (v,$1_descriptor);
-}
-%enddef
-
-%swigtype_ptr_in(in);
-%swigtype_ptr_in(varin);
-%swigtype_ptr_in(directorout);
-%swigtype_ptr_out(out);
-%swigtype_ptr_out(varout);
-%swigtype_ptr_out(directorin);
-
-%define %swigtype_array_fail(how,msg)
-%typemap(how) SWIGTYPE [] {
-    caml_failwith(msg);
-}
-%enddef
-
-%swigtype_array_fail(in,"Array arguments for arbitrary types need a typemap");
-%swigtype_array_fail(varin,"Assignment to global arrays for arbitrary types need a typemap");
-%swigtype_array_fail(out,"Array arguments for arbitrary types need a typemap");
-%swigtype_array_fail(varout,"Array variables need a typemap");
-%swigtype_array_fail(directorin,"Array results with arbitrary types need a typemap");
-%swigtype_array_fail(directorout,"Array arguments with arbitrary types need a typemap");
-
-/* C++ References */
-
-/* Enums */
-%define %swig_enum_in(how)
-%typemap(how) enum SWIGTYPE {
-    $1 = ($type)caml_long_val_full($input,"$type_marker");
-}
-%enddef
-
-%define %swig_enum_out(how)
-%typemap(how) enum SWIGTYPE {
-    $result = caml_callback2(*caml_named_value(SWIG_MODULE "_int_to_enum"),*caml_named_value("$type_marker"),Val_int((int)$1));
-}
-%enddef
-
-%swig_enum_in(in)
-%swig_enum_in(varin)
-%swig_enum_in(directorout)
-%swig_enum_out(out)
-%swig_enum_out(varout)
-%swig_enum_out(directorin)
-
-%typemap(in) (char *STRING, int LENGTH), (char *STRING, size_t LENGTH) {
-    $1 = ($1_ltype) caml_string_val($input);
-    $2 = ($2_ltype) caml_string_len($input);
-}
-
-%typemap(out) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC {
-    swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **)&$1);
-    $result = SWIG_Ocaml_ptr_to_val("create_$ntype_from_ptr", (void *)$1, ty);
-}
-
-/* Array reference typemaps */
-%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) }
-%apply SWIGTYPE && { SWIGTYPE ((&)[ANY]) }
-
-/* const pointers */
-%apply SWIGTYPE * { SWIGTYPE *const }
-%apply SWIGTYPE (CLASS::*) { SWIGTYPE (CLASS::*const) }
-%apply SWIGTYPE & { SWIGTYPE (CLASS::*const&) }
-
+INPUT_OUTPUT_INOUT_TYPEMAPS(bool, caml_val_bool, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(int, caml_val_int, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(long, caml_val_long, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(short, caml_val_int, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(char, caml_val_char, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(signed char, caml_val_char, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(float, caml_val_float, caml_double_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(double, caml_val_double, caml_double_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned int, caml_val_uint, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned long, caml_val_ulong, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned short, caml_val_ushort, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned char, caml_val_uchar, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(long long, caml_val_long, caml_long_val);
+INPUT_OUTPUT_INOUT_TYPEMAPS(unsigned long long, caml_val_ulong, caml_long_val);
+#undef INPUT_OUTPUT_INOUT_TYPEMAPS
diff --git a/Lib/octave/octcontainer.swg b/Lib/octave/octcontainer.swg
index 269ff75..310a849 100644
--- a/Lib/octave/octcontainer.swg
+++ b/Lib/octave/octcontainer.swg
@@ -401,20 +401,14 @@
       return const_reference(_seq, n);
     }
 
-    bool check(bool set_err = true) const
+    bool check() const
     {
       int s = size();
       for (int i = 0; i < s; ++i) {
 	//	swig::SwigVar_PyObject item = OctSequence_GetItem(_seq, i);
 	octave_value item; // * todo
-	if (!swig::check<value_type>(item)) {
-	  if (set_err) {
-	    char msg[1024];
-	    sprintf(msg, "in sequence element %d", i);
-	    SWIG_Error(SWIG_RuntimeError, msg);
-	  }
+	if (!swig::check<value_type>(item))
 	  return false;
-	}
       }
       return true;
     }
diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg
index ff614e6..325a4cc 100644
--- a/Lib/octave/octrun.swg
+++ b/Lib/octave/octrun.swg
@@ -507,10 +507,10 @@
 	delete this;
     }
 
-    long swig_this() const {
+    size_t swig_this() const {
       if (!types.size())
-	return (long) this;
-      return (long) types[0].second.ptr;
+	return (size_t) this;
+      return (size_t) types[0].second.ptr;
     }
     const char* help_text() const {
       if (!types.size())
diff --git a/Lib/python/builtin.swg b/Lib/python/builtin.swg
index 5062a8b..5308748 100644
--- a/Lib/python/builtin.swg
+++ b/Lib/python/builtin.swg
@@ -117,7 +117,7 @@
 
 SWIGINTERN void
 SwigPyStaticVar_dealloc(PyDescrObject *descr) {
-  _PyObject_GC_UNTRACK(descr);
+  PyObject_GC_UnTrack(descr);
   Py_XDECREF(PyDescr_TYPE(descr));
   Py_XDECREF(PyDescr_NAME(descr));
   PyObject_GC_Del(descr);
@@ -256,6 +256,12 @@
 #if PY_VERSION_HEX >= 0x03040000
       0,                                        /* tp_finalize */
 #endif
+#if PY_VERSION_HEX >= 0x03080000
+      0,                                        /* tp_vectorcall */
+#endif
+#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
+      0,                                        /* tp_print */
+#endif
 #ifdef COUNT_ALLOCS
       0,                                        /* tp_allocs */
       0,                                        /* tp_frees */
@@ -334,6 +340,12 @@
 #if PY_VERSION_HEX >= 0x03040000
       0,                                        /* tp_finalize */
 #endif
+#if PY_VERSION_HEX >= 0x03080000
+      0,                                        /* tp_vectorcall */
+#endif
+#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
+      0,                                        /* tp_print */
+#endif
 #ifdef COUNT_ALLOCS
       0,                                        /* tp_allocs */
       0,                                        /* tp_frees */
diff --git a/Lib/python/director.swg b/Lib/python/director.swg
index 4bdc94d..9694c62 100644
--- a/Lib/python/director.swg
+++ b/Lib/python/director.swg
@@ -199,46 +199,6 @@
     }
   };
 
-  /* unknown exception handler  */
-  class UnknownExceptionHandler {
-#ifdef SWIG_DIRECTOR_UEH
-    static void handler() {
-      try {
-        throw;
-      } catch (DirectorException& e) {
-        std::cerr << "SWIG Director exception caught:" << std::endl
-                  << e.what() << std::endl;
-      } catch (std::exception& e) {
-        std::cerr << "std::exception caught: "<< e.what() << std::endl;
-      } catch (...) {
-        std::cerr << "Unknown exception caught." << std::endl;
-      }
-
-      std::cerr << std::endl
-                << "Python interpreter traceback:" << std::endl;
-      PyErr_Print();
-      std::cerr << std::endl;
-
-      std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
-                << "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
-                << std::endl
-                << "Exception is being re-thrown, program will likely abort/terminate." << std::endl;
-      throw;
-    }
-
-  public:
-
-    std::unexpected_handler old;
-    UnknownExceptionHandler(std::unexpected_handler nh = handler) {
-      old = std::set_unexpected(nh);
-    }
-
-    ~UnknownExceptionHandler() {
-      std::set_unexpected(old);
-    }
-#endif
-  };
-
   /* type mismatch in the return value from a python method call */
   class DirectorTypeMismatchException : public DirectorException {
   public:
diff --git a/Lib/python/pycontainer.swg b/Lib/python/pycontainer.swg
index ef2f725..2ddf4c3 100644
--- a/Lib/python/pycontainer.swg
+++ b/Lib/python/pycontainer.swg
@@ -52,7 +52,7 @@
   struct container_owner {
     // By default, do not add the back-reference (for value types)
     // Specialization below will check the reference for pointer types.
-    static bool back_reference(PyObject* child, PyObject* owner) {
+    static bool back_reference(PyObject* /*child*/, PyObject* /*owner*/) {
       return false;
     }
   };
@@ -69,8 +69,7 @@
     static bool back_reference(PyObject* child, PyObject* owner) {
       SwigPyObject* swigThis = SWIG_Python_GetSwigThis(child);
       if (swigThis && (swigThis->own & SWIG_POINTER_OWN) != SWIG_POINTER_OWN) {
-        PyObject_SetAttr(child, container_owner_attribute(), owner);
-        return true;
+        return PyObject_SetAttr(child, container_owner_attribute(), owner) != -1;
       }
       return false;
     }
@@ -672,19 +671,13 @@
       return const_reference(_seq, n);
     }
 
-    bool check(bool set_err = true) const
+    bool check() const
     {
       Py_ssize_t s = size();
       for (Py_ssize_t i = 0; i < s; ++i) {
 	swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i);
-	if (!swig::check<value_type>(item)) {
-	  if (set_err) {
-	    char msg[1024];
-	    sprintf(msg, "in sequence element %d", (int)i);
-	    SWIG_Error(SWIG_RuntimeError, msg);
-	  }
+	if (!swig::check<value_type>(item))
 	  return false;
-	}
       }
       return true;
     }
diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg
index dfbf40b..a6d609d 100644
--- a/Lib/python/pyinit.swg
+++ b/Lib/python/pyinit.swg
@@ -186,6 +186,12 @@
 #if PY_VERSION_HEX >= 0x03040000
       0,                                  /* tp_finalize */
 #endif
+#if PY_VERSION_HEX >= 0x03080000
+      0,                                  /* tp_vectorcall */
+#endif
+#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
+      0,                                  /* tp_print */
+#endif
 #ifdef COUNT_ALLOCS
       0,                                  /* tp_allocs */
       0,                                  /* tp_frees */
diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg
index ad1b819..d6eeda9 100644
--- a/Lib/python/pyrun.swg
+++ b/Lib/python/pyrun.swg
@@ -183,8 +183,21 @@
   }
 }
 
+SWIGINTERN int
+SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) {
+  int no_kwargs = 1;
+  if (kwargs) {
+    assert(PyDict_Check(kwargs));
+    if (PyDict_Size(kwargs) > 0) {
+      PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name);
+      no_kwargs = 0;
+    }
+  }
+  return no_kwargs;
+}
+
 /* A functor is a function object with one single object argument */
-#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, (char *)"O", obj);
+#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
 
 /*
   Helper for static pointer initialization for both C and C++ code, for example
@@ -696,6 +709,12 @@
 #if PY_VERSION_HEX >= 0x03040000
       0,                                    /* tp_finalize */
 #endif
+#if PY_VERSION_HEX >= 0x03080000
+      0,                                    /* tp_vectorcall */
+#endif
+#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
+      0,                                    /* tp_print */
+#endif
 #ifdef COUNT_ALLOCS
       0,                                    /* tp_allocs */
       0,                                    /* tp_frees */
@@ -857,6 +876,12 @@
 #if PY_VERSION_HEX >= 0x03040000
       0,                                    /* tp_finalize */
 #endif
+#if PY_VERSION_HEX >= 0x03080000
+      0,                                    /* tp_vectorcall */
+#endif
+#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
+      0,                                    /* tp_print */
+#endif
 #ifdef COUNT_ALLOCS
       0,                                    /* tp_allocs */
       0,                                    /* tp_frees */
@@ -1183,8 +1208,10 @@
 	}
       }
 #else
-      PyObject *key = SWIG_This();
-      PyObject_SetAttr(inst, key, swig_this);
+      if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
+        Py_DECREF(inst);
+        inst = 0;
+      }
 #endif
     }
   } else {
@@ -1196,8 +1223,12 @@
         inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
         Py_DECREF(empty_kwargs);
         if (inst) {
-          PyObject_SetAttr(inst, SWIG_This(), swig_this);
-          Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
+          if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
+            Py_DECREF(inst);
+            inst = 0;
+          } else {
+            Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
+          }
         }
       }
       Py_DECREF(empty_args);
diff --git a/Lib/python/std_map.i b/Lib/python/std_map.i
index 8ae483c..e0b7d69 100644
--- a/Lib/python/std_map.i
+++ b/Lib/python/std_map.i
@@ -101,7 +101,7 @@
 %#endif
 	  res = traits_asptr_stdseq<map_type, std::pair<K, T> >::asptr(items, val);
 	} else {
-	  map_type *p;
+	  map_type *p = 0;
 	  swig_type_info *descriptor = swig::type_info<map_type>();
 	  res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
 	  if (SWIG_IsOK(res) && val)  *val = p;
diff --git a/Lib/python/std_multimap.i b/Lib/python/std_multimap.i
index f78a527..bbffb6b 100644
--- a/Lib/python/std_multimap.i
+++ b/Lib/python/std_multimap.i
@@ -29,7 +29,7 @@
 %#endif
 	  res = traits_asptr_stdseq<std::multimap<K,T>, std::pair<K, T> >::asptr(items, val);
 	} else {
-	  multimap_type *p;
+	  multimap_type *p = 0;
 	  swig_type_info *descriptor = swig::type_info<multimap_type>();
 	  res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
 	  if (SWIG_IsOK(res) && val)  *val = p;
diff --git a/Lib/python/std_pair.i b/Lib/python/std_pair.i
index 172572b..cf463cb 100644
--- a/Lib/python/std_pair.i
+++ b/Lib/python/std_pair.i
@@ -47,7 +47,7 @@
 	    res = get_pair(first, second, val);
 	  }
 	} else {
-	  value_type *p;
+	  value_type *p = 0;
 	  swig_type_info *descriptor = swig::type_info<value_type>();
 	  res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
 	  if (SWIG_IsOK(res) && val)  *val = *p;
@@ -104,7 +104,7 @@
 	    res = get_pair(first, second, val);
 	  }
 	} else {
-	  value_type *p;
+	  value_type *p = 0;
 	  swig_type_info *descriptor = swig::type_info<value_type>();
 	  res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
 	  if (SWIG_IsOK(res) && val)  *val = p;
diff --git a/Lib/python/std_unordered_map.i b/Lib/python/std_unordered_map.i
index 042d5b6..784be4c 100644
--- a/Lib/python/std_unordered_map.i
+++ b/Lib/python/std_unordered_map.i
@@ -87,7 +87,7 @@
 %#endif
 	  res = traits_asptr_stdseq<std::unordered_map<K,T,Hash,Compare,Alloc>, std::pair<K, T> >::asptr(items, val);
 	} else {
-	  unordered_map_type *p;
+	  unordered_map_type *p = 0;
 	  swig_type_info *descriptor = swig::type_info<unordered_map_type>();
 	  res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
 	  if (SWIG_IsOK(res) && val)  *val = p;
diff --git a/Lib/python/std_unordered_multimap.i b/Lib/python/std_unordered_multimap.i
index 2811404..bc095ea 100644
--- a/Lib/python/std_unordered_multimap.i
+++ b/Lib/python/std_unordered_multimap.i
@@ -36,7 +36,7 @@
 %#endif
 	  res = traits_asptr_stdseq<std::unordered_multimap<K,T,Hash,Compare,Alloc>, std::pair<K, T> >::asptr(items, val);
 	} else {
-	  unordered_multimap_type *p;
+	  unordered_multimap_type *p = 0;
 	  swig_type_info *descriptor = swig::type_info<unordered_multimap_type>();
 	  res = descriptor ? SWIG_ConvertPtr(obj, (void **)&p, descriptor, 0) : SWIG_ERROR;
 	  if (SWIG_IsOK(res) && val)  *val = p;
diff --git a/Lib/ruby/director.swg b/Lib/ruby/director.swg
index c6c53a3..9395b81 100644
--- a/Lib/ruby/director.swg
+++ b/Lib/ruby/director.swg
@@ -153,43 +153,6 @@
     }
   };
 
-  /* unknown exception handler  */
-  class UnknownExceptionHandler {
-#ifdef SWIG_DIRECTOR_UEH
-    static void handler() {
-      try {
-	throw;
-      } catch (DirectorException& e) {
-	std::cerr << "SWIG Director exception caught:" << std::endl
-		  << e.what() << std::endl;
-      } catch (std::exception& e) {
-	std::cerr << "std::exception caught: "<< e.what() << std::endl;
-      } catch (...) {
-	std::cerr << "Unknown exception caught." << std::endl;
-      }
-      std::cerr << std::endl
-		<< "Ruby interpreter traceback:" << std::endl;
-      std::cerr << std::endl;
-      std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
-		<< "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
-		<< std::endl
-		<< "Exception is being re-thrown, program will like abort/terminate." << std::endl;
-      throw;
-    }
-
-  public:
-    std::unexpected_handler old;
-    UnknownExceptionHandler(std::unexpected_handler nh = handler) {
-      old = std::set_unexpected(nh);
-    }
-
-    ~UnknownExceptionHandler() {
-      std::set_unexpected(old);
-    }
-#endif
-  };
-
-
   /* Type mismatch in the return value from a Ruby method call */
   class DirectorTypeMismatchException : public DirectorException {
   public:
diff --git a/Lib/ruby/rubyclasses.swg b/Lib/ruby/rubyclasses.swg
index f7b51bd..b345fce 100644
--- a/Lib/ruby/rubyclasses.swg
+++ b/Lib/ruby/rubyclasses.swg
@@ -174,7 +174,7 @@
       return rb_inspect(_obj);
     }
 
-    static VALUE swig_rescue_swallow(VALUE)
+    static VALUE swig_rescue_swallow(VALUE, VALUE)
     {
       /*
       VALUE errstr = rb_obj_as_string(rb_errinfo());
@@ -203,8 +203,8 @@
         args.id     = op_id;
         args.nargs  = 1;
         args.target = VALUE(other);
-        ret = rb_rescue(RUBY_METHOD_FUNC(swig_rescue_funcall), VALUE(&args),
-                       (RUBY_METHOD_FUNC(swig_rescue_swallow)), Qnil);
+        ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args),
+                       (VALUEFUNC(swig_rescue_swallow)), Qnil);
       }
       if (ret == Qnil) {
         VALUE a = rb_funcall(         _obj, hash_id, 0 );
@@ -243,8 +243,8 @@
       args.id     = op_id;
       args.nargs  = 0;
       args.target = Qnil;
-      ret = rb_rescue(RUBY_METHOD_FUNC(swig_rescue_funcall), VALUE(&args),
-                     (RUBY_METHOD_FUNC(swig_rescue_swallow)), Qnil);
+      ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args),
+                     (VALUEFUNC(swig_rescue_swallow)), Qnil);
       SWIG_RUBY_THREAD_END_BLOCK;
       return ret;
     }
@@ -262,8 +262,8 @@
       args.id     = op_id;
       args.nargs  = 1;
       args.target = VALUE(other);
-      ret = rb_rescue(RUBY_METHOD_FUNC(swig_rescue_funcall), VALUE(&args),
-                     (RUBY_METHOD_FUNC(swig_rescue_swallow)), Qnil);
+      ret = rb_rescue(VALUEFUNC(swig_rescue_funcall), VALUE(&args),
+                     (VALUEFUNC(swig_rescue_swallow)), Qnil);
       SWIG_RUBY_THREAD_END_BLOCK;
       return GC_VALUE(ret);
     }
diff --git a/Lib/ruby/rubycontainer.swg b/Lib/ruby/rubycontainer.swg
index e8830a7..9fa205b 100644
--- a/Lib/ruby/rubycontainer.swg
+++ b/Lib/ruby/rubycontainer.swg
@@ -395,19 +395,13 @@
       return const_reference(_seq, n);
     }
 
-    bool check(bool set_err = false) const
+    bool check() const
     {
       int s = (int) size();
       for (int i = 0; i < s; ++i) {
 	VALUE item = rb_ary_entry(_seq, i );
-	if (!swig::check<value_type>(item)) {
-	  if (set_err) {
-	    char msg[1024];
-	    sprintf(msg, "in sequence element %d", i);
-	    SWIG_Error(SWIG_RuntimeError, msg);
-	  }
+	if (!swig::check<value_type>(item))
 	  return false;
-	}
       }
       return true;
     }
diff --git a/Lib/ruby/rubyhead.swg b/Lib/ruby/rubyhead.swg
index 90f07cf..bf4e362 100644
--- a/Lib/ruby/rubyhead.swg
+++ b/Lib/ruby/rubyhead.swg
@@ -98,38 +98,46 @@
 
 
 /*
- * Need to be very careful about how these macros are defined, especially
- * when compiling C++ code or C code with an ANSI C compiler.
+ * The following macros are used for providing the correct type of a
+ * function pointer to the Ruby C API.
+ * Starting with Ruby 2.7 (corresponding to RB_METHOD_DEFINITION_DECL being
+ * defined) these macros act transparently due to Ruby's moving away from
+ * ANYARGS and instead employing strict function signatures.
  *
- * VALUEFUNC(f) is a macro used to typecast a C function that implements
- * a Ruby method so that it can be passed as an argument to API functions
- * like rb_define_method() and rb_define_singleton_method().
+ * Note: In case of C (not C++) the macros are transparent even before
+ * Ruby 2.7 due to the fact that the Ruby C API used function declarators
+ * with empty parentheses, which allows for an unspecified number of
+ * arguments.
  *
- * VOIDFUNC(f) is a macro used to typecast a C function that implements
- * either the "mark" or "free" stuff for a Ruby Data object, so that it
- * can be passed as an argument to API functions like Data_Wrap_Struct()
+ * PROTECTFUNC(f) is used for the function pointer argument of the Ruby
+ * C API function rb_protect().
+ *
+ * VALUEFUNC(f) is used for the function pointer argument(s) of Ruby C API
+ * functions like rb_define_method() and rb_define_singleton_method().
+ *
+ * VOIDFUNC(f) is used to typecast a C function that implements either
+ * the "mark" or "free" stuff for a Ruby Data object, so that it can be
+ * passed as an argument to Ruby C API functions like Data_Wrap_Struct()
  * and Data_Make_Struct().
+ *
+ * SWIG_RUBY_VOID_ANYARGS_FUNC(f) is used for the function pointer
+ * argument(s) of Ruby C API functions like rb_define_virtual_variable().
+ *
+ * SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer
+ * argument(s) of Ruby C API functions like st_foreach().
  */
- 
-#ifdef __cplusplus
-#  ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
-#    define PROTECTFUNC(f) ((VALUE (*)()) f)
-#    define VALUEFUNC(f) ((VALUE (*)()) f)
-#    define VOIDFUNC(f)  ((void (*)()) f)
-#  else
-#    ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
-#      define PROTECTFUNC(f) ((VALUE (*)()) f)
-#      define VALUEFUNC(f) ((VALUE (*)()) f)
-#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
-#    else /* These definitions should work for Ruby 1.7+ */
-#      define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
-#      define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
-#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
-#    endif
-#  endif
+#if defined(__cplusplus) && !defined(RB_METHOD_DEFINITION_DECL)
+#  define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
+#  define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
+#  define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
+#  define SWIG_RUBY_VOID_ANYARGS_FUNC(f) ((void (*)(ANYARGS))(f))
+#  define SWIG_RUBY_INT_ANYARGS_FUNC(f) ((int (*)(ANYARGS))(f))
 #else
+#  define PROTECTFUNC(f) (f)
 #  define VALUEFUNC(f) (f)
 #  define VOIDFUNC(f) (f)
+#  define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f)
+#  define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f)
 #endif
 
 /* Don't use for expressions have side effect */
diff --git a/Lib/ruby/rubyprimtypes.swg b/Lib/ruby/rubyprimtypes.swg
index 3a84819..4b078de 100644
--- a/Lib/ruby/rubyprimtypes.swg
+++ b/Lib/ruby/rubyprimtypes.swg
@@ -10,15 +10,16 @@
 %fragment("SWIG_ruby_failed","header")
 {
 SWIGINTERN VALUE
-SWIG_ruby_failed(void)
+SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
 {
   return Qnil;
 } 
 }
 
 %define %ruby_aux_method(Type, Method, Action)
-SWIGINTERN VALUE SWIG_AUX_##Method##(VALUE *args)
+SWIGINTERN VALUE SWIG_AUX_##Method##(VALUE arg)
 {
+  VALUE *args = (VALUE *)arg;
   VALUE obj = args[0];
   VALUE type = TYPE(obj);
   Type *res = (Type *)(args[1]);
@@ -79,7 +80,7 @@
     VALUE a[2];
     a[0] = obj;
     a[1] = (VALUE)(&v);
-    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+    if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
       if (val) *val = v;
       return SWIG_OK;
     }
@@ -111,7 +112,7 @@
     VALUE a[2];
     a[0] = obj;
     a[1] = (VALUE)(&v);
-    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+    if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
       if (val) *val = v;
       return SWIG_OK;
     }
@@ -149,7 +150,7 @@
     VALUE a[2];
     a[0] = obj;
     a[1] = (VALUE)(&v);
-    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+    if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
       if (val) *val = v;
       return SWIG_OK;
     }
@@ -187,7 +188,7 @@
     VALUE a[2];
     a[0] = obj;
     a[1] = (VALUE)(&v);
-    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+    if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
       if (val) *val = v;
       return SWIG_OK;
     }
@@ -215,7 +216,7 @@
     VALUE a[2];
     a[0] = obj;
     a[1] = (VALUE)(&v);
-    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+    if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2DBL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
       if (val) *val = v;
       return SWIG_OK;
     }
diff --git a/Lib/ruby/rubytracking.swg b/Lib/ruby/rubytracking.swg
index b9fb249..1edcc56 100644
--- a/Lib/ruby/rubytracking.swg
+++ b/Lib/ruby/rubytracking.swg
@@ -32,7 +32,7 @@
 */
 static st_table* swig_ruby_trackings = NULL;
 
-static VALUE swig_ruby_trackings_count(ANYARGS) {
+static VALUE swig_ruby_trackings_count(ID id, VALUE *var) {
   return SWIG2NUM(swig_ruby_trackings->num_entries);
 }
 
@@ -69,7 +69,9 @@
     swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value);
   }
 
-  rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", swig_ruby_trackings_count, NULL);
+  rb_define_virtual_variable("SWIG_TRACKINGS_COUNT",
+                             VALUEFUNC(swig_ruby_trackings_count),
+                             SWIG_RUBY_VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL));
 }
 
 /* Add a Tracking from a C/C++ struct to a Ruby object */
@@ -118,13 +120,15 @@
    to the passed callback function. */
 
 /* Proxy method to abstract the internal trackings datatype */
-static int swig_ruby_internal_iterate_callback(void* ptr, VALUE obj, void(*meth)(void* ptr, VALUE obj)) {
-  (*meth)(ptr, obj);
+static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) {
+  ((void (*) (void *, VALUE))meth)((void *)ptr, (VALUE)obj);
   return ST_CONTINUE;
 }
 
 SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) {
-  st_foreach(swig_ruby_trackings, (int (*)(ANYARGS))&swig_ruby_internal_iterate_callback, (st_data_t)meth);
+  st_foreach(swig_ruby_trackings,
+             SWIG_RUBY_INT_ANYARGS_FUNC(swig_ruby_internal_iterate_callback),
+             (st_data_t)meth);
 }
 
 #ifdef __cplusplus
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..1a1cda6 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 SWIG (Simplified Wrapper and Interface Generator)
 
-Version: 4.0.0 (in progress)
+Version: 4.0.2 (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..8633dad 100644
--- a/RELEASENOTES
+++ b/RELEASENOTES
@@ -7,6 +7,45 @@
 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.1 summary:
+- SWIG now cleans up on error by removing all generated files.
+- Add Python 3.8 support.
+- Python Sphinx compatibility added for Doxygen comments.
+- Some minor regressions introduced in 4.0.0 were fixed.
+- Fix some C++17 compatibility problems in Python and Ruby generated
+  code.
+- Minor improvements/fixes for C#, Java, Javascript, Lua, MzScheme,
+  Ocaml, Octave and Python.
+
+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/cscanner.c b/Source/CParse/cscanner.c
index 4566817..19a0138 100644
--- a/Source/CParse/cscanner.c
+++ b/Source/CParse/cscanner.c
@@ -428,17 +428,32 @@
 	/* Concatenate or skip all consecutive comments at once. */
 	do {
 	  String *cmt = Scanner_text(scan);
+	  String *cmt_modified = 0;
 	  char *loc = Char(cmt);
 	  if ((strncmp(loc, "/*@SWIG", 7) == 0) && (loc[Len(cmt)-3] == '@')) {
 	    Scanner_locator(scan, cmt);
 	  }
 	  if (scan_doxygen_comments) { /* else just skip this node, to avoid crashes in parser module*/
+
+	    int slashStyle = 0; /* Flag for "///" style doxygen comments */
+	    if (strncmp(loc, "///", 3) == 0) {
+	      slashStyle = 1;
+	      if (Len(cmt) == 3) {
+		/* Modify to make length=4 to ensure that the empty comment does
+		   get processed to preserve the newlines in the original comments. */
+		cmt_modified = NewStringf("%s ", cmt);
+		cmt = cmt_modified;
+		loc = Char(cmt);
+	      }
+	    }
+	    
 	    /* Check for all possible Doxygen comment start markers while ignoring
 	       comments starting with a row of asterisks or slashes just as
-	       Doxygen itself does. */
+	       Doxygen itself does.  Also skip empty comment (slash-star-star-slash), 
+	       which causes a crash due to begin > end. */
 	    if (Len(cmt) > 3 && loc[0] == '/' &&
 		((loc[1] == '/' && ((loc[2] == '/' && loc[3] != '/') || loc[2] == '!')) ||
-		 (loc[1] == '*' && ((loc[2] == '*' && loc[3] != '*') || loc[2] == '!')))) {
+		 (loc[1] == '*' && ((loc[2] == '*' && loc[3] != '*' && loc[3] != '/') || loc[2] == '!')))) {
 	      comment_kind_t this_comment = loc[3] == '<' ? DOX_COMMENT_POST : DOX_COMMENT_PRE;
 	      if (existing_comment != DOX_COMMENT_NONE && this_comment != existing_comment) {
 		/* We can't concatenate together Doxygen pre- and post-comments. */
@@ -461,6 +476,13 @@
 		  Setline(yylval.str, Scanner_start_line(scan));
 		  Setfile(yylval.str, Scanner_file(scan));
 		} else {
+		  if (slashStyle) {
+		    /* Add a newline to the end of each doxygen "///" comment,
+		       since they are processed individually, unlike the
+		       slash-star style, which gets processed as a block with
+		       newlines included. */
+		    Append(yylval.str, "\n");
+		  }
 		  Append(yylval.str, str);
 		}
 
@@ -471,6 +493,7 @@
 	  do {
 	    tok = Scanner_token(scan);
 	  } while (tok == SWIG_TOKEN_ENDLINE);
+	  Delete(cmt_modified);
 	} while (tok == SWIG_TOKEN_COMMENT);
 
 	Scanner_pushtoken(scan, tok, Scanner_text(scan));
@@ -873,10 +896,14 @@
 	  return (USING);
 	if (strcmp(yytext, "namespace") == 0)
 	  return (NAMESPACE);
-	if (strcmp(yytext, "override") == 0)
+	if (strcmp(yytext, "override") == 0) {
+	  last_id = 1;
 	  return (OVERRIDE);
-	if (strcmp(yytext, "final") == 0)
+	}
+	if (strcmp(yytext, "final") == 0) {
+	  last_id = 1;
 	  return (FINAL);
+	}
       } else {
 	if (strcmp(yytext, "class") == 0) {
 	  Swig_warning(WARN_PARSE_CLASS_KEYWORD, cparse_file, cparse_line, "class keyword used, but not in C++ mode.\n");
diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y
index 4046e48..470b7d0 100644
--- a/Source/CParse/parser.y
+++ b/Source/CParse/parser.y
@@ -1650,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;
@@ -1779,7 +1779,7 @@
 		  } else {
 		      Swig_error(cparse_file, cparse_line, "Syntax error in input(1).\n");
 		  }
-		  exit(1);
+		  SWIG_exit(EXIT_FAILURE);
                }
 /* Out of class constructor/destructor declarations */
                | c_constructor_decl { 
@@ -3359,7 +3359,7 @@
 		   } else {
 		       Swig_error(cparse_file, cparse_line, "Syntax error - possibly a missing semicolon.\n");
 		   }
-		   exit(1);
+		   SWIG_exit(EXIT_FAILURE);
                }
               ;
 
@@ -3649,7 +3649,7 @@
 		    }
 		    if (err) {
 		      Swig_error(cparse_file,cparse_line,"Syntax error in input(2).\n");
-		      exit(1);
+		      SWIG_exit(EXIT_FAILURE);
 		    }
                 }
                 ;
@@ -4632,7 +4632,7 @@
 	       int start_line = cparse_line;
 	       skip_decl();
 	       Swig_error(cparse_file,start_line,"Syntax error in input(3).\n");
-	       exit(1);
+	       SWIG_exit(EXIT_FAILURE);
 	       } cpp_members { 
 		 $$ = $3;
    	     }
@@ -6374,21 +6374,41 @@
 		| 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 {
+
+/*
+   Note that "_last" attribute is not supposed to be set on the last enum element, as might be expected from its name, but on the _first_ one, and _only_ on it,
+   so we propagate it back to the first item while parsing and reset it on all the subsequent ones.
+ */
+
+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);
+		  } else {
+		    Setattr($1,"_last",$1);
+		  }
+		  $$ = $1;
+		}
+		| enumlist_item COMMA DOXYGENPOSTSTRING enumlist {
+		  if ($4) {
+		    set_nextSibling($1, $4);
+		    Setattr($1,"_last",Getattr($4,"_last"));
+		    Setattr($4,"_last",NULL);
+		  } else {
+		    Setattr($1,"_last",$1);
+		  }
+		  set_comment($1, $3);
 		  $$ = $1;
 		}
 		| optional_ignored_defines {
@@ -6396,17 +6416,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;
 		}
@@ -6419,19 +6428,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 {
diff --git a/Source/CParse/templ.c b/Source/CParse/templ.c
index 6b1a270..22d49fa 100644
--- a/Source/CParse/templ.c
+++ b/Source/CParse/templ.c
@@ -26,14 +26,19 @@
 }
 
 
-static void add_parms(ParmList *p, List *patchlist, List *typelist) {
+static void add_parms(ParmList *p, List *patchlist, List *typelist, int is_pattern) {
   while (p) {
     SwigType *ty = Getattr(p, "type");
     SwigType *val = Getattr(p, "value");
-    SwigType *name = Getattr(p, "name");
     Append(typelist, ty);
     Append(typelist, val);
-    Append(typelist, name);
+    if (is_pattern) {
+      /* Typemap patterns are not simple parameter lists.
+       * Output style ("out", "ret" etc) typemap names can be
+       * qualified names and so may need template expansion */
+      SwigType *name = Getattr(p, "name");
+      Append(typelist, name);
+    }
     Append(patchlist, val);
     p = nextSibling(p);
   }
@@ -108,8 +113,8 @@
       Append(typelist, Getattr(n, "name"));
     }
 
-    add_parms(Getattr(n, "parms"), cpatchlist, typelist);
-    add_parms(Getattr(n, "throws"), cpatchlist, typelist);
+    add_parms(Getattr(n, "parms"), cpatchlist, typelist, 0);
+    add_parms(Getattr(n, "throws"), cpatchlist, typelist, 0);
 
   } else if (Equal(nodeType, "class")) {
     /* Patch base classes */
@@ -175,8 +180,8 @@
     }
     Append(cpatchlist, Getattr(n, "code"));
     Append(typelist, Getattr(n, "decl"));
-    add_parms(Getattr(n, "parms"), cpatchlist, typelist);
-    add_parms(Getattr(n, "throws"), cpatchlist, typelist);
+    add_parms(Getattr(n, "parms"), cpatchlist, typelist, 0);
+    add_parms(Getattr(n, "throws"), cpatchlist, typelist, 0);
   } else if (Equal(nodeType, "destructor")) {
     /* We only need to patch the dtor of the template itself, not the destructors of any nested classes, so check that the parent of this node is the root
      * template node, with the special exception for %extend which adds its methods under an intermediate node. */
@@ -217,10 +222,10 @@
     Append(cpatchlist, Getattr(n, "code"));
     Append(typelist, Getattr(n, "type"));
     Append(typelist, Getattr(n, "decl"));
-    add_parms(Getattr(n, "parms"), cpatchlist, typelist);
-    add_parms(Getattr(n, "kwargs"), cpatchlist, typelist);
-    add_parms(Getattr(n, "pattern"), cpatchlist, typelist);
-    add_parms(Getattr(n, "throws"), cpatchlist, typelist);
+    add_parms(Getattr(n, "parms"), cpatchlist, typelist, 0);
+    add_parms(Getattr(n, "kwargs"), cpatchlist, typelist, 0);
+    add_parms(Getattr(n, "pattern"), cpatchlist, typelist, 1);
+    add_parms(Getattr(n, "throws"), cpatchlist, typelist, 0);
     cn = firstChild(n);
     while (cn) {
       cparse_template_expand(templnode, cn, tname, rname, templateargs, patchlist, typelist, cpatchlist);
diff --git a/Source/DOH/README b/Source/DOH/README
index 8be5f65..be90f25 100644
--- a/Source/DOH/README
+++ b/Source/DOH/README
@@ -73,11 +73,17 @@
 Chop(obj)                       Remove trailing whitespace
 
 flags is one of the following:
-     DOH_REPLACE_ANY
-     DOH_REPLACE_NOQUOTE
-     DOH_REPLACE_ID
-     DOH_REPLACE_FIRST
-             
+    DOH_REPLACE_ID
+    DOH_REPLACE_ID_BEGIN
+    DOH_REPLACE_ID_END
+    DOH_REPLACE_NUMBER_END
+
+and can be combined with one or more of the following:
+    DOH_REPLACE_ANY
+    DOH_REPLACE_NOQUOTE
+    DOH_REPLACE_NOCOMMENT
+    DOH_REPLACE_FIRST
+
 Callable Operations
 -------------------
 Call(obj, args)                 Perform a function call with arguments args.
diff --git a/Source/DOH/base.c b/Source/DOH/base.c
index 12351dd..f5e4188 100644
--- a/Source/DOH/base.c
+++ b/Source/DOH/base.c
@@ -756,25 +756,6 @@
 }
 
 /* -----------------------------------------------------------------------------
- * DohClose()
- * ----------------------------------------------------------------------------- */
-
-/*
-int DohClose(DOH *obj) {
-  DohBase *b = (DohBase *) obj;
-  DohObjInfo *objinfo;
-  if (DohCheck(obj)) {
-    objinfo = b->type;
-    if (objinfo->doh_file->doh_close) {
-      return (objinfo->doh_file->doh_close) (b);
-    }
-    return 0;
-  }
-  return fclose((FILE *) obj);
-}
-*/
-
-/* -----------------------------------------------------------------------------
  * DohIsString()
  * ----------------------------------------------------------------------------- */
 
diff --git a/Source/DOH/doh.h b/Source/DOH/doh.h
index 5a9bae2..fd0530e 100644
--- a/Source/DOH/doh.h
+++ b/Source/DOH/doh.h
@@ -103,7 +103,6 @@
 #define DohNewFileFromFile DOH_NAMESPACE(NewFileFromFile)
 #define DohNewFileFromFd   DOH_NAMESPACE(NewFileFromFd)
 #define DohFileErrorDisplay   DOH_NAMESPACE(FileErrorDisplay)
-#define DohClose           DOH_NAMESPACE(Close)
 #define DohCopyto          DOH_NAMESPACE(Copyto)
 #define DohNewList         DOH_NAMESPACE(NewList)
 #define DohNewHash         DOH_NAMESPACE(NewHash)
@@ -290,11 +289,12 @@
 
 #define   DOH_REPLACE_ANY         0x01
 #define   DOH_REPLACE_NOQUOTE     0x02
-#define   DOH_REPLACE_ID          0x04
-#define   DOH_REPLACE_FIRST       0x08
-#define   DOH_REPLACE_ID_BEGIN    0x10
-#define   DOH_REPLACE_ID_END      0x20
-#define   DOH_REPLACE_NUMBER_END  0x40
+#define   DOH_REPLACE_NOCOMMENT   0x04
+#define   DOH_REPLACE_ID          0x08
+#define   DOH_REPLACE_FIRST       0x10
+#define   DOH_REPLACE_ID_BEGIN    0x20
+#define   DOH_REPLACE_ID_END      0x40
+#define   DOH_REPLACE_NUMBER_END  0x80
 
 #define Replaceall(s,t,r)  DohReplace(s,t,r,DOH_REPLACE_ANY)
 #define Replaceid(s,t,r)   DohReplace(s,t,r,DOH_REPLACE_ID)
@@ -303,15 +303,12 @@
  * Files
  * ----------------------------------------------------------------------------- */
 
-extern DOHFile *DohNewFile(DOH *filename, const char *mode, DOHList *outfiles);
+extern DOHFile *DohNewFile(DOHString *filename, const char *mode, DOHList *outfiles);
 extern DOHFile *DohNewFileFromFile(FILE *f);
 extern DOHFile *DohNewFileFromFd(int fd);
 extern void DohFileErrorDisplay(DOHString * filename);
-/*
- Deprecated, just use DohDelete
-extern int DohClose(DOH *file);
-*/
 extern int DohCopyto(DOHFile * input, DOHFile * output);
+extern void DohCloseAllOpenFiles(void);
 
 
 /* -----------------------------------------------------------------------------
@@ -392,7 +389,6 @@
 /* #define StringChar         DohStringChar */
 /* #define StringEqual        DohStringEqual */
 
-#define Close              DohClose
 #define vPrintf            DohvPrintf
 #define GetInt             DohGetInt
 #define GetDouble          DohGetDouble
@@ -424,7 +420,6 @@
 #define NewFileFromFile    DohNewFileFromFile
 #define NewFileFromFd      DohNewFileFromFd
 #define FileErrorDisplay   DohFileErrorDisplay
-#define Close              DohClose
 #define NewVoid            DohNewVoid
 #define Keys               DohKeys
 #define Strcmp             DohStrcmp
@@ -432,6 +427,7 @@
 #define Strstr             DohStrstr
 #define Strchr             DohStrchr
 #define Copyto             DohCopyto
+#define CloseAllOpenFiles  DohCloseAllOpenFiles
 #define Split              DohSplit
 #define SplitLines         DohSplitLines
 #define Setmark            DohSetmark
diff --git a/Source/DOH/dohint.h b/Source/DOH/dohint.h
index c073bd9..87def9d 100644
--- a/Source/DOH/dohint.h
+++ b/Source/DOH/dohint.h
@@ -49,7 +49,6 @@
   int (*doh_ungetc) (DOH *obj, int ch);	/* Unget character */
   int (*doh_seek) (DOH *obj, long offset, int whence);	/* Seek */
   long (*doh_tell) (DOH *obj);	/* Tell */
-  int (*doh_close) (DOH *obj);	/* Close */
 } DohFileMethods;
 
 /* String methods */
diff --git a/Source/DOH/file.c b/Source/DOH/file.c
index 5c56771..570f84e 100644
--- a/Source/DOH/file.c
+++ b/Source/DOH/file.c
@@ -26,6 +26,73 @@
 } DohFile;
 
 /* -----------------------------------------------------------------------------
+ * open_files_list_instance
+ * open_files_list_add
+ * open_files_list_remove
+ *
+ * Singleton list containing all the files that have been opened by DohNewFile.
+ * Open file pointers are held in the list as strings so as to not affect the
+ * reference count of the underlying DOH objects.
+ * ----------------------------------------------------------------------------- */
+
+static DOHList *open_files_list_instance() {
+  static DOHList *all_open_files = 0;
+  if (!all_open_files)
+    all_open_files = DohNewList();
+  return all_open_files;
+}
+
+static void open_files_list_add(DohFile *f) {
+  DOHList *all_open_files = open_files_list_instance();
+  DOHString *sf = NewStringf("%p", f);
+  Append(all_open_files, sf);
+  Delete(sf);
+}
+
+static void open_files_list_remove(DohFile *f) {
+  int i;
+  int removed = 0;
+  DOHList *all_open_files = open_files_list_instance();
+  DOHString *sf = NewStringf("%p", f);
+  for (i = 0; i < DohLen(all_open_files); i++) {
+    DOHString *sf_i = Getitem(all_open_files, i);
+    if (Strcmp(sf, sf_i) == 0) {
+      DohDelitem(all_open_files, i);
+      removed = 1;
+      break;
+    }
+  }
+  Delete(sf);
+  assert(removed);
+}
+
+/* -----------------------------------------------------------------------------
+ * DohCloseAllOpenFiles()
+ *
+ * Close all opened files, to be called on program termination
+ * ----------------------------------------------------------------------------- */
+
+void DohCloseAllOpenFiles() {
+  int i;
+  DOHList *all_open_files = open_files_list_instance();
+  for (i = 0; i < DohLen(all_open_files); i++) {
+    DohFile *f = 0;
+    DOHString *sf = Getitem(all_open_files, i);
+    int check = sscanf(Char(sf), "%p", (void **)&f);
+    assert(check == 1);
+    if (f->closeondel) {
+      if (f->filep) {
+	check = fclose(f->filep);
+	assert(check == 0);
+      }
+      f->closeondel = 0;
+      f->filep = 0;
+    }
+  }
+  DohClear(all_open_files);
+}
+
+/* -----------------------------------------------------------------------------
  * DelFile()
  * ----------------------------------------------------------------------------- */
 
@@ -40,6 +107,7 @@
       close(f->fd);
     }
 #endif
+  open_files_list_remove(f);
   }
   DohFree(f);
 }
@@ -166,27 +234,6 @@
   return -1;
 }
 
-/* -----------------------------------------------------------------------------
- * File_close()
- *
- * Close the file
- * ----------------------------------------------------------------------------- */
-
-static int File_close(DOH *fo) {
-  int ret = 0;
-  DohFile *f = (DohFile *) ObjData(fo);
-  if (f->filep) {
-    ret = fclose(f->filep);
-    f->filep = 0;
-  } else if (f->fd) {
-#ifdef DOH_INTFILE
-    ret = close(f->fd);
-    f->fd = 0;
-#endif
-  }
-  return ret;
-}
-
 static DohFileMethods FileFileMethods = {
   File_read,
   File_write,
@@ -195,7 +242,6 @@
   File_ungetc,
   File_seek,
   File_tell,
-  File_close,			/* close */
 };
 
 static DohObjInfo DohFileType = {
@@ -231,8 +277,9 @@
  * If newfiles is non-zero, the filename is added to the list of new files.
  * ----------------------------------------------------------------------------- */
 
-DOH *DohNewFile(DOH *filename, const char *mode, DOHList *newfiles) {
+DOH *DohNewFile(DOHString *filename, const char *mode, DOHList *newfiles) {
   DohFile *f;
+  DOH *obj;
   FILE *file;
   char *filen;
 
@@ -251,7 +298,9 @@
   f->filep = file;
   f->fd = 0;
   f->closeondel = 1;
-  return DohObjMalloc(&DohFileType, f);
+  obj = DohObjMalloc(&DohFileType, f);
+  open_files_list_add(f);
+  return obj;
 }
 
 /* -----------------------------------------------------------------------------
diff --git a/Source/DOH/string.c b/Source/DOH/string.c
index 94d2737..3689f4f 100644
--- a/Source/DOH/string.c
+++ b/Source/DOH/string.c
@@ -595,6 +595,13 @@
   }
 }
 
+static char *end_comment(char *s) {
+  char *substring = strstr(s, "*/");
+  if (substring)
+    ++substring;
+  return substring;
+}
+
 static char *match_simple(char *base, char *s, char *token, int tokenlen) {
   (void) base;
   (void) tokenlen;
@@ -677,6 +684,7 @@
   int ic;
   int rcount = 0;
   int noquote = 0;
+  int nocomment = 0;
   char *c, *s, *t, *first;
   char *q, *q2;
   char *base;
@@ -698,6 +706,11 @@
   if (flags & DOH_REPLACE_NOQUOTE)
     noquote = 1;
 
+  if (flags & DOH_REPLACE_NOCOMMENT)
+    nocomment = 1;
+
+  assert(!(noquote && nocomment)); /* quote and comment combination not implemented */
+
   /* If we are not replacing inside quotes, we need to do a little extra work */
   if (noquote) {
     q = strpbrk(base, "\"\'");
@@ -723,6 +736,31 @@
     }
   }
 
+  /* If we are not replacing inside comments, we need to do a little extra work */
+  if (nocomment) {
+    q = strstr(base, "/*");
+    if (!q) {
+      nocomment = 0;		/* Well, no comments to worry about. Oh well */
+    } else {
+      while (q && (q < s)) {
+	/* First match was found inside a comment.  Try to find another match */
+	q2 = end_comment(q);
+	if (!q2) {
+	  return 0;
+	}
+	if (q2 > s) {
+	  /* Find next match */
+	  s = (*match) (base, q2 + 1, token, tokenlen);
+	}
+	if (!s)
+	  return 0;		/* Oh well, no matches */
+	q = strstr(q2 + 1, "/*");
+	if (!q)
+	  nocomment = 0;		/* No more comments */
+      }
+    }
+  }
+
   first = s;
   replen = (int)strlen(rep);
 
@@ -768,6 +806,28 @@
 	  }
 	}
       }
+      if (nocomment) {
+	q = strstr(s, "/*");
+	if (!q) {
+	  nocomment = 0;
+	} else {
+	  while (q && (q < c)) {
+	    /* First match was found inside a comment.  Try to find another match */
+	    q2 = end_comment(q);
+	    if (!q2) {
+	      c = 0;
+	      break;
+	    }
+	    if (q2 > c)
+	      c = (*match) (base, q2 + 1, token, tokenlen);
+	    if (!c)
+	      break;
+	    q = strstr(q2 + 1, "/*");
+	    if (!q)
+	      nocomment = 0;	/* No more comments */
+	  }
+	}
+      }
       if (delta) {
 	if (c) {
 	  memmove(t, s, c - s);
@@ -823,6 +883,29 @@
 	  }
 	}
       }
+      if (nocomment) {
+	q = strstr(s, "/*");
+	if (!q) {
+	  break;
+	} else {
+	  while (q && (q < c)) {
+	    /* First match was found inside a comment.  Try to find another match */
+	    q2 = end_comment(q);
+	    if (!q2) {
+	      c = 0;
+	      break;
+	    }
+	    if (q2 > c) {
+	      c = (*match) (base, q2 + 1, token, tokenlen);
+	      if (!c)
+		break;
+	    }
+	    q = strstr(q2 + 1, "/*");
+	    if (!q)
+	      nocomment = 0;
+	  }
+	}
+      }
       if (c) {
 	rcount++;
 	ic--;
@@ -875,6 +958,29 @@
 	  }
 	}
       }
+      if (nocomment) {
+	q = strstr(s, "/*");
+	if (!q) {
+	  nocomment = 0;
+	} else {
+	  while (q && (q < c)) {
+	    /* First match was found inside a comment.  Try to find another match */
+	    q2 = end_comment(q);
+	    if (!q2) {
+	      c = 0;
+	      break;
+	    }
+	    if (q2 > c) {
+	      c = (*match) (base, q2 + 1, token, tokenlen);
+	      if (!c)
+		break;
+	    }
+	    q = strstr(q2 + 1, "/*");
+	    if (!q)
+	      nocomment = 0;	/* No more comments */
+	  }
+	}
+      }
       if (i < (rcount - 1)) {
 	memcpy(t, s, c - s);
 	t += (c - s);
@@ -987,7 +1093,6 @@
   String_ungetc,
   String_seek,
   String_tell,
-  0,				/* close */
 };
 
 static DohStringMethods StringStringMethods = {
diff --git a/Source/Doxygen/doxycommands.h b/Source/Doxygen/doxycommands.h
index 1f7b5fa..b5d65af 100644
--- a/Source/Doxygen/doxycommands.h
+++ b/Source/Doxygen/doxycommands.h
@@ -18,11 +18,13 @@
 const char *CMD_HTML_ONLY = "htmlonly";
 // doxy commands are not processed inside this block
 const char *CMD_VERBATIM = "verbatim";
+const char *CMD_CODE = "code";
 const char *CMD_LATEX_1 = "f$";
 const char *CMD_LATEX_2 = "f{";
 const char *CMD_LATEX_3 = "f[";
 const char *CMD_END_HTML_ONLY = "endhtmlonly";
 const char *CMD_END_VERBATIM = "endverbatim";
+const char *CMD_END_CODE = "endcode";
 const char *CMD_END_LATEX_1 = "f$";
 const char *CMD_END_LATEX_2 = "f}";
 const char *CMD_END_LATEX_3 = "f]";
diff --git a/Source/Doxygen/doxyparser.cxx b/Source/Doxygen/doxyparser.cxx
index 7286ade..6bda9d2 100644
--- a/Source/Doxygen/doxyparser.cxx
+++ b/Source/Doxygen/doxyparser.cxx
@@ -34,6 +34,30 @@
 const int TOKENSPERLINE = 8; //change this to change the printing behaviour of the token list
 const std::string END_HTML_TAG_MARK("/");
 
+std::string getBaseCommand(const std::string &cmd) {
+  if (cmd.substr(0,5) == "param")
+    return "param";
+  else if (cmd.substr(0,4) == "code")
+    return "code";
+  else
+    return cmd;
+}
+
+// Find the first position beyond the word command.  Extra logic is
+// used to avoid putting the characters "," and "." in
+// DOXYGEN_WORD_CHARS.
+static size_t getEndOfWordCommand(const std::string &line, size_t pos) {
+  size_t endOfWordPos = line.find_first_not_of(DOXYGEN_WORD_CHARS, pos);
+  if (line.substr(pos, 6) == "param[")
+    // include ",", which can appear in param[in,out]
+    endOfWordPos = line.find_first_not_of(string(DOXYGEN_WORD_CHARS)+ ",", pos);  
+  else if (line.substr(pos, 5) == "code{")
+    // include ".", which can appear in e.g. code{.py}
+    endOfWordPos = line.find_first_not_of(string(DOXYGEN_WORD_CHARS)+ ".", pos);
+  return endOfWordPos;
+}
+
+
 DoxygenParser::DoxygenParser(bool noisy) : noisy(noisy) {
   fillTables();
 }
@@ -118,7 +142,7 @@
 }
 
 DoxygenParser::DoxyCommandEnum DoxygenParser::commandBelongs(const std::string &theCommand) {
-  DoxyCommandsMapIt it = doxygenCommands.find(stringToLower(theCommand));
+  DoxyCommandsMapIt it = doxygenCommands.find(stringToLower(getBaseCommand(theCommand)));
 
   if (it != doxygenCommands.end()) {
     return it->second;
@@ -289,6 +313,18 @@
   TokenListCIt endOfParagraph = m_tokenListIt;
 
   while (endOfParagraph != tokList.end()) {
+    // If \code or \verbatim is encountered within a paragraph, then
+    // go all the way to the end of that command, since the content
+    // could contain empty lines that would appear to be paragraph
+    // ends:
+    if (endOfParagraph->m_tokenType == COMMAND &&
+	(endOfParagraph->m_tokenString == "code" ||
+	 endOfParagraph->m_tokenString == "verbatim")) {
+      const string theCommand = endOfParagraph->m_tokenString;
+      endOfParagraph = getEndCommand("end" + theCommand, tokList);
+      endOfParagraph++; // Move after the end command
+      return endOfParagraph;
+    }
     if (endOfParagraph->m_tokenType == END_LINE) {
       endOfParagraph++;
       if (endOfParagraph != tokList.end()
@@ -300,7 +336,7 @@
 
     } else if (endOfParagraph->m_tokenType == COMMAND) {
 
-      if (isSectionIndicator(endOfParagraph->m_tokenString)) {
+      if (isSectionIndicator(getBaseCommand(endOfParagraph->m_tokenString))) {
         return endOfParagraph;
       } else {
         endOfParagraph++;
@@ -654,7 +690,7 @@
   // \f{ ... \f}
   // \f{env}{ ... \f}
   // \f$ ... \f$
-  else if (theCommand == "code" || theCommand == "verbatim"
+  else if (getBaseCommand(theCommand) == "code" || theCommand == "verbatim"
            || theCommand == "dot" || theCommand == "msc" || theCommand == "f[" || theCommand == "f{" || theCommand == "f$") {
     if (!endCommands.size()) {
       // fill in static table of end commands
@@ -671,7 +707,7 @@
     if (it != endCommands.end())
       endCommand = it->second;
     else
-      endCommand = "end" + theCommand;
+      endCommand = "end" + getBaseCommand(theCommand);
 
     std::string content = getStringTilEndCommand(endCommand, tokList);
     aNewList.push_back(DoxygenEntity("plainstd::string", content));
@@ -959,7 +995,9 @@
   std::string currPlainstringCommandType = root ? "partofdescription" : "plainstd::string";
   DoxygenEntityList aNewList;
 
-  while (m_tokenListIt != endParsingIndex) {
+  // Less than check (instead of not equal) is a safeguard in case the
+  // iterator is incremented past the end
+  while (m_tokenListIt < endParsingIndex) {
 
     Token currToken = *m_tokenListIt;
 
@@ -976,6 +1014,10 @@
       addCommand(currPlainstringCommandType, tokList, aNewList);
     }
 
+    // If addCommand above misbehaves, it can move the iterator past endParsingIndex
+    if (m_tokenListIt > endParsingIndex)
+      printListError(WARN_DOXYGEN_UNEXPECTED_ITERATOR_VALUE, "Unexpected iterator value in DoxygenParser::parse");
+
     if (endParsingIndex != tokList.end() && m_tokenListIt == tokList.end()) {
       // this could happen if we can't reach the original endParsingIndex
       printListError(WARN_DOXYGEN_UNEXPECTED_END_OF_COMMENT, "Unexpected end of Doxygen comment encountered.");
@@ -1072,7 +1114,7 @@
     size_t endOfWordPos = line.find_first_not_of(DOXYGEN_WORD_CHARS, pos);
     string cmd = line.substr(pos, endOfWordPos - pos);
 
-    if (cmd == CMD_END_HTML_ONLY || cmd == CMD_END_VERBATIM || cmd == CMD_END_LATEX_1 || cmd == CMD_END_LATEX_2 || cmd == CMD_END_LATEX_3) {
+    if (cmd == CMD_END_HTML_ONLY || cmd == CMD_END_VERBATIM || cmd == CMD_END_LATEX_1 || cmd == CMD_END_LATEX_2 || cmd == CMD_END_LATEX_3 || cmd == CMD_END_CODE) {
 
       m_isVerbatimText = false;
       addDoxyCommand(m_tokenList, cmd);
@@ -1136,22 +1178,34 @@
  */
 void DoxygenParser::processWordCommands(size_t &pos, const std::string &line) {
   pos++;
-  size_t endOfWordPos = line.find_first_not_of(DOXYGEN_WORD_CHARS, pos);
+  size_t endOfWordPos = getEndOfWordCommand(line, pos);
 
   string cmd = line.substr(pos, endOfWordPos - pos);
   addDoxyCommand(m_tokenList, cmd);
 
-  if (cmd == CMD_HTML_ONLY || cmd == CMD_VERBATIM || cmd == CMD_LATEX_1 || cmd == CMD_LATEX_2 || cmd == CMD_LATEX_3) {
+  // A flag for whether we want to skip leading spaces after the command
+  bool skipLeadingSpace = true;
+
+  if (cmd == CMD_HTML_ONLY || cmd == CMD_VERBATIM || cmd == CMD_LATEX_1 || cmd == CMD_LATEX_2 || cmd == CMD_LATEX_3 || getBaseCommand(cmd) == CMD_CODE) {
 
     m_isVerbatimText = true;
 
-  } else {
+    // Skipping leading space is necessary with inline \code command,
+    // and it won't hurt anything for block \code (TODO: are the other
+    // commands also compatible with skip leading space?  If so, just
+    // do it every time.)
+    if (getBaseCommand(cmd) == CMD_CODE) skipLeadingSpace = true;
+    else skipLeadingSpace = false;
+  }
+
+  if (skipLeadingSpace) {
     // skip any possible spaces after command, because some commands have parameters,
     // and spaces between command and parameter must be ignored.
     if (endOfWordPos != string::npos) {
       endOfWordPos = line.find_first_not_of(" \t", endOfWordPos);
     }
   }
+  
   pos = endOfWordPos;
 }
 
@@ -1294,7 +1348,7 @@
     string lastLine = lines[lines.size() - 1];
 
     if (trim(lastLine).empty()) {
-      lines.pop_back(); // remove trailing empy line
+      lines.pop_back(); // remove trailing empty line
     }
   }
 
diff --git a/Source/Doxygen/doxyparser.h b/Source/Doxygen/doxyparser.h
index 96c71d2..e692729 100644
--- a/Source/Doxygen/doxyparser.h
+++ b/Source/Doxygen/doxyparser.h
@@ -21,6 +21,11 @@
 
 #include "doxyentity.h"
 
+// Utility function to return the base part of a command that may
+// include options, e.g. param[in] -> param
+std::string getBaseCommand(const std::string &cmd);
+
+
 class DoxygenParser {
 private:
 
diff --git a/Source/Doxygen/javadoc.cxx b/Source/Doxygen/javadoc.cxx
index 72f84ab..d9313f9 100644
--- a/Source/Doxygen/javadoc.cxx
+++ b/Source/Doxygen/javadoc.cxx
@@ -334,7 +334,7 @@
 void JavaDocConverter::translateEntity(DoxygenEntity &tag, std::string &translatedComment) {
 
   std::map<std::string, std::pair<tagHandler, std::string> >::iterator it;
-  it = tagHandlers.find(tag.typeOfEntity);
+  it = tagHandlers.find(getBaseCommand(tag.typeOfEntity));
 
   if (it != tagHandlers.end()) {
     (this->*(it->second.first))(tag, translatedComment, it->second.second);
diff --git a/Source/Doxygen/pydoc.cxx b/Source/Doxygen/pydoc.cxx
index 8c30900..c84095b 100644
--- a/Source/Doxygen/pydoc.cxx
+++ b/Source/Doxygen/pydoc.cxx
@@ -138,6 +138,68 @@
     s.erase(lastNonSpace + 1);
 }
 
+// Erase the first character in the string if it is a newline
+static void eraseLeadingNewLine(string &s) {
+  if (!s.empty() && s[0] == '\n')
+    s.erase(s.begin());
+}
+
+// Erase the last character in the string if it is a newline
+static void eraseTrailingNewLine(string &s) {
+  if (!s.empty() && s[s.size() - 1] == '\n')
+    s.erase(s.size() - 1);
+}
+
+// Check the generated docstring line by line and make sure that any
+// code and verbatim blocks have an empty line preceding them, which
+// is necessary for Sphinx.  Additionally, this strips any empty lines
+// appearing at the beginning of the docstring.
+static string padCodeAndVerbatimBlocks(const string &docString) {
+  std::string result;
+
+  std::istringstream iss(docString);
+
+  // Initialize to false because there is no previous line yet
+  bool lastLineWasNonBlank = false;
+  
+  for (string line; std::getline(iss, line); result += line) {
+    if (!result.empty()) {
+      // Terminate the previous line
+      result += '\n';
+    }
+
+    const size_t pos = line.find_first_not_of(" \t");
+    if (pos == string::npos) {
+      lastLineWasNonBlank = false;
+    } else {
+      if (lastLineWasNonBlank &&
+	  (line.compare(pos, 13, ".. code-block") == 0 ||
+	   line.compare(pos, 7, ".. math") == 0 ||
+	   line.compare(pos, 3, ">>>") == 0)) {
+	// Must separate code or math blocks from the previous line
+	result += '\n';
+      }
+      lastLineWasNonBlank = true;
+    }
+  }
+  return result;
+}
+
+// Helper function to extract the option value from a command,
+// e.g. param[in] -> in
+static std::string getCommandOption(const std::string &command, char openChar, char closeChar) {
+  string option;
+
+  size_t opt_begin, opt_end;
+  opt_begin = command.find(openChar);
+  opt_end = command.find(closeChar);
+  if (opt_begin != string::npos && opt_end != string::npos)
+    option = command.substr(opt_begin+1, opt_end-opt_begin-1);
+
+  return option;
+}
+
+
 /* static */
 PyDocConverter::TagHandlersMap::mapped_type PyDocConverter::make_handler(tagHandler handler) {
   return make_pair(handler, std::string());
@@ -199,7 +261,7 @@
   tagHandlers["date"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["deprecated"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["details"] = make_handler(&PyDocConverter::handleParagraph);
-  tagHandlers["em"] = make_handler(&PyDocConverter::handleParagraph, " ");
+  tagHandlers["em"] = make_handler(&PyDocConverter::handleTagWrap, "*");
   tagHandlers["example"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["exception"] = tagHandlers["throw"] = tagHandlers["throws"] = make_handler(&PyDocConverter::handleTagException);
   tagHandlers["htmlonly"] = make_handler(&PyDocConverter::handleParagraph);
@@ -208,7 +270,7 @@
   tagHandlers["link"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["manonly"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["note"] = make_handler(&PyDocConverter::handleParagraph);
-  tagHandlers["p"] = make_handler(&PyDocConverter::handleParagraph);
+  tagHandlers["p"] = make_handler(&PyDocConverter::handleTagWrap, "``");
   tagHandlers["partofdescription"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["rtfonly"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["remark"] = make_handler(&PyDocConverter::handleParagraph);
@@ -219,7 +281,7 @@
   tagHandlers["short"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["todo"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["version"] = make_handler(&PyDocConverter::handleParagraph);
-  tagHandlers["verbatim"] = make_handler(&PyDocConverter::handleParagraph);
+  tagHandlers["verbatim"] = make_handler(&PyDocConverter::handleVerbatimBlock);
   tagHandlers["warning"] = make_handler(&PyDocConverter::handleParagraph);
   tagHandlers["xmlonly"] = make_handler(&PyDocConverter::handleParagraph);
   // these commands have special handlers
@@ -336,8 +398,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
@@ -367,16 +434,32 @@
   ParmList *plist = CopyParmList(Getattr(currentNode, "parms"));
   for (Parm *p = plist; p; p = nextSibling(p)) {
     String *pname = Getattr(p, "name");
-    if (Char(pname) != param)
-      continue;
-
-    type = getPyDocType(p, pname);
-    break;
+    if (pname && Char(pname) == param) {
+      type = getPyDocType(p, pname);
+      break;
+    }
   }
   Delete(plist);
   return type;
 }
 
+std::string PyDocConverter::getParamValue(std::string param) {
+  std::string value;
+
+  ParmList *plist = CopyParmList(Getattr(currentNode, "parms"));
+  for (Parm *p = plist; p; p = nextSibling(p)) {
+    String *pname = Getattr(p, "name");
+    if (pname && Char(pname) == param) {
+      String *pval = Getattr(p, "value");
+      if (pval)
+	value = Char(pval);
+      break;
+    }
+  }
+  Delete(plist);
+  return value;
+}
+
 std::string PyDocConverter::translateSubtree(DoxygenEntity &doxygenEntity) {
   std::string translatedComment;
 
@@ -405,7 +488,7 @@
 void PyDocConverter::translateEntity(DoxygenEntity &doxyEntity, std::string &translatedComment) {
   // check if we have needed handler and call it
   std::map<std::string, std::pair<tagHandler, std::string> >::iterator it;
-  it = tagHandlers.find(doxyEntity.typeOfEntity);
+  it = tagHandlers.find(getBaseCommand(doxyEntity.typeOfEntity));
   if (it != tagHandlers.end())
     (this->*(it->second.first)) (doxyEntity, translatedComment, it->second.second);
 }
@@ -414,6 +497,17 @@
   translatedComment += translateSubtree(tag);
 }
 
+void PyDocConverter::handleVerbatimBlock(DoxygenEntity &tag, std::string &translatedComment, const std::string &) {
+  string verb = translateSubtree(tag);
+
+  eraseLeadingNewLine(verb);
+
+  // Remove the last newline to prevent doubling the newline already present after \endverbatim
+  trimWhitespace(verb); // Needed to catch trailing newline below
+  eraseTrailingNewLine(verb);
+  translatedComment += verb;
+}
+
 void PyDocConverter::handleMath(DoxygenEntity &tag, std::string &translatedComment, const std::string &arg) {
   IndentGuard indent;
 
@@ -428,7 +522,6 @@
     indent.Init(translatedComment, m_indent);
 
     trimWhitespace(translatedComment);
-    translatedComment += '\n';
 
     const string formulaIndent = indent.getFirstLineIndent();
     translatedComment += formulaIndent;
@@ -462,8 +555,6 @@
 
   if (inlineFormula) {
     translatedComment += "`";
-  } else {
-    translatedComment += '\n';
   }
 }
 
@@ -471,23 +562,59 @@
   IndentGuard indent(translatedComment, m_indent);
 
   trimWhitespace(translatedComment);
-  translatedComment += '\n';
 
-  // Use the current indent for the code-block line itself.
-  string codeIndent = indent.getFirstLineIndent();
-  translatedComment += codeIndent;
-
-  // Go out on a limb and assume that examples in the C or C++ sources use C++.
-  // In the worst case, we'll highlight C code using C++ syntax which is not a
-  // big deal (TODO: handle Doxygen code command language argument).
-  translatedComment += ".. code-block:: c++\n\n";
-
-  // For now on, use extra indent level for all the subsequent lines.
-  codeIndent += m_indent;
+  // Check for an option given to the code command (e.g. code{.py}),
+  // and try to set the code-block language accordingly.
+  string option = getCommandOption(tag.typeOfEntity, '{', '}');
+  // Set up the language option to the code-block command, which can
+  // be any language supported by pygments:
+  string codeLanguage;
+  if (option == ".py")
+    // Other possibilities here are "default" or "python3".  In Sphinx
+    // 2.1.2, basic syntax doesn't render quite the same in these as
+    // with "python", which for basic keywords seems to provide
+    // slightly richer formatting.  Another option would be to leave
+    // the language empty, but testing with Sphinx 1.8.5 has produced
+    // an error "1 argument required".
+    codeLanguage = "python";
+  else if (option == ".java")
+    codeLanguage = "java";
+  else if (option == ".c")
+    codeLanguage = "c";
+  else
+    // If there is not a match, or if no option was given, go out on a
+    // limb and assume that the examples in the C or C++ sources use
+    // C++.
+    codeLanguage = "c++";
 
   std::string code;
   handleTagVerbatim(tag, code, arg);
 
+  // Try and remove leading newline, which is present for block \code
+  // command:
+  eraseLeadingNewLine(code);
+
+  // Check for python doctest blocks, and treat them specially:
+  bool isDocTestBlock = false;
+  size_t startPos;
+  // ">>>" would normally appear at the beginning, but doxygen comment
+  // style may have space in front, so skip leading whitespace
+  if ((startPos=code.find_first_not_of(" \t")) != string::npos && code.substr(startPos,3) == ">>>")
+    isDocTestBlock = true;
+
+  string codeIndent;
+  if (! isDocTestBlock) {
+    // Use the current indent for the code-block line itself.
+    translatedComment += indent.getFirstLineIndent();
+    translatedComment += ".. code-block:: " + codeLanguage + "\n\n";
+
+    // Specify the level of extra indentation that will be used for
+    // subsequent lines within the code block.  Note that the correct
+    // "starting indentation" is already present in the input, so we
+    // only need to add the desired code block indentation.
+    codeIndent = m_indent;
+  }
+
   translatedComment += codeIndent;
   for (size_t n = 0; n < code.length(); n++) {
     if (code[n] == '\n') {
@@ -505,8 +632,11 @@
   }
 
   trimWhitespace(translatedComment);
-  if (*translatedComment.rbegin() != '\n')
-    translatedComment += '\n';
+
+  // For block commands, the translator adds the newline after
+  // \endcode, so try and compensate by removing the last newline from
+  // the code text:
+  eraseTrailingNewLine(translatedComment);
 }
 
 void PyDocConverter::handlePlainString(DoxygenEntity &tag, std::string &translatedComment, const std::string &) {
@@ -514,7 +644,7 @@
 }
 
 void PyDocConverter::handleTagVerbatim(DoxygenEntity &tag, std::string &translatedComment, const std::string &arg) {
-  translatedComment += arg + " ";
+  translatedComment += arg;
   for (DoxygenEntityListCIt it = tag.entityList.begin(); it != tag.entityList.end(); it++) {
     translatedComment += it->data;
   }
@@ -569,8 +699,26 @@
   const std::string &paramName = paramNameEntity.data;
 
   const std::string paramType = getParamType(paramName);
+  const std::string paramValue = getParamValue(paramName);
+
+  // Get command option, e.g. "in", "out", or "in,out"
+  string commandOpt = getCommandOption(tag.typeOfEntity, '[', ']');
+  if (commandOpt == "in,out") commandOpt = "in/out";
+
+  // If provided, append the parameter direction to the type
+  // information via a suffix:
+  std::string suffix;
+  if (commandOpt.size() > 0)
+    suffix = ", " + commandOpt;
+  
+  // If the parameter has a default value, flag it as optional in the
+  // generated type definition.  Particularly helpful when the python
+  // call is generated with *args, **kwargs.
+  if (paramValue.size() > 0)
+    suffix += ", optional";  
+
   if (!paramType.empty()) {
-    translatedComment += ":type " + paramName + ": " + paramType + "\n";
+    translatedComment += ":type " + paramName + ": " + paramType + suffix + "\n";
     translatedComment += indent.getFirstLineIndent();
   }
 
@@ -828,9 +976,10 @@
   if (!pyDocString.empty()) {
 
     // remove the last '\n' since additional one is added during writing to file
-    if (pyDocString[pyDocString.size() - 1] == '\n') {
-      pyDocString.erase(pyDocString.size() - 1);
-    }
+    eraseTrailingNewLine(pyDocString);
+
+    // ensure that a blank line occurs before code or math blocks
+    pyDocString = padCodeAndVerbatimBlocks(pyDocString);
 
     if (m_flags & debug_translator) {
       std::cout << "\n---RESULT IN PYDOC---" << std::endl;
@@ -841,3 +990,4 @@
 
   return NewString(pyDocString.c_str());
 }
+
diff --git a/Source/Doxygen/pydoc.h b/Source/Doxygen/pydoc.h
index 8f432fd..07c5ce5 100644
--- a/Source/Doxygen/pydoc.h
+++ b/Source/Doxygen/pydoc.h
@@ -80,6 +80,11 @@
   void handleParagraph(DoxygenEntity &tag, std::string &translatedComment, const std::string &arg = std::string());
 
   /*
+   * Handle Doxygen verbatim tag
+   */
+  void handleVerbatimBlock(DoxygenEntity &tag, std::string &translatedComment, const std::string &arg = std::string());
+
+  /*
    * Handle one of the Doxygen formula-related tags.
    */
   void handleMath(DoxygenEntity &tag, std::string &translatedComment, const std::string &arg);
@@ -173,6 +178,11 @@
    */
   std::string getParamType(std::string name);
 
+  /*
+   * Simple helper function to retrieve the parameter value
+   */
+  std::string getParamValue(std::string name);
+
 private:
   // temporary thing, should be refactored somehow
   Node *currentNode;
diff --git a/Source/Include/swigwarn.h b/Source/Include/swigwarn.h
index fbcea4d..a08693a 100644
--- a/Source/Include/swigwarn.h
+++ b/Source/Include/swigwarn.h
@@ -221,6 +221,7 @@
 #define WARN_DOXYGEN_HTML_ERROR               563
 #define WARN_DOXYGEN_COMMAND_ERROR            564
 #define WARN_DOXYGEN_UNKNOWN_CHARACTER        565
+#define WARN_DOXYGEN_UNEXPECTED_ITERATOR_VALUE  566
 
 /* -- Reserved (600-799) -- */
 
diff --git a/Source/Modules/allegrocl.cxx b/Source/Modules/allegrocl.cxx
index f32d349..97af186 100644
--- a/Source/Modules/allegrocl.cxx
+++ b/Source/Modules/allegrocl.cxx
@@ -471,7 +471,7 @@
 	  // a synonym type was found (held in variable 'match')
 	  // Printf(stderr, "setting primary synonym of %p to %p\n", new_node, match);
 	  if (new_node == match)
-	    Printf(stderr, "Hey-4 * - '%s' is a synonym of iteself!\n", Getattr(new_node, "name"));
+	    Printf(stderr, "Hey-4 * - '%s' is a synonym of itself!\n", Getattr(new_node, "name"));
 	  Setattr(new_node, "allegrocl:synonym-of", match);
 	  // Printf(stderr,"*** 4\n");
 	  add_linked_type(new_node);
diff --git a/Source/Modules/chicken.cxx b/Source/Modules/chicken.cxx
index 68a42a2..76b6455 100644
--- a/Source/Modules/chicken.cxx
+++ b/Source/Modules/chicken.cxx
@@ -547,7 +547,7 @@
   }
   emit_return_variable(n, d, f);
 
-  /* Insert the argumetn output code */
+  /* Insert the argument output code */
   Printv(f->code, argout, NIL);
 
   /* Output cleanup code */
@@ -1456,7 +1456,7 @@
   if (value)
     return value;
   else {
-    Swig_error(input_file, line_number, "Internal Error: attempting to reference non-existant primitive name %s\n", name);
+    Swig_error(input_file, line_number, "Internal Error: attempting to reference non-existent primitive name %s\n", name);
     return NewString("#f");
   }
 }
diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx
index ff73c30..27cc65b 100644
--- a/Source/Modules/csharp.cxx
+++ b/Source/Modules/csharp.cxx
@@ -1533,7 +1533,7 @@
       if (classname_substituted_flag) {
 	if (SwigType_isenum(t)) {
 	  // This handles wrapping of inline initialised const enum static member variables (not when wrapping enum items - ignored later on)
-	  Printf(constants_code, "(%s)%s.%s();\n", return_type, full_imclass_name, Swig_name_get(getNSpace(), symname));
+	  Printf(constants_code, "(%s)%s.%s();\n", return_type, full_imclass_name ? full_imclass_name : imclass_name, Swig_name_get(getNSpace(), symname));
 	} else {
 	  // This handles function pointers using the %constant directive
 	  Printf(constants_code, "new %s(%s.%s(), false);\n", return_type, full_imclass_name ? full_imclass_name : imclass_name, Swig_name_get(getNSpace(), symname));
@@ -1709,11 +1709,11 @@
    * addInterfaceNameAndUpcasts()
    * ----------------------------------------------------------------------------- */
 
-  void addInterfaceNameAndUpcasts(SwigType *smart, String *interface_list, String *interface_upcasts, Hash *base_list, String *c_classname) {
+  void addInterfaceNameAndUpcasts(SwigType *smart, String *interface_list, String *interface_upcasts, Hash *base_list, SwigType *c_classname) {
     List *keys = Keys(base_list);
     for (Iterator it = First(keys); it.item; it = Next(it)) {
       Node *base = Getattr(base_list, it.item);
-      String *c_baseclass = SwigType_namestr(Getattr(base, "name"));
+      SwigType *c_baseclassname = Getattr(base, "name");
       String *interface_name = Getattr(base, "interface:name");
       if (Len(interface_list))
 	Append(interface_list, ", ");
@@ -1732,13 +1732,12 @@
       Replaceall(cptr_method_name, ".", "_");
       Replaceall(cptr_method_name, "$interfacename", interface_name);
 
-      String *upcast_method_name = Swig_name_member(getNSpace(), proxy_class_name, cptr_method_name);
-      upcastsCode(smart, upcast_method_name, c_classname, c_baseclass);
+      String *upcast_method_name = Swig_name_member(getNSpace(), getClassPrefix(), cptr_method_name);
+      upcastsCode(smart, upcast_method_name, c_classname, c_baseclassname);
 
       Delete(upcast_method_name);
       Delete(cptr_method_name);
       Delete(interface_code);
-      Delete(c_baseclass);
     }
     Delete(keys);
   }
@@ -1749,7 +1748,7 @@
    * Add code for C++ casting to base class
    * ----------------------------------------------------------------------------- */
 
-  void upcastsCode(SwigType *smart, String *upcast_method_name, String *c_classname, String *c_baseclass) {
+  void upcastsCode(SwigType *smart, String *upcast_method_name, SwigType *c_classname, SwigType *c_baseclassname) {
     String *wname = Swig_name_wrapper(upcast_method_name);
 
     Printv(imclass_cppcasts_code, "\n  [global::System.Runtime.InteropServices.DllImport(\"", dllimport, "\", EntryPoint=\"", wname, "\")]\n", NIL);
@@ -1757,28 +1756,35 @@
 
     Replaceall(imclass_cppcasts_code, "$csclassname", proxy_class_name);
 
+    String *classname = SwigType_namestr(c_classname);
+    String *baseclassname = SwigType_namestr(c_baseclassname);
     if (smart) {
-      SwigType *bsmart = Copy(smart);
-      SwigType *rclassname = SwigType_typedef_resolve_all(c_classname);
-      SwigType *rbaseclass = SwigType_typedef_resolve_all(c_baseclass);
-      Replaceall(bsmart, rclassname, rbaseclass);
-      Delete(rclassname);
-      Delete(rbaseclass);
       String *smartnamestr = SwigType_namestr(smart);
-      String *bsmartnamestr = SwigType_namestr(bsmart);
+      String *bsmartnamestr = SwigType_namestr(smart);
+
+      // TODO: SwigType_typedef_resolve_all on a String instead of SwigType is incorrect for templates
+      SwigType *rclassname = SwigType_typedef_resolve_all(classname);
+      SwigType *rbaseclassname = SwigType_typedef_resolve_all(baseclassname);
+      Replaceall(bsmartnamestr, rclassname, rbaseclassname);
+
       Printv(upcasts_code,
 	  "SWIGEXPORT ", bsmartnamestr, " * SWIGSTDCALL ", wname, "(", smartnamestr, " *jarg1) {\n",
 	  "    return jarg1 ? new ", bsmartnamestr, "(*jarg1) : 0;\n"
 	  "}\n", "\n", NIL);
+
+      Delete(rbaseclassname);
+      Delete(rclassname);
       Delete(bsmartnamestr);
       Delete(smartnamestr);
-      Delete(bsmart);
     } else {
       Printv(upcasts_code,
-	  "SWIGEXPORT ", c_baseclass, " * SWIGSTDCALL ", wname, "(", c_classname, " *jarg1) {\n",
-	  "    return (", c_baseclass, " *)jarg1;\n"
+	  "SWIGEXPORT ", baseclassname, " * SWIGSTDCALL ", wname, "(", classname, " *jarg1) {\n",
+	  "    return (", baseclassname, " *)jarg1;\n"
 	  "}\n", "\n", NIL);
     }
+
+    Delete(baseclassname);
+    Delete(classname);
     Delete(wname);
   }
 
@@ -1787,10 +1793,9 @@
    * ----------------------------------------------------------------------------- */
 
   void emitProxyClassDefAndCPPCasts(Node *n) {
-    String *c_classname = SwigType_namestr(Getattr(n, "name"));
-    String *c_baseclass = NULL;
+    SwigType *c_classname = Getattr(n, "name");
+    SwigType *c_baseclassname = NULL;
     String *baseclass = NULL;
-    String *c_baseclassname = NULL;
     String *interface_list = NewStringEmpty();
     String *interface_upcasts = NewStringEmpty();
     SwigType *typemap_lookup_type = Getattr(n, "classtypeobj");
@@ -1812,12 +1817,13 @@
 	Iterator base = First(baselist);
 	while (base.item) {
 	  if (!(GetFlag(base.item, "feature:ignore") || Getattr(base.item, "feature:interface"))) {
-	    String *baseclassname = Getattr(base.item, "name");
+	    SwigType *baseclassname = Getattr(base.item, "name");
 	    if (!c_baseclassname) {
-	      c_baseclassname = baseclassname;
-	      baseclass = Copy(getProxyName(baseclassname));
-	      if (baseclass)
-		c_baseclass = SwigType_namestr(baseclassname);
+	      String *name = getProxyName(baseclassname);
+	      if (name) {
+		c_baseclassname = baseclassname;
+		baseclass = name;
+	      }
 	    } else {
 	      /* Warn about multiple inheritance for additional base class(es) */
 	      String *proxyclassname = Getattr(n, "classtypeobj");
@@ -1833,7 +1839,7 @@
     if (interface_bases)
       addInterfaceNameAndUpcasts(smart, interface_list, interface_upcasts, interface_bases, c_classname);
 
-    bool derived = baseclass && getProxyName(c_baseclassname);
+    bool derived = baseclass != 0;
     if (derived && purebase_notderived)
       pure_baseclass = empty_string;
     const String *wanted_base = baseclass ? baseclass : pure_baseclass;
@@ -1841,7 +1847,6 @@
     if (purebase_replace) {
       wanted_base = pure_baseclass;
       derived = false;
-      Delete(baseclass);
       baseclass = NULL;
       if (purebase_notderived)
         Swig_error(Getfile(n), Getline(n), "The csbase typemap for proxy %s must contain just one of the 'replace' or 'notderived' attributes.\n", typemap_lookup_type);
@@ -2032,12 +2037,11 @@
 
     if (derived) {
       String *upcast_method_name = Swig_name_member(getNSpace(), getClassPrefix(), smart != 0 ? "SWIGSmartPtrUpcast" : "SWIGUpcast");
-      upcastsCode(smart, upcast_method_name, c_classname, c_baseclass);
+      upcastsCode(smart, upcast_method_name, c_classname, c_baseclassname);
       Delete(upcast_method_name);
     }
 
     Delete(smart);
-    Delete(baseclass);
   }
 
   /* ----------------------------------------------------------------------
@@ -4064,11 +4068,10 @@
 	      /* Get the C# parameter type */
 	      if ((tm = Getattr(p, "tmap:cstype"))) {
 		substituteClassname(pt, tm);
-		if (Strncmp(tm, "ref ", 4) == 0) {
-		  Replace(tm, "ref ", "", DOH_REPLACE_FIRST);
+		int flags = DOH_REPLACE_FIRST | DOH_REPLACE_ID_BEGIN | DOH_REPLACE_NOCOMMENT;
+		if (Replace(tm, "ref ", "", flags) || Replace(tm, "ref\t", "", flags)) {
 		  Printf(proxy_method_types, "typeof(%s).MakeByRefType()", tm);
-		} else if (Strncmp(tm, "out ", 4) == 0) {
-		  Replace(tm, "out ", "", DOH_REPLACE_FIRST);
+		} else if (Replace(tm, "out ", "", flags) || Replace(tm, "out\t", "", flags)) {
 		  Printf(proxy_method_types, "typeof(%s).MakeByRefType()", tm);
 		} else {
 		  Printf(proxy_method_types, "typeof(%s)", tm);
diff --git a/Source/Modules/d.cxx b/Source/Modules/d.cxx
index 5e82dfd..b7283ea 100644
--- a/Source/Modules/d.cxx
+++ b/Source/Modules/d.cxx
@@ -3140,11 +3140,10 @@
      * Handle inheriting from D and C++ classes.
      */
 
-    String *c_classname = SwigType_namestr(Getattr(n, "name"));
-    String *c_baseclass = NULL;
-    Node *basenode = NULL;
-    String *basename = NULL;
+    String *c_classname = Getattr(n, "name");
     String *c_baseclassname = NULL;
+    Node *basenode = NULL;
+    String *baseclass = NULL;
 
     // Inheritance from pure D classes.
     Node *attributes = NewHash();
@@ -3161,13 +3160,14 @@
 	Iterator base = First(baselist);
 	while (base.item) {
 	  if (!GetFlag(base.item, "feature:ignore")) {
-	    String *baseclassname = Getattr(base.item, "name");
+	    SwigType *baseclassname = Getattr(base.item, "name");
 	    if (!c_baseclassname) {
 	      basenode = base.item;
-	      c_baseclassname = baseclassname;
-	      basename = createProxyName(c_baseclassname);
-	      if (basename)
-		c_baseclass = SwigType_namestr(baseclassname);
+	      String *name = createProxyName(baseclassname);
+	      if (name) {
+		c_baseclassname = baseclassname;
+		baseclass = name;
+	      }
 	    } else {
 	      /* Warn about multiple inheritance for additional base class(es) */
 	      String *proxyclassname = Getattr(n, "classtypeobj");
@@ -3180,25 +3180,24 @@
       }
     }
 
-    bool derived = (basename != NULL);
+    bool derived = baseclass != NULL;
 
     if (derived && purebase_notderived) {
       pure_baseclass = empty_string;
     }
-    const String *wanted_base = basename ? basename : pure_baseclass;
+    const String *wanted_base = baseclass ? baseclass : pure_baseclass;
 
     if (purebase_replace) {
       wanted_base = pure_baseclass;
       derived = false;
       basenode = NULL;
-      Delete(basename);
-      basename = NULL;
+      baseclass = NULL;
       if (purebase_notderived) {
 	Swig_error(Getfile(n), Getline(n),
 	  "The dbase typemap for proxy %s must contain just one of the 'replace' or 'notderived' attributes.\n",
 	  typemap_lookup_type);
       }
-    } else if (basename && Len(pure_baseclass) > 0) {
+    } else if (baseclass && Len(pure_baseclass) > 0) {
       Swig_warning(WARN_D_MULTIPLE_INHERITANCE, Getfile(n), Getline(n),
 	"Warning for %s, base class %s ignored. Multiple inheritance is not supported in D. "
 	"Perhaps you need one of the 'replace' or 'notderived' attributes in the dbase typemap?\n", typemap_lookup_type, pure_baseclass);
@@ -3206,7 +3205,7 @@
 
     // Add code to do C++ casting to base class (only for classes in an inheritance hierarchy)
     if (derived) {
-      writeClassUpcast(n, proxy_class_name, c_classname, c_baseclass);
+      writeClassUpcast(n, proxy_class_name, c_classname, c_baseclassname);
     }
 
     /*
@@ -3354,8 +3353,7 @@
     // Write the class body and the curly bracket closing the class definition
     // to the proxy module.
     indentCode(body);
-    Replaceall(body, "$dbaseclass", basename);
-    Delete(basename);
+    Replaceall(body, "$dbaseclass", baseclass);
 
     Printv(proxy_class_code, body, "\n}\n", NIL);
     Delete(body);
@@ -3368,7 +3366,7 @@
   /* ---------------------------------------------------------------------------
    * D::writeClassUpcast()
    * --------------------------------------------------------------------------- */
-  void writeClassUpcast(Node *n, const String* d_class_name, String* c_class_name, String* c_base_name) {
+  void writeClassUpcast(Node *n, const String* d_class_name, SwigType* c_classname, SwigType* c_baseclassname) {
 
     SwigType *smart = Swig_cparse_smartptr(n);
     String *upcast_name = Swig_name_member(getNSpace(), d_class_name, (smart != 0 ? "SmartPtrUpcast" : "Upcast"));
@@ -3377,36 +3375,42 @@
     writeImDModuleFunction(upcast_name, "void*", "(void* objectRef)",
       upcast_wrapper_name);
 
+    String *classname = SwigType_namestr(c_classname);
+    String *baseclassname = SwigType_namestr(c_baseclassname);
     if (smart) {
-      SwigType *bsmart = Copy(smart);
-      SwigType *rclassname = SwigType_typedef_resolve_all(c_class_name);
-      SwigType *rbaseclass = SwigType_typedef_resolve_all(c_base_name);
-      Replaceall(bsmart, rclassname, rbaseclass);
-      Delete(rclassname);
-      Delete(rbaseclass);
       String *smartnamestr = SwigType_namestr(smart);
-      String *bsmartnamestr = SwigType_namestr(bsmart);
+      String *bsmartnamestr = SwigType_namestr(smart);
+
+      // TODO: SwigType_typedef_resolve_all on a String instead of SwigType is incorrect for templates
+      SwigType *rclassname = SwigType_typedef_resolve_all(classname);
+      SwigType *rbaseclassname = SwigType_typedef_resolve_all(baseclassname);
+      Replaceall(bsmartnamestr, rclassname, rbaseclassname);
+
       Printv(upcasts_code,
 	"SWIGEXPORT ", bsmartnamestr, " * ", upcast_wrapper_name,
 	  "(", smartnamestr, " *objectRef) {\n",
 	"    return objectRef ? new ", bsmartnamestr, "(*objectRef) : 0;\n"
 	"}\n",
 	"\n", NIL);
+
+      Delete(rbaseclassname);
+      Delete(rclassname);
       Delete(bsmartnamestr);
       Delete(smartnamestr);
-      Delete(bsmart);
     } else {
       Printv(upcasts_code,
-	"SWIGEXPORT ", c_base_name, " * ", upcast_wrapper_name,
-	  "(", c_base_name, " *objectRef) {\n",
-	"    return (", c_base_name, " *)objectRef;\n"
+	"SWIGEXPORT ", baseclassname, " * ", upcast_wrapper_name,
+	  "(", baseclassname, " *objectRef) {\n",
+	"    return (", baseclassname, " *)objectRef;\n"
 	"}\n",
 	"\n", NIL);
     }
 
-    Replaceall(upcasts_code, "$cclass", c_class_name);
-    Replaceall(upcasts_code, "$cbaseclass", c_base_name);
+    Replaceall(upcasts_code, "$cclass", classname);
+    Replaceall(upcasts_code, "$cbaseclass", baseclassname);
 
+    Delete(baseclassname);
+    Delete(classname);
     Delete(upcast_name);
     Delete(upcast_wrapper_name);
     Delete(smart);
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/guile.cxx b/Source/Modules/guile.cxx
index 7b42ff9..461c69e 100644
--- a/Source/Modules/guile.cxx
+++ b/Source/Modules/guile.cxx
@@ -255,7 +255,7 @@
     if (goops) {
       if (linkage != GUILE_LSTYLE_PASSIVE && linkage != GUILE_LSTYLE_MODULE) {
 	Printf(stderr, "guile: GOOPS support requires passive or module linkage\n");
-	exit(1);
+	SWIG_exit(EXIT_FAILURE);
       }
     }
 
diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx
index 9408736..7734c64 100644
--- a/Source/Modules/java.cxx
+++ b/Source/Modules/java.cxx
@@ -1633,7 +1633,7 @@
       if (classname_substituted_flag) {
 	if (SwigType_isenum(t)) {
 	  // This handles wrapping of inline initialised const enum static member variables (not when wrapping enum items - ignored later on)
-	  Printf(constants_code, "%s.swigToEnum(%s.%s());\n", return_type, full_imclass_name, Swig_name_get(getNSpace(), symname));
+	  Printf(constants_code, "%s.swigToEnum(%s.%s());\n", return_type, full_imclass_name ? full_imclass_name : imclass_name, Swig_name_get(getNSpace(), symname));
 	} else {
 	  // This handles function pointers using the %constant directive
 	  Printf(constants_code, "new %s(%s.%s(), false);\n", return_type, full_imclass_name ? full_imclass_name : imclass_name, Swig_name_get(getNSpace(), symname));
@@ -1853,11 +1853,11 @@
    * addInterfaceNameAndUpcasts()
    * ----------------------------------------------------------------------------- */
 
-  void addInterfaceNameAndUpcasts(SwigType *smart, String *interface_list, String *interface_upcasts, Hash *base_list, String *c_classname) {
+  void addInterfaceNameAndUpcasts(SwigType *smart, String *interface_list, String *interface_upcasts, Hash *base_list, SwigType *c_classname) {
     List *keys = Keys(base_list);
     for (Iterator it = First(keys); it.item; it = Next(it)) {
       Node *base = Getattr(base_list, it.item);
-      String *c_baseclass = SwigType_namestr(Getattr(base, "name"));
+      SwigType *c_baseclassname = Getattr(base, "name");
       String *interface_name = Getattr(base, "interface:name");
       if (Len(interface_list))
 	Append(interface_list, ", ");
@@ -1876,12 +1876,12 @@
       Replaceall(cptr_method_name, ".", "_");
       Replaceall(cptr_method_name, "$interfacename", interface_name);
 
-      String *upcast_method_name = Swig_name_member(getNSpace(), proxy_class_name, cptr_method_name);
-      upcastsCode(smart, upcast_method_name, c_classname, c_baseclass);
+      String *upcast_method_name = Swig_name_member(getNSpace(), getClassPrefix(), cptr_method_name);
+      upcastsCode(smart, upcast_method_name, c_classname, c_baseclassname);
+
       Delete(upcast_method_name);
       Delete(cptr_method_name);
       Delete(interface_code);
-      Delete(c_baseclass);
     }
     Delete(keys);
   }
@@ -1892,19 +1892,23 @@
    * Add code for C++ casting to base class
    * ----------------------------------------------------------------------------- */
 
-  void upcastsCode(SwigType *smart, String *upcast_method_name, String *c_classname, String *c_baseclass) {
+  void upcastsCode(SwigType *smart, String *upcast_method_name, SwigType *c_classname, SwigType *c_baseclassname) {
     String *jniname = makeValidJniName(upcast_method_name);
     String *wname = Swig_name_wrapper(jniname);
+
     Printf(imclass_cppcasts_code, "  public final static native long %s(long jarg1);\n", upcast_method_name);
+
+    String *classname = SwigType_namestr(c_classname);
+    String *baseclassname = SwigType_namestr(c_baseclassname);
     if (smart) {
-      SwigType *bsmart = Copy(smart);
-      SwigType *rclassname = SwigType_typedef_resolve_all(c_classname);
-      SwigType *rbaseclass = SwigType_typedef_resolve_all(c_baseclass);
-      Replaceall(bsmart, rclassname, rbaseclass);
-      Delete(rclassname);
-      Delete(rbaseclass);
       String *smartnamestr = SwigType_namestr(smart);
-      String *bsmartnamestr = SwigType_namestr(bsmart);
+      String *bsmartnamestr = SwigType_namestr(smart);
+
+      // TODO: SwigType_typedef_resolve_all on a String instead of SwigType is incorrect for templates
+      SwigType *rclassname = SwigType_typedef_resolve_all(classname);
+      SwigType *rbaseclassname = SwigType_typedef_resolve_all(baseclassname);
+      Replaceall(bsmartnamestr, rclassname, rbaseclassname);
+
       Printv(upcasts_code,
 	  "SWIGEXPORT jlong JNICALL ", wname, "(JNIEnv *jenv, jclass jcls, jlong jarg1) {\n",
 	  "    jlong baseptr = 0;\n"
@@ -1915,19 +1919,24 @@
 	  "    *(", bsmartnamestr, " **)&baseptr = argp1 ? new ", bsmartnamestr, "(*argp1) : 0;\n"
 	  "    return baseptr;\n"
 	  "}\n", "\n", NIL);
+
+      Delete(rbaseclassname);
+      Delete(rclassname);
       Delete(bsmartnamestr);
       Delete(smartnamestr);
-      Delete(bsmart);
     } else {
       Printv(upcasts_code,
 	  "SWIGEXPORT jlong JNICALL ", wname, "(JNIEnv *jenv, jclass jcls, jlong jarg1) {\n",
 	  "    jlong baseptr = 0;\n"
 	  "    (void)jenv;\n"
 	  "    (void)jcls;\n"
-	  "    *(", c_baseclass, " **)&baseptr = *(", c_classname, " **)&jarg1;\n"
+	  "    *(", baseclassname, " **)&baseptr = *(", classname, " **)&jarg1;\n"
 	  "    return baseptr;\n"
 	  "}\n", "\n", NIL);
     }
+
+    Delete(baseclassname);
+    Delete(classname);
     Delete(wname);
     Delete(jniname);
   }
@@ -1937,10 +1946,9 @@
    * ----------------------------------------------------------------------------- */
 
   void emitProxyClassDefAndCPPCasts(Node *n) {
-    String *c_classname = SwigType_namestr(Getattr(n, "name"));
-    String *c_baseclass = NULL;
+    SwigType *c_classname = Getattr(n, "name");
+    SwigType *c_baseclassname = NULL;
     String *baseclass = NULL;
-    String *c_baseclassname = NULL;
     String *interface_list = NewStringEmpty();
     String *interface_upcasts = NewStringEmpty();
     SwigType *typemap_lookup_type = Getattr(n, "classtypeobj");
@@ -1962,12 +1970,13 @@
 	Iterator base = First(baselist);
 	while (base.item) {
 	  if (!(GetFlag(base.item, "feature:ignore") || Getattr(base.item, "feature:interface"))) {
-	    String *baseclassname = Getattr(base.item, "name");
+	    SwigType *baseclassname = Getattr(base.item, "name");
 	    if (!c_baseclassname) {
-	      c_baseclassname = baseclassname;
-	      baseclass = Copy(getProxyName(baseclassname));
-	      if (baseclass)
-		c_baseclass = SwigType_namestr(baseclassname);
+	      String *name = getProxyName(baseclassname);
+	      if (name) {
+		c_baseclassname = baseclassname;
+		baseclass = name;
+	      }
 	    } else {
 	      /* Warn about multiple inheritance for additional base class(es) */
 	      String *proxyclassname = Getattr(n, "classtypeobj");
@@ -1984,7 +1993,7 @@
     if (interface_bases)
       addInterfaceNameAndUpcasts(smart, interface_list, interface_upcasts, interface_bases, c_classname);
 
-    bool derived = baseclass && getProxyName(c_baseclassname);
+    bool derived = baseclass != 0;
     if (derived && purebase_notderived)
       pure_baseclass = empty_string;
     const String *wanted_base = baseclass ? baseclass : pure_baseclass;
@@ -1992,7 +2001,6 @@
     if (purebase_replace) {
       wanted_base = pure_baseclass;
       derived = false;
-      Delete(baseclass);
       baseclass = NULL;
       if (purebase_notderived)
         Swig_error(Getfile(n), Getline(n), "The javabase typemap for proxy %s must contain just one of the 'replace' or 'notderived' attributes.\n", typemap_lookup_type);
@@ -2078,7 +2086,7 @@
 	  Printv(proxy_class_def, methodmods, NIL);
 	else
 	  Printv(proxy_class_def, destruct_methodmodifiers, NIL);
-	Printv(proxy_class_def, " void ", destruct_methodname, "(", destruct_parameters, ") ", 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))
@@ -2115,12 +2123,11 @@
 
     if (derived) {
       String *upcast_method_name = Swig_name_member(getNSpace(), getClassPrefix(), smart != 0 ? "SWIGSmartPtrUpcast" : "SWIGUpcast");
-      upcastsCode(smart, upcast_method_name, c_classname, c_baseclass);
+      upcastsCode(smart, upcast_method_name, c_classname, c_baseclassname);
       Delete(upcast_method_name);
     }
 
     Delete(smart);
-    Delete(baseclass);
   }
 
   /* ----------------------------------------------------------------------
diff --git a/Source/Modules/javascript.cxx b/Source/Modules/javascript.cxx
index 8c87330..d2b33b1 100644
--- a/Source/Modules/javascript.cxx
+++ b/Source/Modules/javascript.cxx
@@ -198,6 +198,11 @@
   virtual int emitWrapperFunction(Node *n);
 
   /**
+   * Invoked by nativeWrapper callback
+   */
+  virtual int emitNativeFunction(Node *n);
+
+  /**
    * Invoked from constantWrapper after call to Language::constantWrapper.
    **/
   virtual int emitConstant(Node *n);
@@ -311,6 +316,7 @@
   virtual int classHandler(Node *n);
   virtual int functionWrapper(Node *n);
   virtual int constantWrapper(Node *n);
+  virtual int nativeWrapper(Node *n);
   virtual void main(int argc, char *argv[]);
   virtual int top(Node *n);
 
@@ -442,6 +448,18 @@
 }
 
 /* ---------------------------------------------------------------------
+ * nativeWrapper()
+ *
+ * Function wrapper for generating placeholders for native functions
+ * --------------------------------------------------------------------- */
+
+int JAVASCRIPT::nativeWrapper(Node *n) {
+  emitter->emitNativeFunction(n);
+
+  return SWIG_OK;
+}
+
+/* ---------------------------------------------------------------------
  * classHandler()
  *
  * Function handler for generating wrappers for class
@@ -768,6 +786,14 @@
   return ret;
 }
 
+int JSEmitter::emitNativeFunction(Node *n) {
+  String *wrapname = Getattr(n, "wrap:name");
+  enterFunction(n);
+  state.function(WRAPPER_NAME, wrapname);
+  exitFunction(n);
+  return SWIG_OK;
+}
+
 int JSEmitter::enterClass(Node *n) {
   state.clazz(RESET);
   state.clazz(NAME, Getattr(n, "sym:name"));
diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
index 0b615ce..72b765b 100644
--- a/Source/Modules/main.cxx
+++ b/Source/Modules/main.cxx
@@ -23,6 +23,7 @@
 #include "swigwarn.h"
 #include "cparse.h"
 #include <ctype.h>
+#include <errno.h>
 #include <limits.h>		// for INT_MAX
 
 // Global variables
@@ -970,11 +971,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 +1066,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 +1075,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");
@@ -1374,13 +1377,15 @@
   while (freeze) {
   }
 
-  if ((werror) && (Swig_warn_count())) {
-    return Swig_warn_count();
-  }
-
   delete lang;
 
-  return Swig_error_count();
+  int error_count = werror ? Swig_warn_count() : 0;
+  error_count += Swig_error_count();
+
+  if (error_count != 0)
+    SWIG_exit(error_count);
+
+  return 0;
 }
 
 /* -----------------------------------------------------------------------------
@@ -1392,5 +1397,20 @@
 void SWIG_exit(int exit_code) {
   while (freeze) {
   }
+
+  if (exit_code > 0) {
+    CloseAllOpenFiles();
+
+    /* Remove all generated files */
+    if (all_output_files) {
+      for (int i = 0; i < Len(all_output_files); i++) {
+	String *filename = Getitem(all_output_files, i);
+	int removed = remove(Char(filename));
+	if (removed == -1)
+	  fprintf(stderr, "On exit, could not delete file %s: %s\n", Char(filename), strerror(errno));
+      }
+    }
+  }
+
   exit(exit_code);
 }
diff --git a/Source/Modules/mzscheme.cxx b/Source/Modules/mzscheme.cxx
index 5438741..7886813 100644
--- a/Source/Modules/mzscheme.cxx
+++ b/Source/Modules/mzscheme.cxx
@@ -221,7 +221,6 @@
 
     Wrapper *f = NewWrapper();
     String *proc_name = NewString("");
-    String *source = NewString("");
     String *target = NewString("");
     String *arg = NewString("");
     String *cleanup = NewString("");
@@ -312,10 +311,9 @@
       String *ln = Getattr(p, "lname");
 
       // Produce names of source and target
-      Clear(source);
       Clear(target);
       Clear(arg);
-      Printf(source, "argv[%d]", i);
+      String *source = NewStringf("argv[%d]", i);
       Printf(target, "%s", ln);
       Printv(arg, Getattr(p, "name"), NIL);
 
@@ -339,6 +337,7 @@
       if (i >= numreq) {
 	Printf(f->code, "}\n");
       }
+      Delete(source);
     }
 
     /* Insert constraint checking code */
@@ -465,7 +464,6 @@
     }
 
     Delete(proc_name);
-    Delete(source);
     Delete(target);
     Delete(arg);
     Delete(outarg);
diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx
index 7e59def..9f7504b 100644
--- a/Source/Modules/ocaml.cxx
+++ b/Source/Modules/ocaml.cxx
@@ -473,7 +473,6 @@
 
     Wrapper *f = NewWrapper();
     String *proc_name = NewString("");
-    String *source = NewString("");
     String *target = NewString("");
     String *arg = NewString("");
     String *cleanup = NewString("");
@@ -580,10 +579,9 @@
       pt = SwigType_typedef_qualified(pt);
 
       // Produce names of source and target
-      Clear(source);
       Clear(target);
       Clear(arg);
-      Printf(source, "caml_list_nth(args,%d)", i);
+      String *source = NewStringf("caml_list_nth(args,%d)", i);
       Printf(target, "%s", ln);
       Printv(arg, Getattr(p, "name"), NIL);
 
@@ -607,6 +605,7 @@
       if (i >= numreq) {
 	Printf(f->code, "}\n");
       }
+      Delete(source);
     }
 
     /* Insert constraint checking code */
@@ -787,7 +786,6 @@
       Printf(f_mlibody, "val %s : c_obj -> c_obj\n", mangled_name);
 
     Delete(proc_name);
-    Delete(source);
     Delete(target);
     Delete(arg);
     Delete(outarg);
@@ -1621,7 +1619,7 @@
       /* pass the method call on to the OCaml object */
       Printv(w->code,
 	     "swig_result = caml_swig_alloc(1,C_list);\n" "SWIG_Store_field(swig_result,0,args);\n" "args = swig_result;\n" "swig_result = Val_unit;\n", 0);
-      Printf(w->code, "static CAML_VALUE *swig_ocaml_func_val = NULL;\n" "if (!swig_ocaml_func_val) {\n");
+      Printf(w->code, "static const CAML_VALUE *swig_ocaml_func_val = NULL;\n" "if (!swig_ocaml_func_val) {\n");
       Printf(w->code, "  swig_ocaml_func_val = caml_named_value(\"swig_runmethod\");\n  }\n");
       Printf(w->code, "swig_result = caml_callback3(*swig_ocaml_func_val,swig_get_self(),caml_copy_string(\"%s\"),args);\n", Getattr(n, "name"));
       /* exception handling */
@@ -1866,9 +1864,9 @@
   }
 
   String *runtimeCode() {
-    String *s = Swig_include_sys("ocaml.swg");
+    String *s = Swig_include_sys("ocamlrun.swg");
     if (!s) {
-      Printf(stderr, "*** Unable to open 'ocaml.swg'\n");
+      Printf(stderr, "*** Unable to open 'ocamlrun.swg'\n");
       s = NewString("");
     }
     return s;
diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx
index 994fbd7..1edbd87 100644
--- a/Source/Modules/php.cxx
+++ b/Source/Modules/php.cxx
@@ -676,7 +676,7 @@
       Delete(s_fakeoowrappers);
       s_fakeoowrappers = NULL;
     }
-    Printf(f_phpcode, "%s\n?>\n", s_phpclasses);
+    Printf(f_phpcode, "%s\n", s_phpclasses);
     Delete(f_phpcode);
 
     return SWIG_OK;
@@ -1223,7 +1223,7 @@
 	/* FIXME: How should this be handled?  The rest of SWIG just seems
 	 * to not bother checking for malloc failing! */
 	fprintf(stderr, "Malloc failed!\n");
-	exit(1);
+	SWIG_exit(EXIT_FAILURE);
       }
       for (i = 0; i < max_num_of_arguments; ++i) {
 	arg_names[i] = NULL;
@@ -1235,7 +1235,7 @@
 	/* FIXME: How should this be handled?  The rest of SWIG just seems
 	 * to not bother checking for malloc failing! */
 	fprintf(stderr, "Malloc failed!\n");
-	exit(1);
+	SWIG_exit(EXIT_FAILURE);
       }
       for (i = 0; i < max_num_of_arguments; ++i) {
 	arg_values[i] = NULL;
diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx
old mode 100755
new mode 100644
index b849335..1dbedad
--- a/Source/Modules/python.cxx
+++ b/Source/Modules/python.cxx
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * This file is part of SWIG, which is licensed as a whole under version 3 
+ * This file is part of SWIG, which is licensed as a whole under version 3
  * (or any later version) of the GNU General Public License. Some additional
  * terms also apply to certain portions of SWIG. The full details of the SWIG
  * license and copyrights can be found in the LICENSE and COPYRIGHT files
@@ -16,7 +16,6 @@
 #include "cparse.h"
 #include <ctype.h>
 #include <errno.h>
-#include <stdlib.h>
 #include "pydoc.h"
 
 #include <stdint.h>
@@ -462,12 +461,12 @@
    * ------------------------------------------------------------ */
 
   virtual int top(Node *n) {
-    /* check if directors are enabled for this module.  note: this 
+    /* check if directors are enabled for this module.  note: this
      * is a "master" switch, without which no director code will be
      * emitted.  %feature("director") statements are also required
      * to enable directors for individual classes or methods.
      *
-     * use %module(directors="1") modulename at the start of the 
+     * use %module(directors="1") modulename at the start of the
      * interface file to enable director generation.
      */
     String *mod_docstring = NULL;
@@ -685,13 +684,13 @@
 	 * same package, otherwise load it as a global module.
 	 */
         Printv(default_import_code, "# Import the low-level C/C++ module\n", NULL);
-        Printv(default_import_code, "if __package__ or '.' in __name__:\n", NULL);
+        Printv(default_import_code, "if __package__ or \".\" in __name__:\n", NULL);
         Printv(default_import_code, tab4, "from . import ", module, "\n", NULL);
         Printv(default_import_code, "else:\n", NULL);
         Printv(default_import_code, tab4, "import ", module, "\n", NULL);
       } else {
         Printv(default_import_code, "# Pull in all the attributes from the low-level C/C++ module\n", NULL);
-        Printv(default_import_code, "if __package__ or '.' in __name__:\n", NULL);
+        Printv(default_import_code, "if __package__ or \".\" in __name__:\n", NULL);
         Printv(default_import_code, tab4, "from .", module, " import *\n", NULL);
         Printv(default_import_code, "else:\n", NULL);
         Printv(default_import_code, tab4, "from ", module, " import *\n", NULL);
@@ -707,40 +706,13 @@
 	Printf(f_shadow, "_swig_new_static_method = %s.SWIG_PyStaticMethod_New\n", module);
       }
 
-      {
-	// Python-2.2 object hack
-	Printv(f_shadow,
-	       "\n", "def _swig_setattr_nondynamic(self, class_type, name, value, static=1):\n",
-	       tab4, "if name == \"thisown\":\n", tab8, "return self.this.own(value)\n",
-	       tab4, "if name == \"this\":\n", tab8, "if type(value).__name__ == 'SwigPyObject':\n", tab4, tab8, "self.__dict__[name] = value\n",
-#ifdef USE_THISOWN
-	       tab4, tab8, "if hasattr(value,\"thisown\"):\n", tab8, tab8, "self.__dict__[\"thisown\"] = value.thisown\n", tab4, tab8, "del value.thisown\n",
-#endif
-	       tab4, tab8, "return\n", tab4, "method = class_type.__swig_setmethods__.get(name, None)\n", tab4, "if method:\n", tab4, tab4, "return method(self, value)\n",
-#ifdef USE_THISOWN
-	       tab4, "if not static or name == \"thisown\":\n",
-#else
-	       tab4, "if not static:\n",
-#endif
-	       NIL);
-	Printv(f_shadow, tab4, tab4, "object.__setattr__(self, name, value)\n", NIL);
-	Printv(f_shadow,
-	       tab4, "else:\n",
-	       tab4, tab4, "raise AttributeError(\"You cannot add attributes to %s\" % self)\n\n",
-	        "\n", "def _swig_setattr(self, class_type, name, value):\n", tab4, "return _swig_setattr_nondynamic(self, class_type, name, value, 0)\n\n", NIL);
-
-	Printv(f_shadow,
-	       "\n", "def _swig_getattr(self, class_type, name):\n",
-	       tab4, "if name == \"thisown\":\n", tab8, "return self.this.own()\n",
-	       tab4, "method = class_type.__swig_getmethods__.get(name, None)\n",
-	       tab4, "if method:\n", tab8, "return method(self)\n",
-	       tab4, "raise AttributeError(\"'%s' object has no attribute '%s'\" % (class_type.__name__, name))\n\n", NIL);
-
-	Printv(f_shadow,
-	        "\n", "def _swig_repr(self):\n",
-	       tab4, "try:\n", tab8, "strthis = \"proxy of \" + self.this.__repr__()\n",
-	       tab4, "except __builtin__.Exception:\n", tab8, "strthis = \"\"\n", tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL);
-      }
+      Printv(f_shadow, "\n",
+	     "def _swig_repr(self):\n",
+	     tab4, "try:\n",
+	     tab4, tab4, "strthis = \"proxy of \" + self.this.__repr__()\n",
+	     tab4, "except __builtin__.Exception:\n",
+	     tab4, tab4, "strthis = \"\"\n",
+	     tab4, "return \"<%s.%s; %s >\" % (self.__class__.__module__, self.__class__.__name__, strthis,)\n\n", NIL);
 
       Printv(f_shadow,  "\n",
 	     "def _swig_setattr_nondynamic_instance_variable(set):\n",
@@ -875,7 +847,7 @@
 
       Printv(f_shadow_py, "\nfrom sys import version_info as _swig_python_version_info\n", NULL);
       Printv(f_shadow_py, "if _swig_python_version_info < (2, 7, 0):\n", NULL);
-      Printv(f_shadow_py, tab4, "raise RuntimeError('Python 2.7 or later required')\n\n", NULL);
+      Printv(f_shadow_py, tab4, "raise RuntimeError(\"Python 2.7 or later required\")\n\n", NULL);
 
       if (Len(f_shadow_after_begin) > 0)
 	Printv(f_shadow_py, f_shadow_after_begin, "\n", NIL);
@@ -1633,7 +1605,7 @@
    *
    * For functions that have not had nameless parameters set in the Language class.
    *
-   * Inputs: 
+   * Inputs:
    *   plist - entire parameter list
    *   arg_num - the number to start from when naming arguments
    * Side effects:
@@ -1747,7 +1719,7 @@
       }
       // Write the function annotation
       if (func_annotation)
-	Printf(doc, ": '%s'", type_str);
+	Printf(doc, ": \"%s\"", type_str);
 
       // Write default value
       if (value && !calling) {
@@ -1755,7 +1727,7 @@
 	if (new_value) {
 	  value = new_value;
 	} else {
-	  // Even if the value is not representable in the target language, still use it in the documentaiton, for compatibility with the previous SWIG versions
+	  // Even if the value is not representable in the target language, still use it in the documentation, for compatibility with the previous SWIG versions
 	  // and because it can still be useful to see the C++ expression there.
 	  Node *lookup = Swig_symbol_clookup(value, 0);
 	  if (lookup)
@@ -2038,10 +2010,10 @@
       // This must have been an octal number. This is the only case we
       // cannot use in Python directly, since Python 2 and 3 use non-
       // compatible representations.
-      result = NewString(*s == '-' ? "int('-" : "int('");
+      result = NewString(*s == '-' ? "int(\"-" : "int(\"");
       String *octal_string = NewStringWithSize(p, (int) (end - p));
       Append(result, octal_string);
-      Append(result, "', 8)");
+      Append(result, "\", 8)");
       Delete(octal_string);
       return result;
     }
@@ -2200,7 +2172,7 @@
     while (i) {
       Node *nn = Getattr(i, "defaultargs");
       if (nn != h) {
-	/* Check if overloaded function has defaultargs and 
+	/* Check if overloaded function has defaultargs and
 	 * pointed to the first overloaded. */
 	return true;
       }
@@ -2217,7 +2189,7 @@
    * reuse make_autodocParmList() to do so.
    * ------------------------------------------------------------ */
   String *make_pyParmList(Node *n, bool in_class, bool is_calling, int kw, bool has_self_for_count = false) {
-    /* Get the original function for a defaultargs copy, 
+    /* Get the original function for a defaultargs copy,
      * see default_arguments() in parser.y. */
     Node *nn = Getattr(n, "defaultargs");
     if (nn)
@@ -2521,7 +2493,7 @@
     String *symname = Getattr(n, "sym:name");
     String *wname = Swig_name_wrapper(symname);
 
-    const char *builtin_kwargs = builtin_ctor ? ", PyObject *SWIGUNUSEDPARM(kwargs)" : "";
+    const char *builtin_kwargs = builtin_ctor ? ", PyObject *kwargs" : "";
     Printv(f->def, linkage, builtin_ctor ? "int " : "PyObject *", wname, "(PyObject *self, PyObject *args", builtin_kwargs, ") {", NIL);
 
     Wrapper_add_local(f, "argc", "Py_ssize_t argc");
@@ -2531,6 +2503,9 @@
     if (!fastunpack) {
       Wrapper_add_local(f, "ii", "Py_ssize_t ii");
 
+      if (builtin_ctor)
+	Printf(f->code, "if (!SWIG_Python_CheckNoKeywords(kwargs, \"%s\")) SWIG_fail;\n", symname);
+
       if (maxargs - (add_self ? 1 : 0) > 0) {
         Append(f->code, "if (!PyTuple_Check(args)) SWIG_fail;\n");
         Append(f->code, "argc = PyObject_Length(args);\n");
@@ -2546,8 +2521,9 @@
       if (add_self)
 	Append(f->code, "argc++;\n");
     } else {
-      String *iname = Getattr(n, "sym:name");
-      Printf(f->code, "if (!(argc = SWIG_Python_UnpackTuple(args, \"%s\", 0, %d, argv%s))) SWIG_fail;\n", iname, maxargs, add_self ? "+1" : "");
+      if (builtin_ctor)
+	Printf(f->code, "if (!SWIG_Python_CheckNoKeywords(kwargs, \"%s\")) SWIG_fail;\n", symname);
+      Printf(f->code, "if (!(argc = SWIG_Python_UnpackTuple(args, \"%s\", 0, %d, argv%s))) SWIG_fail;\n", symname, maxargs, add_self ? "+1" : "");
       if (add_self)
 	Append(f->code, "argv[0] = self;\n");
       else
@@ -2728,8 +2704,12 @@
       --tuple_required;
     }
     num_fixed_arguments = tuple_required;
+
+    // builtin handles/checks kwargs by default except in constructor wrappers so we need to explicitly handle them in the C constructor wrapper
+    // The check below is for zero arguments. Sometimes (eg directors) self is the first argument for a method with zero arguments.
     if (((num_arguments == 0) && (num_required == 0)) || ((num_arguments == 1) && (num_required == 1) && Getattr(l, "self")))
-      allow_kwargs = 0;
+      if (!builtin_ctor)
+	allow_kwargs = 0;
     varargs = emit_isvarargs(l);
 
     String *wname = Copy(wrapper_name);
@@ -2737,7 +2717,7 @@
       Append(wname, overname);
     }
 
-    const char *builtin_kwargs = builtin_ctor ? ", PyObject *SWIGUNUSEDPARM(kwargs)" : "";
+    const char *builtin_kwargs = builtin_ctor ? ", PyObject *kwargs" : "";
     if (!allow_kwargs || overname) {
       if (!varargs) {
 	Printv(f->def, linkage, wrap_return, wname, "(PyObject *", self_param, ", PyObject *args", builtin_kwargs, ") {", NIL);
@@ -2755,7 +2735,7 @@
       }
       Printv(f->def, linkage, wrap_return, wname, "(PyObject *", self_param, ", PyObject *args, PyObject *kwargs) {", NIL);
     }
-    if (!builtin || !in_class || tuple_arguments > 0) {
+    if (!builtin || !in_class || tuple_arguments > 0 || builtin_ctor) {
       if (!allow_kwargs) {
 	Append(parse_args, "    if (!PyArg_ParseTuple(args, \"");
       } else {
@@ -2904,14 +2884,13 @@
       Printv(f->locals, "  char * kwnames[] = ", kwargs, ";\n", NIL);
     }
 
-    if (builtin && !funpack && in_class && tuple_arguments == 0) {
-      Printf(parse_args, "    if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, \"%s takes no arguments\");\n", iname);
-    } else if (use_parse || allow_kwargs) {
+    if (use_parse || allow_kwargs) {
       Printf(parse_args, ":%s\"", iname);
       Printv(parse_args, arglist, ")) SWIG_fail;\n", NIL);
       funpack = 0;
     } else {
       Clear(parse_args);
+
       if (funpack) {
 	Clear(f->def);
 	if (overname) {
@@ -2924,6 +2903,8 @@
 	} else {
 	  int is_tp_call = Equal(Getattr(n, "feature:python:slot"), "tp_call");
 	  Printv(f->def, linkage, wrap_return, wname, "(PyObject *", self_param, ", PyObject *args", builtin_kwargs, ") {", NIL);
+	  if (builtin_ctor)
+	    Printf(parse_args, "if (!SWIG_Python_CheckNoKeywords(kwargs, \"%s\")) SWIG_fail;\n", iname);
 	  if (onearg && !builtin_ctor && !is_tp_call) {
 	    Printf(parse_args, "if (!args) SWIG_fail;\n");
 	    Append(parse_args, "swig_obj[0] = args;\n");
@@ -2934,8 +2915,14 @@
 	  }
 	}
       } else {
-	Printf(parse_args, "if (!PyArg_UnpackTuple(args, \"%s\", %d, %d", iname, num_fixed_arguments, tuple_arguments);
-	Printv(parse_args, arglist, ")) SWIG_fail;\n", NIL);
+	if (builtin_ctor)
+	  Printf(parse_args, "if (!SWIG_Python_CheckNoKeywords(kwargs, \"%s\")) SWIG_fail;\n", iname);
+	if (builtin && in_class && tuple_arguments == 0) {
+	  Printf(parse_args, "    if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, \"%s takes no arguments\");\n", iname);
+	} else {
+	  Printf(parse_args, "if (!PyArg_UnpackTuple(args, \"%s\", %d, %d", iname, num_fixed_arguments, tuple_arguments);
+	  Printv(parse_args, arglist, ")) SWIG_fail;\n", NIL);
+	}
       }
     }
 
@@ -2999,9 +2986,9 @@
     }
 
     /* if the object is a director, and the method call originated from its
-     * underlying python object, resolve the call by going up the c++ 
-     * inheritance chain.  otherwise try to resolve the method in python.  
-     * without this check an infinite loop is set up between the director and 
+     * underlying python object, resolve the call by going up the c++
+     * inheritance chain.  otherwise try to resolve the method in python.
+     * without this check an infinite loop is set up between the director and
      * shadow class method calls.
      */
 
@@ -3095,7 +3082,7 @@
       //        base class pointers!
 
       /* New addition to unwrap director return values so that the original
-       * python object is returned instead. 
+       * python object is returned instead.
        */
 #if 1
       int unwrap = 0;
@@ -3640,7 +3627,7 @@
   }
 
 
-  /* ------------------------------------------------------------ 
+  /* ------------------------------------------------------------
    * nativeWrapper()
    * ------------------------------------------------------------ */
 
@@ -3675,7 +3662,7 @@
   /* ---------------------------------------------------------------
    * classDirectorMethod()
    *
-   * Emit a virtual director method to pass a method call on to the 
+   * Emit a virtual director method to pass a method call on to the
    * underlying Python object.
    * ** Moved down due to gcc-2.96 internal error **
    * --------------------------------------------------------------- */
@@ -4156,6 +4143,13 @@
     Printv(f, "#if PY_VERSION_HEX >= 0x03040000\n", NIL);
     printSlot(f, getSlot(n, "feature:python:tp_finalize"), "tp_finalize", "destructor");
     Printv(f, "#endif\n", NIL);
+    Printv(f, "#if PY_VERSION_HEX >= 0x03080000\n", NIL);
+    printSlot(f, getSlot(n, "feature:python:tp_vectorcall"), "tp_vectorcall", "vectorcallfunc");
+    Printv(f, "#endif\n", NIL);
+    Printv(f, "#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)\n", NIL);
+    printSlot(f, getSlot(), "tp_print");
+    Printv(f, "#endif\n", NIL);
+
     Printv(f, "#ifdef COUNT_ALLOCS\n", NIL);
     printSlot(f, getSlot(n, "feature:python:tp_allocs"), "tp_allocs", "Py_ssize_t");
     printSlot(f, getSlot(n, "feature:python:tp_frees"), "tp_frees", "Py_ssize_t");
@@ -4452,7 +4446,7 @@
 	    Printv(f_shadow, tab4, str, "\n\n", NIL);
 	}
 
-	Printv(f_shadow, tab4, "thisown = property(lambda x: x.this.own(), ", "lambda x, v: x.this.own(v), doc='The membership flag')\n", NIL);
+	Printv(f_shadow, tab4, "thisown = property(lambda x: x.this.own(), ", "lambda x, v: x.this.own(v), doc=\"The membership flag\")\n", NIL);
 	/* Add static attribute */
 	if (GetFlag(n, "feature:python:nondynamic")) {
 	  Printv(f_shadow_file, tab4, "__setattr__ = _swig_setattr_nondynamic_instance_variable(object.__setattr__)\n", NIL);
@@ -4786,7 +4780,7 @@
     int oldshadow = shadow;
     int use_director = Swig_directorclass(n);
 
-    /* 
+    /*
      * If we're wrapping the constructor of a C++ director class, prepend a new parameter
      * to receive the scripting language object (e.g. 'self')
      *
@@ -5115,7 +5109,7 @@
 
   /* ------------------------------------------------------------
    * insertDirective()
-   * 
+   *
    * Hook for %insert directive.   We're going to look for special %shadow inserts
    * as a special case so we can do indenting correctly
    * ------------------------------------------------------------ */
@@ -5198,7 +5192,7 @@
 /* ---------------------------------------------------------------
  * classDirectorMethod()
  *
- * Emit a virtual director method to pass a method call on to the 
+ * Emit a virtual director method to pass a method call on to the
  * underlying Python object.
  *
  * ** Moved it here due to internal error on gcc-2.96 **
@@ -5299,7 +5293,7 @@
   Append(w->def, " {");
   Append(declaration, ";\n");
 
-  /* declare method return value 
+  /* declare method return value
    * if the return value is a reference or const reference, a specialized typemap must
    * handle it, including declaration of c_result ($result).
    */
@@ -5459,7 +5453,7 @@
 	  } else {
 	    Wrapper_add_localv(w, source, "swig::SwigVar_PyObject", source, "= 0", NIL);
 	    Printf(wrap_args, "%s = SWIG_InternalNewPointerObj(%s, SWIGTYPE%s, 0);\n", source, nonconst, mangle);
-	    //Printf(wrap_args, "%s = SWIG_NewPointerObj(%s, SWIGTYPE_p_%s, 0);\n", 
+	    //Printf(wrap_args, "%s = SWIG_NewPointerObj(%s, SWIGTYPE_p_%s, 0);\n",
 	    //       source, nonconst, base);
 	    Printv(arglist, source, NIL);
 	  }
diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx
index 6a1e16d..48b0efa 100644
--- a/Source/Modules/ruby.cxx
+++ b/Source/Modules/ruby.cxx
@@ -2191,6 +2191,12 @@
     String *tm;
     String *getfname, *setfname;
     Wrapper *getf, *setf;
+    const int assignable = is_assignable(n);
+
+    // Determine whether virtual global variables shall be used
+    // which have different getter and setter signatures,
+    // see https://docs.ruby-lang.org/en/2.6.0/extension_rdoc.html#label-Global+Variables+Shared+Between+C+and+Ruby
+    const bool use_virtual_var = (current == NO_CPP && useGlobalModule);
 
     getf = NewWrapper();
     setf = NewWrapper();
@@ -2201,7 +2207,7 @@
     getfname = Swig_name_wrapper(getname);
     Setattr(n, "wrap:name", getfname);
     Printv(getf->def, "SWIGINTERN VALUE\n", getfname, "(", NIL);
-    Printf(getf->def, "VALUE self");
+    Printf(getf->def, (use_virtual_var) ? "ID id, VALUE *data" : "VALUE self");
     Printf(getf->def, ") {");
     Wrapper_add_local(getf, "_val", "VALUE _val");
 
@@ -2224,8 +2230,8 @@
 
     Wrapper_print(getf, f_wrappers);
 
-    if (!is_assignable(n)) {
-      setfname = NewString("NULL");
+    if (!assignable) {
+      setfname = NewString("(rb_gvar_setter_t *)NULL");
     } else {
       /* create setter */
       String* docs = docstring(n, AUTODOC_SETTER);
@@ -2235,8 +2241,12 @@
       String *setname = Swig_name_set(NSPACE_TODO, iname);
       setfname = Swig_name_wrapper(setname);
       Setattr(n, "wrap:name", setfname);
-      Printv(setf->def, "SWIGINTERN VALUE\n", setfname, "(VALUE self, ", NIL);
-      Printf(setf->def, "VALUE _val) {");
+      Printf(setf->def, "SWIGINTERN ");
+      if (use_virtual_var) {
+        Printv(setf->def, "void\n", setfname, "(VALUE _val, ID id, VALUE *data) {", NIL);
+      } else {
+        Printv(setf->def, "VALUE\n", setfname, "(VALUE self, VALUE _val) {", NIL);
+      }
       tm = Swig_typemap_lookup("varin", n, name, 0);
       if (tm) {
 	Replaceall(tm, "$input", "_val");
@@ -2247,28 +2257,31 @@
       } else {
 	Swig_warning(WARN_TYPEMAP_VARIN_UNDEF, input_file, line_number, "Unable to set variable of type %s\n", SwigType_str(t, 0));
       }
-      Printv(setf->code, tab4, "return _val;\n", NIL);
-      Printf(setf->code, "fail:\n");
-      Printv(setf->code, tab4, "return Qnil;\n", NIL);
+      if (use_virtual_var) {
+        Printf(setf->code, "fail:\n");
+        Printv(setf->code, tab4, "return;\n", NIL);
+      } else {
+        Printv(setf->code, tab4, "return _val;\n", NIL);
+        Printf(setf->code, "fail:\n");
+        Printv(setf->code, tab4, "return Qnil;\n", NIL);
+      }
       Printf(setf->code, "}\n");
       Wrapper_print(setf, f_wrappers);
       Delete(setname);
     }
 
-    /* define accessor method */
-    if (CPlusPlus) {
-      Insert(getfname, 0, "VALUEFUNC(");
-      Append(getfname, ")");
-      Insert(setfname, 0, "VALUEFUNC(");
-      Append(setfname, ")");
-    }
+    /* define accessor methods */
+    Insert(getfname, 0, "VALUEFUNC(");
+    Append(getfname, ")");
+    Insert(setfname, 0, (use_virtual_var) ? "SWIG_RUBY_VOID_ANYARGS_FUNC(" : "VALUEFUNC(");
+    Append(setfname, ")");
 
     String *s = NewString("");
     switch (current) {
     case STATIC_VAR:
       /* C++ class variable */
       Printv(s, tab4, "rb_define_singleton_method(", klass->vname, ", \"", klass->strip(iname), "\", ", getfname, ", 0);\n", NIL);
-      if (!GetFlag(n, "feature:immutable")) {
+      if (assignable) {
 	Printv(s, tab4, "rb_define_singleton_method(", klass->vname, ", \"", klass->strip(iname), "=\", ", setfname, ", 1);\n", NIL);
       }
       Printv(klass->init, s, NIL);
@@ -2279,14 +2292,11 @@
       assert(current == NO_CPP);
       if (!useGlobalModule) {
 	Printv(s, tab4, "rb_define_singleton_method(", modvar, ", \"", iname, "\", ", getfname, ", 0);\n", NIL);
-	if (!GetFlag(n, "feature:immutable")) {
+	if (assignable) {
 	  Printv(s, tab4, "rb_define_singleton_method(", modvar, ", \"", iname, "=\", ", setfname, ", 1);\n", NIL);
 	}
       } else {
-	Printv(s, tab4, "rb_define_global_method(\"", iname, "\", ", getfname, ", 0);\n", NIL);
-	if (!GetFlag(n, "feature:immutable")) {
-	  Printv(s, tab4, "rb_define_global_method(\"", iname, "=\", ", setfname, ", 1);\n", NIL);
-	}
+	Printv(s, tab4, "rb_define_virtual_variable(\"$", iname, "\", ", getfname, ", ", setfname, ");\n", NIL);
       }
       Printv(f_init, s, NIL);
       Delete(s);
diff --git a/Source/Modules/scilab.cxx b/Source/Modules/scilab.cxx
index 4fea0ce..23e45f7 100644
--- a/Source/Modules/scilab.cxx
+++ b/Source/Modules/scilab.cxx
@@ -496,7 +496,7 @@
     /* Add the failure cleanup code */
     /* TODO */
 
-    /* Final substititions if applicable */
+    /* Final substitutions if applicable */
     Replaceall(wrapper->code, "$symname", functionName);
 
     /* Set CheckInputArgument and CheckOutputArgument input arguments */
diff --git a/Source/Modules/swigmod.h b/Source/Modules/swigmod.h
index 583cb13..bfb93d1 100644
--- a/Source/Modules/swigmod.h
+++ b/Source/Modules/swigmod.h
@@ -371,7 +371,6 @@
 int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm);
 void emit_parameter_variables(ParmList *l, Wrapper *f);
 void emit_return_variable(Node *n, SwigType *rt, Wrapper *f);
-void SWIG_exit(int);		/* use EXIT_{SUCCESS,FAILURE} */
 void SWIG_config_file(const_String_or_char_ptr );
 const String *SWIG_output_directory();
 void SWIG_config_cppext(const char *ext);
diff --git a/Source/Modules/typepass.cxx b/Source/Modules/typepass.cxx
index 57125fc..dc84cf9 100644
--- a/Source/Modules/typepass.cxx
+++ b/Source/Modules/typepass.cxx
@@ -267,6 +267,8 @@
 	       and smart pointer to base class, so that smart pointer upcasts
 	       are automatically generated. */
 	    SwigType *bsmart = Copy(smart);
+
+	    // TODO: SwigType_typedef_resolve_all on a String instead of SwigType is incorrect for templates
 	    SwigType *rclsname = SwigType_typedef_resolve_all(clsname);
 	    SwigType *rbname = SwigType_typedef_resolve_all(bname);
 	    int replace_count = Replaceall(bsmart, rclsname, rbname);
@@ -276,6 +278,12 @@
 	      String *firstname = Getattr(first, "name");
 	      Replaceall(bsmart, firstname, rbname);
 	    }
+	    // The code above currently creates a smartptr of the base class by substitution, replacing Derived
+	    // with Base resulting in something like: 'smartptr< Derived >' from 'smartptr< Base >'. Instead
+	    // the feature:smartptr should be used as it also contains 'smartptr< Base >' as specified by the user.
+	    // A similar fix should also be done in upcastsCode in java.cxx, csharp.cxx and writeClassUpcast in d.cxx.
+	    // Printf(stdout, "smartcomparison %s <=> %s\n", SwigType_namestr(bsmart), Getattr(bclass, "feature:smartptr"));
+
 	    Delete(rclsname);
 	    Delete(rbname);
 	    String *smartnamestr = SwigType_namestr(smart);
@@ -961,7 +969,7 @@
       if (Getattr(c, "sym:overloaded") != checkoverloaded) {
         Printf(stdout, "sym:overloaded error c:%p checkoverloaded:%p\n", c, checkoverloaded);
         Swig_print_node(c);
-        exit (1);
+        SWIG_exit(EXIT_FAILURE);
       }
 
       String *decl = Strcmp(nodeType(c), "using") == 0 ? NewString("------") : Getattr(c, "decl");
@@ -969,7 +977,7 @@
       if (!Getattr(c, "sym:overloaded")) {
         Printf(stdout, "sym:overloaded error.....%p\n", c);
         Swig_print_node(c);
-        exit (1);
+        SWIG_exit(EXIT_FAILURE);
       }
       c = Getattr(c, "sym:nextSibling");
     }
diff --git a/Source/Swig/getopt.c b/Source/Swig/getopt.c
index 74076a5..6970dc1 100644
--- a/Source/Swig/getopt.c
+++ b/Source/Swig/getopt.c
@@ -16,7 +16,6 @@
  * sure there are no unmarked options.
  * 
  * TODO: 
- *     - This module needs to be modified so that it doesn't call exit().
  *       Should have cleaner error handling in general.
  * ----------------------------------------------------------------------------- */
 
@@ -88,11 +87,11 @@
   }
   if (error) {
     Printf(stderr, "Use 'swig -help' for available options.\n");
-    exit(1);
+    SWIG_exit(EXIT_FAILURE);
   }
   if (check_input && marked[numargs - 1]) {
     Printf(stderr, "Must specify an input file. Use -help for available options.\n");
-    exit(1);
+    SWIG_exit(EXIT_FAILURE);
   }
 }
 
@@ -105,5 +104,5 @@
 void Swig_arg_error(void) {
   Printf(stderr, "SWIG : Unable to parse command line options.\n");
   Printf(stderr, "Use 'swig -help' for available options.\n");
-  exit(1);
+  SWIG_exit(EXIT_FAILURE);
 }
diff --git a/Source/Swig/misc.c b/Source/Swig/misc.c
index 6b07118..7b81847 100644
--- a/Source/Swig/misc.c
+++ b/Source/Swig/misc.c
@@ -1177,7 +1177,7 @@
       pclose(fp);
     } else {
       Swig_error("SWIG", Getline(s), "Command encoder fails attempting '%s'.\n", s);
-      exit(1);
+      SWIG_exit(EXIT_FAILURE);
     }
   }
 #endif
@@ -1327,7 +1327,8 @@
 
 err_out:
   Swig_error("SWIG", Getline(s), "Invalid regex substitution: '%s'.\n", s);
-  exit(1);
+  SWIG_exit(EXIT_FAILURE);
+  return 0;
 }
 
 /* This function copies len characters from src to dst, possibly applying case conversions to them: if convertCase is 1, to upper case and if it is -1, to lower
@@ -1449,7 +1450,7 @@
     if (!compiled_pat) {
       Swig_error("SWIG", Getline(s), "PCRE compilation failed: '%s' in '%s':%i.\n",
           pcre_error, Char(pattern), pcre_errorpos);
-      exit(1);
+      SWIG_exit(EXIT_FAILURE);
     }
     rc = pcre_exec(compiled_pat, NULL, input, (int)strlen(input), 0, 0, captures, 30);
     if (rc >= 0) {
@@ -1457,7 +1458,7 @@
     } else if (rc != PCRE_ERROR_NOMATCH) {
       Swig_error("SWIG", Getline(s), "PCRE execution failed: error %d while matching \"%s\" using \"%s\".\n",
 	rc, Char(pattern), input);
-      exit(1);
+      SWIG_exit(EXIT_FAILURE);
     }
   }
 
@@ -1475,7 +1476,8 @@
 
 String *Swig_string_regex(String *s) {
   Swig_error("SWIG", Getline(s), "PCRE regex support not enabled in this SWIG build.\n");
-  exit(1);
+  SWIG_exit(EXIT_FAILURE);
+  return 0;
 }
 
 String *Swig_pcre_version(void) {
diff --git a/Source/Swig/naming.c b/Source/Swig/naming.c
index 1b6c963..6689ceb 100644
--- a/Source/Swig/naming.c
+++ b/Source/Swig/naming.c
@@ -1105,7 +1105,7 @@
     Swig_error("SWIG", Getline(n),
                "Invalid regex \"%s\": compilation failed at %d: %s\n",
                Char(pattern), errpos, err);
-    exit(1);
+    SWIG_exit(EXIT_FAILURE);
   }
 
   rc = pcre_exec(compiled_pat, NULL, Char(s), Len(s), 0, 0, NULL, 0);
@@ -1118,7 +1118,7 @@
     Swig_error("SWIG", Getline(n),
                "Matching \"%s\" against regex \"%s\" failed: %d\n",
                Char(s), Char(pattern), rc);
-    exit(1);
+    SWIG_exit(EXIT_FAILURE);
   }
 
   return 1;
@@ -1131,7 +1131,7 @@
   (void)s;
   Swig_error("SWIG", Getline(n),
              "PCRE regex matching is not available in this SWIG build.\n");
-  exit(1);
+  SWIG_exit(EXIT_FAILURE);
 }
 
 #endif /* HAVE_PCRE/!HAVE_PCRE */
diff --git a/Source/Swig/scanner.c b/Source/Swig/scanner.c
index 908bc74..e5a267a 100644
--- a/Source/Swig/scanner.c
+++ b/Source/Swig/scanner.c
@@ -833,7 +833,7 @@
 	return SWIG_TOKEN_MODEQUAL;
       } else if (c == '}') {
 	Swig_error(cparse_file, cparse_line, "Syntax error. Extraneous '%%}'\n");
-	exit(1);
+	SWIG_exit(EXIT_FAILURE);
       } else {
 	retract(s, 1);
 	return SWIG_TOKEN_PERCENT;
diff --git a/Source/Swig/swig.h b/Source/Swig/swig.h
index 1acd32d..e0783da 100644
--- a/Source/Swig/swig.h
+++ b/Source/Swig/swig.h
@@ -438,6 +438,7 @@
   extern void Language_replace_special_variables(String *method, String *tm, Parm *parm);
   extern void Swig_print(DOH *object, int count);
   extern void Swig_print_with_location(DOH *object, int count);
+  extern void SWIG_exit(int exit_code);
 
 
 /* -- template init -- */
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/obs-buildlogs.py b/Tools/obs-buildlogs.py
index b97e7db..1c77e80 100755
--- a/Tools/obs-buildlogs.py
+++ b/Tools/obs-buildlogs.py
@@ -11,9 +11,9 @@
     os.remove(file)
 
 def download():
-  repos = subprocess.Popen(['osc', 'repositories'], stdout=subprocess.PIPE)
+  repos = subprocess.Popen(["osc", "repositories"], stdout=subprocess.PIPE)
   for line in repos.stdout:
-    command = ['osc', 'buildlog', '--last'] + line.split()
+    command = ["osc", "buildlog", "--last"] + line.split()
     filename = "-".join(line.split()) + ".log"
     print("Downloading logs using: {}".format(" ".join(command)))
     buildlog = subprocess.Popen(command, stdout=subprocess.PIPE)
diff --git a/Tools/testflags.py b/Tools/testflags.py
index bf85f56..f3d216b 100755
--- a/Tools/testflags.py
+++ b/Tools/testflags.py
@@ -23,7 +23,7 @@
         "scilab":"-Werror " + c_common,
            "tcl":"-Werror " + c_common,
     }
-    if compiler == 'clang':
+    if compiler == "clang":
         cflags["guile"] += " -Wno-attributes" # -Wno-attributes is for clang LLVM 3.5 and bdw-gc < 7.5 used by guile
 
     if language not in cflags:
@@ -54,7 +54,7 @@
         "scilab":"-Werror " + cxx_common,
            "tcl":"-Werror " + cxx_common,
     }
-    if compiler == 'clang':
+    if compiler == "clang":
         cxxflags["guile"] += " -Wno-attributes" # -Wno-attributes is for clang LLVM 3.5 and bdw-gc < 7.5 used by guile
 
     if language not in cxxflags:
@@ -64,12 +64,12 @@
 
 import argparse
 parser = argparse.ArgumentParser(description="Display CFLAGS or CXXFLAGS to use for testing the SWIG examples and test-suite.")
-parser.add_argument('-l', '--language', required=True, help='set language to show flags for')
+parser.add_argument("-l", "--language", required=True, help="set language to show flags for")
 flags = parser.add_mutually_exclusive_group(required=True)
-flags.add_argument('-c', '--cflags', action='store_true', default=False, help='show CFLAGS')
-flags.add_argument('-x', '--cxxflags', action='store_true', default=False, help='show CXXFLAGS')
-parser.add_argument('-s', '--std', required=False, help='language standard flags for the -std= option')
-parser.add_argument('-C', '--compiler', required=False, help='compiler used (clang or gcc)')
+flags.add_argument("-c", "--cflags", action="store_true", default=False, help="show CFLAGS")
+flags.add_argument("-x", "--cxxflags", action="store_true", default=False, help="show CXXFLAGS")
+parser.add_argument("-s", "--std", required=False, help="language standard flags for the -std= option")
+parser.add_argument("-C", "--compiler", required=False, help="compiler used (clang or gcc)")
 args = parser.parse_args()
 
 if args.cflags:
diff --git a/Tools/travis-linux-install.sh b/Tools/travis-linux-install.sh
index dc85265..c8347d2 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
@@ -33,22 +23,26 @@
 		travis_retry sudo apt-get -qq install mono-devel
 		;;
 	"d")
-		travis_retry wget http://downloads.dlang.org/releases/2014/dmd_2.066.0-0_amd64.deb
-		travis_retry sudo dpkg -i dmd_2.066.0-0_amd64.deb
+		travis_retry wget http://downloads.dlang.org/releases/2.x/${VER}/dmd_${VER}-0_amd64.deb
+		travis_retry sudo dpkg -i dmd_${VER}-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" ] || [ "$VER" == "4" ] ; 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,25 +68,10 @@
 		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
-			travis_retry sudo apt-get -qq install liboctave-dev
-		else
-			# Travis adds external PPAs which contain newer versions of packages
-			# than in baseline trusty. These newer packages prevent some of the
-			# Octave packages in ppa:kwwette/octave, which rely on the older
-			# packages in trusty, from installing. To prevent these kind of
-			# interactions arising, clean out all external PPAs added by Travis
-			# before installing Octave
-			sudo rm -rf /etc/apt/sources.list.d/*
-			travis_retry sudo apt-get -qq update
-			travis_retry sudo add-apt-repository -y ppa:kwwette/octaves
-			travis_retry sudo apt-get -qq update
-			travis_retry sudo apt-get -qq install liboctave${VER}-dev
-		fi
+		travis_retry sudo apt-get -qq install liboctave-dev
 		;;
 	"php")
 		travis_retry sudo add-apt-repository -y ppa:ondrej/php
@@ -118,11 +95,21 @@
 		travis_retry sudo apt-get -qq install r-base
 		;;
 	"ruby")
+		if [[ "$VER" == "2.7" ]]; then
+			# Ruby 2.7 support is currently only rvm master (30 Dec 2019)
+			travis_retry rvm get master
+			rvm reload
+			rvm list known
+		fi
 		if [[ "$VER" ]]; then
 			travis_retry rvm install $VER
 		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..393d96e 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
@@ -20,11 +22,11 @@
 	"lua")
 		travis_retry brew install lua
 		;;
+	"octave")
+		travis_retry brew install octave
+		;;
 	"python")
 		WITHLANG=$SWIGLANG$PY3
-		if [[ "$PY3" ]]; then
-			travis_retry brew upgrade python
-		fi
 		;;
 esac
 
diff --git a/appveyor.yml b/appveyor.yml
index 1eb7ae4..f87cefd 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -16,10 +16,10 @@
   - SWIGLANG: python
     VSVER: 14
     VER: 27
-  - SWIGLANG: python
-    VSVER: 14
-    VER: 36
-    PY3: 3
+# - SWIGLANG: python
+#   VSVER: 14
+#   VER: 36
+#   PY3: 3
   - SWIGLANG: python
     OSVARIANT: cygwin
   - SWIGLANG: python
@@ -89,7 +89,7 @@
 - if "%OSVARIANT%"=="" bash -c "cl.exe /? 2>&1 | head -n 1"
 - if "%OSVARIANT%"=="" bash -c "which csc.exe"
 - if "%OSVARIANT%"=="" bash -c "csc.exe /? | head -n 1"
-- if "%OSVARIANT%"=="cygwin" %CYGWINSETUP% --quiet-mode --packages python-devel,libpcre-devel,libboost-devel > cygwin-install.txt || bash -c "cat cygwin-install.txt"
+- if "%OSVARIANT%"=="cygwin" %CYGWINSETUP% --quiet-mode --packages python2-devel,libpcre-devel,libboost-devel > cygwin-install.txt || bash -c "cat cygwin-install.txt"
 - if "%OSVARIANT%"=="mingw" bash -c "pacman --noconfirm --sync mingw%MBITS%/mingw-w64-%MARCH%-pcre mingw%MBITS%/mingw-w64-%MARCH%-boost"
 - if not "%WITHLANG%"=="" set SWIGWITHLANG==%WITHLANG%
 - if not "%WITHLANG%"=="" where %WITHLANG%
@@ -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..b4cadef 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.2],[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])],
@@ -1066,23 +1058,33 @@
    AS_IF([test "x`${OCTAVE} --version 2>/dev/null | sed -n -e '1p' | sed -n -e '/Octave, version/p'`" != x],[
       AC_MSG_RESULT([yes])
    ],[
-      AC_MSG_NOTICE([no, disabling Octave])
+      AC_MSG_NOTICE([no])
       OCTAVE=
    ])
 fi
 
 # Check for required Octave helper program "mkoctfile"
 if test -n "$OCTAVE"; then
-   AC_MSG_CHECKING([for mkoctfile])
-   mkoctfile=["`echo $OCTAVE | sed -e 's|[a-z][a-z-]*$|mkoctfile|;t;s|[a-z][a-z-]*\(-[0-9][0-9.+]*\)$|mkoctfile\1|;t'`"]
-   AC_MSG_RESULT([${mkoctfile}])
-   AC_MSG_CHECKING([if ${mkoctfile} works])
-   AS_IF([test "x`${mkoctfile} --version 2>/dev/null | sed -n -e '1p' | sed -n -e '/mkoctfile, version/p'`" != x],[
+  AC_MSG_CHECKING([for mkoctfile])
+  version_suffix=["`echo $OCTAVE | sed -e 's|.*\(-[0-9][0-9.]*\)$|\1|'`"]
+  case $version_suffix in
+    -*) ;;
+    *) version_suffix="" ;;
+  esac
+  octave_directory=`dirname $OCTAVE`
+  if test "$octave_directory" = "." ; then
+    mkoctfile="mkoctfile${version_suffix}"
+  else
+    mkoctfile="${octave_directory}/mkoctfile${version_suffix}"
+  fi
+  AC_MSG_RESULT([${mkoctfile}])
+  AC_MSG_CHECKING([if ${mkoctfile} works])
+  AS_IF([test "x`${mkoctfile} --version 2>/dev/null | sed -n -e '1p' | sed -n -e '/mkoctfile, version/p'`" != x],[
       AC_MSG_RESULT([yes])
-   ],[
-      AC_MSG_NOTICE([no, disabling Octave])
+    ],[
+      AC_MSG_RESULT([no])
       OCTAVE=
-   ])
+    ])
 fi
 
 # Check for Octave preprocessor/compiler/linker flags
@@ -1122,7 +1124,10 @@
 
    AC_MSG_CHECKING([for Octave linker flags])
    OCTAVE_LDFLAGS=
-   for var in RDYNAMIC_FLAG LFLAGS RLD_FLAG OCTAVE_LIBS LIBS; do
+   for var in OCTLIBDIR; do
+     OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "-L`env - ${mkoctfile} -p ${var}`
+   done
+   for var in RDYNAMIC_FLAG RLD_FLAG OCTAVE_LIBS LIBS; do
      OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "`env - ${mkoctfile} -p ${var}`
    done
    AC_MSG_RESULT([$OCTAVE_LDFLAGS])
@@ -1343,6 +1348,33 @@
   JAVAC="$JAVACBIN"
 fi
 
+# Check Java version: we require Java 9 or later for Doxygen tests.
+if test -n "$JAVAC"; then
+    AC_MSG_CHECKING(if java version is 9 or greater)
+    javac_version=`"$JAVAC" -version 2>&1`
+    java_version_num=`echo $javac_version | sed -n 's/^javac //p'`
+    if test -z "$java_version_num"; then
+        AC_MSG_WARN([unknown format for Java version returned by "$JAVAC" ($javac_version)])
+        JAVA_SKIP_DOXYGEN_TEST_CASES=1
+        AC_MSG_RESULT(unknown)
+    else
+        dnl Until Java 8 version number was in format "1.x", starting from
+        dnl Java 9 it's just "x".
+        case $java_version_num in
+            1.*)
+                JAVA_SKIP_DOXYGEN_TEST_CASES=1
+                AC_MSG_RESULT([no, disabling Doxygen tests])
+                ;;
+
+            *)
+                AC_MSG_RESULT(yes)
+                ;;
+        esac
+    fi
+
+    AC_SUBST(JAVA_SKIP_DOXYGEN_TEST_CASES)
+fi
+
 AC_MSG_CHECKING(for java include file jni.h)
 AC_ARG_WITH(javaincl, [  --with-javaincl=path    Set location of Java include directory], [JAVAINCDIR="$withval"], [JAVAINCDIR=])
 
@@ -1403,15 +1435,6 @@
   fi
 fi
 
-# Javadoc support required for the Java test-suite is available by default in jdk9+ and in tools.jar in earlier jdk versions
-AC_MSG_CHECKING(for java tools.jar)
-if test -n "$JAVA_HOME" && test -r "$JAVA_HOME/lib/tools.jar" ; then
-  JAVA_TOOLS_JAR="$JAVA_HOME/lib/tools.jar"
-  AC_MSG_RESULT([$JAVA_TOOLS_JAR])
-else
-  AC_MSG_RESULT(not found)
-fi
-
 case $host in
 *-*-cygwin*)
         # TODO: Only use this flag if the compiler supports it, later versions of gcc no longer have it
@@ -1478,7 +1501,6 @@
 AC_SUBST(JAVAC)
 AC_SUBST(JAVAINC)
 AC_SUBST(JAVA_CLASSPATH_SEP)
-AC_SUBST(JAVA_TOOLS_JAR)
 AC_SUBST(JAVADYNAMICLINKING)
 AC_SUBST(JAVALIBRARYPREFIX)
 AC_SUBST(JAVASO)
@@ -2052,6 +2074,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 +2094,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#
@@ -2365,11 +2387,6 @@
 if test x"${GOBIN}" = xno; then
   AC_MSG_NOTICE([Disabling Go])
   GO=
-  GOC=
-  GO1=false
-  GO12=false
-  GO13=false
-  GO15=false
   GOGCC=false
   GCCGO=
   GOOPT=
@@ -2385,30 +2402,17 @@
 
   GOGCC=false
   GCCGO=
-  GO1=false
-  GO12=false
-  GO13=false
-  GO15=false
   GOOPT=
   GCCGOOPT=
   GOVERSIONOPTION=
 
   if test -n "$GO" ; then
-    GO1=true
     GOVERSIONOPTION=version
     go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //')
-    case "$go_version" in
-    go1 | go1.[[01234]] | go1.[[01234]].*)
-      GOC=$(sh -c "$(go env) && echo \$GOCHAR")c
-      ;;
-    *)
-      GOC=compile
-      ;;
-    esac
     AC_MSG_CHECKING([whether go version is too old])
     case $go_version in
-    go1.1.* | go1.1 | go1.0 | go1.0.* | go1 )
-      AC_MSG_RESULT([yes - minimum version is 1.2])
+    go1.[012]*)
+      AC_MSG_RESULT([yes - minimum version is 1.3])
       GO=
       GOOPT="-intgosize 32"
       ;;
@@ -2424,20 +2428,6 @@
       esac
       ;;
     esac
-    case $go_version in
-    go1.0 | go1.0.* | go1 | go1.1 | go1.1.*)
-      GOOPT="$GOOPT -use-shlib"
-      ;;
-    go1.2 | go1.2.*)
-      GO12=true
-      ;;
-    go1.3 | go1.3.* | go1.4 | go1.4.*)
-      GO13=true
-      ;;
-    *)
-      GO15=true
-      ;;
-    esac
   fi
 
   AC_CHECK_PROGS(GCCGO, gccgo)
@@ -2644,7 +2634,7 @@
 
 
 SKIP_OCAML=
-if test -z "$OCAMLC" ; then
+if test -z "$OCAMLC" || test -z "$CAMLP4" ; then
     SKIP_OCAML="1"
 fi
 AC_SUBST(SKIP_OCAML)