diff --git a/.gitignore b/.gitignore
index e94087e29..5df510547 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,6 +66,7 @@ CCache/ccache_swig_config.h
CCache/config.h
CCache/config.log
CCache/config.status
+CCache/config_win32.h
Examples/Makefile
Examples/d/example.mk
Examples/guile/Makefile
@@ -85,6 +86,8 @@ swig.spec
# Build Artifacts
.dirstamp
CCache/ccache-swig
+CCache/ccache-swig.1
+CCache/web/ccache-swig-man.html
Lib/swigwarn.swg
Source/CParse/parser.c
Source/CParse/parser.h
@@ -149,14 +152,29 @@ Examples/guile/*/my-guile
Examples/test-suite/java/*/
Examples/java/*/*.java
!Examples/java/*/runme.java
+Examples/java/doxygen/javadocs
# Javascript
Examples/test-suite/javascript/*/
*.gyp
+# OCaml
+Examples/test-suite/ocaml/*.ml*
+Examples/test-suite/ocaml/*.cm*
+Examples/test-suite/ocaml/*_runme
+!Examples/test-suite/ocaml/*runme.ml
+Examples/ocaml/**/example.ml*
+Examples/ocaml/**/runme
+Examples/ocaml/**/runme_top
+Examples/ocaml/**/*.cm*
+Examples/ocaml/**/swig.ml*
+Examples/ocaml/**/swigp4.ml
+
# Octave
swigexample*.oct
Examples/test-suite/octave/*.oct
+Examples/test-suite/octave/octheaders.hpp
+Examples/test-suite/octave/octheaders.hpp.gch
# Perl5
Examples/test-suite/perl5/*.pm
@@ -177,11 +195,16 @@ Examples/php/*/example.php
/__pycache__/
Examples/test-suite/python/*.py
!Examples/test-suite/python/*runme.py
-Examples/python/*/example.py
Examples/python/**/bar.py
Examples/python/**/base.py
+Examples/python/**/example.py
Examples/python/**/foo.py
+Examples/python/**/robin.py
+Examples/python/**/runme3.py
Examples/python/**/spam.py
+Examples/python/import_packages/module_is_init/pkg1/__init__.py
+Examples/python/import_packages/namespace_pkg/path4.zip
+Examples/python/doxygen/example.html
# R
Examples/test-suite/r/*.R
diff --git a/.travis.yml b/.travis.yml
index d9dc92312..3ed261b6e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,307 +4,454 @@ matrix:
- compiler: clang
os: linux
env: SWIGLANG=
- sudo: required
- dist: trusty
+ dist: xenial
+ - compiler: clang
+ os: linux
+ env: SWIGLANG= BUILDSYSTEM=cmake
+ dist: xenial
- compiler: gcc
os: linux
env: SWIGLANG=
+ dist: xenial
- compiler: gcc
os: linux
- env: SWIGLANG=
- sudo: required
- dist: trusty
+ env: SWIGLANG= BUILDSYSTEM=cmake
+ dist: xenial
- os: linux
- env: SWIGLANG= SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
- sudo: required
- dist: trusty
+ env: SWIGLANG= GCC=4.4
+ dist: xenial
- os: linux
- env: SWIGLANG= SWIG_CC=gcc-6 SWIG_CXX=g++-6
- sudo: required
- dist: trusty
+ env: SWIGLANG= GCC=4.6
+ dist: xenial
+ - os: linux
+ env: SWIGLANG= GCC=4.7
+ dist: xenial
+ - os: linux
+ env: SWIGLANG= GCC=4.8
+ dist: xenial
+ - os: linux
+ env: SWIGLANG= GCC=4.9
+ dist: xenial
+ - os: linux
+ env: SWIGLANG= GCC=6
+ dist: xenial
+ - os: linux
+ env: SWIGLANG= GCC=7
+ dist: xenial
+ - os: linux
+ env: SWIGLANG= GCC=8
+ dist: xenial
+ - os: linux
+ env: SWIGLANG= GCC=9
+ dist: xenial
- compiler: gcc
os: linux
env: SWIGLANG=csharp
- sudo: required
- dist: trusty
+ dist: xenial
- compiler: gcc
os: linux
- env: SWIGLANG=d
- sudo: required
- dist: trusty
+ env: SWIGLANG=d VER=2.066.0
+ dist: xenial
- compiler: gcc
os: linux
- env: SWIGLANG=go
- sudo: required
- dist: trusty
+ env: SWIGLANG=d VER=2.086.1
+ dist: xenial
- compiler: gcc
os: linux
- env: SWIGLANG=go VER=1.5
- sudo: required
- dist: trusty
+ env: SWIGLANG=go VER=1.3
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=go VER=1.8
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=go VER=1.12
+ 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=6 CPP11=1
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=javascript ENGINE=node VER=8 CPP11=1
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=javascript ENGINE=node VER=10 CPP11=1
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=javascript ENGINE=node VER=12 CPP11=1
+ sudo: required
+ 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=octave SWIGJOBS=-j2 # 3.2
- - compiler: gcc
- os: linux
- env: SWIGLANG=octave SWIGJOBS=-j2 VER=3.8
- - compiler: gcc
- os: linux
- env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.0
- - compiler: gcc
- os: linux
- env: SWIGLANG=perl5
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=php5
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=php VER=7.0
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=php VER=7.1
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python VER=2.4
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python VER=2.5
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python VER=2.6
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python # 2.7
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python PY3=3 VER=3.2
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python PY3=3 VER=3.3
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python PY3=3 VER=3.4
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python PY3=3 VER=3.5
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python SWIG_FEATURES=-builtin VER=2.6
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python SWIG_FEATURES=-builtin
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.4
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.5
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.5 SWIGOPTPY3=
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python SWIG_FEATURES=-O
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=python SWIG_FEATURES=-classic
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=r
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=ruby VER=1.9.3
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=ruby VER=2.0.0
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=ruby VER=2.3.0
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=scilab
- sudo: required
- dist: trusty
- - compiler: gcc
- os: linux
- env: SWIGLANG=tcl
- sudo: required
- dist: trusty
- - os: linux
- env: SWIGLANG=csharp SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
- sudo: required
- dist: trusty
- - os: linux
- env: SWIGLANG=java SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
- sudo: required
- dist: trusty
- - os: linux
- env: SWIGLANG=python SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
- sudo: required
- dist: trusty
- - os: linux
- env: SWIGLANG=csharp SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
- sudo: required
- dist: trusty
- - os: linux
- env: SWIGLANG=java SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
- sudo: required
- dist: trusty
- - os: linux
- env: SWIGLANG=python SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
- sudo: required
- dist: trusty
- - compiler: gcc
- os: osx
- env: SWIGLANG=
- - compiler: clang
- os: osx
- env: SWIGLANG=
- - compiler: clang
- os: osx
- env: SWIGLANG=csharp
- - compiler: clang
- os: osx
- env: SWIGLANG=go
- - compiler: clang
- os: osx
- env: SWIGLANG=guile
- - compiler: clang
- os: osx
- env: SWIGLANG=java
- - compiler: clang
- os: osx
- env: SWIGLANG=lua
- - compiler: clang
- os: osx
- env: SWIGLANG=perl5
- - compiler: clang
- os: osx
- env: SWIGLANG=php5
- - compiler: clang
- os: osx
- env: SWIGLANG=python
- - compiler: clang
- os: osx
- env: SWIGLANG=python PY3=3
- - compiler: clang
- os: osx
- env: SWIGLANG=ruby
- - compiler: clang
- os: osx
- env: SWIGLANG=tcl
-
- allow_failures:
- # Lots of failing tests currently
+ env: SWIGLANG=mzscheme
+ dist: xenial
- compiler: gcc
os: linux
env: SWIGLANG=ocaml
- sudo: required
- dist: trusty
- # Not quite working yet
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=octave SWIGJOBS=-j2
+ dist: xenial # Octave v4.0.0
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=octave SWIGJOBS=-j2 CPP11=1
+ dist: bionic # Octave v4.2.2
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=perl5
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=php VER=7.0
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=php VER=7.1
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=php VER=7.2
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=php VER=7.3
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python # 2.7
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python PY3=3 VER=3.2
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python PY3=3 VER=3.3
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python PY3=3 VER=3.4
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python PY3=3 VER=3.5
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python PY3=3 VER=3.6
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python PY3=3 VER=3.7
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python PY3=3 VER=3.8
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python PY3=3 VER=3.9
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python SWIG_FEATURES="-builtin -O"
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin GCC=6 CPP11=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin GCC=6 CPP11=1 PY3=3 VER=3.9
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.4
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.5
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.7
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.8
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.9
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python SWIG_FEATURES="-builtin -O" PY3=3 VER=3.9
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.9 SWIGOPTPY3=
+ 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.9
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=r
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ruby VER=1.9
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ruby VER=2.0
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ruby VER=2.1
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ruby VER=2.2
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ruby VER=2.3
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ruby VER=2.4
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ruby VER=2.5
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ruby VER=2.6
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ruby VER=2.7
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=scilab
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=tcl
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=csharp CPP11=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=go VER=1.6 CPP11=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=java CPP11=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=python CPP11=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=r CPP11=1 # Note: making 'R CMD SHLIB' use a different compiler is non-trivial
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=ruby CPP11=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=tcl CPP11=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=csharp GCC=6 CPP14=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=go VER=1.6 GCC=6 CPP14=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=java GCC=6 CPP14=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=python GCC=6 CPP14=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=ruby GCC=6 CPP14=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=tcl GCC=6 CPP14=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=java GCC=7 CPP14=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=python GCC=7 CPP14=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=csharp GCC=8 CPP17=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=java GCC=8 CPP17=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=python GCC=8 CPP17=1 PY3=3 VER=3.9
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=csharp GCC=9 CPP17=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=java GCC=9 CPP17=1
+ dist: xenial
+ - os: linux
+ env: SWIGLANG=python GCC=9 CPP17=1 PY3=3 VER=3.9
+ dist: xenial
+ - os: linux
+ arch: s390x
+ env: SWIGLANG=ruby CPP11=1
+ dist: xenial
+ - compiler: gcc
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=
+ - compiler: gcc
+ os: osx
+ env: SWIGLANG= BUILDSYSTEM=cmake
+ - compiler: clang
+ os: osx
+ env: SWIGLANG= BUILDSYSTEM=cmake
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=csharp
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=go
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=guile CSTD=c11
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=java
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=lua
+# octave-6.1 not working
+# - compiler: clang
+# os: osx
+# osx_image: xcode12.2
+# env: SWIGLANG=octave SWIGJOBS=-j2 CPP11=1
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=perl5
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=python
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=python PY3=3
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=ruby
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=tcl
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=java CPP17=1
+ - compiler: clang
+ os: osx
+ osx_image: xcode12.2
+ env: SWIGLANG=python PY3=3 CPP17=1
+
+ allow_failures:
+ # Newer version of D not yet working/supported
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=d VER=2.086.1
+ dist: xenial
+ # seg fault in director_basic testcase
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=php VER=7.2
+ dist: xenial
+ # Experimental languages
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=mzscheme
+ dist: xenial
+ - compiler: gcc
+ os: linux
+ env: SWIGLANG=ocaml
+ 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" = "linux"; then lscpu; grep "model name" /proc/cpuinfo || echo 'Unknown CPU model'; grep "MemTotal" /proc/meminfo || echo 'Unknown system memory amount'; 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:
+ - if test "$BUILDSYSTEM" = "cmake"; then mkdir -p build/build && cd build/build && cmake -DCMAKE_INSTALL_PREFIX=~/.local ../.. && make install && ctest --output-on-failure -V && exit 0; fi
+ - 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
- - 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 "$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
- if test -n "$SWIGLANG"; then CONFIGOPTS+=(--without-alllang --with-$WITHLANG); fi
- echo "${CONFIGOPTS[@]}"
- ./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
@@ -324,5 +471,6 @@ script:
- if test -n "$SWIGLANG"; then make $SWIGJOBS check-$SWIGLANG-examples CFLAGS="$cflags" CXXFLAGS="$cxxflags"; fi
- if test -n "$SWIGLANG"; then make $SWIGJOBS check-$SWIGLANG-test-suite CFLAGS="$cflags" CXXFLAGS="$cxxflags"; fi
- echo 'Cleaning...' && echo -en 'travis_fold:start:script.3\\r'
- - make check-maintainer-clean && ../../configure $CONFIGOPTS
+ # Skip on osx as often fails with: rm: Resource temporarily unavailable
+ - if test "$TRAVIS_OS_NAME" != "osx"; then make check-maintainer-clean && ../../configure $CONFIGOPTS; fi
- echo -en 'travis_fold:end:script.3\\r'
diff --git a/ANNOUNCE b/ANNOUNCE
index aa5424a1a..e50bcd463 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,8 +1,8 @@
-*** ANNOUNCE: SWIG 3.0.12 (in progress) ***
+*** ANNOUNCE: SWIG 4.1.0 (in progress) ***
http://www.swig.org
-We're pleased to announce SWIG-3.0.12, the latest SWIG release.
+We're pleased to announce SWIG-4.1.0, the latest SWIG release.
What is SWIG?
=============
@@ -10,13 +10,11 @@ What is SWIG?
SWIG is a software development tool that reads C/C++ header files and
generates the wrapper code needed to make C and C++ code accessible
from other programming languages including Perl, Python, Tcl, Ruby,
-PHP, C#, Go, Java, Javascript, Lua, Scheme (Guile, MzScheme, CHICKEN),
-D, Ocaml, Pike, Modula-3, Octave, R, Scilab, Common Lisp (CLISP,
-Allegro CL, CFFI, UFFI). SWIG can also export its parse tree in
-the form of XML and Lisp s-expressions. Major applications of SWIG
-include generation of scripting language extension modules, rapid
-prototyping, testing, and user interface development for large
-C/C++ systems.
+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 @@ Availability
============
The release is available for download on Sourceforge at
- http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz
+ http://prdownloads.sourceforge.net/swig/swig-4.1.0.tar.gz
A Windows version is also available at
- http://prdownloads.sourceforge.net/swig/swigwin-3.0.12.zip
+ http://prdownloads.sourceforge.net/swig/swigwin-4.1.0.zip
Please report problems with this release to the swig-devel mailing list,
details at http://www.swig.org/mail.html.
diff --git a/CCache/Makefile.in b/CCache/Makefile.in
index 67fd3f363..d1bb8c526 100644
--- a/CCache/Makefile.in
+++ b/CCache/Makefile.in
@@ -8,6 +8,7 @@ bindir=@bindir@
mandir=@mandir@
INSTALLCMD=@INSTALL@
PACKAGE_NAME=@PACKAGE_NAME@
+PROGRAM_NAME=@PROGRAM_NAME@
# Soft link test can be skipped on systems that don't support soft linking
NOSOFTLINKSTEST=
@@ -17,13 +18,10 @@ SWIG=swig
SWIG_LIB=../$(srcdir)/../Lib
EXEEXT=@EXEEXT@
-# Use standard autoconf approach to transform executable name using --program-prefix and --program-suffix
-transform = @program_transform_name@
-
LIBS= @LIBS@
OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \
cleanup.o snprintf.o unify.o
-HEADERS = ccache.h mdfour.h
+HEADERS = ccache.h mdfour.h config.h config_win32.h
all: $(PACKAGE_NAME)$(EXEEXT)
@@ -32,7 +30,7 @@ Makefile: $(srcdir)/Makefile.in ./config.status
$(SHELL) ./config.status
# Note that HTML documentation is actually generated and used from the main SWIG documentation Makefile
-docs: $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/ccache-man.html
+docs: $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/$(PACKAGE_NAME)-man.html
$(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
@@ -40,40 +38,43 @@ $(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS)
$(srcdir)/$(PACKAGE_NAME).1: $(srcdir)/ccache.yo
-yodl2man -o $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/ccache.yo
-$(srcdir)/web/ccache-man.html: $(srcdir)/ccache.yo
- yodl2html -o $(srcdir)/web/ccache-man.html $(srcdir)/ccache.yo
+$(srcdir)/web/$(PACKAGE_NAME)-man.html: $(srcdir)/ccache.yo
+ yodl2html -o $(srcdir)/web/$(PACKAGE_NAME)-man.html $(srcdir)/ccache.yo
install: $(PACKAGE_NAME)$(EXEEXT)
@echo "Installing $(PACKAGE_NAME)"
- @echo "Installing $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)"
+ @echo "Installing $(DESTDIR)${bindir}/$(PROGRAM_NAME)$(EXEEXT)"
${INSTALLCMD} -d $(DESTDIR)${bindir}
- ${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)
+ ${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/$(PROGRAM_NAME)$(EXEEXT)
install-docs: $(srcdir)/$(PACKAGE_NAME).1
- @echo "Installing $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1"
+ @echo "Installing $(DESTDIR)${mandir}/man1/$(PROGRAM_NAME).1"
${INSTALLCMD} -d $(DESTDIR)${mandir}/man1
- ${INSTALLCMD} -m 644 $(srcdir)/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1
+ ${INSTALLCMD} -m 644 $(srcdir)/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/$(PROGRAM_NAME).1
uninstall: $(PACKAGE_NAME)$(EXEEXT)
- rm -f $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)
+ rm -f $(DESTDIR)${bindir}/$(PROGRAM_NAME)$(EXEEXT)
uninstall-docs: $(srcdir)/$(PACKAGE_NAME).1
- rm -f $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1
+ rm -f $(DESTDIR)${mandir}/man1/$(PROGRAM_NAME).1
-clean:
+clean: clean-docs
/bin/rm -f $(OBJS) *~ $(PACKAGE_NAME)$(EXEEXT)
+clean-docs:
+ rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/$(PACKAGE_NAME)-man.html
+
test: test.sh
- SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' $(srcdir)/test.sh
+ SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' CCACHE='../$(PACKAGE_NAME)' CCACHE_PROG=$(PROGRAM_NAME) $(srcdir)/test.sh
check: test
distclean: clean
- /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status ccache_swig_config.h
+ /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status ccache_swig_config.h config_win32.h
/bin/rm -rf autom4te.cache
maintainer-clean: distclean
- /bin/rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/ccache-man.html
+ /bin/rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/$(PACKAGE_NAME)-man.html
# FIXME: To fix this, test.sh needs to be able to take ccache from the
diff --git a/CCache/ccache.h b/CCache/ccache.h
index a79d88322..25e786496 100644
--- a/CCache/ccache.h
+++ b/CCache/ccache.h
@@ -6,7 +6,7 @@
#include "config.h"
#else
#include
-#define PACKAGE_NAME "ccache-swig.exe"
+#include "config_win32.h"
#endif
#include
@@ -51,7 +51,7 @@
#define STATUS_FATAL 4
#define STATUS_NOCACHE 5
-#define MYNAME PACKAGE_NAME
+#define MYNAME PROGRAM_NAME
#define LIMIT_MULTIPLE 0.8
diff --git a/CCache/config_win32.h.in b/CCache/config_win32.h.in
new file mode 100644
index 000000000..2d5ab97e3
--- /dev/null
+++ b/CCache/config_win32.h.in
@@ -0,0 +1,3 @@
+#if !defined(PROGRAM_NAME)
+#define PROGRAM_NAME "@PROGRAM_NAME@.exe"
+#endif
diff --git a/CCache/configure.ac b/CCache/configure.ac
index dfbf86dbc..e1c761860 100644
--- a/CCache/configure.ac
+++ b/CCache/configure.ac
@@ -7,6 +7,7 @@ AC_CONFIG_SRCDIR([ccache.h])
AC_MSG_NOTICE([Configuring ccache])
AC_CONFIG_HEADER(config.h)
+AC_CONFIG_FILES([config_win32.h])
dnl Checks for programs.
AC_PROG_CC
@@ -14,6 +15,20 @@ AC_PROG_CPP
AC_PROG_INSTALL
AC_ARG_PROGRAM # for program_transform_name
+AC_SUBST(PROGRAM_NAME)
+if test "x$program_prefix" != "xNONE" -a "x$program_prefix" != "x"
+then
+ PROGRAM_NAME="$program_prefix$PACKAGE_NAME"
+else
+ PROGRAM_NAME="$PACKAGE_NAME"
+fi
+if test "x$program_suffix" != "xNONE" -a "x$program_suffix" != "x"
+then
+ PROGRAM_NAME="$PROGRAM_NAME$program_suffix"
+fi
+
+AC_DEFINE_UNQUOTED(PROGRAM_NAME, "$PROGRAM_NAME", [Define my program name])
+
AC_DEFINE([_GNU_SOURCE], 1,
[Define _GNU_SOURCE so that we get all necessary prototypes])
diff --git a/CCache/snprintf.c b/CCache/snprintf.c
index 32187c1a5..9bf8a817b 100644
--- a/CCache/snprintf.c
+++ b/CCache/snprintf.c
@@ -292,6 +292,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args
break;
case 'X':
flags |= DP_F_UP;
+ /* FALLTHROUGH */
case 'x':
flags |= DP_F_UNSIGNED;
if (cflags == DP_C_SHORT)
@@ -314,6 +315,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args
break;
case 'E':
flags |= DP_F_UP;
+ /* FALLTHROUGH */
case 'e':
if (cflags == DP_C_LDOUBLE)
fvalue = va_arg (args, LDOUBLE);
@@ -322,6 +324,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args
break;
case 'G':
flags |= DP_F_UP;
+ /* FALLTHROUGH */
case 'g':
if (cflags == DP_C_LDOUBLE)
fvalue = va_arg (args, LDOUBLE);
diff --git a/CCache/test.sh b/CCache/test.sh
index 438e782cd..3c44e859c 100755
--- a/CCache/test.sh
+++ b/CCache/test.sh
@@ -20,7 +20,12 @@ fi
PATH="`echo $PATH | \
sed -e 's!:/usr\(/local\)*/lib\([0-9]\)*/ccache\(/\)*!!g'`"
-CCACHE=../ccache-swig
+if test -n "$CCACHE"; then
+ CCACHE="$CCACHE"
+else
+ CCACHE=../ccache-swig
+fi
+
TESTDIR=test.$$
test_failed() {
@@ -406,6 +411,10 @@ swigtests() {
# main program
rm -rf $TESTDIR
mkdir $TESTDIR
+if test -n "$CCACHE_PROG"; then
+ ln -s $CCACHE $TESTDIR/$CCACHE_PROG
+ CCACHE=./$CCACHE_PROG
+fi
cd $TESTDIR || exit 1
unset CCACHE_DIR
@@ -442,14 +451,16 @@ swigtests
if test -z "$NOSOFTLINKSTEST"; then
testsuite="link"
- ln -s $CCACHE $COMPILER
- CCACHE_COMPILE="./$COMPILER"
+ compilername=`basename $COMPILER`
+ ln -s $CCACHE ./$compilername
+ CCACHE_COMPILE="./$compilername"
basetests
- rm "./$COMPILER"
- ln -s $CCACHE $SWIG
- CCACHE_COMPILE="./$SWIG"
+ rm "./$compilername"
+ compilername=`basename $SWIG`
+ ln -s $CCACHE ./$compilername
+ CCACHE_COMPILE="./$compilername"
swigtests
- rm "./$SWIG"
+ rm "./$compilername"
else
echo "skipping testsuite link"
fi
diff --git a/CHANGES b/CHANGES
index 4347c126a..05834910a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,1953 @@ See the RELEASENOTES file for a summary of changes in each release.
Issue # numbers mentioned below can be found on Github. For more details, add
the issue number to the end of the URL: https://github.com/swig/swig/issues/
+Version 4.0.2 (8 Jun 2020)
+==========================
+
+2020-06-07 vigsterkr
+ [Ruby] #1717 Nil fix mangling strings
+
+2020-06-07 vadz
+ #1748 Fix doxygen comments quoting issue
+
+2020-06-07 munoah
+ #1800 Escape spaces in file paths for dependencies (-M -MM etc)
+
+2020-06-06 andreas-schwab
+ [Ruby] #1801 Fix encoding on big endian systems when wrapping std::wstring.
+
+2020-05-31 kwwette
+ [Octave] #1789 error handling improvements and return error code on exit for SWIG wrapped modules.
+
+2020-05-30 msteinbeck
+ [D] #1593 Replace broken imports when using newer versions of D.
+
+2020-05-29: ZackerySpytz
+ [Python] #1716 Performance improvements converting strings when using Python >= 3.3.
+
+2020-05-28: ZackerySpytz
+ #1776 Quite dramatically decrease run times when generating very large interface files by changing
+ some internal memory pool sizes.
+
+2020-05-28: mcfarljm
+ #1788 Fix handling of Doxygen \endlink command.
+
+2020-05-24: vapier
+ [Javascript] #1796 Fix pkg-config invocation in configure.
+
+2020-04-30: kwwette
+ [Octave] Fix exception raising for newer Octave versions
+ Since (at least) Octave 5.1.0, the Octave error() function now raises a C++ exception,
+ which if uncaught immediately exits a SWIG wrapper function, bypassing any cleanup code
+ that may appear after a "fail:" label. This patch adds a "try { ... } catch(...) { }"
+ block around the contents of SWIG wrapper functions to first execute the cleanup code
+ before rethrowing any exception raised. It is backward compatible with earlier versions
+ of Octave where error() does not raise an exception, which will still branch to the
+ "fail:" block to execute cleanup code if an error is encountered.
+
+ Note that the new "try { ... } catch(...) { }" block will localise any local variables
+ used in typemaps that were NOT declared through SWIG's %typemap(...) syntax, so it's
+ possible this could break existing SWIG wrappers which were implicitly sharing local
+ variables between typemaps. This can be fixed, however, by declaring local variables
+ which need to be shared between typemaps through SWIG's %typemap(...) syntax.
+
+2020-02-18: ryannevell
+ [Lua] #1728 Add support for LUA lightuserdata to SWIG_Lua_ConvertPtr.
+
+2020-02-18: dmach
+ [Ruby] #1725 Fix gcc -Wcatch-value warnings.
+
+2020-02-14: treitmayr
+ #1724 Fix wrapping of abstract user-defined conversion operators.
+
+2020-02-13: ddurham2
+ [Python] #1512 Fix memleak when using STL containers of shared_ptr objects.
+
+2020-02-06: wsfulton
+ [Python] #1673 #1674 Fix setting 'this' when extending a proxy class with __slots__.
+
+2020-01-31: vadz
+ [Ruby] #1651 Add std::auto_ptr<> typemaps.
+
+2020-01-31: ZackerySpytz
+ [Python] #1700 More robust error checking for failures in calls to Python C API:
+ PyBytes_AsStringAndSize() and PyString_AsStringAndSize().
+
+2020-01-31: vadz
+ [Python] #1710 Fix crash parsing empty docstrings.
+
+2020-01-30: Alzathar
+ [R] #910 #914 Fix R memory leak on exception.
+
+2020-01-30: richardbeare
+ [R] #1511 Fix bug wrapping functions. These were previously incorrectly wrapped as if
+ they were variables. This happened when 'get' or 'set' was in the name of the function
+ or method, but sometimes also in some other circumstances. If you were using R
+ attribute syntax to access these methods, you'll need to switch to calling them as R
+ methods.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2020-01-24: etse-dignitas, wsfulton
+ [C#, D, Java] #1533 Fix upcasting for shared_ptr's of templated types.
+
+2020-01-16: mcfarljm
+ #1643 #1654 When using -doxygen, fix segfault when nameless parameters or vararg parameters
+ are used.
+
+2020-01-16: mcfarljm
+ #1632 #1659 Fix newline handling for doxygen "///" comments.
+
+2020-01-14: mcfarljm
+ #1647 #1656 Fix crash handling empty doxygen comments.
+
+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.
+
+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.
+
+2020-01-05: jschueller shadchin
+ [Python] #1670 #1696 Add missing field initializers introduced in python 3.8:
+ tp_vectorcall and tp_print.
+
+2020-01-05: friedrichatgc
+ [Octave] #1688 Change swig_this() to use size_t instead of long for compatibility
+ with Windows 64 bit.
+
+2020-01-05: treitmayr
+ [Ruby] #1692 #1689 Add support for Ruby 2.7
+
+2019-12-30: treitmayr
+ [Ruby] #1653 #1668 Fix code generated when using -globalmodule option.
+
+2019-12-29: ZackerySpytz
+ [OCaml] #1686 Fix compilation errors with OCaml 4.09.0.
+
+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-11-26: wsfulton
+ [C#] #1628 'out' or 'ref' used in a cstype typemap was not always stripped out in parts
+ of director code generation.
+
+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.
+
+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
+ %include
+
+ %inline %{
+ struct X {};
+ %}
+
+ %template(VectorX) std::vector;
+ %template(VectorInt) std::vector;
+
+ %inline %{
+ using namespace std;
+ string VectorOverload(vector v);
+ string VectorOverload(vector v);
+ %}
+
+ The following would incorrectly fail:
+
+ s = VectorOverload([1, 2, 3])
+
+ With:
+
+ Traceback (most recent call last):
+ File "runme3.py", line 20, in
+ 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
+ check(VectorOverload(v), "vector")
+ SystemError: 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 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;
+
+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::make
+ and the name now expands correctly to X< int >::make
+
+ template struct X {
+ %typemap(out) T X::make "..."
+ T make();
+ };
+
+ %template(Xint) X;
+
+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
+ 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 _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 struct X { ... };
+ %template(X) X;
+
+2017-09-23: wsfulton
+ Issue #1098. Fix overloading of shared_ptr with underlying pointer types, eg:
+
+ void m(std::shared_ptr 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;
+ template class vector;
+ }
+
+ // valid
+ using namespace std;
+ %template(vin) vector;
+ template class vector;
+
+ // valid
+ using std::vector;
+ %template(vin) vector;
+ template class vector;
+
+ // ill-formed
+ namespace unrelated {
+ using std::vector;
+ %template(vin) vector;
+ template class vector;
+ }
+
+ // ill-formed
+ namespace unrelated {
+ using namespace std;
+ %template(vin) vector;
+ template class vector;
+ }
+
+ // ill-formed
+ namespace unrelated {
+ namespace std {
+ %template(vin) vector;
+ template class vector;
+ }
+ }
+
+ // ill-formed
+ namespace unrelated {
+ %template(vin) std::vector;
+ template class std::vector;
+ }
+
+ When the scope is incorrect, an error now occurs such as:
+
+ cpp_template_scope.i:34: Error: 'vector' resolves to 'std::vector' and
+ was incorrectly instantiated in scope 'unrelated' instead of within scope 'std'.
+
+ Previously SWIG accepted the ill-formed examples above but this led to
+ numerous subtle template scope problems especially in the presence of
+ using declarations and using directives as well as with %feature and %typemap.
+
+ Actually, a valid instantiation is one which conforms to the C++03
+ standard as C++11 made a change to disallow using declarations and
+ using directives to find a template.
+
+ // valid C++03, ill-formed C++11
+ using std::vector;
+ template class vector;
+
+ Similar fixes for defining classes using forward class references have
+ also been put in place. For example:
+
+ namespace Space1 {
+ struct A;
+ }
+ namespace Space2 {
+ struct Space1::A {
+ void x();
+ }
+ }
+
+ will now error out with:
+
+ cpp_class_definition.i:5: Error: 'Space1::A' resolves to 'Space1::A' and
+ was incorrectly instantiated in scope 'Space2' instead of within scope 'Space1'.
+
+ 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::clear;
+ using namespace std;
+ %template(VectorInt) vector;
+
+ Prior versions of SWIG incorrectly instantiated vector 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. The other SWIG directives need correcting as
+ they do not follow 'using declarations' and 'using directives'. Change it to:
+
+ %rename(Zap) std::vector::clear;
+ using namespace std;
+ %template(vin) vector;
+
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2017-08-16: wsfulton
+ Fix scope lookup for template parameters containing unary scope operators.
+
+ Fixes cases like:
+
+ namespace Alloc {
+ template struct Rebind {
+ typedef int Integer;
+ };
+ }
+ %template(RebindBucket) Alloc::Rebind< Bucket >;
+ OR
+ %template(RebindBucket) Alloc::Rebind< ::Bucket >;
+
+ Alloc::Rebind< Bucket >::Integer Bucket1();
+ Alloc::Rebind< ::Bucket >::Integer Bucket2();
+ Alloc::Rebind<::template TemplateBucket>::Integer Bucket3();
+
+2017-08-16: wsfulton
+ For templates only, the template parameters are fully resolved when
+ handling typemaps. Without this, it is too hard to have decent rules
+ to apply typemaps when parameter types are typedef'd and template
+ parameters have default values.
+
+ Fixes %clear for typedefs in templates, eg:
+
+ %typemap("in") XXX::Long "..."
+ template typename struct XXX {
+ typedef long Long;
+ };
+ %clear XXX::Long;
+
+ as the typemap was previously incorrectly stored as a typemap for long
+ instead of XXX::Long.
+
+2017-08-05: olly
+ [C++11] Allow static_assert at the top level (and disallow it right
+ after template). Fixes 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 struct T {};
+ %template(TInteger) T;
+
+ the generated documentation contains:
+ """Proxy of C++ T< int > class."""
+ instead of:
+ """Proxy of C++ T<(int)> class."""
+ and
+ """__init__(TInteger self) -> TInteger"""
+ instead of
+ """__init__(T<(int)> self) -> TInteger"""
+
+2017-06-27: nihaln
+ [PHP] Update the OUTPUT Typemap to add return statement to the
+ PHP Wrapper.
+
+2017-06-27: nihaln
+ [PHP] Update the enum and value examples to use the OO wrappers
+ rather than the flat functions produced with -noproxy. There's
+ not been a good reason to use -noproxy for since PHP5 OO wrapping
+ was fixed back in 2005.
+
+2017-06-23: m7thon
+ [Python] fix and improve default argument handling:
+
+ 1. Fix negative octals. Currently not handled correctly by `-py3`
+ (unusual case, but incorrect).
+ 2. Fix arguments of type "octal + something" (e.g. `0640 | 04`).
+ Currently drops everything after the first octal. Nasty!
+ 3. Fix bool arguments "0 + something" (e.g. `0 | 1`) are always
+ "False" (unusual case, but incorrect).
+ 4. Remove special handling of "TRUE" and "FALSE" from
+ `convertValue` since there's no reason these have to match
+ "true" and "false".
+ 5. Remove the Python 2 vs. Python 3 distinction based on the
+ `-py3` flag. Now the same python code is produced for default
+ arguments for Python 2 and Python 3. For this, octal default
+ arguments, e.g. 0644, are now wrapped as `int('644', 8)`. This
+ is required, as Python 2 and Python 3 have incompatible syntax
+ for octal literals.
+
+ Fixes #707
+
+2017-06-21: futatuki
+ #1004 - Fix ccache-swig executable name to respect configure's --program-prefix and
+ --program-suffix values if used.
+
+2017-06-21: tamuratak
+ [Ruby] #911 - Add std::wstring support.
+
+2017-06-19: wsfulton
+ [Python] Fix handling of rich comparisons when wrapping overloaded operators:
+
+ operator< operator<= operator> operator>= operator== operator!=
+
+ Previously a TypeError was always thrown if the type was not correct. NotImplemented
+ is now returned from these wrapped functions if the type being compared with is
+ not correct. The subsequent behaviour varies between different versions of Python
+ and the comparison function being used, but is now consistent with normal Python
+ behaviour. For example, for the first 4 operator overloads above, a TypeError
+ 'unorderable types' is thrown in Python 3, but Python 2 will return True or False.
+ NotImplemented should be returned when the comparison cannot be done, see PEP 207 and
+ https://docs.python.org/3/library/constants.html#NotImplemented
+
+ Note that the bug was only present when overloaded operators did not also have a
+ function overload.
+
+ Fixes SF bug #1208 (3441262) and SF patch #303.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2017-06-17: fabrice102
+ [Go] Fix Go callback example. Fixes github #600, #955, #1000.
+
+2017-06-16: wsfulton
+ Make sure warning and error messages are not split up by other processes writing to
+ stdout at the same time.
+
+2017-06-16: wsfulton
+ [R] Fix wrapping function pointers containing rvalue and lvalue reference parameters.
+
+2017-06-13: olly
+ [Perl] Fix testsuite to work without . in @INC - it was removed in
+ Perl 5.26 for security reasons, and has also been removed from
+ older versions in some distros. Fixes #997 reported by lfam.
+
+2017-06-03: wsfulton
+ Fix %import on a file containing a file scope %fragment forced inclusion to not
+ generate the fragment contents as %import should not result in code being generated.
+ The behaviour is now the same as importing code insertion blocks.
+ Wrapping FileC.i in the following example will result in no generated code, whereas
+ previously "#include " was generated:
+
+ // FileA.i
+ %fragment("", "header") %{
+ #include
+ %}
+
+ %{
+ #include
+ %}
+ %fragment("");
+
+ // FileC.i
+ %import "FileA.i"
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2017-05-26: Volker Diels-Grabsch, vadz
+ [Java] #842 Extend from java.util.AbstractList<> and implement java.util.RandomAccess for
+ std::vector wrappers. This notably allows to iterate over wrapped vectors in a natural way.
+ 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:
+
+ #if defined(SWIGJAVA)
+ // Add in old api that uses non-boxed types
+ %extend std::vector {
+ %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;
+
+ *** 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>) and NULL/nullptr support added.
+
+2017-04-12: smarchetto
+ [Scilab] New parameter targetversion to specify the Scilab target version (5, 6, ..) for code generation
+ With Scilab 6 target specified, identifier names truncation is disabled (no longer necessary)
+
+2017-03-24: tamuratak
+ [Ruby] Fix #939 - Wrapping std::vector fix due to incorrect null checks
+ on VALUE obj.
+
+2017-03-17: vadz
+ [C#] #947 Add support for std::complex
+
+2017-03-17: wsfulton
+ [Go] Fix handling of typedef'd function pointers and typedef'd member function pointers
+ such as:
+
+ typedef int (*FnPtr_td)(int, int);
+ int do_op(int x, int y, FnPtr_td op);
+
+2017-03-16: wsfulton
+ Add support for member const function pointers such as:
+
+ int fn(short (Funcs::* parm)(bool)) const;
+
+ Also fix parsing of references/pointers and qualifiers to member
+ pointers such as:
+
+ int fn(short (Funcs::* const parm)(bool));
+ int fn(short (Funcs::* & parm)(bool));
+
+2017-03-10: wsfulton
+ Extend C++11 alternate function syntax parsing to support const and noexcept, such as:
+
+ auto sum1(int x, int y) const -> int { return x + y; }
+ auto sum2(int x, int y) noexcept -> int { return x + y; }
+
+2017-02-29: tamuratak
+ [Ruby] #917 - Add Enumerable module to all container class wrappers. It was missing
+ for std::list, std::multiset, std::unordered_multiset and std::unordered_map.
+
+2017-02-27: assambar
+ [C++11] Extend parser to support throw specifier in combination
+ with override and/or final.
+
+2017-02-10: tamuratak
+ [Ruby] #883 - Add support for C++11 hash tables:
+ std::unordered_map
+ std::unordered_set
+ std::unordered_multimap
+ std::unordered_multiset
+
+2017-02-08: jcsharp
+ [C#] #887 Improve std::vector wrapper constructors -
+ Replace constructor taking ICollection with IEnumerable and also add IEnumerable
+ constructor to avoid the boxing and unboxing overhead of the original constructor,
+ when the type parameter is a value type.
+
+Version 3.0.12 (27 Jan 2017)
+============================
+
+2017-01-27: wsfulton
+ [C#] #882 Fix missing filename in error messages when there is a problem
+ writing out C# files.
+
+2017-01-27: briancaine
+ [Guile] #744 Fix compilation errors in Guile wrappers - regression
+ introduced in swig-3.0.11.
+
+2017-01-24: andrey-starodubtsev
+ [Java] Apply #704 - director typemap improvements.
+ Memory leak fixes, add support for "directorargout" typemap and
+ add director support to typemaps.i.
+
+2017-01-24: wsfulton
+ Enhance %extend to extend a class with template constructors, eg:
+
+ struct Foo {
+ %extend {
+ template
+ Foo(int a, T b) {
+ ...
+ }
+ }
+ };
+ %template(Foo) Foo::Foo;
+
+2017-01-22: wsfulton
+ Issue #876 Enhance %extend to extend a class with template methods, eg:
+
+ struct Foo {
+ %extend {
+ template
+ void do_stuff(int a, T b) {
+ ...
+ }
+ }
+ };
+ %template(do_stuff_inst) Foo::do_stuff;
+
+ Similarly for static template methods.
+
+2017-01-22: kwwette
+ [Octave] add support for version 4.2
+ - The Octave API now uses some C++11 features. It is recommended to use
+ the mkoctfile program supplied by Octave to compile the SWIG-generated
+ wrapper code, as mkoctfile will ensure the correct C++ compiler/options
+ are used. Otherwise, the value of `mkoctfile -p CXX` should be parsed
+ for any -std=* flags which might be present.
+ - Octave has dropped support for << and >> operators, so SWIG now
+ ignores them.
+ - The Octave error() function now raises C++ exceptions to propagate
+ Octave errors, so %exception directives may need to be modified.
+ For convenience the SWIG_RETHROW_OCTAVE_EXCEPTIONS macro can be used
+ to rethrow any Octave exceptions for Octave itself to handle, e.g.:
+
+ try {
+ $action // may call error()
+ }
+ SWIG_RETHROW_OCTAVE_EXCEPTIONS // error() exceptions are rethrown
+ catch(...) {
+ ... // all other exceptions
+ }
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2017-01-16: wkalinin
+ [C#] Fix #733 regression introduced in swig-3.0.9.
+ Missing virtual function override in C# layer when using %import.
+
+2017-01-16: fschlimb
+ Fix #813 template symbol name lookup bug when typedef names are the same but in different
+ namespaces.
+
+2017-01-15: wsfulton
+ [C# D Java]
+ The SWIG library no longer uses the javatype, dtype or cstype typemaps, thereby
+ completely freeing them up for users to use without having to replicate the library
+ code that they previously added. The code previously generated by these typemaps
+ has been replaced by the new %proxycode directive. Their use in the library code
+ was fairly minimal:
+
+ C# cstype: std_array.i std_map.i std_vector.i
+ D dtype: std_vector.i
+ Java javatype: arrays_java.i
+
+2017-01-14: wsfulton
+ The %extend directive can now optionally support one of the 'class', 'struct' or 'union'
+ keywords before the identifier name, for example:
+
+ struct X { ... };
+ %extend struct X { ... }
+
+ Previously this had to specified as:
+
+ struct X { ... };
+ %extend X { ... }
+
+2017-01-13: wsfulton
+ [C# D Java] Add new %proxycode directive which is a macro for %insert("proxycode").
+ This is a way of adding pure C#/D/Java code into the appropriate proxy class, eg:
+
+ %extend Proxy2 {
+ %proxycode %{
+ public int proxycode2(int i) {
+ return i+2;
+ }
+ %}
+ }
+
+ %inline %{
+ struct Proxy2 {};
+ %}
+
+ There will then be a pure Java/C#/D method called proxycode2 in the Proxy2 class.
+
+2016-12-31: ajrheading1
+ Issue #860 - Remove use of std::unary_function and std::binary_function
+ which is deprecated in C++11.
+
+2016-12-30: olly
+ [PHP7] Register internal 'swig_runtime_data_type_pointer' constant
+ as "CONST_PERSISTENT" to avoid segmentation fault on module unload.
+ Fixes #859 reported by Timotheus Pokorra. Thanks also to Javier Torres
+ for a minimal reproducer.
+
Version 3.0.11 (29 Dec 2016)
============================
@@ -45,7 +1992,7 @@ Version 3.0.11 (29 Dec 2016)
[Python] Fix #446
Python %array_class of carrays.i failed with -builtin option.
-2016-12-16: bcaine
+2016-12-16: briancaine
[Guile] Patch #744 Added support for Guile's native pointer functionality
2016-12-01: wsfulton
@@ -11477,7 +13424,7 @@ Version 1.3.23 (November 11, 2004)
- Properly qualify type in syntax as 'long(2)' or 'Foo()',
this solve old problem with default args, and probably
other problems around. However, the default arg problem
- was also already solved by William (see bellow).
+ was also already solved by William (see below).
- Fix feature_set and feature_get methods. Before
they look from particular to general and keep the first
@@ -11685,7 +13632,7 @@ Version 1.3.23 (November 11, 2004)
ie, no additional pointer elements are created, and
the original 'foo' and 'A.bar' can be used as parameters.
- In the case of member fucntion however, still you need
+ In the case of member function however, still you need
to use the special variable Class::_cb_ptr, ie:
foobarm(3, a, A.barm_cb_ptr)
@@ -20988,7 +22935,7 @@ Version 1.3.7 (September 3, 2001)
typedef __name vector;
%enddef
- An a specific instantiation is created in exactly the same way:
+ A specific instantiation is created in exactly the same way:
%template(intvec) vector;
diff --git a/CHANGES.current b/CHANGES.current
index 04a7e277b..0f69796f2 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -4,15 +4,89 @@ See the RELEASENOTES file for a summary of changes in each release.
Issue # numbers mentioned below can be found on Github. For more details, add
the issue number to the end of the URL: https://github.com/swig/swig/issues/
-Version 3.0.12 (in progress)
-============================
+Version 4.1.0 (in progress)
+===========================
-2016-12-31: ajrheading1
- Issue #860 - Remove use of std::unary_function and std::binary_function
- which is deprecated in C++11.
+2021-03-01: xantares, Oliver Buchtala, geographika
+ #1040 Add support for building SWIG with CMake. See documentation in Windows.html.
-2016-12-30: olly
- [PHP7] Register internal 'swig_runtime_data_type_pointer' constant
- as "CONST_PERSISTENT" to avoid segmentation fault on module unload.
- Fixes https://github.com/swig/swig/issues/859 reported by Timotheus
- Pokorra - thanks also to Javier Torres for a minimal reproducer.
+2021-03-01: vadz
+ #1952 Fix incorrect warning "Unknown Doxygen command: ."
+
+2021-02-28: p2k
+ #969 [Javascript] v8/node - prevent crash calling a constructor without new keyword.
+
+2021-02-28: alecmev
+ #405 #1121 [Javascript] Fix OUTPUT typemaps on methods that don't return void.
+ The output value is appended to the return value.
+
+2021-02-26: murillo128, wsfulton
+ #1269 [Javascript] Fix handling of large positive unsigned long and
+ unsigned long long values.
+
+2021-02-24: tomleavy, yegorich, tungntpham
+ #1746 [Javascript] Add support for Node v12.
+ SWIG support is now for Node v6 and later only.
+
+2020-10-10: wsfulton
+ #252 complex can now be used as a C identifier and doesn't give a syntax error.
+
+2020-10-10: lpsinger
+ #1770 Correct C complex support.
+ _Complex is now parsed as a keyword rather than complex as per the C99 standard.
+ The complex macro is available in the ccomplex.i library file along with other
+ complex number handling provided by the complex.h header.
+
+2020-10-07: ZackerySpytz
+ [Python] #1812 Fix the error handling for the PyObject_GetBuffer() calls in
+ pybuffer.i.
+
+2020-10-07: treitmayr
+ #1824 Add missing space in director method declaration returning
+ const pointer.
+
+2020-10-07: adelva1984
+ #1859 Remove all (two) exceptions from SWIG executable.
+
+2020-09-25: wsfulton
+ [C#, Java] #1874 Add ability to change the modifiers for the interface
+ generated when using the %interface macros.
+
+ For C# use the 'csinterfacemodifiers' typemap.
+ For Java use the 'javainterfacemodifiers' typemap.
+
+ For example:
+
+ %typemap(csinterfacemodifiers) X "internal interface"
+
+
+2020-09-24: geefr
+ [C#] #1868 Fix wchar_t* csvarout typemap for member variable wrappers.
+
+2020-08-28: wsfulton
+ [Java] #1862 Fix crashes in swig_connect_director during director class construction
+ when using the director class from multiple threads - a race condition initialising
+ block scope static variables. The fix is guaranteed when using C++11, but most
+ compilers also fix it when using C++03/C++98.
+
+2020-08-16: wsfulton
+ [Python] Add missing initializer for member ‘_heaptypeobject::ht_module’ when using
+ -builtin to complete Python 3.9 support.
+
+2020-08-16: wsfulton
+ [Python] Remove PyEval_InitThreads() call for Python 3.7 and later as Python calls
+ it automatically now. This removes a deprecation warning when using Python 3.9.
+
+2020-08-15: wsfulton
+ [Python] All Python examples and tests are written to be Python 2 and Python 3
+ compatible, removing the need for 2to3 to run the examples or test-suite.
+
+2020-08-13: wsfulton
+ [C#] Add support for void *VOID_INT_PTR for member variables.
+
+2020-07-29: chrisburr
+ #1843 [Python] Compilation error fix in SwigPyBuiltin_SetMetaType when using PyPy.
+
+2020-06-14: ZackerySpytz
+ #1642 #1809 Fix virtual comparison operators in director classes - remove incorrect
+ space in the function name, for example, operator= = is now operator==.
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 000000000..b36f441fe
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,161 @@
+cmake_minimum_required (VERSION 3.2)
+
+if (NOT DEFINED CMAKE_BUILD_TYPE)
+ set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
+endif ()
+
+project (swig)
+
+if (POLICY CMP0074)
+ cmake_policy (SET CMP0074 NEW)
+endif()
+
+file (STRINGS configure.ac line LIMIT_COUNT 1 REGEX "AC_INIT\\(.*\\)" )
+if (line MATCHES "AC_INIT\\(\\[(.*)\\],[ \t]*\\[(.*)\\],[ \t]*\\[(.*)\\]\\)" )
+ set (SWIG_VERSION ${CMAKE_MATCH_2})
+ set (PACKAGE_BUGREPORT ${CMAKE_MATCH_3})
+else ()
+ message (SEND_ERROR "Could not parse version from configure.ac")
+endif ()
+
+set (SWIG_ROOT ${PROJECT_SOURCE_DIR})
+
+set (SWIG_LIB share/swig/${SWIG_VERSION})
+
+# Project wide configuration variables
+# ------------------------------------
+
+set (SWIG_SOURCE_DIR ${SWIG_ROOT}/Source CACHE INTERNAL "Path of swig sources" FORCE)
+
+set (PACKAGE_NAME swig)
+set (PACKAGE_VERSION ${SWIG_VERSION})
+
+# Configure
+# ---------
+
+list (APPEND CMAKE_MODULE_PATH ${SWIG_ROOT}/Tools/cmake)
+
+include (CheckIncludeFiles)
+include (CheckIncludeFile)
+include (CheckIncludeFileCXX)
+include (CheckTypeSize)
+include (CheckSymbolExists)
+include (CheckFunctionExists)
+include (CheckLibraryExists)
+include (CheckCSourceCompiles)
+
+# HACK: didn't get the bool check working for Visual Studio 2008
+if (MSVC)
+ set(HAVE_BOOL 1)
+else()
+ set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
+ check_type_size ("bool" HAVE_BOOL)
+ set (CMAKE_EXTRA_INCLUDE_FILES)
+endif()
+
+check_include_file ("inttypes.h" HAVE_INTTYPES_H)
+check_include_file ("stddef.h" HAVE_STDDEF_H)
+check_include_file ("stdint.h" HAVE_STDINT_H)
+check_include_file ("stdio.h" HAVE_STDIO_H)
+check_include_file ("stdlib.h" HAVE_STDLIB_H)
+check_include_file ("string.h" HAVE_STRING_H)
+check_include_file ("strings.h" HAVE_STRINGS_H)
+check_include_file ("sys/stat.h" HAVE_SYS_STAT_H)
+check_include_file ("sys/types.h" HAVE_SYS_TYPES_H)
+check_include_file ("unistd.h" HAVE_UNISTD_H)
+check_include_files ("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
+
+check_include_file_cxx ("boost/shared_ptr.hpp" HAVE_BOOST)
+check_library_exists (dl dlopen "" HAVE_LIBDL)
+check_function_exists (popen HAVE_POPEN)
+
+set (PCRE_REQUIRED_ARG "REQUIRED" CACHE STRING "required arg")
+find_package (PCRE ${PCRE_REQUIRED_ARG})
+if (PCRE_FOUND)
+ set (HAVE_PCRE 1)
+ include_directories (${PCRE_INCLUDE_DIRS})
+endif()
+
+if (WIN32)
+ file (TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/${SWIG_LIB} SWIG_LIB_WIN_UNIX)
+endif ()
+configure_file (${SWIG_ROOT}/Tools/cmake/swigconfig.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Source/Include/swigconfig.h)
+
+find_package (BISON REQUIRED)
+
+
+# Compiler flags
+# --------------
+
+include_directories (
+ ${SWIG_SOURCE_DIR}/CParse
+ ${SWIG_SOURCE_DIR}/Include
+ ${SWIG_SOURCE_DIR}/DOH
+ ${SWIG_SOURCE_DIR}/Swig
+ ${SWIG_SOURCE_DIR}/Preprocessor
+ ${SWIG_SOURCE_DIR}/Modules
+ ${PROJECT_BINARY_DIR}/Source/Include
+ ${PROJECT_BINARY_DIR}/Source/CParse
+ ${PROJECT_SOURCE_DIR}/Source/Doxygen
+)
+
+# generate the parser source code (depends on bison)
+file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Source/CParse)
+
+BISON_TARGET (swig_parser
+ ${SWIG_SOURCE_DIR}/CParse/parser.y
+ ${PROJECT_BINARY_DIR}/Source/CParse/parser.c
+)
+
+# generate swigwarn.swg
+file (READ ${SWIG_SOURCE_DIR}/Include/swigwarn.h SWIG_WARN_H)
+string (REGEX REPLACE "#define WARN([^ \\t]*)[ \\t]*([0-9]+)" "%define SWIGWARN\\1 \\2 %enddef" SWIG_WARN_SWG ${SWIG_WARN_H})
+file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/swigwarn.swg ${SWIG_WARN_SWG})
+set_property (SOURCE ${CMAKE_CURRENT_BINARY_DIR}/swigwarn.swg PROPERTY GENERATED 1)
+
+# install lib
+install (DIRECTORY ${SWIG_ROOT}/Lib/ DESTINATION ${SWIG_LIB})
+install (FILES ${CMAKE_CURRENT_BINARY_DIR}/swigwarn.swg DESTINATION ${SWIG_LIB})
+
+# sources
+# ---------
+file (GLOB DOH_SOURCES ${SWIG_SOURCE_DIR}/DOH/*.c)
+file (GLOB CPARSE_SOURCES ${SWIG_SOURCE_DIR}/CParse/*.c)
+list (APPEND CPARSE_SOURCES)
+file (GLOB PREPROCESSOR_SOURCES ${SWIG_SOURCE_DIR}/Preprocessor/*.c)
+file (GLOB CORE_SOURCES ${SWIG_SOURCE_DIR}/Swig/*.c)
+file (GLOB DOXYGEN_SOURCES ${SWIG_SOURCE_DIR}/Doxygen/*.cxx)
+file (GLOB MODULES_SOURCES ${SWIG_SOURCE_DIR}/Modules/*.cxx)
+
+add_executable (swig
+ ${CPARSE_SOURCES}
+ ${DOH_SOURCES}
+ ${DOXYGEN_SOURCES}
+ ${MODULES_SOURCES}
+ ${CORE_SOURCES}
+ ${PREPROCESSOR_SOURCES}
+ ${PROJECT_BINARY_DIR}/Source/Include/swigconfig.h
+ ${SWIG_SOURCE_DIR}/Include/swigwarn.h
+ ${PROJECT_BINARY_DIR}/Source/CParse/parser.c
+ ${PROJECT_BINARY_DIR}/Source/CParse/parser.h
+)
+if (PCRE_FOUND)
+ target_link_libraries (swig ${PCRE_LIBRARIES})
+endif ()
+install (TARGETS swig DESTINATION bin)
+
+# 'make package-source' creates tarballs
+set (CPACK_PACKAGE_NAME ${PACKAGE_NAME})
+set (CPACK_SOURCE_GENERATOR "TGZ;TBZ2")
+set (CPACK_SOURCE_IGNORE_FILES "/.git;/build;.*~;${CPACK_SOURCE_IGNORE_FILES}")
+set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION})
+include (CPack)
+
+# few tests
+enable_testing ()
+add_test (NAME cmd_version COMMAND swig -version)
+add_test (NAME cmd_swiglib COMMAND swig -swiglib)
+add_test (NAME cmd_external_runtime COMMAND swig -external-runtime ext_rt.h)
+set_tests_properties(cmd_external_runtime PROPERTIES ENVIRONMENT "SWIG_LIB=${PROJECT_SOURCE_DIR}/Lib")
+
diff --git a/COPYRIGHT b/COPYRIGHT
index c3fbbdebd..e6df73ff8 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -19,6 +19,7 @@ Active SWIG Developers:
Oliver Buchtala (oliver.buchtala@gmail.com) (Javascript)
Neha Narang (narangneha03@gmail.com) (Javascript)
Simon Marchetto (simon.marchetto@scilab-enterprises.com) (Scilab)
+ Zackery Spytz (zspytz@gmail.com) (OCaml, SWIG core)
Past SWIG developers and major contributors include:
Dave Beazley (dave-swig@dabeaz.com) (SWIG core, Python, Tcl, Perl)
@@ -28,7 +29,7 @@ Past SWIG developers and major contributors include:
Mikel Bancroft (mikel@franz.com) (Allegro CL)
Surendra Singhi (efuzzyone@netscape.net) (CLISP, CFFI)
Marcelo Matus (mmatus@acms.arizona.edu) (SWIG core, Python, UTL[python,perl,tcl,ruby])
- Art Yerkes (ayerkes@speakeasy.net) (Ocaml)
+ Art Yerkes (ayerkes@speakeasy.net) (OCaml)
Lyle Johnson (lyle@users.sourceforge.net) (Ruby)
Charlie Savage (cfis@interserv.com) (Ruby)
Thien-Thi Nguyen (ttn@glug.org) (build/test/misc)
@@ -62,7 +63,8 @@ Past SWIG developers and major contributors include:
John Lenz (Guile, MzScheme updates, Chicken module, runtime system)
Baozeng Ding (Scilab)
Ian Lance Taylor (Go)
- Vadim Zeitlin (PCRE, Python)
+ Dmitry Kabak (userdima@gmail.com) (Doxygen)
+ Vadim Zeitlin (PCRE, Python, Doxygen)
Stefan Zager (szager@gmail.com) (Python)
Vincent Couvert (Scilab)
Sylvestre Ledru (Scilab)
diff --git a/Doc/Devel/plan-gsoc-2012.txt b/Doc/Devel/plan-gsoc-2012.txt
new file mode 100644
index 000000000..ac764fb2a
--- /dev/null
+++ b/Doc/Devel/plan-gsoc-2012.txt
@@ -0,0 +1,341 @@
+
+
+
+
+ Project Plan
+ ============
+ SWIG Code Comments
+ Google Summer of Code 2012
+
+
+This document describes goals for the Google Summer of Code 2012,
+SWIG code documentation project.
+
+Author: Marko Klopcic, Dmitry Kabak
+
+
+Introduction
+============
+
+The goal of this project is _not_ to translate _any_ possible Doxygen
+formatted comment to JavaDoc or PyDoc, but to make it possible to
+translate a subset of comment types in C/C++ code to
+JavaDoc and PyDoc. Covering all the Doxygen functionality would be to
+complex for the limited time. However, the code must be flexible so
+that implementing missing features would not require redesign of the
+comment handling code in SWIG.
+
+There will also be a possibility to add untranslated comments to Java
+and Python code (## comments, see Doxygen manual), if the user will
+prefer to use Doxygen on the generated code.
+
+Note:
+'-OK-' tick below means that the item is implemented, committed and
+working.
+
+Abbreviations:
+ JD - JavaDoc
+ PD - PyDoc
+
+
+Functionality
+=============
+
+ Types of comments
+ -----------------
+
+ Note:
+ See 'http://www.stack.nl/~dimitri/doxygen/docblocks.html' for
+ the detailed description of Doxygen syntax and terms used in this
+ section.
+
+ 1. -OK- Only JavaDoc (/** */) and Qt (/*! */) styles of comment blocks
+ will be supported by SWIG translator.
+
+ 2. -OK- The following doc after members will be supported:
+
+ int var; ///< Detailed description after the member
+ //!<
+
+ int var; //!< Brief description after the member
+
+ int var; ///< Brief description after the member
+
+
+ 3. -OK- Only comments before or after declaration/definition will be
+ supported. Comments with structural commands will be ignored
+ (warning will be written). (What about writing them to
+ 'package.info.java' for JD?)
+
+
+ Tags
+ ----
+
+ This section contains all doxygen tags taken from
+ http://www.stack.nl/~dimitri/doxygen/commands.html. If a tag is
+ marked as 'ignored', then the tag is ignored, but the text is copied
+ to the destination documentation. 'Not implemented' means that the
+ tag with it's contents is stripped out of the output.
+
+ Doxygen tags:
+
+ All tags: -OK-
+
+ \a - translated to in JD, surrounded with _ in PD
+ \addindex - ignored
+ \addtogroup - ignored
+ \anchor - ignored, not supported by JD and PD
+ \arg - equivalent to \li
+ \attention - ignored
+ \authors, \author - translated to @author in JD, 'Author:' in PD
+ \b - in JD, surrounded with __ in PD
+ \brief - ignored
+ \bug - ignored
+ \c - translated to in JD, ignored in PD
+ \callgraph - ignored, not supported by JD and PD
+ \callergraph - ignored, not supported by JD and PD
+ \category - ignored, used only in Objective C
+ \cite - translated to in JD, single quotes in PD
+ \class - ignored (structural command)
+ \code - translated to {@code ...} in JD, ignored in PD
+ \cond - translated to 'Conditional comment: '. Later
+ SWIG may support definitions of conditions in config file.
+ \copybrief - ignored. Later SWIG may support this command by
+ performing copy
+ \copydetails - ignored. Later SWIG may support this command by
+ performing copy
+ \copydoc - ignored. Later SWIG may support this command by
+ performing copy
+ \copyright - replaced with text 'Copyright' in PD and PD
+ \date - ignored
+ \def - ignored (structural command)
+ \defgroup - not supported
+ \deprecated - translated to @deprecated in JD, 'Deprecated:' in PD
+ \details - ignored
+ \dir - not supported
+ \dontinclude - not supported
+ \dot - not supported. Later SWIG may call dot and produce the graph image
+ to include in JD and PD
+ \dotfile - see note for \dot
+ \e - equivalent \a
+ \else - see note for \cond
+ \elseif - see note for \cond
+ \em - equivalent to \a
+ \endcode - see note for \code
+ \endcond - translated to 'End of conditional comment: '. Later
+ SWIG may support definitions of conditions in config file.
+ \enddot - see note for \dot
+ \endhtmlonly - ignored
+ \endif - see note for \cond
+ \endinternal - ignored
+ \endlatexonly - ignored
+ \endlink - see note for \link
+ \endmanonly - ignored
+ \endmsc - see note for \msc
+ \endrtfonly - ignored
+ \endverbatim - see note for \verbatim
+ \endxmlonly - ignored
+ \enum - ignored (structural command)
+ \example - translated to 'Example:' in JD and PD
+ \exception - equivalent to throws, but translates to @exception in JD
+ \extends - not supported
+ \f$ - ignored. Later swig may call LATeX to produce bitmaps with formulas
+ to include in JD and PD
+ \f[ - see note for \f$
+ \f] - see note for \f$
+ \f{ - see note for \f$
+ \f} - see note for \f$
+ \file - ignored (structural command)
+ \fn - ignored (structural command)
+ \headerfile - not supported
+ \hideinitializer - not supported
+ \htmlinclude - not supported
+ \htmlonly - ignored
+ \if - see note for \cond
+ \ifnot - see note for \cond
+ \image - translated to
in JD only when target=HTML, translated to
+ 'Image: filename(Title)'
+ \implements - not supported
+ \include - not supported
+ \includelineno - not supported
+ \ingroup - not supported. Later swig may print group names as plain text
+ in comments like 'Code group: something' in both JD and PD
+ \internal - ignored
+ \invariant - ignored
+ \interface - ignored (structural command)
+ \latexonly - ignored
+ \li - trabslated to in JD, ignored in PD
+ \line - not supported
+ \link - translated to {@link ...} in JD, ignored in PD
+ \mainpage - ignored
+ \manonly - ignored
+ \memberof - not supported
+ \msc - not supported. Later SWIG may call dot and produce the graph image
+ to include in JD and PD
+ \mscfile - see note for \msc
+ \n - prints the new line
+ \name - ignored
+ \namespace - included in package-info.java if nspace feature is enabled,
+ otherwise ignored, ignored in PD
+ \nosubgrouping - ignored
+ \note - translated to 'Note:' in both JD and PD
+ \overload - prints 'This is an overloaded member function, provided for
+ convenience. It differs from the above function only in what
+ argument(s) it accepts.' to the output in both JD and PD
+ \p - equivalent to \c
+ \package - is kept same in JD (it is already a JD tag), ignored in PD
+ \page - ignored
+ \par - translated to in JD, 'Title: ...' in PD
+ \paragraph - ignored
+ \param - translated to @param in JD, special formatting in PD
+ \post - ignored
+ \pre - ignored
+ \private - ignored
+ \privatesection - ignored
+ \property - ignored
+ \protected - ignored
+ \protectedsection - ignored
+ \protocol - ignored (Objective-C tag)
+ \public - ignored
+ \publicsection - ignored
+ \ref - ignored, not supported by JD and PD
+ \related - ignored
+ \relates - ignored
+ \relatedalso - ignored
+ \relatesalso - ignored
+ \remark - translated to 'Remarks:' in both JD and PD
+ \remarks - equivalent to remark
+ \result - translated to @return in JD, 'Return:' in PD
+ \return - equivalent to result
+ \returns - equivalent to result
+ \retval - ignored
+ \rtfonly - ignored
+ \sa - translated to @see in JD, 'See also:' in PD
+ \section - not supported
+ \see - equivalent to \sa
+ \short - equivalent to \brief
+ \showinitializer - not supported
+ \since - translated to @since in JD, 'Since:' in PD
+ \skip - not supported
+ \skipline - not supported
+ \snippet - not supported
+ \struct - ignored (structural command)
+ \subpage - not supported
+ \subsection - not supported
+ \subsubsection - not supported
+ \tableofcontents - not supported
+ \test - ignored
+ \throw - translated to @throws in JD, 'Throws:' in PD
+ \throws - equivalent to \throw
+ \todo - translated to 'TODO:' in both JD and PD
+ \tparam - similar to \arg
+ \typedef - ignored (structural command)
+ \union - ignored (structural command)
+ \until - not supported
+ \var - ignored (structural command)
+ \verbatim - translated to {@literal ...} in JD, ignored in PD
+ \verbinclude - ignored
+ \version - translated to @version in JD, 'Version:' in PD
+ \warning - translated to 'Warning:' in both JD and PD
+ \weakgroup - not supported
+ \xmlonly - ignored
+ \xrefitem - ignored
+ \$ - this and all the others below: these commands insert single char,
+ it is escaped as HTML char in JD, kept as-is in PD
+ \@
+ \\
+ \&
+ \~
+ \<
+ \>
+ \#
+ \%
+ \"
+ \.
+ \::
+
+Optional functionality
+======================
+
+That section describes some complex cases where the current code
+does not behave really well. Like a short to-do list of special cases.
+
+-OK- When translating functions with default parameters in swig to
+java, it creates overloaded functions with all the parameters
+except the default ones. We need to copy the doxygen comment to
+such functions and correct the list of @param tags.
+
+-OK- In doxygen there is a special tags (and even a special option)
+to create links to some code members from the current comment.
+Sometimes it needs a type of parameters specified because of the
+overloaded functions. And the same linking tags are supported in JD,
+but it has a completely different typesystem, so we need to translate
+the types of function parameters in comments also. For example:
+{@link MyClass#doSomething(const std::string &)}
+does not make sense in Java, so the type should be converted.
+{@link MyClass#doSomething(String)}
+
+
+Tests
+=====
+
+The following test cases will be implemented:
+
+-OK- Class comments.
+
+-OK- Struct comments.
+-OK- Enum comments.
+-OK- Function comments.
+-OK- Var comments.
+
+-OK- Class attributes, comment before and after declaration.
+-OK- Class methods, comment of parameters in function
+ comment.
+-OK- Class methods, comment of parameters
+ after parameter declaration.
+
+-OK- Struct attributes, comment before and after declaration.
+-OK- Struct methods, comment of parameters in function
+ comment.
+-OK- Struct methods, comment of parameters
+ after parameter declaration.
+
+-OK- Enum items JD and Qt style, comment before items
+-OK- Enum items JD and Qt style, comment after items
+
+-OK- Class comment, with all supported tags.
+-OK- Class comment, with all doxygen tags, including
+ ignored ones.
+
+The list of all tests, in form of shell commands to make it simple
+to test project by copying the text below into terminal program.
+make doxygen_parsing.cpptest -s
+make doxygen_translate.cpptest -s
+make doxygen_translate_all_tags.cpptest -s
+make doxygen_basic_translate.cpptest -s
+make doxygen_basic_notranslate.cpptest -s
+make doxygen_translate_links.cpptest -s
+make doxygen_tricky_constructs.cpptest -s
+
+
+Refactoring
+===========
+
+All the code in directory _Doxygen_ should be refactored:
+-OK- all methods should be class members
+-OK- most static methods should be normal members
+-OK- replace C arrays of strings and sequential searches with STL data
+ structures and algorithms.
+-OK- use singletons instead of class instantiaion for each comment found.
+
+
+Documentation
+=============
+
+SWIG documentation will contain:
+-OK- command line options
+-OK- list of implemented features (types and placements of comments)
+-OK- list of unimplemented features (types and placements of comments)
+-OK- list of tags and their translations (all Doxygen tags).
+-OK- some amount of debugging and development information
+
diff --git a/Doc/Devel/runtime.txt b/Doc/Devel/runtime.txt
index f88edf767..ae9c83275 100644
--- a/Doc/Devel/runtime.txt
+++ b/Doc/Devel/runtime.txt
@@ -57,7 +57,7 @@ Alternatively, if the language supports modules, a module named
named "type_table" SWIG_TYPE_TABLE_NAME can be created inside it. The most
common approach is to store the mod pointer in some global variable in the
target language, but if the language provides an alternative place to store data
-(like the chicken module), then that is good too.
+then that is good too.
The way the code is set up, SetModule should only be called when GetModule
returns NULL, and if SetModule is called a second time, the behavior is
@@ -105,7 +105,7 @@ Standard Functions
These functions are not required and their API is not formalized, but almost all
language modules implement them for consistency across languages. Throughout
this discussion, I will use LangType to represent the underlying language type
-(C_word in chicken, Scheme_Object * in mzscheme, PyObject * in python, etc)
+(Scheme_Object * in mzscheme, PyObject * in python, etc)
diff --git a/Doc/Devel/tree.html b/Doc/Devel/tree.html
index 73a49ed55..5bb4b6a1e 100644
--- a/Doc/Devel/tree.html
+++ b/Doc/Devel/tree.html
@@ -236,7 +236,7 @@ The following functions can be used to help debug SWIG parse trees.
Prints the tag-structure of the parse tree to standard output. node is the top-level parse tree node. prefix is
-a string prefix thats added to the start of each line. Normally, you would specify the empty string or NIL for prefix.
+a string prefix that's added to the start of each line. Normally, you would specify the empty string or NIL for prefix.
This function is called by the -debug-tags option to SWIG.
diff --git a/Doc/Manual/Allegrocl.html b/Doc/Manual/Allegrocl.html
index ddb6fba55..4069ecd8b 100644
--- a/Doc/Manual/Allegrocl.html
+++ b/Doc/Manual/Allegrocl.html
@@ -8,7 +8,7 @@
-
+
@@ -129,16 +129,16 @@ It is significant to note that, while this is a vendor-specific
module, we would like to acknowledge the current and ongoing
work by developers in the open source lisp community that are
working on similar interfaces to implementation-independent
-foreign function interfaces (UFFI or CFFI, for example). Such
+foreign function interfaces (CFFI, for example). Such
work can only benefit the lisp community, and we would not
be unhappy to see some enterprising folk use this work to add
to it.
-
+
-
+
@@ -155,7 +155,7 @@ SWIG directives. SWIG can be furnished with a header file, but an
interface can also be generated without library headers by supplying a
simple text file--called the interface file, which is typically named
with a .i extension--containing any foreign declarations of
-identifiers you wish to use. The most common approach is to use a an
+identifiers you wish to use. The most common approach is to use an
interface file with directives to parse the needed headers. A straight
parse of library headers will result in usable code, but SWIG
directives provides much freedom in how a user might tailor the
@@ -360,7 +360,7 @@ need to link in the Allegro shared library. The library you create from
the C++ wrapper will be what you then load into Allegro CL.
-
+
@@ -396,7 +396,7 @@ See Section 17.5 Identifier converter
functions for more details.
-
+
@@ -436,7 +436,7 @@ Note that the block %{ ... %} is effectively a shortcut for
-
+
@@ -446,7 +446,7 @@ New users to SWIG are encouraged to read
interested in generating an interface to C++.
-
+
@@ -499,7 +499,7 @@ interested in generating an interface to C++.
-
+
@@ -512,7 +512,7 @@ interested in generating an interface to C++.
typemap.
-
+
@@ -593,7 +593,7 @@ char *xxx();
ff:def-foreign-call's.
-
+
@@ -606,11 +606,11 @@ char *xxx();
this function can be manipulated via the lout typemap.
-
+
- In the case of overloaded functions, mulitple layers are
+ In the case of overloaded functions, multiple layers are
generated. First, all the overloads for a given name are separated
out into groups based on arity, and are wrapped in
defmethods. Each method calls a distinct wrapper function, but are
@@ -622,7 +622,7 @@ char *xxx();
can be manipulated via the lout typemap.
-
+
@@ -635,7 +635,7 @@ char *xxx();
into the foreign module.
-
+
@@ -657,7 +657,7 @@ char *xxx();
foreign function interface.
-
+
@@ -665,7 +665,7 @@ char *xxx();
translated into lisp.
-
+
@@ -742,7 +742,7 @@ namespace car {
function such as (car '(1 2 3).
-
+
@@ -803,7 +803,7 @@ namespace car {
not use the -nocwrap command-line option.
-
+
@@ -881,7 +881,7 @@ globalvar> (globalvar.nnn::glob_float)
-
+
@@ -957,7 +957,7 @@ EXPORT const int ACL_ENUM___FOO3__SWIG_0 = FOO3;
-
+
@@ -1105,10 +1105,10 @@ namespace BAR {
-
+
-
+
@@ -1123,7 +1123,7 @@ namespace BAR {
integer values.
-
+
@@ -1136,7 +1136,7 @@ namespace BAR {
parameter.
-
+
@@ -1152,7 +1152,7 @@ namespace BAR {
the interface does nothing for friend directives,
-
+
@@ -1170,11 +1170,11 @@ namespace BAR {
use the more robust wrapper functions.
-
+
-
+
@@ -1187,7 +1187,7 @@ them. This is done via the
directive.
-
+
@@ -1197,7 +1197,7 @@ to include these templated classes in the foreign-type and CLOS
class schema.
-
+
@@ -1239,7 +1239,7 @@ int zzz(A *inst = 0); /* return inst->x + inst->y */
We resolve this issue, by noting synonym relationships between
types while generating the interface. A Primary type is selected
(more on this below) from the candidate list of synonyms. For
- all other synonyms, intead of generating a distinct CLOS class
+ all other synonyms, instead of generating a distinct CLOS class
definition, we generate a form that expands to:
@@ -1277,7 +1277,7 @@ synonym>
-
+
@@ -1298,7 +1298,7 @@ synonym>
-
+
@@ -1461,7 +1461,7 @@ overload>
-
+
@@ -1607,7 +1607,7 @@ opoverload>
-
+
@@ -1628,7 +1628,7 @@ opoverload>
with other ways such functions can be wrapped.
-
+
@@ -1640,7 +1640,7 @@ opoverload>
implemented.
-
+
@@ -1652,7 +1652,7 @@ opoverload>
newly defined types.
-
+
@@ -1663,7 +1663,7 @@ opoverload>
on Typemaps for more information.
-
+
@@ -1693,7 +1693,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
-
+
@@ -1728,7 +1728,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
-
+
@@ -1752,7 +1752,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
-
+
@@ -1784,7 +1784,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
these common typemaps here.
-
+
@@ -1803,7 +1803,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
16.3.1 Namespaces for details.
-
+
@@ -1846,7 +1846,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
-
+
@@ -1889,7 +1889,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
-
+
@@ -1939,7 +1939,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
-
+
@@ -1959,7 +1959,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
-
+
@@ -1983,7 +1983,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
-
+
@@ -2017,10 +2017,10 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
-
+
-
+
@@ -2041,11 +2041,11 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
of arguments.
-
+
Two basic identifier routines have been defined.
-
+
@@ -2054,7 +2054,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
strings, from which a symbol will be created.
-
+
@@ -2063,7 +2063,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
same symbol transformations.
-
+
@@ -2072,7 +2072,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
default naming conventions.
-
+
@@ -2128,7 +2128,7 @@ indicating the number of arguments passed to the routine indicated by
this identifier.
-
+
diff --git a/Doc/Manual/Android.html b/Doc/Manual/Android.html
index b295b5e04..da475e9a4 100644
--- a/Doc/Manual/Android.html
+++ b/Doc/Manual/Android.html
@@ -6,7 +6,7 @@
-
+
@@ -31,7 +31,7 @@ This chapter describes SWIG's support of Android.
-
+
@@ -41,14 +41,14 @@ Everything in the Java chapter applies to generatin
This chapter contains a few Android specific notes and examples.
-
+
-
+
-The examples require the Android SDK and Android NDK which can be installed as per instructions in the links.
+The examples require the Android SDK and Android NDK which can be installed as per instructions in the links.
The Eclipse version is not required for these examples as just the command line tools are used (shown for Linux as the host, but Windows will be very similar, if not identical in most places).
Add the SDK tools and NDK tools to your path and create a directory somewhere for your Android projects (adjust PATH as necessary to where you installed the tools):
@@ -77,7 +77,7 @@ $ android list targets
The following examples are shipped with SWIG under the Examples/android directory and include a Makefile to build and install each example.
-
+
@@ -326,7 +326,7 @@ include $(BUILD_SHARED_LIBRARY)
-See the Android NDK documentation for more on the NDK build system and getting started with the NDK.
+See the Android NDK documentation 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:
@@ -399,7 +399,7 @@ Run the app again and this time you will see the output pictured below, showing
-
+
@@ -409,7 +409,7 @@ All the steps required to compile and use a simple hierarchy of classes for shap
First create an Android project called SwigClass in a subdirectory called class.
-The steps below create and build a the JNI C++ app.
+The steps below create and build the JNI C++ app.
Adjust the --target id as mentioned earlier in the Examples introduction.
@@ -747,7 +747,7 @@ Run the app to see the result of calling the C++ code from Java:
-
+
@@ -759,7 +759,7 @@ Note that the 'extend' example is demonstrates the directors feature.
Normally C++ exception handling and the STL is not available by default in the version of g++ shipped with Android, but this example turns these features on as described in the next section.
-
+
diff --git a/Doc/Manual/Arguments.html b/Doc/Manual/Arguments.html
index 9dae9fdcd..3d633f336 100644
--- a/Doc/Manual/Arguments.html
+++ b/Doc/Manual/Arguments.html
@@ -7,7 +7,7 @@
-
+
@@ -32,7 +32,7 @@
-In Chapter 3, SWIG's treatment of basic datatypes and pointers was
+In Chapter 5, SWIG's treatment of basic datatypes and pointers was
described. In particular, primitive types such as int and
double are mapped to corresponding types in the target
language. For everything else, pointers are used to refer to
@@ -43,7 +43,7 @@ return multiple values through the arguments of a function. This chapter
describes some of the techniques for doing this.
-
+
@@ -51,7 +51,7 @@ This section describes the typemaps.i library file--commonly used to
change certain properties of argument conversion.
-
+
@@ -195,7 +195,7 @@ else. To clear a typemap, the %clear directive should be used. For e
-
+
@@ -248,7 +248,7 @@ When the function is used in the scripting language interpreter, it will work li
result = add(3, 4)
-
+
@@ -315,7 +315,7 @@ iresult, dresult = foo(3.5, 2)
-
+
@@ -380,7 +380,7 @@ rather than directly overwriting the value of the original input object.
SWIG. Backwards compatibility is preserved, but deprecated.
-
+
@@ -414,7 +414,7 @@ Typemap declarations are lexically scoped so a typemap takes effect from the poi
file or a matching %clear declaration.
-
+
@@ -424,7 +424,7 @@ insure that a value is positive, or that a pointer is non-NULL. This
can be accomplished including the constraints.i library file.
-
+
@@ -450,7 +450,7 @@ the arguments violate the constraint condition, a scripting language
exception will be raised. As a result, it is possible to catch bad
values, prevent mysterious program crashes and so on.
-
+
@@ -466,7 +466,7 @@ NONNULL Non-NULL pointer (pointers only).
-
+
diff --git a/Doc/Manual/CCache.html b/Doc/Manual/CCache.html
index d23b0cb2f..1a94709ae 100644
--- a/Doc/Manual/CCache.html
+++ b/Doc/Manual/CCache.html
@@ -7,7 +7,7 @@
-
+
@@ -35,7 +35,7 @@
-
+
@@ -43,7 +43,7 @@
ccache-swig - a fast compiler cache
-
+
@@ -53,7 +53,7 @@ ccache-swig <compiler> [COMPILER OPTIONS]
<compiler> [COMPILER OPTIONS]
-
+
@@ -62,7 +62,7 @@ by caching previous compiles and detecting when the same compile is
being done again. ccache-swig is ccache plus support for SWIG. ccache
and ccache-swig are used interchangeably in this document.
-
+
@@ -82,7 +82,7 @@ Here is a summary of the options to ccache-swig.
-
+
@@ -124,7 +124,7 @@ rounded down to the nearest multiple of 16 kilobytes.
-
+
@@ -156,7 +156,7 @@ This will work as long as /usr/local/bin comes before the path to gcc
Note! Do not use a hard link, use a symbolic link. A hardlink will
cause "interesting" problems.
-
+
@@ -176,7 +176,7 @@ file). By using --ccache-skip you can force an option to not be
treated as an input file name and instead be passed along to the
compiler as a command line option.
-
+
@@ -315,7 +315,7 @@ the use of '#pragma SWIG'.
-
+
@@ -328,7 +328,7 @@ When these limits are reached ccache will reduce the cache to 20%
below the numbers you specified in order to avoid doing the cache
clean operation too often.
-
+
@@ -339,7 +339,7 @@ performance slowdown, it significantly increases the number of files
that fit in the cache. You can turn off compression setting the
CCACHE_NOCOMPRESS environment variable.
-
+
@@ -364,7 +364,7 @@ compiler output that you would get without the cache. If you ever
discover a case where ccache changes the output of your compiler then
please let me know.
-
+
@@ -378,7 +378,7 @@ option. You just need to set the environment variable CCACHE_PREFIX to
'distcc' and ccache will prefix the command line used with the
compiler with the command 'distcc'.
-
+
@@ -407,11 +407,11 @@ following conditions need to be met:
versions of ccache that do not support compression.
-
+
-ccache was inspired by the compilercache shell script script written
+ccache was inspired by the compilercache shell script written
by Erik Thiele and I would like to thank him for an excellent piece of
work. See
http://www.erikyyy.de/compilercache/
@@ -423,7 +423,7 @@ I wrote ccache because I wanted to get a bit more speed out of a
compiler cache and I wanted to remove some of the limitations of the
shell-script version.
-
+
@@ -441,7 +441,7 @@ are:
ccache avoids a double call to cpp on a cache miss
-
+
@@ -453,12 +453,12 @@ Thanks to the following people for their contributions to ccache
Paul Russell for many suggestions and the debian packaging
-
+
ccache was written by Andrew Tridgell
-http://samba.org/~tridge/.
+https://www.samba.org/~tridge/.
ccache was adapted to create ccache-swig for use with SWIG by William Fulton.
If you wish to report a problem or make a suggestion then please email
diff --git a/Doc/Manual/CPlusPlus11.html b/Doc/Manual/CPlusPlus11.html
index 4d4261cd7..e5d7fbc2d 100644
--- a/Doc/Manual/CPlusPlus11.html
+++ b/Doc/Manual/CPlusPlus11.html
@@ -32,6 +32,7 @@
Type alias and alias templates
Unrestricted unions
Variadic templates
+New character literals
New string literals
User-defined literals
Thread-local storage
@@ -42,6 +43,7 @@
Exception specifications and noexcept
Control and query object alignment
Attributes
+Methods with ref-qualifiers
Standard library changes
@@ -334,6 +336,10 @@ int i; int j;
decltype(i+j) k; // syntax error
+SWIG does not support auto as a type specifier for variables, only
+for specifying the return type of lambdas
+and functions.
+
@@ -713,7 +719,24 @@ const int SIZE = sizeof...(ClassName<int, int>);
In the above example SIZE is of course wrapped as a constant.
-
+
+
+
+
+C++11 adds support for UCS-2 and UCS-4 character literals.
+These character literals are preceded by either 'u' or 'U'.
+
+
+
+char16_t a = u'a';
+char32_t b = U'b';
+
+
+
+Compatibility note: SWIG-4.0.0 was the first version to support these Universal Coded Character Set (UCS) character literals.
+
+
+
SWIG supports wide string and Unicode string constants and raw string literals.
@@ -743,7 +766,7 @@ Note: There is a bug currently where SWIG's preprocessor incorrectly parses an o
inside raw string literals.
-
+
@@ -810,7 +833,7 @@ OutputType var2 = 1234_suffix;
OutputType var3 = 3.1416_suffix;
-
+
SWIG correctly parses the thread_local keyword. For example, variables
@@ -830,7 +853,7 @@ A variable will be thread local if accessed from different threads from the targ
same way that it will be thread local if accessed from C++ code.
-
+
SWIG handles explicitly defaulted functions, that is, = default added to a function declaration. Deleted definitions, which are also called deleted functions, have = delete added to the function declaration.
@@ -868,16 +891,17 @@ This is a C++ compile time check and SWIG does not make any attempt to detect if
so in this case it is entirely possible to pass an int instead of a double to f from Java, Python etc.
-
+
SWIG correctly parses and uses the new long long type already introduced in C99 some time ago.
-
+
-SWIG correctly parses the new static_assert declarations.
+SWIG correctly parses the new static_assert declarations (though 3.0.12 and earlier
+had a bug which meant this wasn't accepted at file scope).
This is a C++ compile time directive so there isn't anything useful that SWIG can do with it.
@@ -888,7 +912,7 @@ struct Check {
};
-
+
@@ -909,7 +933,7 @@ const int SIZE = sizeof(A::member); // does not work with C++03. Okay with C++11
8
-
+
@@ -925,7 +949,7 @@ int noex2(int) noexcept(true);
int noex3(int, bool) noexcept(false);
-
+
@@ -957,7 +981,7 @@ Use the preprocessor to work around this for now:
-
+
@@ -970,6 +994,104 @@ int [[attr1]] i [[attr2, attr3]];
[[noreturn, nothrow]] void f [[noreturn]] ();
+
+
+
+
+
+C++11 non-static member functions can be declared with ref-qualifiers.
+Member functions declared with a & lvalue ref-qualifiers are wrapped like any other function without ref-qualifiers.
+Member functions declared with a && rvalue ref-qualifiers are ignored by default
+as they are unlikely to be required from non-C++ languages where the concept of rvalue-ness
+for the implied *this pointer does not apply.
+The warning is hidden by default, but can be displayed as described in the section on Enabling extra warnings.
+
+
+
+Consider:
+
+
+
+struct RQ {
+ void m1(int x) &;
+ void m2(int x) &&;
+};
+
+
+
+The only wrapped method will be the lvalue ref-qualified method m1
+and if SWIG is run with the -Wextra command-line option, the following warning will be issued indicating m2 is not wrapped:
+
+
+
+
+example.i:7: Warning 405: Method with rvalue ref-qualifier m2(int) && ignored.
+
+
+
+
+If you unignore the method as follows, wrappers for m2 will be generated:
+
+
+
+%feature("ignore", "0") RQ::m2(int x) &&;
+struct RQ {
+ void m1(int x) &;
+ void m2(int x) &&;
+};
+
+
+
+Inspection of the generated C++ code, will show that std::move is used on the instance
+of the RQ * class:
+
+
+
+ RQ *arg1 = (RQ *) 0 ;
+ int arg2 ;
+
+ arg1 = ...marshalled from target language...
+ arg2 = ...marshalled from target language...
+
+ std::move(*arg1).m2(arg2);
+
+
+
+This will compile but when run, the move effects may not be what you want.
+As stated earlier, rvalue ref-qualifiers aren't really applicable outside the world of C++.
+However, if you really know what you are doing, full control over the call to the method is
+possible via the low-level "action" feature.
+This feature completely replaces the call to the underlying function, that is, the last line in the snippet of code above.
+
+
+
+%feature("ignore", "0") RQ::m2(int x) &&;
+%feature("action") RQ::m2(int x) && %{
+ RQ().m2(arg2);
+%}
+struct RQ {
+ void m1(int x) &;
+ void m2(int x) &&;
+};
+
+
+
+resulting in:
+
+
+
+ RQ *arg1 = (RQ *) 0 ;
+ int arg2 ;
+
+ arg1 = ...marshalled from target language...
+ arg2 = ...marshalled from target language...
+
+ RQ().m2(arg2);
+
+
+
+Compatibility note: SWIG-4.0.0 was the first version to support ref-qualifiers.
+
@@ -994,7 +1116,8 @@ Variadic template support requires further work to provide substantial tuple wra
The new hash tables in the STL are unordered_set, unordered_multiset, unordered_map, unordered_multimap.
-These are not available in SWIG, but in principle should be easily implemented by adapting the current STL containers.
+These are not available in all target languages.
+Any missing support can in principle be easily implemented by adapting the current STL containers.
@@ -1175,5 +1298,6 @@ Phew, that is a lot of hard work to get a callback working.
You could just go with the more attractive option of just using double as the return type in the function declaration instead of result_of!
+