Merge remote-tracking branch 'upstream/master' into OCaml-INPUT-OUTPUT-INOUT-primitives
This commit is contained in:
commit
2f48bec666
363 changed files with 5825 additions and 2936 deletions
256
.travis.yml
256
.travis.yml
|
|
@ -5,115 +5,139 @@ matrix:
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=
|
env: SWIGLANG=
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=
|
env: SWIGLANG=
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG= SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
env: SWIGLANG= GCC=4.4
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG= SWIG_CC=gcc-6 SWIG_CXX=g++-6
|
env: SWIGLANG= GCC=4.6
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG= GCC=4.7
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG= GCC=4.8
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG= GCC=4.9
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG= GCC=6
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG= GCC=7
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG= GCC=8
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=csharp
|
env: SWIGLANG=csharp
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=d
|
env: SWIGLANG=d
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=go
|
env: SWIGLANG=go VER=1.3
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=go VER=1.5
|
env: SWIGLANG=go VER=1.8
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
|
- compiler: gcc
|
||||||
|
os: linux
|
||||||
|
env: SWIGLANG=go VER=1.12
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=guile
|
env: SWIGLANG=guile
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=java
|
env: SWIGLANG=java
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=javascript ENGINE=node
|
env: SWIGLANG=javascript ENGINE=node VER=0.10
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=javascript ENGINE=node VER=4 CPP11=1
|
env: SWIGLANG=javascript ENGINE=node VER=4 CPP11=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=javascript ENGINE=node VER=6 CPP11=1
|
env: SWIGLANG=javascript ENGINE=node VER=6 CPP11=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=javascript ENGINE=node VER=8 CPP11=1
|
env: SWIGLANG=javascript ENGINE=node VER=8 CPP11=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=javascript ENGINE=node VER=10 CPP11=1
|
env: SWIGLANG=javascript ENGINE=node VER=10 CPP11=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=javascript ENGINE=jsc
|
env: SWIGLANG=javascript ENGINE=jsc
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=javascript ENGINE=v8
|
env: SWIGLANG=javascript ENGINE=v8
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=lua
|
env: SWIGLANG=lua
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=lua VER=5.3
|
env: SWIGLANG=lua VER=5.3
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=mzscheme
|
env: SWIGLANG=mzscheme
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=ocaml
|
env: SWIGLANG=ocaml
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=octave SWIGJOBS=-j2 # 3.8
|
env: SWIGLANG=octave SWIGJOBS=-j2
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
|
||||||
os: linux
|
|
||||||
env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.0
|
|
||||||
sudo: required
|
|
||||||
dist: trusty
|
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.2 CPP11=1
|
env: SWIGLANG=octave SWIGJOBS=-j2 VER=4.2 CPP11=1
|
||||||
|
|
@ -128,130 +152,130 @@ matrix:
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=perl5
|
env: SWIGLANG=perl5
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=php VER=7.0
|
env: SWIGLANG=php VER=7.0
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=php VER=7.1
|
env: SWIGLANG=php VER=7.1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=php VER=7.2
|
env: SWIGLANG=php VER=7.2
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=php VER=7.3
|
env: SWIGLANG=php VER=7.3
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python # 2.7
|
env: SWIGLANG=python # 2.7
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python PY3=3 VER=3.2
|
env: SWIGLANG=python PY3=3 VER=3.2
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python PY3=3 VER=3.3
|
env: SWIGLANG=python PY3=3 VER=3.3
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python PY3=3 VER=3.4
|
env: SWIGLANG=python PY3=3 VER=3.4
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python PY3=3 VER=3.5
|
env: SWIGLANG=python PY3=3 VER=3.5
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python PY3=3 VER=3.6
|
env: SWIGLANG=python PY3=3 VER=3.6
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python PY3=3 VER=3.7
|
env: SWIGLANG=python PY3=3 VER=3.7
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES=-builtin
|
env: SWIGLANG=python SWIG_FEATURES=-builtin
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES="-builtin -O"
|
env: SWIGLANG=python SWIG_FEATURES="-builtin -O"
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES=-builtin SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP11=1
|
env: SWIGLANG=python SWIG_FEATURES=-builtin GCC=6 CPP11=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES=-builtin SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP11=1 PY3=3 VER=3.7
|
env: SWIGLANG=python SWIG_FEATURES=-builtin GCC=6 CPP11=1 PY3=3 VER=3.7
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.4
|
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.4
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.5
|
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.5
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.7
|
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.7
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES="-builtin -O" PY3=3 VER=3.7
|
env: SWIGLANG=python SWIG_FEATURES="-builtin -O" PY3=3 VER=3.7
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.7 SWIGOPTPY3=
|
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.7 SWIGOPTPY3=
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES=-O
|
env: SWIGLANG=python SWIG_FEATURES=-O
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=python SWIG_FEATURES=-O PY3=3 VER=3.7
|
env: SWIGLANG=python SWIG_FEATURES=-O PY3=3 VER=3.7
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=r
|
env: SWIGLANG=r
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=ruby VER=1.9.3
|
env: SWIGLANG=ruby VER=1.9.3
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=ruby VER=2.0.0
|
env: SWIGLANG=ruby VER=2.0.0
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=ruby VER=2.3.0
|
env: SWIGLANG=ruby VER=2.3.0
|
||||||
|
|
@ -261,84 +285,84 @@ matrix:
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=scilab
|
env: SWIGLANG=scilab
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=tcl
|
env: SWIGLANG=tcl
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=csharp SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
env: SWIGLANG=csharp CPP11=1
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG=go VER=1.6 CPP11=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: trusty
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=go SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
env: SWIGLANG=java CPP11=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=java SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
env: SWIGLANG=python CPP11=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
|
||||||
env: SWIGLANG=python SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
|
||||||
sudo: required
|
|
||||||
dist: trusty
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=r CPP11=1 # Note: making 'R CMD SHLIB' use a different compiler is non-trivial
|
env: SWIGLANG=r CPP11=1 # Note: making 'R CMD SHLIB' use a different compiler is non-trivial
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=ruby SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
env: SWIGLANG=ruby CPP11=1
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG=tcl CPP11=1
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG=csharp GCC=6 CPP14=1
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
- os: linux
|
||||||
|
env: SWIGLANG=go GCC=6 CPP14=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: trusty
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=tcl SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
env: SWIGLANG=java GCC=6 CPP14=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=csharp SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
env: SWIGLANG=python GCC=6 CPP14=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=go SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
env: SWIGLANG=ruby GCC=6 CPP14=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=java SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
env: SWIGLANG=tcl GCC=6 CPP14=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=python SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
env: SWIGLANG=java GCC=7 CPP14=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=ruby SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
env: SWIGLANG=python GCC=7 CPP14=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=tcl SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
env: SWIGLANG=csharp GCC=8 CPP17=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=java SWIG_CC=gcc-7 SWIG_CXX=g++-7 CPP14=1
|
env: SWIGLANG=java GCC=8 CPP17=1
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
- os: linux
|
||||||
env: SWIGLANG=python SWIG_CC=gcc-7 SWIG_CXX=g++-7 CPP14=1
|
env: SWIGLANG=python GCC=8 CPP17=1 PY3=3 VER=3.7
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- os: linux
|
|
||||||
env: SWIGLANG=csharp SWIG_CC=gcc-8 SWIG_CXX=g++-8 CPP17=1
|
|
||||||
sudo: required
|
|
||||||
dist: trusty
|
|
||||||
- os: linux
|
|
||||||
env: SWIGLANG=java SWIG_CC=gcc-8 SWIG_CXX=g++-8 CPP17=1
|
|
||||||
sudo: required
|
|
||||||
dist: trusty
|
|
||||||
- os: linux
|
|
||||||
env: SWIGLANG=python SWIG_CC=gcc-8 SWIG_CXX=g++-8 CPP17=1 PY3=3 VER=3.7
|
|
||||||
sudo: required
|
|
||||||
dist: trusty
|
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: osx
|
os: osx
|
||||||
env: SWIGLANG=
|
env: SWIGLANG=
|
||||||
|
|
@ -377,12 +401,12 @@ matrix:
|
||||||
env: SWIGLANG=tcl
|
env: SWIGLANG=tcl
|
||||||
|
|
||||||
allow_failures:
|
allow_failures:
|
||||||
# Deprecated functions causing build failure since upgrade from Node v10.11.0 to v10.12.0
|
# seg fault in director_basic testcase
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=javascript ENGINE=node VER=10 CPP11=1
|
env: SWIGLANG=php VER=7.2
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
# Sometimes hits the Travis 50 minute time limit
|
# Sometimes hits the Travis 50 minute time limit
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
|
|
@ -394,33 +418,29 @@ matrix:
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=mzscheme
|
env: SWIGLANG=mzscheme
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
os: linux
|
os: linux
|
||||||
env: SWIGLANG=ocaml
|
env: SWIGLANG=ocaml
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: trusty
|
dist: xenial
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- date -u
|
- date -u
|
||||||
- uname -a
|
- 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 && cat /proc/cpuinfo | grep "model name" && cat /proc/meminfo | grep MemTotal; fi
|
||||||
- if test "$TRAVIS_OS_NAME" = "osx"; then sysctl -a | grep brand_string; fi
|
- if test "$TRAVIS_OS_NAME" = "osx"; then sysctl -a | grep brand_string; fi
|
||||||
# Travis overrides CC environment with compiler predefined values
|
# Travis overrides CC environment with compiler predefined values
|
||||||
- if test -n "$SWIG_CC"; then export CC="$SWIG_CC"; fi
|
- if test -n "$GCC"; then export CC="gcc-$GCC" && export CXX="g++-$GCC"; fi
|
||||||
- if test -n "$SWIG_CXX"; then export CXX="$SWIG_CXX"; fi
|
|
||||||
install:
|
install:
|
||||||
- if test "$TRAVIS_OS_NAME" = "linux"; then source Tools/travis-linux-install.sh; fi
|
- 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
|
- if test "$TRAVIS_OS_NAME" = "osx"; then source Tools/travis-osx-install.sh; fi
|
||||||
|
- ls -la $(which $CC) $(which $CXX) && $CC --version && $CXX --version
|
||||||
|
script:
|
||||||
|
- echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r'
|
||||||
- if test -n "$CPP11"; then CONFIGOPTS+=(--enable-cpp11-testing --without-maximum-compile-warnings "CXXFLAGS=-std=c++11 -Wall -Wextra" "CFLAGS=-std=c11 -Wall -Wextra") && export CSTD=c11 && export CPPSTD=c++11; fi
|
- if test -n "$CPP11"; then CONFIGOPTS+=(--enable-cpp11-testing --without-maximum-compile-warnings "CXXFLAGS=-std=c++11 -Wall -Wextra" "CFLAGS=-std=c11 -Wall -Wextra") && export CSTD=c11 && export CPPSTD=c++11; fi
|
||||||
- if test -n "$CPP14"; then CONFIGOPTS+=(--enable-cpp11-testing --without-maximum-compile-warnings "CXXFLAGS=-std=c++14 -Wall -Wextra" "CFLAGS=-std=c11 -Wall -Wextra") && export CSTD=c11 && export CPPSTD=c++14; fi
|
- if test -n "$CPP14"; then CONFIGOPTS+=(--enable-cpp11-testing --without-maximum-compile-warnings "CXXFLAGS=-std=c++14 -Wall -Wextra" "CFLAGS=-std=c11 -Wall -Wextra") && export CSTD=c11 && export CPPSTD=c++14; fi
|
||||||
- if test -n "$CPP17"; then CONFIGOPTS+=(--enable-cpp11-testing --without-maximum-compile-warnings "CXXFLAGS=-std=c++17 -Wall -Wextra" "CFLAGS=-std=c17 -Wall -Wextra") && export CSTD=c17 && export CPPSTD=c++17; fi
|
- if test -n "$CPP17"; then CONFIGOPTS+=(--enable-cpp11-testing --without-maximum-compile-warnings "CXXFLAGS=-std=c++17 -Wall -Wextra" "CFLAGS=-std=c17 -Wall -Wextra") && export CSTD=c17 && export CPPSTD=c++17; fi
|
||||||
- ls -la $(which $CC)
|
|
||||||
- ls -la $(which $CXX)
|
|
||||||
- $CC --version
|
|
||||||
- $CXX --version
|
|
||||||
script:
|
|
||||||
- echo 'Configuring...' && echo -en 'travis_fold:start:script.1\\r'
|
|
||||||
- if test -n "$SWIGLANG"; then CONFIGOPTS+=(--without-alllang --with-$WITHLANG); fi
|
- if test -n "$SWIGLANG"; then CONFIGOPTS+=(--without-alllang --with-$WITHLANG); fi
|
||||||
- echo "${CONFIGOPTS[@]}"
|
- echo "${CONFIGOPTS[@]}"
|
||||||
- ./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
|
- ./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
|
||||||
|
|
|
||||||
20
ANNOUNCE
20
ANNOUNCE
|
|
@ -1,8 +1,8 @@
|
||||||
*** ANNOUNCE: SWIG 4.0.0 (in progress) ***
|
*** ANNOUNCE: SWIG 4.0.1 (in progress) ***
|
||||||
|
|
||||||
http://www.swig.org
|
http://www.swig.org
|
||||||
|
|
||||||
We're pleased to announce SWIG-4.0.0, the latest SWIG release.
|
We're pleased to announce SWIG-4.0.1, the latest SWIG release.
|
||||||
|
|
||||||
What is SWIG?
|
What is SWIG?
|
||||||
=============
|
=============
|
||||||
|
|
@ -10,13 +10,11 @@ What is SWIG?
|
||||||
SWIG is a software development tool that reads C/C++ header files and
|
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
|
generates the wrapper code needed to make C and C++ code accessible
|
||||||
from other programming languages including Perl, Python, Tcl, Ruby,
|
from other programming languages including Perl, Python, Tcl, Ruby,
|
||||||
PHP, C#, Go, Java, Javascript, Lua, Scheme (Guile, MzScheme),
|
PHP, C#, Go, Java, Javascript, Lua, Scheme (Guile, MzScheme), D,
|
||||||
D, Ocaml, Octave, R, Scilab.
|
Ocaml, Octave, R, Scilab. SWIG can also export its parse tree in
|
||||||
SWIG can also export its parse tree in
|
the form of XML. Major applications of SWIG include generation of
|
||||||
the form of XML. Major applications of SWIG
|
scripting language extension modules, rapid prototyping, testing,
|
||||||
include generation of scripting language extension modules, rapid
|
and user interface development for large C/C++ systems.
|
||||||
prototyping, testing, and user interface development for large
|
|
||||||
C/C++ systems.
|
|
||||||
|
|
||||||
Release Notes
|
Release Notes
|
||||||
=============
|
=============
|
||||||
|
|
@ -27,11 +25,11 @@ Availability
|
||||||
============
|
============
|
||||||
The release is available for download on Sourceforge at
|
The release is available for download on Sourceforge at
|
||||||
|
|
||||||
http://prdownloads.sourceforge.net/swig/swig-4.0.0.tar.gz
|
http://prdownloads.sourceforge.net/swig/swig-4.0.1.tar.gz
|
||||||
|
|
||||||
A Windows version is also available at
|
A Windows version is also available at
|
||||||
|
|
||||||
http://prdownloads.sourceforge.net/swig/swigwin-4.0.0.zip
|
http://prdownloads.sourceforge.net/swig/swigwin-4.0.1.zip
|
||||||
|
|
||||||
Please report problems with this release to the swig-devel mailing list,
|
Please report problems with this release to the swig-devel mailing list,
|
||||||
details at http://www.swig.org/mail.html.
|
details at http://www.swig.org/mail.html.
|
||||||
|
|
|
||||||
1384
CHANGES.current
1384
CHANGES.current
File diff suppressed because it is too large
Load diff
|
|
@ -19,6 +19,7 @@ Active SWIG Developers:
|
||||||
Oliver Buchtala (oliver.buchtala@gmail.com) (Javascript)
|
Oliver Buchtala (oliver.buchtala@gmail.com) (Javascript)
|
||||||
Neha Narang (narangneha03@gmail.com) (Javascript)
|
Neha Narang (narangneha03@gmail.com) (Javascript)
|
||||||
Simon Marchetto (simon.marchetto@scilab-enterprises.com) (Scilab)
|
Simon Marchetto (simon.marchetto@scilab-enterprises.com) (Scilab)
|
||||||
|
Zackery Spytz (zspytz@gmail.com) (OCaml, SWIG core)
|
||||||
|
|
||||||
Past SWIG developers and major contributors include:
|
Past SWIG developers and major contributors include:
|
||||||
Dave Beazley (dave-swig@dabeaz.com) (SWIG core, Python, Tcl, Perl)
|
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)
|
Mikel Bancroft (mikel@franz.com) (Allegro CL)
|
||||||
Surendra Singhi (efuzzyone@netscape.net) (CLISP, CFFI)
|
Surendra Singhi (efuzzyone@netscape.net) (CLISP, CFFI)
|
||||||
Marcelo Matus (mmatus@acms.arizona.edu) (SWIG core, Python, UTL[python,perl,tcl,ruby])
|
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)
|
Lyle Johnson (lyle@users.sourceforge.net) (Ruby)
|
||||||
Charlie Savage (cfis@interserv.com) (Ruby)
|
Charlie Savage (cfis@interserv.com) (Ruby)
|
||||||
Thien-Thi Nguyen (ttn@glug.org) (build/test/misc)
|
Thien-Thi Nguyen (ttn@glug.org) (build/test/misc)
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ This chapter contains a few Android specific notes and examples.
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The examples require the <a href="http://developer.android.com/sdk/index.html">Android SDK</a> and <a href="http://developer.android.com/tools/sdk/ndk/index.html">Android NDK</a> which can be installed as per instructions in the links.
|
The examples require the <a href="https://developer.android.com/sdk/">Android SDK</a> and <a href="https://developer.android.com/ndk/">Android NDK</a> which can be installed as per instructions in the links.
|
||||||
The Eclipse version is not required for these examples as just the command line tools are used (shown for Linux as the host, but Windows will be very similar, if not identical in most places).
|
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):
|
Add the SDK tools and NDK tools to your path and create a directory somewhere for your Android projects (adjust PATH as necessary to where you installed the tools):
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -326,7 +326,7 @@ include $(BUILD_SHARED_LIBRARY)
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
See the <a href="http://developer.android.com/sdk/ndk/index.html">Android NDK documentation</a> for more on the NDK build system and getting started with the NDK.
|
See the <a href="https://developer.android.com/ndk/">Android NDK documentation</a> for more on the NDK build system and getting started with the NDK.
|
||||||
A simple invocation of ndk-build will compile the .c files and generate a shared object/system library. Output will be similar to:
|
A simple invocation of ndk-build will compile the .c files and generate a shared object/system library. Output will be similar to:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,7 @@ Thanks to the following people for their contributions to ccache
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
ccache was written by Andrew Tridgell
|
ccache was written by Andrew Tridgell
|
||||||
<a href="http://samba.org/~tridge/">http://samba.org/~tridge/</a>.
|
<a href="https://www.samba.org/~tridge/">https://www.samba.org/~tridge/</a>.
|
||||||
ccache was adapted to create ccache-swig for use with SWIG by William Fulton.
|
ccache was adapted to create ccache-swig for use with SWIG by William Fulton.
|
||||||
<p>
|
<p>
|
||||||
If you wish to report a problem or make a suggestion then please email
|
If you wish to report a problem or make a suggestion then please email
|
||||||
|
|
|
||||||
|
|
@ -64,15 +64,15 @@ The wrapper code implementation uses C# and the Platform Invoke (PInvoke) interf
|
||||||
The PInvoke interface has been chosen over Microsoft's Managed C++ interface as it is portable to both Microsoft Windows and non-Microsoft platforms.
|
The PInvoke interface has been chosen over Microsoft's Managed C++ interface as it is portable to both Microsoft Windows and non-Microsoft platforms.
|
||||||
PInvoke is part of the ECMA/ISO C# specification.
|
PInvoke is part of the ECMA/ISO C# specification.
|
||||||
It is also better suited for robust production environments due to the Managed C++ flaw called the
|
It is also better suited for robust production environments due to the Managed C++ flaw called the
|
||||||
<a href="http://msdn.microsoft.com/en-us/library/aa290048(VS.71).aspx">Mixed DLL Loading Problem</a>.
|
<a href="https://msdn.microsoft.com/en-us/ie/aa290048(v=vs.94)">Mixed DLL Loading Problem</a>.
|
||||||
SWIG C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using
|
SWIG C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using
|
||||||
<a href="http://www.mono-project.com/Main_Page">Mono</a> and <a href="http://www.dotgnu.org/pnet.html">Portable.NET</a>.
|
<a href="https://www.mono-project.com/Main_Page/">Mono</a> and <a href="http://www.dotgnu.org/pnet.html">Portable.NET</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To get the most out of this chapter an understanding of interop is required.
|
To get the most out of this chapter an understanding of interop is required.
|
||||||
The <a href="http://msdn.microsoft.com">Microsoft Developer Network (MSDN)</a> has a good reference guide in a section titled "Interop Marshaling".
|
The <a href="https://msdn.microsoft.com">Microsoft Developer Network (MSDN)</a> has a good reference guide in a section titled "Interop Marshaling".
|
||||||
Monodoc, available from the Mono project, has a very useful section titled <a href="http://www.mono-project.com/docs/advanced/pinvoke/">Interop with native libraries</a>.
|
Monodoc, available from the Mono project, has a very useful section titled <a href="https://www.mono-project.com/docs/advanced/pinvoke/">Interop with native libraries</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="CSharp_introduction_swig2_compatibility">22.1.1 SWIG 2 Compatibility</a></H3>
|
<H3><a name="CSharp_introduction_swig2_compatibility">22.1.1 SWIG 2 Compatibility</a></H3>
|
||||||
|
|
@ -232,8 +232,8 @@ javacode -> cscode
|
||||||
javaimports -> csimports
|
javaimports -> csimports
|
||||||
javabody -> csbody
|
javabody -> csbody
|
||||||
javafinalize -> csfinalize
|
javafinalize -> csfinalize
|
||||||
javadestruct -> csdestruct
|
javadestruct -> csdisposing and csdispose
|
||||||
javadestruct_derived -> csdestruct_derived
|
javadestruct_derived -> csdisposing_derived and csdispose_derived
|
||||||
javainterfacecode -> csinterfacecode
|
javainterfacecode -> csinterfacecode
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
|
|
@ -643,7 +643,7 @@ passing a direct reference as described in the next section.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
For more information on the subject, see the
|
For more information on the subject, see the
|
||||||
<a href="http://msdn.microsoft.com/en-us/library/z6cfh6e6(VS.80).aspx">Default Marshaling for Arrays</a> article
|
<a href="https://docs.microsoft.com/en-us/dotnet/framework/interop/default-marshaling-for-arrays">Default Marshaling for Arrays</a> article
|
||||||
on MSDN.
|
on MSDN.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -763,7 +763,7 @@ another thread may produce enough garbage to trigger garbage collection.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
For more information, see the <a href="http://msdn.microsoft.com/en-us/library/f58wzh21(VS.80).aspx">fixed statement</a> in the C# language reference.
|
For more information, see the <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/fixed-statement">fixed statement</a> in the C# language reference.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -647,6 +647,10 @@
|
||||||
<li><a href="Doxygen.html#Doxygen_python_unsupported_tags">Unsupported tags</a>
|
<li><a href="Doxygen.html#Doxygen_python_unsupported_tags">Unsupported tags</a>
|
||||||
<li><a href="Doxygen.html#Doxygen_python_further_details">Further details</a>
|
<li><a href="Doxygen.html#Doxygen_python_further_details">Further details</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
<li><a href="Doxygen.html#Doxygen_troubleshooting">Troubleshooting</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="Doxygen.html#troubleshooting_ifndef">Problem with conditional compilation</a>
|
||||||
|
</ul>
|
||||||
<li><a href="Doxygen.html#Doxygen_developer_details">Developer information</a>
|
<li><a href="Doxygen.html#Doxygen_developer_details">Developer information</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Doxygen.html#Doxygen_translator_design">Doxygen translator design</a>
|
<li><a href="Doxygen.html#Doxygen_translator_design">Doxygen translator design</a>
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
<H2><a name="D_command_line_invocation">23.2 Command line invocation</a></H2>
|
<H2><a name="D_command_line_invocation">23.2 Command line invocation</a></H2>
|
||||||
|
|
||||||
|
|
||||||
<p>To activate the D module, pass the <tt>-d</tt> option to SWIG at the command line. The same standard command line switches as with any other language module are available, plus the following D specific ones:</p>
|
<p>To activate the D module, pass the <tt>-d</tt> option to SWIG at the command line. The same standard command line options as with any other language module are available, plus the following D specific ones:</p>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt><tt>-d2</tt></dt>
|
<dt><tt>-d2</tt></dt>
|
||||||
|
|
@ -66,8 +66,8 @@
|
||||||
|
|
||||||
<dt><a name="D_splitproxy"></a><tt>-splitproxy</tt></dt>
|
<dt><a name="D_splitproxy"></a><tt>-splitproxy</tt></dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p>By default, SWIG generates two D modules: the <em>proxy</em> module, named like the source module (either specified via the <tt>%module</tt> directive or via the <tt>module</tt> command line switch), which contains all the proxy classes, functions, enums, etc., and the <em>intermediary</em> module (named like the proxy module, but suffixed with <tt>_im</tt>), which contains all the <tt>extern(C)</tt> function declarations and other private parts only used internally by the proxy module.</p>
|
<p>By default, SWIG generates two D modules: the <em>proxy</em> module, named like the source module (either specified via the <tt>%module</tt> directive or via the <tt>module</tt> command line option), which contains all the proxy classes, functions, enums, etc., and the <em>intermediary</em> module (named like the proxy module, but suffixed with <tt>_im</tt>), which contains all the <tt>extern(C)</tt> function declarations and other private parts only used internally by the proxy module.</p>
|
||||||
<p>If the split proxy mode is enabled by passing this switch at the command line, all proxy classes and enums are emitted to their own D module instead. The main proxy module only contains free functions and constants in this case.</p>
|
<p>If the split proxy mode is enabled by passing this option at the command line, all proxy classes and enums are emitted to their own D module instead. The main proxy module only contains free functions and constants in this case.</p>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt><tt>-package <pkg></tt></dt>
|
<dt><tt>-package <pkg></tt></dt>
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
|
|
||||||
<dt><tt>-wrapperlibrary <wl></tt></dt>
|
<dt><tt>-wrapperlibrary <wl></tt></dt>
|
||||||
<dd>
|
<dd>
|
||||||
<p>The code SWIG generates to dynamically load the C/C++ wrapper layer looks for a library called <tt>$module_wrap</tt> by default. With this switch, you can override the name of the file the wrapper code loads at runtime (the <tt>lib</tt> prefix and the suffix for shared libraries are appended automatically, depending on the OS).</p>
|
<p>The code SWIG generates to dynamically load the C/C++ wrapper layer looks for a library called <tt>$module_wrap</tt> by default. With this option, you can override the name of the file the wrapper code loads at runtime (the <tt>lib</tt> prefix and the suffix for shared libraries are appended automatically, depending on the OS).</p>
|
||||||
<p>This might especially be useful if you want to invoke SWIG several times on separate modules, but compile the resulting code into a single shared library.</p>
|
<p>This might especially be useful if you want to invoke SWIG several times on separate modules, but compile the resulting code into a single shared library.</p>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
@ -107,8 +107,8 @@
|
||||||
csimports <-> dimports
|
csimports <-> dimports
|
||||||
csbody <-> dbody
|
csbody <-> dbody
|
||||||
csfinalize <-> ddestructor
|
csfinalize <-> ddestructor
|
||||||
csdestruct <-> ddispose
|
csdisposing <-> ddispose
|
||||||
csdestruct_derived <-> ddispose_derived
|
csdisposing_derived <-> ddispose_derived
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,10 @@
|
||||||
<li><a href="#Doxygen_python_unsupported_tags">Unsupported tags</a>
|
<li><a href="#Doxygen_python_unsupported_tags">Unsupported tags</a>
|
||||||
<li><a href="#Doxygen_python_further_details">Further details</a>
|
<li><a href="#Doxygen_python_further_details">Further details</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
<li><a href="#Doxygen_troubleshooting">Troubleshooting</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#troubleshooting_ifndef">Problem with conditional compilation</a>
|
||||||
|
</ul>
|
||||||
<li><a href="#Doxygen_developer_details">Developer information</a>
|
<li><a href="#Doxygen_developer_details">Developer information</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#Doxygen_translator_design">Doxygen translator design</a>
|
<li><a href="#Doxygen_translator_design">Doxygen translator design</a>
|
||||||
|
|
@ -63,13 +67,13 @@ supported.
|
||||||
<p>
|
<p>
|
||||||
The Doxygen Translation module of SWIG adds an extra layer of
|
The Doxygen Translation module of SWIG adds an extra layer of
|
||||||
functionality to SWIG, allowing automated translation of <a href=
|
functionality to SWIG, allowing automated translation of <a href=
|
||||||
"http://www.stack.nl/~dimitri/doxygen/">Doxygen</a> formatted comments
|
"http://www.doxygen.nl/manual/">Doxygen</a> formatted comments
|
||||||
from input files into a documentation language more suited for the
|
from input files into a documentation language more suited for the
|
||||||
target language. Currently this module only translates into Javadoc
|
target language. Currently this module only translates into Javadoc
|
||||||
and Pydoc for the SWIG Java and Python modules.
|
and Pydoc for the SWIG Java and Python modules.
|
||||||
Other extensions could be added at a later date.
|
Other extensions could be added at a later date.
|
||||||
The Doxygen Translation module originally started as
|
The Doxygen Translation module originally started as
|
||||||
a <a href="http://code.google.com/soc/2008/">Google Summer of
|
a <a href="https://developers.google.com/open-source/gsoc/2008/">Google Summer of
|
||||||
Code</a> proposal from Summer 2008.
|
Code</a> proposal from Summer 2008.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -79,14 +83,14 @@ Code</a> proposal from Summer 2008.
|
||||||
<p>
|
<p>
|
||||||
To make use of the comment translation system, your documentation
|
To make use of the comment translation system, your documentation
|
||||||
comments must be in properly formatted <a href=
|
comments must be in properly formatted <a href=
|
||||||
"http://www.stack.nl/~dimitri/doxygen/">Doxygen.</a> Doxygen comments can be
|
"http://www.doxygen.nl/manual/">Doxygen.</a> Doxygen comments can be
|
||||||
present in your main SWIG interface file or any header file that it
|
present in your main SWIG interface file or any header file that it
|
||||||
imports. You are advised to be validate that your comments compile
|
imports. You are advised to be validate that your comments compile
|
||||||
properly with Doxygen before you try to translate them. Doxygen
|
properly with Doxygen before you try to translate them. Doxygen
|
||||||
itself is a more comprehensive tool and can provide you better feedback for
|
itself is a more comprehensive tool and can provide you better feedback for
|
||||||
correcting any syntax errors that may be present. Please look at
|
correcting any syntax errors that may be present. Please look at
|
||||||
Doxygen's <a href=
|
Doxygen's <a href=
|
||||||
"http://www.stack.nl/~dimitri/doxygen/docblocks.html"> Documenting the
|
"http://www.doxygen.nl/manual/docblocks.html"> Documenting the
|
||||||
code</a> for the full comment format specifications. However, SWIG's
|
code</a> for the full comment format specifications. However, SWIG's
|
||||||
Doxygen parser will still report many errors and warnings found
|
Doxygen parser will still report many errors and warnings found
|
||||||
in comments (like unterminated strings or missing ending tags).
|
in comments (like unterminated strings or missing ending tags).
|
||||||
|
|
@ -94,7 +98,7 @@ in comments (like unterminated strings or missing ending tags).
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Currently, the whole subset of Doxygen comment styles is supported
|
Currently, the whole subset of Doxygen comment styles is supported
|
||||||
(See <a href="http://www.stack.nl/~dimitri/doxygen/docblocks.html">
|
(See <a href="http://www.doxygen.nl/manual/docblocks.html">
|
||||||
Documenting the code</a>). Here they are:
|
Documenting the code</a>). Here they are:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -194,7 +198,7 @@ These structural commands are stripped out by SWIG and are not assigned to anyth
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Doxygen comments translation is disabled by default and needs to be explicitly
|
Doxygen comments translation is disabled by default and needs to be explicitly
|
||||||
enabled using the command line <tt>-doxygen</tt> switch for the languages that
|
enabled using the command line <tt>-doxygen</tt> option for the languages that
|
||||||
do support it (currently Java and Python).
|
do support it (currently Java and Python).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -293,7 +297,7 @@ make much sense for the other languages without explicit ownership management.
|
||||||
<p>
|
<p>
|
||||||
Doxygen syntax is rather rich and, in addition to simple commands such as
|
Doxygen syntax is rather rich and, in addition to simple commands such as
|
||||||
<tt>@transferfull</tt>, it is also possible to define commands with arguments.
|
<tt>@transferfull</tt>, it is also possible to define commands with arguments.
|
||||||
As explained in <a href="http://www.stack.nl/~dimitri/doxygen/manual/commands.html">Doxygen documentation</a>,
|
As explained in <a href="http://www.doxygen.nl/manual/commands.html">Doxygen documentation</a>,
|
||||||
the arguments can have a range of a single word, everything until the end of
|
the arguments can have a range of a single word, everything until the end of
|
||||||
line or everything until the end of the next paragraph. Currently, only the "end
|
line or everything until the end of the next paragraph. Currently, only the "end
|
||||||
of line" case is supported using the <tt>range="line"</tt> argument of the
|
of line" case is supported using the <tt>range="line"</tt> argument of the
|
||||||
|
|
@ -818,7 +822,7 @@ Here is the list of all Doxygen tags and the description of how they are transla
|
||||||
<p>
|
<p>
|
||||||
Doxygen has a wealth of tags such as @latexonly that have no
|
Doxygen has a wealth of tags such as @latexonly that have no
|
||||||
equivalent in Javadoc (all supported tags are listed in
|
equivalent in Javadoc (all supported tags are listed in
|
||||||
<a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html">Javadoc documentation</a>).
|
<a href="https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html">Javadoc documentation</a>).
|
||||||
As a result several tags have no
|
As a result several tags have no
|
||||||
translation or particular use, such as some linking and section tags.
|
translation or particular use, such as some linking and section tags.
|
||||||
These are suppressed with their content just printed out (if the tag has any
|
These are suppressed with their content just printed out (if the tag has any
|
||||||
|
|
@ -1223,9 +1227,9 @@ completely (doxygen:notranslate feature). Then SWIG will just copy
|
||||||
the comments to the proxy file and reformat them if needed, but all
|
the comments to the proxy file and reformat them if needed, but all
|
||||||
the comment content will be left as is. As Doxygen doesn't support
|
the comment content will be left as is. As Doxygen doesn't support
|
||||||
special commands in Python comments
|
special commands in Python comments
|
||||||
(see <a href="http://www.stack.nl/~dimitri/doxygen/docblocks.html#pythonblocks">Doxygen
|
(see <a href="http://www.doxygen.nl/manual/docblocks.html#pythonblocks">Doxygen
|
||||||
docs</a>), you may want to use some tool like doxypy
|
docs</a>), you may want to use some tool like doxypy
|
||||||
(<a href="http://code.foosel.org/doxypy">http://code.foosel.org/doxypy</a>)
|
(<a href="https://pypi.org/project/doxypy/">doxypy</a>)
|
||||||
to do the work.
|
to do the work.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -1634,14 +1638,76 @@ Here is the list of these tags:
|
||||||
TO BE ADDED.
|
TO BE ADDED.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Doxygen_developer_details">17.5 Developer information</a></H2>
|
<H2><a name="Doxygen_troubleshooting">17.5 Troubleshooting</a></H2>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
When running SWIG with command line option <tt>-doxygen</tt>, it may happen
|
||||||
|
that SWIG will fail to parse the code, which is valid C++ code and
|
||||||
|
is parsed without problems without the option. The problem is,
|
||||||
|
that Doxygen comments are not tokens (the C/C++ compiler actually never
|
||||||
|
sees them) and that they can appear anywhere in the code. That's why it is
|
||||||
|
practically impossible to handle all corner cases with the parser.
|
||||||
|
However, these problems can usually be avoided by minor changes in the
|
||||||
|
code or comment. Known problems and solutions are shown in this section.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Recommended approach is to first run SWIG without command line
|
||||||
|
option <tt>-doxygen</tt>. When it successfully processes the code,
|
||||||
|
include the option and fix problems with Doxygen comments.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<H3><a name="troubleshooting_ifndef">17.5.1 Problem with conditional compilation</a></H3>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Inserting a conditional compilation preprocessor directive between a
|
||||||
|
Doxygen comment and a commented item may break parsing:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="code"><pre>
|
||||||
|
class A {
|
||||||
|
/**
|
||||||
|
* Some func.
|
||||||
|
*/
|
||||||
|
<font color='#ff0000'>#ifndef SWIG</font>
|
||||||
|
void myfunc()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The solution is to move the directive above the comment:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="code"><pre>
|
||||||
|
class A {
|
||||||
|
<font color='#00d000'>#ifndef SWIG</font>
|
||||||
|
/**
|
||||||
|
* Some func.
|
||||||
|
*/
|
||||||
|
void myfunc()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
|
||||||
|
<H2><a name="Doxygen_developer_details">17.6 Developer information</a></H2>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This section contains information for developers enhancing the Doxygen translator.
|
This section contains information for developers enhancing the Doxygen translator.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Doxygen_translator_design">17.5.1 Doxygen translator design</a></H3>
|
<H3><a name="Doxygen_translator_design">17.6.1 Doxygen translator design</a></H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -1667,11 +1733,11 @@ class for translation into the target documentation language. For
|
||||||
example, <tt>JavaDocConverter</tt> is the Javadoc module class.
|
example, <tt>JavaDocConverter</tt> is the Javadoc module class.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Doxygen_debugging_commands">17.5.2 Debugging the Doxygen parser and translator</a></H3>
|
<H3><a name="Doxygen_debugging_commands">17.6.2 Debugging the Doxygen parser and translator</a></H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
There are two handy command line switches, that enable lots of
|
There are two handy command line options, that enable lots of
|
||||||
detailed debug information printing.
|
detailed debug information printing.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -1680,7 +1746,7 @@ detailed debug information printing.
|
||||||
-debug-doxygen-translator - Display Doxygen translator module debugging information
|
-debug-doxygen-translator - Display Doxygen translator module debugging information
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<H3><a name="Doxygen_tests">17.5.3 Tests</a></H3>
|
<H3><a name="Doxygen_tests">17.6.3 Tests</a></H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -1732,7 +1798,7 @@ Runtime tests in Python are just plain string comparisons of the __doc__
|
||||||
properties.
|
properties.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Doxygen_language_extension">17.6 Extending to other languages</a></H2>
|
<H2><a name="Doxygen_language_extension">17.7 Extending to other languages</a></H2>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -125,16 +125,15 @@ Go distribution. To generate code for gccgo, you should also use the
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
When using the <tt>-cgo</tt> option, SWIG will generate files that can be used
|
By default SWIG will generate files that can be used directly
|
||||||
directly by <tt>go build</tt>. Starting with the Go 1.5 distribution the
|
by <tt>go build</tt>. This requires Go 1.2 or later. Put your SWIG
|
||||||
<tt>-cgo</tt> option has to be given. Put your SWIG interface file in a
|
interface file in a directory under GOPATH/src, and give it a name
|
||||||
directory under GOPATH/src, and give it a name that does <b>not</b> end in the
|
that does <b>not</b> end in the .swig or .swigcxx extension.
|
||||||
.swig or .swigcxx extension. Typically the SWIG interface file extension is .i
|
Typically the SWIG interface file extension is .i in this case.
|
||||||
in this case.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
% swig -go -cgo example.i
|
% swig -go example.i
|
||||||
% go install
|
% go install
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
|
|
@ -144,15 +143,16 @@ usual.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To use SWIG without the <tt>-cgo</tt> option, more steps are required. Recall
|
SWIG can be used without cgo, via the <tt>-no-cgo</tt> option, but
|
||||||
that this only works with Go versions before 1.5. When using Go version 1.2 or
|
more steps are required. This only works with Go versions before 1.5.
|
||||||
later, or when using gccgo, the code generated by SWIG can be linked directly
|
When using Go version 1.2 or later, or when using gccgo, the code
|
||||||
into the Go program. A typical command sequence when using the Go compiler of
|
generated by SWIG can be linked directly into the Go program. A
|
||||||
the Go distribution would look like this:
|
typical command sequence when using the Go compiler of the Go
|
||||||
|
distribution would look like this:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
% swig -go example.i
|
% swig -go -no-cgo example.i
|
||||||
% gcc -c code.c # The C library being wrapped.
|
% gcc -c code.c # The C library being wrapped.
|
||||||
% gcc -c example_wrap.c
|
% gcc -c example_wrap.c
|
||||||
% go tool 6g example.go
|
% go tool 6g example.go
|
||||||
|
|
@ -169,7 +169,7 @@ sequence for this approach would look like this:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="code"><pre>
|
<div class="code"><pre>
|
||||||
% swig -go -use-shlib example.i
|
% swig -go -no-cgo -use-shlib example.i
|
||||||
% gcc -c -fpic example.c
|
% gcc -c -fpic example.c
|
||||||
% gcc -c -fpic example_wrap.c
|
% gcc -c -fpic example_wrap.c
|
||||||
% gcc -shared example.o example_wrap.o -o example.so
|
% gcc -shared example.o example_wrap.o -o example.so
|
||||||
|
|
@ -200,10 +200,15 @@ swig -go -help
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>-cgo</td>
|
<td>-cgo</td>
|
||||||
<td>Generate files to be used as input for the Go cgo tool. This
|
<td>Generate files to be used as input for the Go cgo tool. This is
|
||||||
option is required for Go 1.5 and later, and works for Go 1.2 and
|
the default.</td>
|
||||||
later. In the future this option will likely become the
|
</tr>
|
||||||
default.</td>
|
|
||||||
|
<tr>
|
||||||
|
<td>-no-cgo</td>
|
||||||
|
<td>Generate files that can be used directly, rather than via the Go
|
||||||
|
cgo tool. This option does not work with Go 1.5 or later. It is
|
||||||
|
required for versions of Go before 1.2.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -261,6 +266,13 @@ swig -go -help
|
||||||
ignored.</td>
|
ignored.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>-import-prefix <prefix></td>
|
||||||
|
<td>A prefix to add when turning a %import prefix in the SWIG
|
||||||
|
interface file into an import statement in the Go file. For
|
||||||
|
example, with <code>-import-prefix mymodule</code>, a SWIG
|
||||||
|
interface file <code>%import mypackage</code> will become a Go
|
||||||
|
import statement <code>import "mymodule/mypackage"</code>.</td>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -268,11 +280,11 @@ swig -go -help
|
||||||
|
|
||||||
|
|
||||||
<p>There are two different approaches to generating wrapper files,
|
<p>There are two different approaches to generating wrapper files,
|
||||||
controlled by SWIG's <tt>-cgo</tt> option. The <tt>-cgo</tt> option
|
controlled by SWIG's <tt>-no-cgo</tt> option. The <tt>-no-cgo</tt>
|
||||||
works with Go version 1.2 or later. It is required when using Go
|
option only works with version of Go before 1.5. It is required
|
||||||
version 1.5 or later.</p>
|
when using versions of Go before 1.2.</p>
|
||||||
|
|
||||||
<p>With or without the <tt>-cgo</tt> option, SWIG will generate the
|
<p>With or without the <tt>-no-cgo</tt> option, SWIG will generate the
|
||||||
following files when generating wrapper code:</p>
|
following files when generating wrapper code:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -296,8 +308,8 @@ or C++ compiler.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>When neither the <tt>-cgo</tt> nor the <tt>-gccgo</tt> option is
|
<p>When the <tt>-no-cgo</tt> option is used, and the <tt>-gccgo</tt>
|
||||||
used, SWIG will also generate an additional file:</p>
|
option is not used, SWIG will also generate an additional file:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
@ -785,7 +797,9 @@ In order to override virtual methods on a C++ class with Go methods the
|
||||||
<tt>NewDirectorClassName</tt> constructor functions receives a
|
<tt>NewDirectorClassName</tt> constructor functions receives a
|
||||||
<tt>DirectorInterface</tt> argument. The methods in the <tt>
|
<tt>DirectorInterface</tt> argument. The methods in the <tt>
|
||||||
DirectorInterface</tt> are a subset of the public and protected virtual methods
|
DirectorInterface</tt> are a subset of the public and protected virtual methods
|
||||||
of the C++ class. If the <tt>DirectorInterface</tt> contains a method with a
|
of the C++ class.
|
||||||
|
Virtual methods that have a final specifier are unsurprisingly excluded.
|
||||||
|
If the <tt>DirectorInterface</tt> contains a method with a
|
||||||
matching signature to a virtual method of the C++ class then the virtual C++
|
matching signature to a virtual method of the C++ class then the virtual C++
|
||||||
method will be overwritten with the Go method. As Go doesn't support protected
|
method will be overwritten with the Go method. As Go doesn't support protected
|
||||||
methods all overridden protected virtual C++ methods will be public in Go.
|
methods all overridden protected virtual C++ methods will be public in Go.
|
||||||
|
|
@ -1289,7 +1303,7 @@ fraction := modulename.Modf(5.0, ptr)
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<p>Since this is ugly, you may want to wrap the swig-generated API with
|
<p>Since this is ugly, you may want to wrap the swig-generated API with
|
||||||
some <a href="#Embedded_go_code">additional functions written in go</a> that
|
some <a href="#Go_adding_additional_code">additional functions written in go</a> that
|
||||||
hide the ugly details.</p>
|
hide the ugly details.</p>
|
||||||
|
|
||||||
<p>There are no <code>char *OUTPUT</code> typemaps. However you can
|
<p>There are no <code>char *OUTPUT</code> typemaps. However you can
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ This ability to interface C/C++ to many different target languages is one of SWI
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
SWIG is very broadly composed of two components.
|
SWIG is very broadly composed of two components.
|
||||||
A core component creates a parse tree from the input C/C++ and SWIG directives (extensions to C/C++).
|
A core component creates a parse tree from the input ISO C/C++ and SWIG directives (extensions to the C/C++ standards).
|
||||||
The parse tree is then passed to a second component, one of the target language modules for generating code specific to a higher level language.
|
The parse tree is then passed to a second component, one of the target language modules for generating code specific to a higher level language.
|
||||||
SWIG supports many different target languages.
|
SWIG supports many different target languages.
|
||||||
These target languages are given a status of either Supported or Experimental.
|
These target languages are given a status of either Supported or Experimental.
|
||||||
|
|
@ -273,7 +273,7 @@ extern int my_mod(int n, int m);
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The interface file contains ANSI C function prototypes and variable
|
The interface file contains ISO C function prototypes and variable
|
||||||
declarations. The <tt>%module</tt> directive defines the name of the
|
declarations. The <tt>%module</tt> directive defines the name of the
|
||||||
module that will be created by SWIG. The <tt>%{ %}</tt> block
|
module that will be created by SWIG. The <tt>%{ %}</tt> block
|
||||||
provides a location for inserting additional code, such as C header
|
provides a location for inserting additional code, such as C header
|
||||||
|
|
@ -400,7 +400,7 @@ major features include:
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Full C99 preprocessing.
|
<li>Full C99 preprocessing.
|
||||||
<li>All ANSI C and C++ datatypes.
|
<li>All ISO C and C++ datatypes.
|
||||||
<li>Functions, variables, and constants.
|
<li>Functions, variables, and constants.
|
||||||
<li>Classes.
|
<li>Classes.
|
||||||
<li>Single and multiple inheritance.
|
<li>Single and multiple inheritance.
|
||||||
|
|
@ -464,7 +464,7 @@ for further information on this and other Autoconf macros.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
There is growing support for SWIG in some build tools, for example <a href="http://cmake.org">CMake</a>
|
There is growing support for SWIG in some build tools, for example <a href="https://cmake.org">CMake</a>
|
||||||
is a cross-platform, open-source build manager with built in support for SWIG. CMake can detect the SWIG executable
|
is a cross-platform, open-source build manager with built in support for SWIG. CMake can detect the SWIG executable
|
||||||
and many of the target language libraries for linking against.
|
and many of the target language libraries for linking against.
|
||||||
CMake knows how to build shared libraries and loadable modules on many different operating systems.
|
CMake knows how to build shared libraries and loadable modules on many different operating systems.
|
||||||
|
|
@ -531,7 +531,7 @@ to work with complicated and unusual C/C++ applications.
|
||||||
Ironically, the freedom that SWIG provides is countered by an
|
Ironically, the freedom that SWIG provides is countered by an
|
||||||
extremely conservative approach to code generation. At its core, SWIG
|
extremely conservative approach to code generation. At its core, SWIG
|
||||||
tries to distill even the most advanced C++ code down to a small
|
tries to distill even the most advanced C++ code down to a small
|
||||||
well-defined set of interface building techniques based on ANSI C
|
well-defined set of interface building techniques based on ISO C
|
||||||
programming. Because of this, you will find that SWIG interfaces can
|
programming. Because of this, you will find that SWIG interfaces can
|
||||||
be easily compiled by virtually every C/C++ compiler and that they can
|
be easily compiled by virtually every C/C++ compiler and that they can
|
||||||
be used on any platform. Again, this is an important part of staying out
|
be used on any platform. Again, this is an important part of staying out
|
||||||
|
|
|
||||||
|
|
@ -477,7 +477,7 @@ Exception in thread "main" java.lang.UnsatisfiedLinkError: exampleJNI.gcd(II)I
|
||||||
<p>
|
<p>
|
||||||
where <tt>gcd</tt> is the missing JNI function that SWIG generated into the wrapper file.
|
where <tt>gcd</tt> is the missing JNI function that SWIG generated into the wrapper file.
|
||||||
Also make sure you pass all of the required libraries to the linker.
|
Also make sure you pass all of the required libraries to the linker.
|
||||||
The <tt>java -verbose:jni</tt> commandline switch is also a great way to get more information on unresolved symbols.
|
The <tt>java -verbose:jni</tt> commandline option is also a great way to get more information on unresolved symbols.
|
||||||
One last piece of advice is to beware of the common faux pas of having more than one native library version in your path.
|
One last piece of advice is to beware of the common faux pas of having more than one native library version in your path.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -645,7 +645,7 @@ java::
|
||||||
<p>
|
<p>
|
||||||
To build the DLL and compile the java code, run NMAKE (you may need to run <tt>vcvars32</tt> first).
|
To build the DLL and compile the java code, run NMAKE (you may need to run <tt>vcvars32</tt> first).
|
||||||
This is a pretty simplistic Makefile, but hopefully its enough to get you started.
|
This is a pretty simplistic Makefile, but hopefully its enough to get you started.
|
||||||
Of course you may want to make changes for it to work for C++ by adding in the -c++ command line switch for swig and replacing .c with .cxx.
|
Of course you may want to make changes for it to work for C++ by adding in the -c++ command line option for swig and replacing .c with .cxx.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1113,11 +1113,10 @@ Typesafe enums have their advantages over using plain integers in that they can
|
||||||
However, there are limitations. For example, they cannot be used in switch statements and serialization is an issue.
|
However, there are limitations. For example, they cannot be used in switch statements and serialization is an issue.
|
||||||
Please look at the following references for further information:
|
Please look at the following references for further information:
|
||||||
|
|
||||||
http://java.sun.com/developer/Books/shiftintojava/page1.html#replaceenums
|
|
||||||
<a href="http://java.sun.com/developer/Books/shiftintojava/page1.html#replaceenums">Replace Enums with Classes</a> in <i>Effective Java Programming</i> on the Sun website,
|
<a href="http://java.sun.com/developer/Books/shiftintojava/page1.html#replaceenums">Replace Enums with Classes</a> in <i>Effective Java Programming</i> on the Sun website,
|
||||||
<a href="http://www.javaworld.com/javaworld/jw-07-1997/jw-07-enumerated.html">Create enumerated constants in Java</a> JavaWorld article,
|
<a href="https://www.javaworld.com/article/2076970/create-enumerated-constants-in-java.html">Create enumerated constants in Java</a> JavaWorld article,
|
||||||
<a href="http://www.javaworld.com/javaworld/javatips/jw-javatip133.html">Java Tip 133: More on typesafe enums</a> and
|
<a href="https://www.javaworld.com/article/2077499/java-tip-133--more-on-typesafe-enums.html">Java Tip 133: More on typesafe enums</a> and
|
||||||
<a href="http://www.javaworld.com/javaworld/javatips/jw-javatip122.html">Java Tip 122: Beware of Java typesafe enumerations</a> JavaWorld tips.
|
<a href="https://www.javaworld.com/article/2077487/java-tip-122--beware-of-java-typesafe-enumerations.html">Java Tip 122: Beware of Java typesafe enumerations</a> JavaWorld tips.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -2763,7 +2762,7 @@ The <tt>finalize()</tt> method calls <tt>delete()</tt> which frees any malloc'd
|
||||||
The idea is for <tt>delete()</tt> to be called when you have finished with the C/C++ object.
|
The idea is for <tt>delete()</tt> to be called when you have finished with the C/C++ object.
|
||||||
Ideally you need not call <tt>delete()</tt>, but rather leave it to the garbage collector to call it from the finalizer.
|
Ideally you need not call <tt>delete()</tt>, but rather leave it to the garbage collector to call it from the finalizer.
|
||||||
When a program exits, the garbage collector does not guarantee to call all finalizers.
|
When a program exits, the garbage collector does not guarantee to call all finalizers.
|
||||||
An insight into the reasoning behind this can be obtained from <a href="http://www.hpl.hp.com/techreports/2002/HPL-2002-335.html">Hans Boehm's Destructors, Finalizers, and Synchronization</a> paper.
|
An insight into the reasoning behind this can be obtained from <a href="https://www.hpl.hp.com/techreports/2002/HPL-2002-335.html">Hans Boehm's Destructors, Finalizers, and Synchronization</a> paper.
|
||||||
Depending on what the finalizers do and which operating system you use, this may or may not be a problem.
|
Depending on what the finalizers do and which operating system you use, this may or may not be a problem.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -2787,7 +2786,7 @@ Call the <tt>System.runFinalizersOnExit(true)</tt> or <tt>Runtime.getRuntime().r
|
||||||
This method is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock.
|
This method is inherently unsafe. It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock.
|
||||||
</i></div>
|
</i></div>
|
||||||
<p>In many cases you will be lucky and find that it works, but it is not to be advocated.
|
<p>In many cases you will be lucky and find that it works, but it is not to be advocated.
|
||||||
Have a look at <a href="http://www.oracle.com/technetwork/java/index.html">Java web site</a> and search for <tt>runFinalizersOnExit</tt>.
|
Have a look at <a href="https://www.oracle.com/technetwork/java/index.html">Java web site</a> and search for <tt>runFinalizersOnExit</tt>.
|
||||||
</p></li>
|
</p></li>
|
||||||
|
|
||||||
<li><p>
|
<li><p>
|
||||||
|
|
@ -3629,7 +3628,7 @@ The %feature directive can be applied globally, to specific classes, and to spec
|
||||||
// generate directors for all classes that have virtual methods
|
// generate directors for all classes that have virtual methods
|
||||||
%feature("director");
|
%feature("director");
|
||||||
|
|
||||||
// generate directors for all virtual methods in class Foo
|
// generate directors for the virtual methods in class Foo
|
||||||
%feature("director") Foo;
|
%feature("director") Foo;
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -3647,7 +3646,7 @@ So for example,
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
will generate directors for all virtual methods of class Foo except bar().
|
will generate directors for the virtual methods of class Foo except bar().
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -3683,7 +3682,8 @@ The director classes store a pointer to their underlying Java proxy classes.
|
||||||
<p>
|
<p>
|
||||||
For simplicity let's ignore the <tt>Swig::Director</tt> class and refer to the original C++ class as the director's base class.
|
For simplicity let's ignore the <tt>Swig::Director</tt> class and refer to the original C++ class as the director's base class.
|
||||||
By default, a director class extends all virtual methods in the inheritance chain of its base class (see the preceding section for how to modify this behavior).
|
By default, a director class extends all virtual methods in the inheritance chain of its base class (see the preceding section for how to modify this behavior).
|
||||||
Thus all virtual method calls, whether they originate in C++ or in Java via proxy classes, eventually end up in at the implementation in the director class.
|
Virtual methods that have a final specifier are unsurprisingly excluded.
|
||||||
|
Thus the virtual method calls, whether they originate in C++ or in Java via proxy classes, eventually end up in at the implementation in the director class.
|
||||||
The job of the director methods is to route these method calls to the appropriate place in the inheritance chain.
|
The job of the director methods is to route these method calls to the appropriate place in the inheritance chain.
|
||||||
By "appropriate place" we mean the method that would have been called if the C++ base class and its Java derived classes were seamlessly integrated.
|
By "appropriate place" we mean the method that would have been called if the C++ base class and its Java derived classes were seamlessly integrated.
|
||||||
That seamless integration is exactly what the director classes provide, transparently skipping over all the messy JNI glue code that binds the two languages together.
|
That seamless integration is exactly what the director classes provide, transparently skipping over all the messy JNI glue code that binds the two languages together.
|
||||||
|
|
@ -5644,7 +5644,7 @@ This section describes how you can modify SWIG's default wrapping behavior
|
||||||
for various C/C++ datatypes using the <tt>%typemap</tt> directive.
|
for various C/C++ datatypes using the <tt>%typemap</tt> directive.
|
||||||
You are advised to be familiar with the material in the "<a href="Typemaps.html#Typemaps">Typemaps</a>" chapter.
|
You are advised to be familiar with the material in the "<a href="Typemaps.html#Typemaps">Typemaps</a>" chapter.
|
||||||
While not absolutely essential knowledge, this section assumes some familiarity with the Java Native Interface (JNI).
|
While not absolutely essential knowledge, this section assumes some familiarity with the Java Native Interface (JNI).
|
||||||
JNI documentation can be consulted either online at <a href="http://java.sun.com">Sun's Java web site</a> or from a good JNI book.
|
JNI documentation can be consulted either online at <a href="https://www.oracle.com/technetwork/java/index.html">the Java web site</a> or from a good JNI book.
|
||||||
The following two books are recommended:</p>
|
The following two books are recommended:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -6551,7 +6551,7 @@ As there can only be one "javacode" typemap per class, also consider using the
|
||||||
and offers nearly identical functionality.
|
and offers nearly identical functionality.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><tt>%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized")</tt> <br></p>
|
<p><tt>%typemap(javadestruct, methodname="delete", methodmodifiers="public synchronized", parameters="")</tt> <br></p>
|
||||||
<div class="indent">
|
<div class="indent">
|
||||||
destructor wrapper - the <tt>delete()</tt> method (proxy classes only),
|
destructor wrapper - the <tt>delete()</tt> method (proxy classes only),
|
||||||
used for all proxy classes except those which have a base class
|
used for all proxy classes except those which have a base class
|
||||||
|
|
@ -6562,9 +6562,10 @@ Note that the <tt>delete()</tt> method name is configurable and is specified by
|
||||||
The method modifiers are also configurable via the <tt>methodmodifiers</tt> attribute.
|
The method modifiers are also configurable via the <tt>methodmodifiers</tt> attribute.
|
||||||
If a <tt>%javamethodmodifiers</tt> is attached to the class' destructor,
|
If a <tt>%javamethodmodifiers</tt> is attached to the class' destructor,
|
||||||
it will be used in preference to the <tt>methodmodifiers</tt> typemap attribute for the class.
|
it will be used in preference to the <tt>methodmodifiers</tt> typemap attribute for the class.
|
||||||
|
The <tt>delete</tt> method's parameters declaration can be provided in the optional <tt>parameters</tt> typemap attribute.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><tt>%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized")</tt></p>
|
<p><tt>%typemap(javadestruct_derived, methodname="delete", methodmodifiers="public synchronized", parameters="")</tt></p>
|
||||||
<div class="indent">
|
<div class="indent">
|
||||||
destructor wrapper - the <tt>delete()</tt> method (proxy classes only),
|
destructor wrapper - the <tt>delete()</tt> method (proxy classes only),
|
||||||
same as "javadestruct" but only used for derived proxy classes
|
same as "javadestruct" but only used for derived proxy classes
|
||||||
|
|
@ -6575,6 +6576,7 @@ Note that the <tt>delete()</tt> method name is configurable and is specified by
|
||||||
The method modifiers are also configurable via the <tt>methodmodifiers</tt> attribute.
|
The method modifiers are also configurable via the <tt>methodmodifiers</tt> attribute.
|
||||||
If a <tt>%javamethodmodifiers</tt> is attached to the class' destructor,
|
If a <tt>%javamethodmodifiers</tt> is attached to the class' destructor,
|
||||||
it will be used in preference to the <tt>methodmodifiers</tt> typemap attribute for the class.
|
it will be used in preference to the <tt>methodmodifiers</tt> typemap attribute for the class.
|
||||||
|
The <tt>delete</tt> method's parameters declaration can be provided in the optional <tt>parameters</tt> typemap attribute.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><tt>%typemap(javaimports)</tt></p>
|
<p><tt>%typemap(javaimports)</tt></p>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" type="text/css" href="./style.css">
|
<link rel="stylesheet" type="text/css" href="style.css">
|
||||||
<title></title>
|
<title></title>
|
||||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
</head>
|
</head>
|
||||||
|
|
@ -56,10 +56,10 @@
|
||||||
|
|
||||||
|
|
||||||
<p>Javascript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. Its arguably the most popular language for web development.
|
<p>Javascript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. Its arguably the most popular language for web development.
|
||||||
Javascript has gone beyond being a browser-based scripting language and with <a href="http://nodejs.org">node.js</a>, it is also used as a backend development language.</p>
|
Javascript has gone beyond being a browser-based scripting language and with <a href="https://nodejs.org">node.js</a>, it is also used as a backend development language.</p>
|
||||||
<p>Native Javascript extensions can be used for applications that embed a web-browser view or that embed a Javascript engine (such as <em>node.js</em>). Extending a general purpose web-browser is not possible as this would be a severe security issue.</p>
|
<p>Native Javascript extensions can be used for applications that embed a web-browser view or that embed a Javascript engine (such as <em>node.js</em>). Extending a general purpose web-browser is not possible as this would be a severe security issue.</p>
|
||||||
<p>SWIG Javascript currently supports <strong>JavascriptCore</strong>, the Javascript engine used by <code>Safari/Webkit</code>, and <a href="https://developers.google.com/v8"><strong>v8</strong></a>, which is used by <code>Chromium</code> and <code>node.js</code>.</p>
|
<p>SWIG Javascript currently supports <strong>JavascriptCore</strong>, the Javascript engine used by <code>Safari/Webkit</code>, and <a href="https://v8.dev/"><strong>v8</strong></a>, which is used by <code>Chromium</code> and <code>node.js</code>.</p>
|
||||||
<p><a href="http://www.webkit.org/">WebKit</a> is a modern browser implementation available as open-source which can be embedded into an application.
|
<p><a href="https://webkit.org/">WebKit</a> is a modern browser implementation available as open-source which can be embedded into an application.
|
||||||
With <a href="https://github.com/rogerwang/node-webkit">node-webkit</a> there is a platform which uses Google's <code>Chromium</code> as Web-Browser widget and <code>node.js</code> for javascript extensions.
|
With <a href="https://github.com/rogerwang/node-webkit">node-webkit</a> there is a platform which uses Google's <code>Chromium</code> as Web-Browser widget and <code>node.js</code> for javascript extensions.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -289,7 +289,7 @@ extern bool example_initialize(JSGlobalContextRef context, JSObjectRef* exports)
|
||||||
<H4><a name="Javascript_gtk">27.3.2.2 GTK</a></H4>
|
<H4><a name="Javascript_gtk">27.3.2.2 GTK</a></H4>
|
||||||
|
|
||||||
|
|
||||||
<p>There is general information about programming GTK at <a href="https://developer.gnome.org/gtk2/">GTK documentation</a> and in the <a href="https://developer.gnome.org/gtk-tutorial">GTK tutorial</a>, and for Webkit there is a <a href="http://webkitgtk.org/reference/webkitgtk/stable/index.html">Webkit GTK+ API Reference</a>.</p>
|
<p>There is general information about programming GTK at <a href="https://developer.gnome.org/gtk2/">GTK documentation</a> and in the <a href="https://developer.gnome.org/gtk-tutorial/">GTK tutorial</a>, and for Webkit there is a <a href="http://webkitgtk.org/reference/webkitgtk/stable/index.html">Webkit GTK+ API Reference</a>.</p>
|
||||||
<p>An integration of a native extension 'example' would look like this:</p>
|
<p>An integration of a native extension 'example' would look like this:</p>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
<pre>
|
<pre>
|
||||||
|
|
@ -604,7 +604,7 @@ at ReadStream.EventEmitter.emit (events.js:98:17)
|
||||||
at emitKey (readline.js:1095:12)</pre>
|
at emitKey (readline.js:1095:12)</pre>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<b>Note</b>: In ECMAScript 5 there is no concept for classes. Instead each function can be used as a constructor function which is executed by the 'new' operator. Furthermore, during construction the key property <code>prototype</code> of the constructor function is used to attach a prototype instance to the created object. A prototype is essentially an object itself that is the first-class delegate of a class used whenever the access to a property of an object fails. The very same prototype instance is shared among all instances of one type. Prototypal inheritance is explained in more detail on in <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain">Inheritance and the prototype chain</a>, for instance.
|
<b>Note</b>: In ECMAScript 5 there is no concept for classes. Instead each function can be used as a constructor function which is executed by the 'new' operator. Furthermore, during construction the key property <code>prototype</code> of the constructor function is used to attach a prototype instance to the created object. A prototype is essentially an object itself that is the first-class delegate of a class used whenever the access to a property of an object fails. The very same prototype instance is shared among all instances of one type. Prototypal inheritance is explained in more detail on in <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain">Inheritance and the prototype chain</a>, for instance.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Javascript_implementation">27.5 Implementation</a></H2>
|
<H2><a name="Javascript_implementation">27.5 Implementation</a></H2>
|
||||||
|
|
|
||||||
|
|
@ -1365,7 +1365,7 @@ to accomplish this in SWIG. This library provides support for a few common tech
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>If used in C++, this library uses <tt>new</tt> and <tt>delete []</tt> for memory
|
<li>If used in C++, this library uses <tt>new</tt> and <tt>delete []</tt> for memory
|
||||||
allocation. If using ANSI C, the library uses <tt>malloc()</tt> and <tt>free()</tt>.
|
allocation. If using C, the library uses <tt>malloc()</tt> and <tt>free()</tt>.
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>Rather than manipulating <tt>char *</tt> directly, you might consider using a special string
|
<li>Rather than manipulating <tt>char *</tt> directly, you might consider using a special string
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Lua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, light-weight configuration language for any program that needs one. Lua is implemented as a library, written in clean C (that is, in the common subset of ANSI C and C++). It's also a <em>really</em> tiny language, less than 6000 lines of code, which compiles to <100 kilobytes of binary code. It can be found at <a href="http://www.lua.org">http://www.lua.org</a>
|
Lua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, light-weight configuration language for any program that needs one. Lua is implemented as a library, written in clean C (that is, in the common subset of ISO C and C++). It's also a <em>really</em> tiny language, less than 6000 lines of code, which compiles to <100 kilobytes of binary code. It can be found at <a href="http://www.lua.org">http://www.lua.org</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
eLua stands for Embedded Lua (can be thought of as a flavor of Lua) and offers the full implementation of the Lua programming language to the embedded world, extending it with specific features for efficient and portable software embedded development. eLua runs on smaller devices like microcontrollers and provides the full features of the regular Lua desktop version. More information on eLua can be found here: <a href="http://www.eluaproject.net">http://www.eluaproject.net</a>
|
eLua stands for Embedded Lua (can be thought of as a flavor of Lua) and offers the full implementation of the Lua programming language to the embedded world, extending it with specific features for efficient and portable software embedded development. eLua runs on smaller devices like microcontrollers and provides the full features of the regular Lua desktop version. More information on eLua can be found here: <a href="http://www.eluaproject.net">http://www.eluaproject.net</a>
|
||||||
|
|
|
||||||
|
|
@ -89,3 +89,9 @@ linkchecker2:
|
||||||
cp *.png linkchecker-tmp
|
cp *.png linkchecker-tmp
|
||||||
(cd linkchecker-tmp && linkchecker --config=../linkchecker.config -F text --no-warnings SWIGDocumentation.html)
|
(cd linkchecker-tmp && linkchecker --config=../linkchecker.config -F text --no-warnings SWIGDocumentation.html)
|
||||||
|
|
||||||
|
# Simple check for relative links (there shouldn't be any), they don't translate properly creating the .pdf doc
|
||||||
|
# with wkhtmltopdf. For example, href="SWIG.html" needs to be href="SWIG.html#SWIG"
|
||||||
|
linkchecker3:
|
||||||
|
@echo "The following list should just contain SWIGDocumentation.html and SWIGDocumentation.pdf,"
|
||||||
|
@echo "as all links should have an anchor (with a #) or be a full url beginning http."
|
||||||
|
grep 'href="' *.html | sed -e 's/.*href="\(.*\)">.*$$/\1/' | grep -v "#" | grep -v "^http" | grep -v "^style.css"
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ Some points of interest:
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
See the <a href="http://docs.racket-lang.org/inside/index.html">C API</a> for more description of using the mechanism for adding extensions. The main documentation is <a href="http://docs.racket-lang.org/">here</a>.
|
See the <a href="https://docs.racket-lang.org/inside/index.html">C API</a> for more description of using the mechanism for adding extensions. The main documentation is <a href="https://docs.racket-lang.org/">here</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -3070,7 +3070,7 @@ globally, to specific classes, and to specific methods, like this:
|
||||||
// generate directors for all classes that have virtual methods
|
// generate directors for all classes that have virtual methods
|
||||||
%feature("director");
|
%feature("director");
|
||||||
|
|
||||||
// generate directors for all virtual methods in class Foo
|
// generate directors for the virtual methods in class Foo
|
||||||
%feature("director") Foo;
|
%feature("director") Foo;
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -3088,7 +3088,7 @@ directors for specific classes or methods. So for example,
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
will generate directors for all virtual methods of class Foo except
|
will generate directors for the virtual methods of class Foo except
|
||||||
bar().
|
bar().
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -3153,7 +3153,8 @@ For simplicity let's ignore the <tt>Swig::Director</tt> class and refer to the
|
||||||
original C++ class as the director's base class. By default, a director
|
original C++ class as the director's base class. By default, a director
|
||||||
class extends all virtual methods in the inheritance chain of its base
|
class extends all virtual methods in the inheritance chain of its base
|
||||||
class (see the preceding section for how to modify this behavior).
|
class (see the preceding section for how to modify this behavior).
|
||||||
Thus all virtual method calls, whether they originate in C++ or in
|
Virtual methods that have a final specifier are unsurprisingly excluded.
|
||||||
|
Thus the virtual method calls, whether they originate in C++ or in
|
||||||
Perl via proxy classes, eventually end up in at the implementation in
|
Perl via proxy classes, eventually end up in at the implementation in
|
||||||
the director class. The job of the director methods is to route these
|
the director class. The job of the director methods is to route these
|
||||||
method calls to the appropriate place in the inheritance chain. By
|
method calls to the appropriate place in the inheritance chain. By
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ If the module is in PHP's default extension directory, you can omit the path.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
For some SAPIs (for example, the CLI SAPI) you can instead use the
|
For some SAPIs (for example, the CLI SAPI) you can instead use the
|
||||||
<a href="http://php.net/manual/en/function.dl.php">dl() function</a> to load
|
<a href="https://www.php.net/manual/en/function.dl.php">dl() function</a> to load
|
||||||
an extension at run time, by adding a line like this to the start of each
|
an extension at run time, by adding a line like this to the start of each
|
||||||
PHP script which uses your extension:
|
PHP script which uses your extension:
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -937,7 +937,7 @@ globally, to specific classes, and to specific methods, like this:
|
||||||
// generate directors for all classes that have virtual methods
|
// generate directors for all classes that have virtual methods
|
||||||
%feature("director");
|
%feature("director");
|
||||||
|
|
||||||
// generate directors for all virtual methods in class Foo
|
// generate directors for the virtual methods in class Foo
|
||||||
%feature("director") Foo;
|
%feature("director") Foo;
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -955,7 +955,7 @@ directors for specific classes or methods. So for example,
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
will generate directors for all virtual methods of class Foo except
|
will generate directors for the virtual methods of class Foo except
|
||||||
bar().
|
bar().
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -1020,7 +1020,8 @@ For simplicity let's ignore the <tt>Swig::Director</tt> class and refer to the
|
||||||
original C++ class as the director's base class. By default, a director
|
original C++ class as the director's base class. By default, a director
|
||||||
class extends all virtual methods in the inheritance chain of its base
|
class extends all virtual methods in the inheritance chain of its base
|
||||||
class (see the preceding section for how to modify this behavior).
|
class (see the preceding section for how to modify this behavior).
|
||||||
Thus all virtual method calls, whether they originate in C++ or in
|
Virtual methods that have a final specifier are unsurprisingly excluded.
|
||||||
|
Thus the virtual method calls, whether they originate in C++ or in
|
||||||
PHP via proxy classes, eventually end up in at the implementation in the
|
PHP via proxy classes, eventually end up in at the implementation in the
|
||||||
director class. The job of the director methods is to route these method
|
director class. The job of the director methods is to route these method
|
||||||
calls to the appropriate place in the inheritance chain. By "appropriate
|
calls to the appropriate place in the inheritance chain. By "appropriate
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ In addition, SWIG defines the following set of standard C/C++ macros:
|
||||||
<pre>
|
<pre>
|
||||||
__LINE__ Current line number
|
__LINE__ Current line number
|
||||||
__FILE__ Current file name
|
__FILE__ Current file name
|
||||||
__STDC__ Defined to indicate ANSI C
|
__STDC__ Defined to indicate ISO C
|
||||||
__cplusplus Defined when -c++ option used
|
__cplusplus Defined when -c++ option used
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -180,9 +180,9 @@ More complex macros can be defined in the standard way. For example:
|
||||||
<pre>
|
<pre>
|
||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
#define _ANSI(args) (args)
|
#define ISOC_(args) (args)
|
||||||
#else
|
#else
|
||||||
#define _ANSI(args) ()
|
#define ISOC_(args) ()
|
||||||
#endif
|
#endif
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -458,7 +458,7 @@ would generate
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Like many compilers, SWIG supports a <tt>-E</tt> command line option to display the output from the preprocessor.
|
Like many compilers, SWIG supports a <tt>-E</tt> command line option to display the output from the preprocessor.
|
||||||
When the <tt>-E</tt> switch is used, SWIG will not generate any wrappers.
|
When the <tt>-E</tt> option is used, SWIG will not generate any wrappers.
|
||||||
Instead the results after the preprocessor has run are displayed.
|
Instead the results after the preprocessor has run are displayed.
|
||||||
This might be useful as an aid to debugging and viewing the results of macro expansions.
|
This might be useful as an aid to debugging and viewing the results of macro expansions.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@ how you might go about compiling and using the generated files.
|
||||||
<p>
|
<p>
|
||||||
The preferred approach to building an extension module for Python is to compile it with
|
The preferred approach to building an extension module for Python is to compile it with
|
||||||
distutils, which comes with all recent versions of Python
|
distutils, which comes with all recent versions of Python
|
||||||
(<a href="https://docs.python.org/library/distutils.html">Distutils Docs</a>).
|
(<a href="https://docs.python.org/3/library/distutils.html">Distutils Docs</a>).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -2355,7 +2355,7 @@ wrapped class is turned into a new Python built-in type which inherits from
|
||||||
from the wrapped methods. For more information about Python built-in extensions,
|
from the wrapped methods. For more information about Python built-in extensions,
|
||||||
please refer to the Python documentation:</p>
|
please refer to the Python documentation:</p>
|
||||||
|
|
||||||
<p><a href="http://docs.python.org/extending/newtypes.html">http://docs.python.org/extending/newtypes.html</a></p>
|
<p><a href="https://docs.python.org/3/extending/newtypes.html">https://docs.python.org/3/extending/newtypes.html</a></p>
|
||||||
|
|
||||||
<H4><a name="Python_builtin_limitations">32.4.2.1 Limitations</a></H4>
|
<H4><a name="Python_builtin_limitations">32.4.2.1 Limitations</a></H4>
|
||||||
|
|
||||||
|
|
@ -2574,7 +2574,7 @@ automatically converted to Python slot operators, refer to the file
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Read about all of the available Python slots here:
|
Read about all of the available Python slots here:
|
||||||
<a href="http://docs.python.org/c-api/typeobj.html">http://docs.python.org/c-api/typeobj.html</a></p>
|
<a href="https://docs.python.org/3/c-api/typeobj.html">https://docs.python.org/3/c-api/typeobj.html</a></p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
There are two ways to define a Python slot function: dispatch to a
|
There are two ways to define a Python slot function: dispatch to a
|
||||||
|
|
@ -2934,7 +2934,7 @@ globally, to specific classes, and to specific methods, like this:
|
||||||
// generate directors for all classes that have virtual methods
|
// generate directors for all classes that have virtual methods
|
||||||
%feature("director");
|
%feature("director");
|
||||||
|
|
||||||
// generate directors for all virtual methods in class Foo
|
// generate directors for the virtual methods in class Foo
|
||||||
%feature("director") Foo;
|
%feature("director") Foo;
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -2952,7 +2952,7 @@ directors for specific classes or methods. So for example,
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
will generate directors for all virtual methods of class Foo except
|
will generate directors for the virtual methods of class Foo except
|
||||||
bar().
|
bar().
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -3018,7 +3018,8 @@ For simplicity let's ignore the <tt>Swig::Director</tt> class and refer to the
|
||||||
original C++ class as the director's base class. By default, a director
|
original C++ class as the director's base class. By default, a director
|
||||||
class extends all virtual methods in the inheritance chain of its base
|
class extends all virtual methods in the inheritance chain of its base
|
||||||
class (see the preceding section for how to modify this behavior).
|
class (see the preceding section for how to modify this behavior).
|
||||||
Thus all virtual method calls, whether they originate in C++ or in
|
Virtual methods that have a final specifier are unsurprisingly excluded.
|
||||||
|
Thus the virtual method calls, whether they originate in C++ or in
|
||||||
Python via proxy classes, eventually end up in at the implementation in
|
Python via proxy classes, eventually end up in at the implementation in
|
||||||
the director class. The job of the director methods is to route these
|
the director class. The job of the director methods is to route these
|
||||||
method calls to the appropriate place in the inheritance chain. By
|
method calls to the appropriate place in the inheritance chain. By
|
||||||
|
|
|
||||||
|
|
@ -189,9 +189,49 @@ of the proxy class baggage you see in other languages.
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
enumerations are characters which are then converted back and forth to
|
R doesn't have a native enumeration type. Enumerations are represented
|
||||||
ints before calling the C routines. All of the enumeration code is
|
as character strings in R, with calls to R functions that convert back
|
||||||
done in R.
|
and forth between integers.
|
||||||
|
|
||||||
|
The details of enumeration names and contents are stored in hidden R
|
||||||
|
environments, which are named according the the enumeration name - for
|
||||||
|
example, an enumeration colour:
|
||||||
|
<div class="code"><pre>
|
||||||
|
enum colour { red=-1, blue, green = 10 };
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
will be initialized by the following call in R:
|
||||||
|
<div class="code"><pre>
|
||||||
|
defineEnumeration("_colour",
|
||||||
|
.values=c("red" = .Call('R_swig_colour_red_get',FALSE, PACKAGE='enum_thorough'),
|
||||||
|
"blue" = .Call('R_swig_colour_blue_get',FALSE, PACKAGE='enum_thorough'),
|
||||||
|
"green" = .Call('R_swig_colour_green_get',FALSE, PACKAGE='enum_thorough')))
|
||||||
|
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
which will create an environment named <tt>.__E___colour</tt>. The enumeration
|
||||||
|
values are initialised via calls to C/C++ code, allowing complex
|
||||||
|
values for enumerations to be used. Calls to the C/C++ code require
|
||||||
|
the compiled library to be loaded, so a <tt>delayedAssign</tt> is employed
|
||||||
|
within <tt>defineEnumeration</tt> in order to allow the code to be easily used in R
|
||||||
|
packages.
|
||||||
|
|
||||||
|
The user typically does not need to access the enumeration lookup
|
||||||
|
functions or know the name of the enumeration type used by
|
||||||
|
R. Attributes containing the type information are attached by swig to
|
||||||
|
functions requiring enumeration arguments or returning enumeration
|
||||||
|
values, and those attributes are used to identify and access the
|
||||||
|
appropriate environments and thus translate between characters
|
||||||
|
and integers.
|
||||||
|
|
||||||
|
The relevant functions, for debugging purposes, are <tt>enumToInteger</tt> and
|
||||||
|
<tt>enumFromInteger</tt>.
|
||||||
|
|
||||||
|
Anonymous enumerations are ignored by the binding generation process,
|
||||||
|
leaving no way of accessing the value of anonymous enumerations from R
|
||||||
|
code.
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This chapter describes the basic operation of SWIG, the structure of its
|
This chapter describes the basic operation of SWIG, the structure of its
|
||||||
input files, and how it handles standard ANSI C declarations. C++ support is
|
input files, and how it handles standard ISO C declarations. C++ support is
|
||||||
described in the next chapter. However, C++ programmers should still read this
|
described in the next chapter. However, C++ programmers should still read this
|
||||||
chapter to understand the basics.
|
chapter to understand the basics.
|
||||||
Specific details about each target language are described in later
|
Specific details about each target language are described in later
|
||||||
|
|
@ -252,7 +252,7 @@ recursively.
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
As input, SWIG expects a file containing ANSI C/C++ declarations and
|
As input, SWIG expects a file containing ISO C/C++ declarations and
|
||||||
special SWIG directives. More often than not, this is a special SWIG
|
special SWIG directives. More often than not, this is a special SWIG
|
||||||
interface file which is usually denoted with a special <tt>.i</tt> or
|
interface file which is usually denoted with a special <tt>.i</tt> or
|
||||||
<tt>.swg</tt> suffix. In certain cases, SWIG can be used directly on
|
<tt>.swg</tt> suffix. In certain cases, SWIG can be used directly on
|
||||||
|
|
@ -270,7 +270,7 @@ The most common format of a SWIG interface is as follows:
|
||||||
%{
|
%{
|
||||||
#include "myheader.h"
|
#include "myheader.h"
|
||||||
%}
|
%}
|
||||||
// Now list ANSI C/C++ declarations
|
// Now list ISO C/C++ declarations
|
||||||
int foo;
|
int foo;
|
||||||
int bar(int x);
|
int bar(int x);
|
||||||
...
|
...
|
||||||
|
|
@ -1826,7 +1826,7 @@ When wrapping C code, simple use of identifiers/symbols with <tt>%rename</tt> us
|
||||||
When wrapping C++ code, simple use of simple identifiers/symbols with <tt>%rename</tt> might be too
|
When wrapping C++ code, simple use of simple identifiers/symbols with <tt>%rename</tt> might be too
|
||||||
limiting when using C++ features such as function overloading, default arguments, namespaces, template specialization etc.
|
limiting when using C++ features such as function overloading, default arguments, namespaces, template specialization etc.
|
||||||
If you are using the <tt>%rename</tt> directive and C++, make sure you read the
|
If you are using the <tt>%rename</tt> directive and C++, make sure you read the
|
||||||
<a href="SWIGPlus.html">SWIG and C++</a> chapter and in particular the section on
|
<a href="SWIGPlus.html#SWIGPlus">SWIG and C++</a> chapter and in particular the section on
|
||||||
<a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Renaming and ambiguity resolution</a>
|
<a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Renaming and ambiguity resolution</a>
|
||||||
for method overloading and default arguments.
|
for method overloading and default arguments.
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -2242,7 +2242,7 @@ used in Tcl as follows :</p>
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Although the ANSI C standard does not allow default arguments, default
|
Although the ISO C standard does not allow default arguments, default
|
||||||
arguments specified in a SWIG interface work with both C and C++.
|
arguments specified in a SWIG interface work with both C and C++.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -2415,7 +2415,7 @@ see <a href="SWIGPlus.html#SWIGPlus_target_language_callbacks">Callbacks to the
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This section describes the behavior of SWIG when processing ANSI C structures and union declarations. Extensions to
|
This section describes the behavior of SWIG when processing ISO C structures and union declarations. Extensions to
|
||||||
handle C++ are described in the next section.
|
handle C++ are described in the next section.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -3469,7 +3469,7 @@ interface to your program.
|
||||||
SWIG's <tt>%include</tt> directive to process an entire C
|
SWIG's <tt>%include</tt> directive to process an entire C
|
||||||
source/header file.
|
source/header file.
|
||||||
|
|
||||||
<li>Make sure everything in the interface file uses ANSI C/C++ syntax.
|
<li>Make sure everything in the interface file uses ISO C/C++ syntax.
|
||||||
|
|
||||||
<li>Make sure all necessary `<tt>typedef</tt>' declarations and
|
<li>Make sure all necessary `<tt>typedef</tt>' declarations and
|
||||||
type-information is available in the interface file.
|
type-information is available in the interface file.
|
||||||
|
|
|
||||||
|
|
@ -88,12 +88,12 @@
|
||||||
This chapter describes SWIG's support for wrapping C++.
|
This chapter describes SWIG's support for wrapping C++.
|
||||||
It is mostly concerned about C++ as defined by the C++ 98 and 03 standards.
|
It is mostly concerned about C++ as defined by the C++ 98 and 03 standards.
|
||||||
For additions to the original C++ standard, please read the
|
For additions to the original C++ standard, please read the
|
||||||
<a href="CPlusPlus11.html">SWIG and C++11</a>,
|
<a href="CPlusPlus11.html#CPlusPlus11">SWIG and C++11</a>,
|
||||||
<a href="CPlusPlus14.html">SWIG and C++14</a> and
|
<a href="CPlusPlus14.html#CPlusPlus14">SWIG and C++14</a> and
|
||||||
<a href="CPlusPlus17.html">SWIG and C++17</a> chapters.
|
<a href="CPlusPlus17.html#CPlusPlus17">SWIG and C++17</a> chapters.
|
||||||
As a prerequisite,
|
As a prerequisite,
|
||||||
you should first read the chapter <a href="SWIG.html#SWIG">SWIG Basics</a> to see
|
you should first read the chapter <a href="SWIG.html#SWIG">SWIG Basics</a> to see
|
||||||
how SWIG wraps ANSI C. Support for C++ builds upon ANSI C
|
how SWIG wraps ISO C. Support for C++ builds upon ISO C
|
||||||
wrapping and that material will be useful in understanding this chapter.
|
wrapping and that material will be useful in understanding this chapter.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -144,7 +144,7 @@ yourself in the foot. You will just have to be careful.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To wrap C++, SWIG uses a layered approach to code generation.
|
To wrap C++, SWIG uses a layered approach to code generation.
|
||||||
At the lowest level, SWIG generates a collection of procedural ANSI-C style
|
At the lowest level, SWIG generates a collection of procedural ISO C style
|
||||||
wrappers. These wrappers take care of basic type conversion,
|
wrappers. These wrappers take care of basic type conversion,
|
||||||
type checking, error handling, and other low-level details of the C++ binding.
|
type checking, error handling, and other low-level details of the C++ binding.
|
||||||
These wrappers are also sufficient to bind C++ into any target language
|
These wrappers are also sufficient to bind C++ into any target language
|
||||||
|
|
|
||||||
|
|
@ -973,7 +973,7 @@ ans =
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Note: the pointer to the struct works as described in <a href="Scilab_wrapping_pointers">Pointers</a>. For example, the type of the struct pointer can be get with <tt>typeof</tt>, as following:
|
Note: the pointer to the struct works as described in <a href="#Scilab_wrapping_pointers">Pointers</a>. For example, the type of the struct pointer can be get with <tt>typeof</tt>, as following:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="targetlang"><pre>
|
<div class="targetlang"><pre>
|
||||||
|
|
@ -1037,7 +1037,7 @@ ans =
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Note: like structs, class pointers are mapped as described in <a href="Scilab_wrapping_pointers">Pointers</a>. Let's give an example which shows that each class pointer type is a new type in Scilab that can be used for example (through <a href="https://help.scilab.org/docs/5.5.2/en_US/overloading.html">overloading</a>) to implement a custom print for the <tt>Point</tt> class:
|
Note: like structs, class pointers are mapped as described in <a href="#Scilab_wrapping_pointers">Pointers</a>. Let's give an example which shows that each class pointer type is a new type in Scilab that can be used for example (through <a href="https://help.scilab.org/docs/5.5.2/en_US/overloading.html">overloading</a>) to implement a custom print for the <tt>Point</tt> class:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="targetlang"><pre>
|
<div class="targetlang"><pre>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<H1><a name="Sections">SWIG-4.0 Documentation</a></H1>
|
<H1><a name="Sections">SWIG-4.0 Documentation</a></H1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Last update : SWIG-4.0.0 (in progress)
|
Last update : SWIG-4.0.1 (in progress)
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H2><a name="Sections_Sections">Sections</a></H2>
|
<H2><a name="Sections_Sections">Sections</a></H2>
|
||||||
|
|
|
||||||
|
|
@ -672,8 +672,8 @@ void wrap_foo(char *s, int x) {
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
SWIG has parallels to <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect Oriented Software Development (AOP)</a>.
|
SWIG has parallels to <a href="https://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect Oriented Software Development (AOP)</a>.
|
||||||
The <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming#Terminology">AOP terminology</a> with respect to SWIG typemaps can be viewed as follows:
|
The <a href="https://en.wikipedia.org/wiki/Aspect-oriented_programming#Terminology">AOP terminology</a> with respect to SWIG typemaps can be viewed as follows:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li> <b>Cross-cutting concerns</b>: The cross-cutting concerns are the modularization of the functionality that the typemaps implement, which is primarily marshalling of types from/to the target language and C/C++.
|
<li> <b>Cross-cutting concerns</b>: The cross-cutting concerns are the modularization of the functionality that the typemaps implement, which is primarily marshalling of types from/to the target language and C/C++.
|
||||||
|
|
|
||||||
|
|
@ -535,6 +535,7 @@ example.i(4) : Syntax error in input(1).
|
||||||
<li>522. Use of an illegal constructor name '<em>name</em>' in %extend is deprecated, the constructor name should be '<em>name</em>'.
|
<li>522. Use of an illegal constructor name '<em>name</em>' in %extend is deprecated, the constructor name should be '<em>name</em>'.
|
||||||
<li>523. Use of an illegal destructor name '<em>name</em>' in %extend is deprecated, the destructor name should be '<em>name</em>'.
|
<li>523. Use of an illegal destructor name '<em>name</em>' in %extend is deprecated, the destructor name should be '<em>name</em>'.
|
||||||
<li>524. Experimental target language. Target language <em>language</em> specified by <em>lang</em> is an experimental language. Please read about SWIG experimental languages, <em>htmllink</em>.
|
<li>524. Experimental target language. Target language <em>language</em> specified by <em>lang</em> is an experimental language. Please read about SWIG experimental languages, <em>htmllink</em>.
|
||||||
|
<li>525. Destructor <em>declaration</em> is final, <em>name</em> cannot be a director class.
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<H3><a name="Warnings_doxygen">18.9.6 Doxygen comments (560-599)</a></H3>
|
<H3><a name="Warnings_doxygen">18.9.6 Doxygen comments (560-599)</a></H3>
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ SWIG does not come with the usual Windows type installation program, however it
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The swigwin distribution contains the SWIG Windows executable, swig.exe, which will run on 32 bit versions of Windows, ie Windows 95 and later.
|
The swigwin distribution contains the SWIG Windows 32-bit executable, swig.exe, which will run on both 32-bit and 64-bit versions of Windows.
|
||||||
If you want to build your own swig.exe have a look at <a href="#Windows_swig_exe">Building swig.exe on Windows</a>.
|
If you want to build your own swig.exe have a look at <a href="#Windows_swig_exe">Building swig.exe on Windows</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -211,7 +211,7 @@ If you do not have access to Visual C++ you will have to set up project files /
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
SWIG can also be compiled and run using <a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> which provides a Unix like front end to Windows and comes free with gcc, an ANSI C/C++ compiler. However, this is not a recommended approach as the prebuilt executable is supplied.
|
SWIG can also be compiled and run using <a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> which provides a Unix like front end to Windows and comes free with gcc, an ISO C/C++ compiler. However, this is not a recommended approach as the prebuilt executable is supplied.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Windows_swig_exe">3.3.1 Building swig.exe on Windows</a></H3>
|
<H3><a name="Windows_swig_exe">3.3.1 Building swig.exe on Windows</a></H3>
|
||||||
|
|
@ -249,7 +249,7 @@ Execute the steps in the order shown and don't use spaces in path names. In fact
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
Download the following packages from the <a href="http://www.mingw.org/download.shtml">MinGW download page</a>
|
Download the following packages from the <a href="http://www.mingw.org/download.shtml">MinGW download page</a>
|
||||||
or <a href="http://sourceforge.net/projects/mingw/files/">MinGW SourceForge download page</a>.
|
or <a href="https://sourceforge.net/projects/mingw/files/">MinGW SourceForge download page</a>.
|
||||||
Note that at the time of writing, the majority of these are in the Current
|
Note that at the time of writing, the majority of these are in the Current
|
||||||
release list and some are in the Snapshot or Previous release list.
|
release list and some are in the Snapshot or Previous release list.
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
||||||
|
|
@ -858,31 +858,33 @@ mzscheme_clean:
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
OCC=$(COMPILETOOL) @OCAMLC@
|
OCC=$(COMPILETOOL) @OCAMLC@
|
||||||
|
OCC_WITH_PP=env TMPDIR=./localtmp $(OCC)
|
||||||
|
# TMPDIR above is a workaround for some ocamlc versions, such as 4.05.0, which always create a temp file of the same name breaking parallel make (seemingly only when -pp is used)
|
||||||
OCAMLDLGEN=$(COMPILETOOL) @OCAMLDLGEN@
|
OCAMLDLGEN=$(COMPILETOOL) @OCAMLDLGEN@
|
||||||
OCAMLFIND=$(COMPILETOOL) @OCAMLFIND@
|
OCAMLFIND=$(COMPILETOOL) @OCAMLFIND@
|
||||||
OCAMLMKTOP=$(COMPILETOOL) @OCAMLMKTOP@
|
OCAMLMKTOP=$(COMPILETOOL) @OCAMLMKTOP@
|
||||||
NOLINK ?= false
|
NOLINK ?= false
|
||||||
OCAMLPP= -pp "camlp4o ./swigp4.cmo"
|
OCAMLPP= -pp "camlp4o ./swigp4.cmo"
|
||||||
OCAMLP4WHERE=`$(COMPILETOOL) @CAMLP4@ -where`
|
OCAMLP4WHERE=`$(COMPILETOOL) @CAMLP4@ -where`
|
||||||
OCAMLCORE=\
|
|
||||||
(test -f swig.mli || $(SWIG) -ocaml -co swig.mli 2>/dev/null) && \
|
ocaml_core:
|
||||||
(test -f swig.ml || $(SWIG) -ocaml -co swig.ml 2>/dev/null) && \
|
mkdir -p ./localtmp
|
||||||
(test -f swigp4.ml || $(SWIG) -ocaml -co swigp4.ml 2>/dev/null) && \
|
$(SWIG) -ocaml -co swig.mli 2>/dev/null
|
||||||
(test -f swig.cmi || $(OCC) -c swig.mli) && \
|
$(SWIG) -ocaml -co swig.ml 2>/dev/null
|
||||||
(test -f swig.cmo || $(OCC) -c swig.ml) && \
|
$(SWIG) -ocaml -co swigp4.ml 2>/dev/null
|
||||||
(test -f swigp4.cmi || $(OCC) -I $(OCAMLP4WHERE) -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml)
|
$(OCC) -c swig.mli
|
||||||
|
$(OCC) -c swig.ml
|
||||||
|
$(OCC_WITH_PP) -I $(OCAMLP4WHERE) -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml
|
||||||
|
|
||||||
ocaml_static: $(SRCDIR_SRCS)
|
ocaml_static: $(SRCDIR_SRCS)
|
||||||
$(OCAMLCORE)
|
|
||||||
$(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
$(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
||||||
$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS)
|
$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS)
|
||||||
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
|
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
|
||||||
$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
|
$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
|
||||||
test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
||||||
$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(RUNME) swig.cmo $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)"
|
$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(RUNME) swig.cmo $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)"
|
||||||
|
|
||||||
ocaml_dynamic: $(SRCDIR_SRCS)
|
ocaml_dynamic: $(SRCDIR_SRCS)
|
||||||
$(OCAMLCORE)
|
|
||||||
$(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
$(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
||||||
$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS)
|
$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS)
|
||||||
$(CXXSHARED) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(CCSHARED) -o $(INTERFACE:%.i=%@SO@) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) $(LIBS)
|
$(CXXSHARED) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(CCSHARED) -o $(INTERFACE:%.i=%@SO@) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) $(LIBS)
|
||||||
|
|
@ -890,40 +892,36 @@ ocaml_dynamic: $(SRCDIR_SRCS)
|
||||||
mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
|
mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
|
||||||
rm $(INTERFACE:%.i=%.mli)
|
rm $(INTERFACE:%.i=%.mli)
|
||||||
$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
|
$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
|
||||||
test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
||||||
$(NOLINK) || $(OCAMLFIND) $(OCC) -g -ccopt -g -cclib -g -custom -o $(RUNME) swig.cmo -package dl -linkpkg $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo)
|
$(NOLINK) || $(OCAMLFIND) $(OCC) -g -ccopt -g -cclib -g -custom -o $(RUNME) swig.cmo -package dl -linkpkg $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo)
|
||||||
|
|
||||||
ocaml_static_toplevel: $(SRCDIR_SRCS)
|
ocaml_static_toplevel: $(SRCDIR_SRCS)
|
||||||
$(OCAMLCORE)
|
|
||||||
$(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
$(SWIG) -ocaml $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
||||||
$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS)
|
$(OCC) -g -c -ccopt -g -ccopt "$(INCLUDES)" $(ISRCS) $(SRCDIR_SRCS)
|
||||||
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
|
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
|
||||||
$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
|
$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
|
||||||
test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
||||||
$(NOLINK) || $(OCAMLMKTOP) swig.cmo -I $(OCAMLP4WHERE) dynlink.cma camlp4o.cma swigp4.cmo -cclib "$(LIBS)" -g -ccopt -g -cclib -g -custom -o $(RUNME)_top $(INTERFACE:%.i=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS)
|
$(NOLINK) || $(OCAMLMKTOP) swig.cmo -I $(OCAMLP4WHERE) dynlink.cma camlp4o.cma swigp4.cmo -cclib "$(LIBS)" -g -ccopt -g -cclib -g -custom -o $(RUNME)_top $(INTERFACE:%.i=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS)
|
||||||
|
|
||||||
ocaml_static_cpp: $(SRCDIR_SRCS)
|
ocaml_static_cpp: $(SRCDIR_SRCS)
|
||||||
$(OCAMLCORE)
|
|
||||||
$(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
$(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
||||||
cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
|
cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
|
||||||
$(OCC) -cc '$(CXX) $(CPPFLAGS)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
|
$(OCC) -cc '$(CXX) $(CPPFLAGS)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
|
||||||
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
|
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
|
||||||
$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
|
$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
|
||||||
test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
||||||
$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(RUNME) swig.cmo $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)" -cc '$(CXX)'
|
$(NOLINK) || $(OCC) -g -ccopt -g -cclib -g -custom -o $(RUNME) swig.cmo $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS) -cclib "$(LIBS)" -cc '$(CXX)'
|
||||||
|
|
||||||
ocaml_static_cpp_toplevel: $(SRCDIR_SRCS)
|
ocaml_static_cpp_toplevel: $(SRCDIR_SRCS)
|
||||||
$(OCAMLCORE)
|
|
||||||
$(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
$(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
||||||
cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
|
cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
|
||||||
$(OCC) -cc '$(CXX) $(CPPFLAGS)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
|
$(OCC) -cc '$(CXX) $(CPPFLAGS)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
|
||||||
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
|
$(OCC) -g -c $(INTERFACE:%.i=%.mli)
|
||||||
$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
|
$(OCC) -w -U -g -c $(INTERFACE:%.i=%.ml)
|
||||||
test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
||||||
$(NOLINK) || $(OCAMLMKTOP) -cc '$(CXX) $(CPPFLAGS)' swig.cmo -I $(OCAMLP4WHERE) dynlink.cma camlp4o.cma swigp4.cmo -cclib "$(LIBS)" -g -ccopt -g -cclib -g -custom -o $(RUNME)_top $(INTERFACE:%.i=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS)
|
$(NOLINK) || $(OCAMLMKTOP) -cc '$(CXX) $(CPPFLAGS)' swig.cmo -I $(OCAMLP4WHERE) dynlink.cma camlp4o.cma swigp4.cmo -cclib "$(LIBS)" -g -ccopt -g -cclib -g -custom -o $(RUNME)_top $(INTERFACE:%.i=%.cmo) $(INTERFACE:%.i=%_wrap.@OBJEXT@) $(OBJS)
|
||||||
|
|
||||||
ocaml_dynamic_cpp: $(SRCDIR_SRCS)
|
ocaml_dynamic_cpp: $(SRCDIR_SRCS)
|
||||||
$(OCAMLCORE)
|
|
||||||
$(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
$(SWIG) -ocaml -c++ $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
||||||
cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
|
cp $(ICXXSRCS) $(ICXXSRCS:%.cxx=%.c)
|
||||||
$(OCC) -cc '$(CXX) $(CPPFLAGS)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) -ccopt -fPIC
|
$(OCC) -cc '$(CXX) $(CPPFLAGS)' -g -c -ccopt -g -ccopt "-xc++ $(INCLUDES)" $(ICXXSRCS:%.cxx=%.c) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS) -ccopt -fPIC
|
||||||
|
|
@ -932,7 +930,7 @@ ocaml_dynamic_cpp: $(SRCDIR_SRCS)
|
||||||
mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
|
mv $(INTERFACE:%.i=%_dynamic.ml) $(INTERFACE:%.i=%.ml)
|
||||||
rm $(INTERFACE:%.i=%.mli)
|
rm $(INTERFACE:%.i=%.mli)
|
||||||
$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
|
$(OCAMLFIND) $(OCC) -g -c -package dl $(INTERFACE:%.i=%.ml)
|
||||||
test -z "$(PROGFILE)" || $(OCC) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
test -z "$(PROGFILE)" || $(OCC_WITH_PP) -o $(PROGFILE:%.ml=%) $(OCAMLPP) -c $(SRCDIR)$(PROGFILE)
|
||||||
$(NOLINK) || $(OCAMLFIND) swig.cmo $(OCC) -cclib -export-dynamic -g -ccopt -g -cclib -g -custom -o $(RUNME) -package dl -linkpkg $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) -cc '$(CXX)'
|
$(NOLINK) || $(OCAMLFIND) swig.cmo $(OCC) -cclib -export-dynamic -g -ccopt -g -cclib -g -custom -o $(RUNME) -package dl -linkpkg $(INTERFACE:%.i=%.cmo) $(PROGFILE:%.ml=%.cmo) -cc '$(CXX)'
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
|
@ -957,6 +955,7 @@ ocaml_clean:
|
||||||
rm -f *_wrap* *~ .~* *.cmo *.cmi *.mli $(TARGET).ml $(RUNME) $(RUNME)_top swig.ml swigp4.ml
|
rm -f *_wrap* *~ .~* *.cmo *.cmi *.mli $(TARGET).ml $(RUNME) $(RUNME)_top swig.ml swigp4.ml
|
||||||
rm -f core @EXTRA_CLEAN@
|
rm -f core @EXTRA_CLEAN@
|
||||||
rm -f *.@OBJEXT@ *@SO@
|
rm -f *.@OBJEXT@ *@SO@
|
||||||
|
rm -rf ./localtmp
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
##### RUBY ######
|
##### RUBY ######
|
||||||
|
|
@ -1095,7 +1094,7 @@ CSHARPCFLAGS = @CSHARPCFLAGS@
|
||||||
CSHARPFLAGS =
|
CSHARPFLAGS =
|
||||||
CSHARPOPTIONS =
|
CSHARPOPTIONS =
|
||||||
CSHARPSO = @CSHARPSO@
|
CSHARPSO = @CSHARPSO@
|
||||||
CSHARP_RUNME = $(CSHARPCILINTERPRETER) $(CSHARPCILINTERPRETER_FLAGS) ./$(RUNME).exe
|
CSHARP_RUNME = ./$(RUNME).exe
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# Build a CSharp dynamically loadable module (C)
|
# Build a CSharp dynamically loadable module (C)
|
||||||
|
|
@ -1133,7 +1132,7 @@ csharp_compile: $(SRCDIR_SRCS)
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
csharp_run:
|
csharp_run:
|
||||||
env LD_LIBRARY_PATH=$$PWD $(RUNTOOL) $(CSHARP_RUNME) $(RUNPIPE)
|
env LD_LIBRARY_PATH=$$PWD $(RUNTOOL) $(CSHARPCILINTERPRETER) $(CSHARPCILINTERPRETER_FLAGS) $(CSHARP_RUNME) $(RUNPIPE)
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
# Version display
|
# Version display
|
||||||
|
|
@ -1458,7 +1457,8 @@ GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; fi`
|
||||||
|
|
||||||
GOPACKAGE = $(notdir $(INTERFACE:.i=.a))
|
GOPACKAGE = $(notdir $(INTERFACE:.i=.a))
|
||||||
|
|
||||||
GOPATHDIR = gopath/src/$(INTERFACE:.i=)
|
GOPATHPARENTDIR = gopath/$(GOMOD)/src
|
||||||
|
GOPATHDIR = $(GOPATHPARENTDIR)/$(INTERFACE:.i=)
|
||||||
|
|
||||||
GOOBJEXT = `if $(GO15); then echo o; else echo $(GOC:c=); fi`
|
GOOBJEXT = `if $(GO15); then echo o; else echo $(GOC:c=); fi`
|
||||||
GOGCOBJS = $(GOSRCS:.go=.$(GOOBJEXT))
|
GOGCOBJS = $(GOSRCS:.go=.$(GOOBJEXT))
|
||||||
|
|
@ -1468,8 +1468,18 @@ GOGCCOBJS = $(GOSRCS:.go=.@OBJEXT@)
|
||||||
# Build a Go module (C)
|
# Build a Go module (C)
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
|
$(GOPATHPARENTDIR)/go.mod:
|
||||||
|
@mkdir gopath 2>/dev/null || true
|
||||||
|
@mkdir gopath/$(GOMOD) 2>/dev/null || true
|
||||||
|
@mkdir gopath/$(GOMOD)/src 2>/dev/null || true
|
||||||
|
@mkdir $(GOPATHDIR) 2>/dev/null || true
|
||||||
|
echo "module swigtests" > $(GOPATHDIR)/go.mod
|
||||||
|
echo "" >> $(GOPATHDIR)/go.mod
|
||||||
|
echo "go 1.12" >> $(GOPATHDIR)/go.mod
|
||||||
|
mv -f $(GOPATHDIR)/go.mod $(GOPATHPARENTDIR)/go.mod
|
||||||
|
|
||||||
go_nocgo: $(SRCDIR_SRCS)
|
go_nocgo: $(SRCDIR_SRCS)
|
||||||
$(SWIG) -go $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
$(SWIG) -go -no-cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
||||||
if $(GO12) || $(GO13) || $(GO15) || $(GOGCC); then \
|
if $(GO12) || $(GO13) || $(GO15) || $(GOGCC); then \
|
||||||
$(CC) -g -c $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \
|
$(CC) -g -c $(CPPFLAGS) $(CFLAGS) $(SRCDIR_SRCS) $(ISRCS) $(INCLUDES); \
|
||||||
else \
|
else \
|
||||||
|
|
@ -1504,11 +1514,12 @@ go_nocgo: $(SRCDIR_SRCS)
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
go: $(SRCDIR_SRCS)
|
go: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod
|
||||||
$(SWIG) -go -cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
$(SWIG) -go -import-prefix swigtests $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
|
||||||
@mkdir gopath 2>/dev/null || true
|
@mkdir gopath 2>/dev/null || true
|
||||||
@mkdir gopath/src 2>/dev/null || true
|
@mkdir gopath/$(GOMOD) 2>/dev/null || true
|
||||||
@mkdir gopath/src/$(INTERFACE:.i=) 2>/dev/null || true
|
@mkdir gopath/$(GOMOD)/src 2>/dev/null || true
|
||||||
|
@mkdir $(GOPATHDIR) 2>/dev/null || true
|
||||||
rm -f $(GOPATHDIR)/*
|
rm -f $(GOPATHDIR)/*
|
||||||
cp $(ISRCS) $(GOPATHDIR)/
|
cp $(ISRCS) $(GOPATHDIR)/
|
||||||
if test -f $(IWRAP:.i=.h); then \
|
if test -f $(IWRAP:.i=.h); then \
|
||||||
|
|
@ -1518,7 +1529,7 @@ go: $(SRCDIR_SRCS)
|
||||||
cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \
|
cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \
|
||||||
fi
|
fi
|
||||||
cp $(GOSRCS) $(GOPATHDIR)/
|
cp $(GOSRCS) $(GOPATHDIR)/
|
||||||
GOPATH=`pwd`/gopath; \
|
GOPATH=`pwd`/gopath/$(GOMOD); \
|
||||||
export GOPATH; \
|
export GOPATH; \
|
||||||
CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
|
CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
|
||||||
export CGO_CPPFLAGS; \
|
export CGO_CPPFLAGS; \
|
||||||
|
|
@ -1527,17 +1538,16 @@ go: $(SRCDIR_SRCS)
|
||||||
CGO_LDFLAGS="$(LDFLAGS) -lm"; \
|
CGO_LDFLAGS="$(LDFLAGS) -lm"; \
|
||||||
export CGO_LDFLAGS; \
|
export CGO_LDFLAGS; \
|
||||||
(cd $(GOPATHDIR)/ && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE))
|
(cd $(GOPATHDIR)/ && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE))
|
||||||
cp $(GOPATHDIR)/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE)
|
|
||||||
if $(GOGCC); then \
|
if $(GOGCC); then \
|
||||||
cp $(dir $(INTERFACE))/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE:.a=.gox); \
|
cp $(GOPATHDIR)/$(GOPACKAGE) $(GOPATHDIR)/$(GOPACKAGE:.a=.gox); \
|
||||||
fi
|
fi
|
||||||
if test -f $(SRCDIR)$(RUNME).go; then \
|
if test -f $(SRCDIR)$(RUNME).go; then \
|
||||||
if $(GOGCC) ; then \
|
if $(GOGCC) ; then \
|
||||||
$(COMPILETOOL) $(GCCGO) -c -g $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GCCGO) -c -g -I $(GOPATHDIR) $(SRCDIR)$(RUNME).go; \
|
||||||
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE); \
|
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOPATHDIR)/$(GOPACKAGE); \
|
||||||
elif $(GO12) || $(GO13) || $(GO15); then \
|
elif $(GO12) || $(GO13) || $(GO15); then \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I $(GOPATHDIR) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L $(GOPATHDIR) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
||||||
else \
|
else \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
||||||
|
|
@ -1549,7 +1559,7 @@ go: $(SRCDIR_SRCS)
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
go_cpp_nocgo: $(SRCDIR_SRCS)
|
go_cpp_nocgo: $(SRCDIR_SRCS)
|
||||||
$(SWIG) -go -c++ $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
$(SWIG) -go -c++ -no-cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
||||||
if $(GO12) || $(GO13) || $(GO15) || $(GOGCC); then \
|
if $(GO12) || $(GO13) || $(GO15) || $(GOGCC); then \
|
||||||
if test -n "$(SRCDIR_CXXSRCS)$(SRCDIR_SRCS)"; then \
|
if test -n "$(SRCDIR_CXXSRCS)$(SRCDIR_SRCS)"; then \
|
||||||
$(CXX) -g -c $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_CXXSRCS) $(SRCDIR_SRCS) $(INCLUDES); \
|
$(CXX) -g -c $(CPPFLAGS) $(CXXFLAGS) $(SRCDIR_CXXSRCS) $(SRCDIR_SRCS) $(INCLUDES); \
|
||||||
|
|
@ -1596,11 +1606,12 @@ go_cpp_nocgo: $(SRCDIR_SRCS)
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
go_cpp: $(SRCDIR_SRCS)
|
go_cpp: $(SRCDIR_SRCS) $(GOPATHPARENTDIR)/go.mod
|
||||||
$(SWIG) -go -c++ -cgo $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
$(SWIG) -go -c++ -import-prefix swigtests $(GOOPT) $(GOSWIGARG) $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
|
||||||
@mkdir gopath 2>/dev/null || true
|
@mkdir gopath 2>/dev/null || true
|
||||||
@mkdir gopath/src 2>/dev/null || true
|
@mkdir gopath/$(GOMOD) 2>/dev/null || true
|
||||||
@mkdir gopath/src/$(INTERFACE:.i=) 2>/dev/null || true
|
@mkdir gopath/$(GOMOD)/src 2>/dev/null || true
|
||||||
|
@mkdir $(GOPATHDIR) 2>/dev/null || true
|
||||||
rm -f $(GOPATHDIR)/*
|
rm -f $(GOPATHDIR)/*
|
||||||
cp $(ICXXSRCS) $(GOPATHDIR)/
|
cp $(ICXXSRCS) $(GOPATHDIR)/
|
||||||
if test -f $(IWRAP:.i=.h); then \
|
if test -f $(IWRAP:.i=.h); then \
|
||||||
|
|
@ -1613,7 +1624,7 @@ go_cpp: $(SRCDIR_SRCS)
|
||||||
cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \
|
cp $(SRCDIR_SRCS) $(GOPATHDIR)/; \
|
||||||
fi
|
fi
|
||||||
cp $(GOSRCS) $(GOPATHDIR)/
|
cp $(GOSRCS) $(GOPATHDIR)/
|
||||||
GOPATH=`pwd`/gopath; \
|
GOPATH=`pwd`/gopath/$(GOMOD); \
|
||||||
export GOPATH; \
|
export GOPATH; \
|
||||||
CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
|
CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) -I `cd $(SRCDIR) && pwd` -I `pwd`"; \
|
||||||
export CGO_CPPFLAGS; \
|
export CGO_CPPFLAGS; \
|
||||||
|
|
@ -1624,17 +1635,16 @@ go_cpp: $(SRCDIR_SRCS)
|
||||||
CGO_LDFLAGS="$(LDFLAGS) -lm"; \
|
CGO_LDFLAGS="$(LDFLAGS) -lm"; \
|
||||||
export CGO_LDFLAGS; \
|
export CGO_LDFLAGS; \
|
||||||
(cd $(GOPATHDIR) && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE))
|
(cd $(GOPATHDIR) && $(COMPILETOOL) $(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o $(GOPACKAGE))
|
||||||
cp $(GOPATHDIR)/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE)
|
|
||||||
if $(GOGCC); then \
|
if $(GOGCC); then \
|
||||||
cp $(dir $(INTERFACE))/$(GOPACKAGE) $(dir $(INTERFACE))/$(GOPACKAGE:.a=.gox); \
|
cp $(GOPATHDIR)/$(GOPACKAGE) $(GOPATHDIR)/$(GOPACKAGE:.a=.gox); \
|
||||||
fi
|
fi
|
||||||
if test -f $(SRCDIR)$(RUNME).go; then \
|
if test -f $(SRCDIR)$(RUNME).go; then \
|
||||||
if $(GOGCC) ; then \
|
if $(GOGCC) ; then \
|
||||||
$(COMPILETOOL) $(GCCGO) -g -c $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GCCGO) -g -c -I $(GOPATHDIR) $(SRCDIR)$(RUNME).go; \
|
||||||
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE) -lstdc++; \
|
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(GOPATHDIR)/$(GOPACKAGE) -lstdc++; \
|
||||||
elif $(GO12) || $(GO13) || $(GO15); then \
|
elif $(GO12) || $(GO13) || $(GO15); then \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I $(GOPATHDIR) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L $(GOPATHDIR) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
||||||
else \
|
else \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
. "example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
. "example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Compare(name string, got string, exp string) error {
|
func Compare(name string, got string, exp string) error {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
. "example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
. "example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
. "example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
. "example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
. "example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
. "example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
. "example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"./example"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"example"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ public class runme {
|
||||||
System.out.println( " Trying to set 'status'" );
|
System.out.println( " Trying to set 'status'" );
|
||||||
try {
|
try {
|
||||||
Method m = example.class.getDeclaredMethod("setStatus", new Class[] {Integer.class});
|
Method m = example.class.getDeclaredMethod("setStatus", new Class[] {Integer.class});
|
||||||
m.invoke(example.class, new Object[] {new Integer(0)} );
|
m.invoke(example.class, new Object[] {Integer.valueOf(0)} );
|
||||||
System.out.println( "Hey, what's going on?!?! This shouldn't work" );
|
System.out.println( "Hey, what's going on?!?! This shouldn't work" );
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodException e) {
|
catch (NoSuchMethodException e) {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@ check: build
|
||||||
build: static
|
build: static
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,10 @@ check: build
|
||||||
build: static
|
build: static
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,10 @@ check: build
|
||||||
build: static
|
build: static
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ dynamic:
|
||||||
ocaml_dynamic
|
ocaml_dynamic
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ dynamic:
|
||||||
ocaml_dynamic_cpp
|
ocaml_dynamic_cpp
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,17 @@ check: build
|
||||||
build: static toplevel
|
build: static toplevel
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
|
PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
|
||||||
ocaml_static_cpp
|
ocaml_static_cpp
|
||||||
|
|
||||||
toplevel:
|
toplevel: static
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ dynamic:
|
||||||
ocaml_dynamic
|
ocaml_dynamic
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ check: build
|
||||||
build: static
|
build: static
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ check: build
|
||||||
build: static
|
build: static
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ check: build
|
||||||
build: static
|
build: static
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
@ -21,7 +25,7 @@ dynamic:
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
ocaml_static_cpp
|
ocaml_dynamic_cpp
|
||||||
|
|
||||||
toplevel:
|
toplevel:
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,17 @@ check: build
|
||||||
build: static toplevel
|
build: static toplevel
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
|
PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
|
||||||
ocaml_static
|
ocaml_static
|
||||||
|
|
||||||
toplevel:
|
toplevel: static
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ check: build
|
||||||
build: static toplevel
|
build: static toplevel
|
||||||
|
|
||||||
static:
|
static:
|
||||||
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
ocaml_core
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
@ -21,9 +25,9 @@ dynamic:
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
ocaml_static_cpp
|
ocaml_dynamic_cpp
|
||||||
|
|
||||||
toplevel:
|
toplevel: static
|
||||||
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
zend_printf("This was %%rshutdown\n");
|
zend_printf("This was %%rshutdown\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
%pragma(php) include="include.php";
|
%pragma(php) include="./include.php";
|
||||||
|
|
||||||
%pragma(php) code="
|
%pragma(php) code="
|
||||||
# This code is inserted into example.php
|
# This code is inserted into example.php
|
||||||
|
|
|
||||||
|
|
@ -79,5 +79,9 @@ protected:
|
||||||
};
|
};
|
||||||
int ProtectedBase::staticMemberVariable = 10;
|
int ProtectedBase::staticMemberVariable = 10;
|
||||||
|
|
||||||
|
class ProtectedDerived : public ProtectedBase {
|
||||||
|
public:
|
||||||
|
ProtectedDerived(const char *s) : ProtectedBase(s) {}
|
||||||
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -407,6 +407,7 @@ CPP_TEST_CASES += \
|
||||||
static_array_member \
|
static_array_member \
|
||||||
static_const_member \
|
static_const_member \
|
||||||
static_const_member_2 \
|
static_const_member_2 \
|
||||||
|
stl_no_default_constructor \
|
||||||
string_constants \
|
string_constants \
|
||||||
struct_initialization_cpp \
|
struct_initialization_cpp \
|
||||||
struct_value \
|
struct_value \
|
||||||
|
|
@ -571,6 +572,7 @@ CPP11_TEST_CASES += \
|
||||||
cpp11_director_enums \
|
cpp11_director_enums \
|
||||||
cpp11_directors \
|
cpp11_directors \
|
||||||
cpp11_explicit_conversion_operators \
|
cpp11_explicit_conversion_operators \
|
||||||
|
cpp11_final_directors \
|
||||||
cpp11_final_override \
|
cpp11_final_override \
|
||||||
cpp11_function_objects \
|
cpp11_function_objects \
|
||||||
cpp11_inheriting_constructors \
|
cpp11_inheriting_constructors \
|
||||||
|
|
@ -707,6 +709,7 @@ C_TEST_CASES += \
|
||||||
preproc \
|
preproc \
|
||||||
preproc_constants_c \
|
preproc_constants_c \
|
||||||
preproc_defined \
|
preproc_defined \
|
||||||
|
preproc_gcc_output \
|
||||||
preproc_include \
|
preproc_include \
|
||||||
preproc_line_file \
|
preproc_line_file \
|
||||||
register_par \
|
register_par \
|
||||||
|
|
|
||||||
|
|
@ -19,17 +19,17 @@ template<typename T> struct Y {
|
||||||
typedef T2 another_type;
|
typedef T2 another_type;
|
||||||
};
|
};
|
||||||
value_type create1() const { return T(); }
|
value_type create1() const { return T(); }
|
||||||
Y::value_type create2() const { return T(); }
|
typename Y::value_type create2() const { return T(); }
|
||||||
Y<T>::value_type create3() const { return T(); }
|
typename Y<T>::value_type create3() const { return T(); }
|
||||||
YY::value_type create4() const { return T(); }
|
typename YY::value_type create4() const { return T(); }
|
||||||
Y<T>::YY::value_type create5() const { return T(); }
|
typename Y<T>::YY::value_type create5() const { return T(); }
|
||||||
Y<T>::YYY<T>::value_type create6() const { return T(); }
|
Y<T>::YYY<T>::value_type create6() const { return T(); }
|
||||||
typename Y<T>::template ZZZ<T>::another_type create7() const { return T(); }
|
typename Y<T>::template ZZZ<T>::another_type create7() const { return T(); }
|
||||||
|
|
||||||
// With global scope prefix
|
// With global scope prefix
|
||||||
::Y<T>::value_type create13() const { return T(); }
|
typename ::Y<T>::value_type create13() const { return T(); }
|
||||||
|
|
||||||
::Y<T>::YY::value_type create15() const { return T(); }
|
typename ::Y<T>::YY::value_type create15() const { return T(); }
|
||||||
::Y<T>::YYY<T>::value_type create16() const { return T(); }
|
::Y<T>::YYY<T>::value_type create16() const { return T(); }
|
||||||
typename ::Y<T>::template ZZZ<T>::another_type create17() const { return T(); }
|
typename ::Y<T>::template ZZZ<T>::another_type create17() const { return T(); }
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
struct A {
|
struct A {
|
||||||
int member;
|
int member;
|
||||||
};
|
};
|
||||||
const int align1 = alignof(A::member);
|
const int align1 = alignof(int);
|
||||||
|
const int align2 = alignof(int *);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
|
||||||
33
Examples/test-suite/cpp11_final_directors.i
Normal file
33
Examples/test-suite/cpp11_final_directors.i
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
%module(directors="1") cpp11_final_directors
|
||||||
|
|
||||||
|
%director Derived;
|
||||||
|
|
||||||
|
// Check SWIG will not wrap these classes as directors where the destructors are final
|
||||||
|
%director BaseFinalDestructor;
|
||||||
|
%director BaseFinalDestructor2;
|
||||||
|
|
||||||
|
%warnfilter(SWIGWARN_LANG_DIRECTOR_FINAL) BaseFinalDestructor::~BaseFinalDestructor;
|
||||||
|
%warnfilter(SWIGWARN_LANG_DIRECTOR_FINAL) BaseFinalDestructor2::~BaseFinalDestructor2;
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
struct Base {
|
||||||
|
virtual void basemeth() final {}
|
||||||
|
virtual ~Base() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Derived : Base {
|
||||||
|
virtual int derivedmeth() final { return 1; }
|
||||||
|
virtual int meth() { return 2; }
|
||||||
|
virtual ~Derived() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BaseFinalDestructor {
|
||||||
|
virtual void basefinalmeth() final {}
|
||||||
|
virtual ~BaseFinalDestructor() final {}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BaseFinalDestructor2 {
|
||||||
|
virtual void basefinalmeth() {}
|
||||||
|
virtual ~BaseFinalDestructor2() final {}
|
||||||
|
};
|
||||||
|
%}
|
||||||
|
|
@ -43,14 +43,17 @@ auto lambda1 = [](int x, int y) -> int { return x+y; };
|
||||||
single statement "return expr;". */
|
single statement "return expr;". */
|
||||||
auto lambda2 = [](int x, int y) { return x+y; };
|
auto lambda2 = [](int x, int y) { return x+y; };
|
||||||
|
|
||||||
auto lambda3 = [&](int x, int y) { return x+y; };
|
|
||||||
auto lambda4 = [=](int x, int y) { return x+y; };
|
|
||||||
int thing = 0;
|
int thing = 0;
|
||||||
#ifdef SWIG
|
#ifdef SWIG
|
||||||
// Not strictly correct as captured variables should have non-automatic storage duration, ie shouldn't capture globals. gcc-4.7 warns about this, but we check that SWIG can parse this anyway.
|
// This is not strictly legal: non-local lambda expression cannot have a capture-default
|
||||||
|
// gcc-4.7 warns about this and gcc-9 gives an error, but we check that SWIG can parse this anyway.
|
||||||
|
auto lambda3 = [&](int x, int y) { return x+y; };
|
||||||
|
auto lambda4 = [=](int x, int y) { return x+y; };
|
||||||
auto lambda5 = [=,&thing]() { return thing; };
|
auto lambda5 = [=,&thing]() { return thing; };
|
||||||
#else
|
#else
|
||||||
auto lambda5 = [=]() { return thing; };
|
auto lambda3 = [](int x, int y) { return x+y; };
|
||||||
|
auto lambda4 = [](int x, int y) { return x+y; };
|
||||||
|
auto lambda5 = []() { return thing; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void fn() {
|
void fn() {
|
||||||
|
|
@ -115,6 +118,6 @@ int runLambdaInline() {
|
||||||
// TODO
|
// TODO
|
||||||
int(*lambda101notauto)(int, int) = [] (int a, int b) { return a + b; };
|
int(*lambda101notauto)(int, int) = [] (int a, int b) { return a + b; };
|
||||||
int lambda102 = [] (int a, int b) mutable { return a + b; }(1, 2);
|
int lambda102 = [] (int a, int b) mutable { return a + b; }(1, 2);
|
||||||
void lambda_init(int = ([=]{ return 0; })());
|
void lambda_init(int = ([]{ return 0; })());
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,7 @@
|
||||||
|
|
||||||
%template(UnorderedMapIntInt) std::unordered_map<int, int>;
|
%template(UnorderedMapIntInt) std::unordered_map<int, int>;
|
||||||
%template(UnorderedMapStringInt) std::unordered_map<std::string, int>;
|
%template(UnorderedMapStringInt) std::unordered_map<std::string, int>;
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
std::unordered_map<std::string, int, std::hash< std::string >,std::equal_to< std::string >,std::allocator< std::pair< std::string const,int > > > inout(std::unordered_map<std::string, int> m) { return m; }
|
||||||
|
%}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
template<typename T> struct Temper {
|
template<typename T> class Temper {
|
||||||
|
public:
|
||||||
T val;
|
T val;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -18,14 +19,20 @@ public:
|
||||||
int memberFunction() { return 100; }
|
int memberFunction() { return 100; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class B {
|
||||||
|
public:
|
||||||
|
short member;
|
||||||
|
short memberFunction() { return 100; }
|
||||||
|
};
|
||||||
|
|
||||||
template class Temper<A>;
|
template class Temper<A>;
|
||||||
extern template class Temper<A>;
|
extern template class Temper<B>;
|
||||||
|
|
||||||
template class Temper<A*>;
|
template class Temper<A*>;
|
||||||
extern template class Temper<A*>;
|
extern template class Temper<B*>;
|
||||||
|
|
||||||
template class Temper<int>;
|
template class Temper<int>;
|
||||||
extern template class Temper<int>;
|
extern template class Temper<short>;
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%template(TemperInt) Temper<int>;
|
%template(TemperInt) Temper<int>;
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,10 @@ extern "C++" thread_local int ecpptval;
|
||||||
|
|
||||||
thread_local int ThreadLocals::stval = 11;
|
thread_local int ThreadLocals::stval = 11;
|
||||||
thread_local int ThreadLocals::tsval = 22;
|
thread_local int ThreadLocals::tsval = 22;
|
||||||
|
#if !defined(_MSC_VER)
|
||||||
thread_local const int ThreadLocals::stcval88;
|
thread_local const int ThreadLocals::stcval88;
|
||||||
thread_local const int ThreadLocals::tscval99;
|
thread_local const int ThreadLocals::tscval99;
|
||||||
|
#endif
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ Tests Sourceforge bug #444748.
|
||||||
class StaticMemberTest {
|
class StaticMemberTest {
|
||||||
public:
|
public:
|
||||||
static int static_int;
|
static int static_int;
|
||||||
|
static int grab_int() { return static_int; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class StaticFunctionTest {
|
class StaticFunctionTest {
|
||||||
|
|
@ -28,10 +29,12 @@ int StaticMemberTest::static_int = 99;
|
||||||
%inline %{
|
%inline %{
|
||||||
struct StaticBase {
|
struct StaticBase {
|
||||||
static int statty;
|
static int statty;
|
||||||
|
static int grab_statty_base() { return statty; }
|
||||||
virtual ~StaticBase() {}
|
virtual ~StaticBase() {}
|
||||||
};
|
};
|
||||||
struct StaticDerived : StaticBase {
|
struct StaticDerived : StaticBase {
|
||||||
static int statty;
|
static int statty;
|
||||||
|
static int grab_statty_derived() { return statty; }
|
||||||
};
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ CPP_TEST_CASES = \
|
||||||
enum_thorough_typesafe \
|
enum_thorough_typesafe \
|
||||||
exception_partial_info \
|
exception_partial_info \
|
||||||
intermediary_classname \
|
intermediary_classname \
|
||||||
li_boost_intrusive_ptr
|
li_boost_intrusive_ptr \
|
||||||
|
li_std_list \
|
||||||
|
|
||||||
CPP11_TEST_CASES = \
|
CPP11_TEST_CASES = \
|
||||||
cpp11_shared_ptr_const \
|
cpp11_shared_ptr_const \
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,20 @@ public class runme
|
||||||
{
|
{
|
||||||
MyProtectedBase mpb = new MyProtectedBase("MyProtectedBase");
|
MyProtectedBase mpb = new MyProtectedBase("MyProtectedBase");
|
||||||
mpb.accessProtected();
|
mpb.accessProtected();
|
||||||
|
try {
|
||||||
|
// C++ destructor is protected
|
||||||
|
mpb.Dispose();
|
||||||
|
throw new Exception("failed to catch MethodAccessException");
|
||||||
|
} catch (MethodAccessException) {
|
||||||
|
// Exception message: C++ destructor does not have public access
|
||||||
|
}
|
||||||
|
ProtectedDerived pd = new ProtectedDerived("ProtectedDerived");
|
||||||
|
// Destroying via the ProtectedDerived's destructor should work
|
||||||
|
pd.Dispose();
|
||||||
|
|
||||||
|
ProtectedBase pb = new ProtectedDerived("ProtectedDerived");
|
||||||
|
// ProtectedDerived's destructor should be called via the Dispose(disposing) virtual call
|
||||||
|
pb.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,13 @@ public class li_std_auto_ptr_runme {
|
||||||
if (Klass.getTotal_count() != 2)
|
if (Klass.getTotal_count() != 2)
|
||||||
throw new Exception("number of objects should be 2");
|
throw new Exception("number of objects should be 2");
|
||||||
|
|
||||||
|
using (Klass k3 = li_std_auto_ptr.makeKlassAutoPtr("second")) {
|
||||||
|
if (Klass.getTotal_count() != 3)
|
||||||
|
throw new Exception("number of objects should be 3");
|
||||||
|
}
|
||||||
|
if (Klass.getTotal_count() != 2)
|
||||||
|
throw new Exception("number of objects should be 2");
|
||||||
|
|
||||||
k1 = null;
|
k1 = null;
|
||||||
{
|
{
|
||||||
int countdown = 500;
|
int countdown = 500;
|
||||||
|
|
|
||||||
402
Examples/test-suite/csharp/li_std_list_runme.cs
Normal file
402
Examples/test-suite/csharp/li_std_list_runme.cs
Normal file
|
|
@ -0,0 +1,402 @@
|
||||||
|
using System;
|
||||||
|
using li_std_listNamespace;
|
||||||
|
|
||||||
|
public class li_std_list_runme {
|
||||||
|
private static readonly int collectionSize = 20;
|
||||||
|
|
||||||
|
public static void Main() {
|
||||||
|
// Setup a list of int
|
||||||
|
IntList list = new IntList();
|
||||||
|
IntList.IntListNode node;
|
||||||
|
|
||||||
|
for (int i = 0; i < 20; i++) {
|
||||||
|
int nb = i * 10;
|
||||||
|
list.Add(nb);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count property test
|
||||||
|
if (list.Count != collectionSize)
|
||||||
|
throw new Exception("Count test failed");
|
||||||
|
|
||||||
|
// IsReadOnly property test
|
||||||
|
if (list.IsReadOnly)
|
||||||
|
throw new Exception("IsReadOnly test failed");
|
||||||
|
|
||||||
|
// Contains method test
|
||||||
|
if (!list.Contains(0))
|
||||||
|
throw new Exception("Contains method test 1 failed");
|
||||||
|
if (!list.Contains(2 * 10))
|
||||||
|
throw new Exception("Contains method test 2 failed");
|
||||||
|
if (!list.Contains(19 * 10))
|
||||||
|
throw new Exception("Contains method test 3 failed");
|
||||||
|
if (list.Contains(20 * 10))
|
||||||
|
throw new Exception("Contains method test 4 failed");
|
||||||
|
|
||||||
|
// Nodes comparison method overload
|
||||||
|
{
|
||||||
|
IntList.IntListNode temp = new IntList.IntListNode(3);
|
||||||
|
if (list.First == temp)
|
||||||
|
throw new Exception("== overload method test (1) failed");
|
||||||
|
temp = new IntList.IntListNode(0);
|
||||||
|
if (list.First == temp)
|
||||||
|
throw new Exception("== overload method test (2) failed");
|
||||||
|
IntList.IntListNode temp2 = new IntList.IntListNode(0);
|
||||||
|
if (temp == temp2)
|
||||||
|
throw new Exception("== overload method test (3) failed");
|
||||||
|
if (!(list.First == list.First))
|
||||||
|
throw new Exception("== overload method test (4) failed");
|
||||||
|
if (list.First != list.First)
|
||||||
|
throw new Exception("!= overload method test (1) failed");
|
||||||
|
if (!(temp != temp2))
|
||||||
|
throw new Exception("!= overload method test (2) failed");
|
||||||
|
if (list.First.Equals(temp))
|
||||||
|
throw new Exception("Equals method test failed");
|
||||||
|
if (list.First.GetHashCode() == temp.GetHashCode())
|
||||||
|
throw new Exception("GetHashCode method test (1) failed");
|
||||||
|
if (list.First.GetHashCode() == list.First.GetHashCode())
|
||||||
|
throw new Exception("GetHashCode method test (2) failed");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getter test
|
||||||
|
{
|
||||||
|
if (list.First == null)
|
||||||
|
throw new Exception("First getter test (1) failed");
|
||||||
|
if (list.Last == null)
|
||||||
|
throw new Exception("Last getter test (1) failed");
|
||||||
|
if (list.Last.Next != null)
|
||||||
|
throw new Exception("Next getter test (1) failed");
|
||||||
|
if (list.First.Next == null)
|
||||||
|
throw new Exception("Next getter test (2) failed");
|
||||||
|
if (list.First.Previous != null)
|
||||||
|
throw new Exception("Previous getter test (1) failed");
|
||||||
|
if (list.Last.Previous == null)
|
||||||
|
throw new Exception("Previous getter test (2) failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddFirst method test
|
||||||
|
node = list.AddFirst(34);
|
||||||
|
if (list.First.Value != 34 || node.Value != 34 || node != list.First)
|
||||||
|
throw new Exception("AddFirst method test failed");
|
||||||
|
try {
|
||||||
|
list.AddFirst(null);
|
||||||
|
} catch (ArgumentNullException) {
|
||||||
|
try {
|
||||||
|
list.AddFirst(list.First);
|
||||||
|
} catch (InvalidOperationException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// RemoveFirst method test
|
||||||
|
int tmp = list.First.Value;
|
||||||
|
list.RemoveFirst();
|
||||||
|
if (list.First.Value == tmp || list.First.Value != 0 * 10)
|
||||||
|
throw new Exception("RemoveFirst method test failed");
|
||||||
|
|
||||||
|
// AddLast method test
|
||||||
|
node = list.AddLast(8);
|
||||||
|
if (list.Last.Value != 8 || node.Value != 8 || node != list.Last)
|
||||||
|
throw new Exception("AddLast method test failed");
|
||||||
|
try {
|
||||||
|
list.AddLast(null);
|
||||||
|
} catch (ArgumentNullException) {
|
||||||
|
try {
|
||||||
|
list.AddLast(list.First);
|
||||||
|
} catch (InvalidOperationException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// RemoveLast method test
|
||||||
|
int tmp2 = list.Last.Value;
|
||||||
|
list.RemoveLast();
|
||||||
|
if (list.Last.Value == tmp2 || list.Last.Value != (list.Count - 1) * 10)
|
||||||
|
throw new Exception("RemoveLast method test failed");
|
||||||
|
|
||||||
|
// AddBefore method test
|
||||||
|
node = list.AddBefore(list.Last, 17);
|
||||||
|
if (list.Last.Previous.Value != 17 || node.Value != 17 || node != list.Last.Previous)
|
||||||
|
throw new Exception("AddBefore method test (1) failed");
|
||||||
|
try {
|
||||||
|
node = null;
|
||||||
|
list.AddBefore(list.Last, node);
|
||||||
|
throw new Exception("AddBefore method test (2) failed");
|
||||||
|
} catch (ArgumentNullException) {
|
||||||
|
try {
|
||||||
|
node = new IntList.IntListNode(1);
|
||||||
|
list.AddBefore(null, node);
|
||||||
|
throw new Exception("AddBefore method test (3) failed");
|
||||||
|
} catch (ArgumentNullException) {
|
||||||
|
try {
|
||||||
|
list.AddBefore(list.Last, list.First);
|
||||||
|
} catch (InvalidOperationException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddAfter method test
|
||||||
|
node = list.AddAfter(list.First, 47);
|
||||||
|
if (list.First.Next.Value != 47 || node.Value != 47 || node != list.First.Next)
|
||||||
|
throw new Exception("AddAfter method test (1) failed");
|
||||||
|
try {
|
||||||
|
node = null;
|
||||||
|
list.AddAfter(list.First.Next, node);
|
||||||
|
throw new Exception("AddAfter method test (2) failed");
|
||||||
|
} catch (ArgumentNullException) {
|
||||||
|
try {
|
||||||
|
list.AddAfter(list.First, list.Last);
|
||||||
|
} catch (InvalidOperationException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find method test
|
||||||
|
node = list.Find(0);
|
||||||
|
if (node == null || node.Value != 0)
|
||||||
|
throw new Exception("Find method test (1) failed");
|
||||||
|
node = list.Find(47);
|
||||||
|
if (node == null || node.Value != 47)
|
||||||
|
throw new Exception("Find method test (2) failed");
|
||||||
|
node = list.Find(190);
|
||||||
|
if (node == null || node.Value != 190)
|
||||||
|
throw new Exception("Find method test (3) failed");
|
||||||
|
node = list.Find(-3);
|
||||||
|
if (node != null)
|
||||||
|
throw new Exception("Find method test (4) failed");
|
||||||
|
|
||||||
|
// Remove method test
|
||||||
|
if (!list.Remove(17) || list.Contains(17) || list.Last.Previous.Value == 17)
|
||||||
|
throw new Exception("Remove method test (1) failed");
|
||||||
|
if (!list.Remove(47) || list.Contains(47) || list.First.Next.Value == 47)
|
||||||
|
throw new Exception("Remove method test (2) failed");
|
||||||
|
if (!list.Remove(0) || list.Contains(0) || list.First.Value == 0)
|
||||||
|
throw new Exception("Remove method test (3) failed");
|
||||||
|
if (!list.Remove(190) || list.Contains(190) || list.Last.Value == 190)
|
||||||
|
throw new Exception("Remove method test (4) failed");
|
||||||
|
try {
|
||||||
|
node = null;
|
||||||
|
list.Remove(node);
|
||||||
|
throw new Exception("Remove method test (5) failed");
|
||||||
|
} catch (ArgumentNullException) {
|
||||||
|
try {
|
||||||
|
node = new IntList.IntListNode(4);
|
||||||
|
list.Remove(node);
|
||||||
|
throw new Exception("Remove method test (5) failed");
|
||||||
|
} catch (InvalidOperationException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ICollection constructor test
|
||||||
|
{
|
||||||
|
int[] intArray = new int[] { 0, 11, 22, 33, 44, 55, 33 };
|
||||||
|
IntList il = new IntList(intArray);
|
||||||
|
if (intArray.Length != il.Count)
|
||||||
|
throw new Exception("ICollection constructor length check failed: " + intArray.Length + "-" + il.Count);
|
||||||
|
node = il.First;
|
||||||
|
for (int i = 0; i < intArray.Length; i++) {
|
||||||
|
if (intArray[i] != node.Value)
|
||||||
|
throw new Exception("ICollection constructor failed, index:" + i);
|
||||||
|
node = node.Next;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
new IntList((System.Collections.ICollection)null);
|
||||||
|
throw new Exception("ICollection constructor null test failed");
|
||||||
|
} catch (ArgumentNullException) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enumerator test
|
||||||
|
{
|
||||||
|
node = list.First;
|
||||||
|
System.Collections.IEnumerator myEnumerator = list.GetEnumerator();
|
||||||
|
while (myEnumerator.MoveNext()) {
|
||||||
|
if ((int)myEnumerator.Current != node.Value)
|
||||||
|
throw new Exception("Enumerator (1) test failed");
|
||||||
|
node = node.Next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
node = list.First;
|
||||||
|
System.Collections.Generic.IEnumerator<int> myEnumerator = list.GetEnumerator();
|
||||||
|
while (myEnumerator.MoveNext()) {
|
||||||
|
if (myEnumerator.Current != node.Value)
|
||||||
|
throw new Exception("Enumerator (2) test failed");
|
||||||
|
node = node.Next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
node = list.First;
|
||||||
|
IntList.IntListEnumerator myEnumerator = list.GetEnumerator();
|
||||||
|
while (myEnumerator.MoveNext()) {
|
||||||
|
if (myEnumerator.Current != node.Value)
|
||||||
|
throw new Exception("Enumerator (3) test failed");
|
||||||
|
node = node.Next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
node = list.First;
|
||||||
|
foreach (var elem in list) {
|
||||||
|
if (elem != node.Value)
|
||||||
|
throw new Exception("Enumerator (4) test failed");
|
||||||
|
node = node.Next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CopyTo method test
|
||||||
|
{
|
||||||
|
int[] outputarray = new int[collectionSize - 2];
|
||||||
|
list.CopyTo(outputarray, 0);
|
||||||
|
int index = 0;
|
||||||
|
IntList.IntListNode temp = list.First;
|
||||||
|
foreach (int val in outputarray) {
|
||||||
|
if (temp.Value != val) {
|
||||||
|
throw new Exception("CopyTo method test (1) failed, index:" + index);
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
temp = temp.Next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
DoubleList inputlist = new DoubleList();
|
||||||
|
int arrayLen = 10;
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
double num = i * 10.1;
|
||||||
|
inputlist.Add(num);
|
||||||
|
}
|
||||||
|
double[] outputarray = new double[arrayLen];
|
||||||
|
inputlist.CopyTo(outputarray, 0);
|
||||||
|
DoubleList.DoubleListNode temp = inputlist.First;
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
if (outputarray[i] != temp.Value)
|
||||||
|
throw new Exception("CopyTo method test (2) failed, index:" + i);
|
||||||
|
temp = temp.Next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
StructList inputlist = new StructList();
|
||||||
|
int arrayLen = 10;
|
||||||
|
for (int i = 0; i < arrayLen; i++)
|
||||||
|
inputlist.Add(new Struct(i / 10.0));
|
||||||
|
Struct[] outputarray = new Struct[arrayLen];
|
||||||
|
inputlist.CopyTo(outputarray, 0);
|
||||||
|
StructList.StructListNode temp = inputlist.First;
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
if (outputarray[i].num != temp.Value.num)
|
||||||
|
throw new Exception("CopyTo method test (3) failed, index:" + i);
|
||||||
|
temp = temp.Next;
|
||||||
|
}
|
||||||
|
foreach (Struct s in inputlist) {
|
||||||
|
s.num += 20.0;
|
||||||
|
}
|
||||||
|
temp = inputlist.First;
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
if (outputarray[i].num != temp.Value.num)
|
||||||
|
throw new Exception("CopyTo method test (4) failed, index:" + i);
|
||||||
|
temp = temp.Next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
list.CopyTo(null, 0);
|
||||||
|
throw new Exception("CopyTo method test (5) failed");
|
||||||
|
} catch (ArgumentNullException) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear() test
|
||||||
|
list.Clear();
|
||||||
|
if (list.Count != 0)
|
||||||
|
throw new Exception("Clear method failed");
|
||||||
|
|
||||||
|
// Finally test the methods being wrapped
|
||||||
|
{
|
||||||
|
IntList il = new IntList();
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
il.Add(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
double x = li_std_list.average(il);
|
||||||
|
x += li_std_list.average(new IntList(new int[] { 1, 2, 3, 4 }));
|
||||||
|
|
||||||
|
DoubleList dlist = new DoubleList();
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
dlist.Add(i / 2.0);
|
||||||
|
}
|
||||||
|
li_std_list.halve_in_place(dlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dispose()
|
||||||
|
{
|
||||||
|
using (StructList ls = new StructList(new Struct[] { new Struct(0.0), new Struct(11.1) }))
|
||||||
|
using (DoubleList ld = new DoubleList(new double[] { 0.0, 11.1 })) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
// More wrapped methods
|
||||||
|
{
|
||||||
|
FloatList l0 = li_std_list.listreal(new FloatList());
|
||||||
|
float flo = 123.456f;
|
||||||
|
l0.Add(flo);
|
||||||
|
flo = l0.First.Value;
|
||||||
|
|
||||||
|
IntList l1 = li_std_list.listint(new IntList());
|
||||||
|
IntPtrList l2 = li_std_list.listintptr(new IntPtrList());
|
||||||
|
IntConstPtrList l3 = li_std_list.listintconstptr(new IntConstPtrList());
|
||||||
|
|
||||||
|
l1.Add(123);
|
||||||
|
l2.Clear();
|
||||||
|
l3.Clear();
|
||||||
|
|
||||||
|
StructList l4 = li_std_list.liststruct(new StructList());
|
||||||
|
StructPtrList l5 = li_std_list.liststructptr(new StructPtrList());
|
||||||
|
StructConstPtrList l6 = li_std_list.liststructconstptr(new StructConstPtrList());
|
||||||
|
|
||||||
|
l4.Add(new Struct(123));
|
||||||
|
l5.Add(new Struct(123));
|
||||||
|
l6.Add(new Struct(123));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test lists of pointers
|
||||||
|
{
|
||||||
|
StructPtrList inputlist = new StructPtrList();
|
||||||
|
int arrayLen = 10;
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
inputlist.Add(new Struct(i / 10.0));
|
||||||
|
}
|
||||||
|
Struct[] outputarray = new Struct[arrayLen];
|
||||||
|
inputlist.CopyTo(outputarray, 0);
|
||||||
|
StructPtrList.StructPtrListNode temp = inputlist.First;
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
if (outputarray[i].num != temp.Value.num)
|
||||||
|
throw new Exception("StructPtrList test (1) failed, i:" + i);
|
||||||
|
temp = temp.Next;
|
||||||
|
}
|
||||||
|
foreach (Struct s in inputlist) {
|
||||||
|
s.num += 20.0;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
if (outputarray[i].num != 20.0 + i / 10.0)
|
||||||
|
throw new Exception("StructPtrList test (2) failed (a deep copy was incorrectly made), i:" + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test lists of const pointers
|
||||||
|
{
|
||||||
|
StructConstPtrList inputlist = new StructConstPtrList();
|
||||||
|
int arrayLen = 10;
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
inputlist.Add(new Struct(i / 10.0));
|
||||||
|
}
|
||||||
|
Struct[] outputarray = new Struct[arrayLen];
|
||||||
|
inputlist.CopyTo(outputarray, 0);
|
||||||
|
StructConstPtrList.StructConstPtrListNode temp = inputlist.First;
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
if (outputarray[i].num != temp.Value.num)
|
||||||
|
throw new Exception("StructConstPtrList test (1) failed, i:" + i);
|
||||||
|
temp = temp.Next;
|
||||||
|
}
|
||||||
|
foreach (Struct s in inputlist) {
|
||||||
|
s.num += 20.0;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < arrayLen; i++) {
|
||||||
|
if (outputarray[i].num != 20.0 + i / 10.0)
|
||||||
|
throw new Exception("StructConstPtrList test (2) failed (a deep copy was incorrectly made), i:" + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
89
Examples/test-suite/csharp/li_std_set_runme.cs
Normal file
89
Examples/test-suite/csharp/li_std_set_runme.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using li_std_setNamespace;
|
||||||
|
|
||||||
|
public class runme
|
||||||
|
{
|
||||||
|
static void checkThat(bool mustBeTrue, string message)
|
||||||
|
{
|
||||||
|
if (!mustBeTrue)
|
||||||
|
throw new Exception("Test that the set " + message + " failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
StringSet ss = new StringSet();
|
||||||
|
|
||||||
|
// Check the interface methods first.
|
||||||
|
ISet<string> s = ss;
|
||||||
|
|
||||||
|
checkThat(s.Count == 0, "is initially empty");
|
||||||
|
checkThat(!s.Contains("key"), "doesn't contain inexistent element");
|
||||||
|
checkThat(!s.Remove("key"), "returns false when removing inexistent element");
|
||||||
|
|
||||||
|
checkThat(s.Add("key"), "returns true when adding a new element");
|
||||||
|
checkThat(!s.Add("key"), "returns false when adding an existing element");
|
||||||
|
checkThat(s.Contains("key"), "contains the just added element");
|
||||||
|
checkThat(s.Remove("key"), "returns true when removing an existing element");
|
||||||
|
checkThat(s.Count == 0, "is empty again");
|
||||||
|
|
||||||
|
checkThat(s.Add("key1"), "Add(key1) returns true");
|
||||||
|
checkThat(s.Add("key2"), "Add(key2) returns true");
|
||||||
|
checkThat(s.Add("key3"), "Add(key3) returns true");
|
||||||
|
|
||||||
|
// Also check a different interface, providing a different Add() (sic!).
|
||||||
|
ICollection<string> coll = ss;
|
||||||
|
coll.Add("key");
|
||||||
|
checkThat(ss.Count == 4, "contains 4 elements");
|
||||||
|
|
||||||
|
// Now use object-specific methods, mimicking HashSet<>.
|
||||||
|
string val;
|
||||||
|
checkThat(ss.TryGetValue("key1", out val), "could retrieve existing item");
|
||||||
|
checkThat(val.Equals("key1"), "value was returned correctly by TryGetValue()");
|
||||||
|
checkThat(!ss.TryGetValue("no-such-key", out val), "couldn't retrieve inexistent item");
|
||||||
|
checkThat(val == null, "value was reset after failed TryGetValue()");
|
||||||
|
|
||||||
|
IList<string> list = new List<string>();
|
||||||
|
foreach (string str in ss) {
|
||||||
|
list.Add(str);
|
||||||
|
}
|
||||||
|
checkThat(list.Count == 4, "copy contains 4 elements");
|
||||||
|
|
||||||
|
ss.Clear();
|
||||||
|
checkThat(ss.Count == 0, "is empty after Clear()");
|
||||||
|
|
||||||
|
// Check set-theoretic methods.
|
||||||
|
checkThat(new StringSet().SetEquals(new StringSet()), "SetEquals() works for empty sets");
|
||||||
|
checkThat(new StringSet{"foo"}.SetEquals(new StringSet{"foo"}), "SetEquals() works for non-empty sets");
|
||||||
|
checkThat(!new StringSet{"foo"}.SetEquals(new[] {"bar"}), "SetEquals() doesn't always return true");
|
||||||
|
|
||||||
|
ss = new StringSet{"foo", "bar", "baz"};
|
||||||
|
ss.ExceptWith(new[] {"baz", "quux"});
|
||||||
|
checkThat(ss.SetEquals(new[] {"foo", "bar"}), "ExceptWith works");
|
||||||
|
|
||||||
|
ss = new StringSet{"foo", "bar", "baz"};
|
||||||
|
ss.IntersectWith(new[] {"baz", "quux"});
|
||||||
|
checkThat(ss.SetEquals(new[] {"baz"}), "IntersectWith works");
|
||||||
|
|
||||||
|
checkThat(ss.IsProperSubsetOf(new[] {"bar", "baz"}), "IsProperSubsetOf works");
|
||||||
|
checkThat(!ss.IsProperSubsetOf(new[] {"baz"}), "!IsProperSubsetOf works");
|
||||||
|
checkThat(ss.IsSubsetOf(new[] {"bar", "baz"}), "IsSubsetOf works");
|
||||||
|
checkThat(!ss.IsSubsetOf(new[] {"bar"}), "!IsSubsetOf works");
|
||||||
|
|
||||||
|
ss = new StringSet{"foo", "bar", "baz"};
|
||||||
|
checkThat(ss.IsProperSupersetOf(new[] {"bar"}), "IsProperSupersetOf works");
|
||||||
|
checkThat(!ss.IsProperSupersetOf(new[] {"quux"}), "IsProperSupersetOf works");
|
||||||
|
checkThat(ss.IsSupersetOf(new[] {"foo", "bar", "baz"}), "IsProperSupersetOf works");
|
||||||
|
checkThat(!ss.IsSupersetOf(new[] {"foo", "bar", "baz", "quux"}), "IsProperSupersetOf works");
|
||||||
|
|
||||||
|
checkThat(ss.Overlaps(new[] {"foo"}), "Overlaps works");
|
||||||
|
checkThat(!ss.Overlaps(new[] {"moo"}), "!Overlaps works");
|
||||||
|
|
||||||
|
ss.SymmetricExceptWith(new[] {"baz", "quux"});
|
||||||
|
checkThat(ss.SetEquals(new[] {"foo", "bar", "quux"}), "SymmetricExceptWith works");
|
||||||
|
|
||||||
|
ss = new StringSet{"foo", "bar", "baz"};
|
||||||
|
ss.UnionWith(new[] {"baz", "quux"});
|
||||||
|
checkThat(ss.SetEquals(new[] {"foo", "bar", "baz", "quux"}), "UnionWith works");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -104,6 +104,9 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// @return This is a bad place for this tag, but it should be ignored.
|
||||||
|
struct StructWithReturnComment {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
An example of a list in a documentation comment.
|
An example of a list in a documentation comment.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,4 +32,9 @@
|
||||||
SOME_ITEM_30 ///< Post comment for the third item
|
SOME_ITEM_30 ///< Post comment for the third item
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum SomeEnumWithTrailingComma
|
||||||
|
{
|
||||||
|
SOME_ITEM_100, ///< Post comment after comma.
|
||||||
|
SOME_ITEM_200, ///< Post comment after last comma.
|
||||||
|
};
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
%module doxygen_translate
|
%module doxygen_translate
|
||||||
|
|
||||||
|
#if defined(SWIGJAVA)
|
||||||
|
%javamethodmodifiers function "@Deprecated\npublic"
|
||||||
|
#endif
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
%module doxygen_translate_all_tags
|
%module doxygen_translate_all_tags
|
||||||
|
|
||||||
|
#if defined(SWIGJAVA)
|
||||||
|
%javamethodmodifiers func02 "@Deprecated\npublic"
|
||||||
|
#endif
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,11 @@ SWIG_LIB_SET = @SWIG_LIB_SET@
|
||||||
SWIGINVOKE = $(SWIG_LIB_SET) $(SWIGTOOL) $(SWIGEXE)
|
SWIGINVOKE = $(SWIG_LIB_SET) $(SWIGTOOL) $(SWIGEXE)
|
||||||
|
|
||||||
# All .i files with prefix 'cpp_' will be treated as C++ input and remaining .i files as C input
|
# All .i files with prefix 'cpp_' will be treated as C++ input and remaining .i files as C input
|
||||||
ALL_ERROR_TEST_CASES := $(patsubst %.i,%, $(notdir $(wildcard $(srcdir)/*.i)))
|
ALL_ERROR_TEST_CASES := $(sort $(patsubst %.i,%, $(notdir $(wildcard $(srcdir)/*.i))))
|
||||||
CPP_ERROR_TEST_CASES := $(filter cpp_%, $(ALL_ERROR_TEST_CASES))
|
CPP_ERROR_TEST_CASES := $(sort $(filter cpp_%, $(ALL_ERROR_TEST_CASES)))
|
||||||
C_ERROR_TEST_CASES := $(filter-out $(CPP_ERROR_TEST_CASES), $(ALL_ERROR_TEST_CASES))
|
C_ERROR_TEST_CASES := $(sort $(filter-out $(CPP_ERROR_TEST_CASES), $(ALL_ERROR_TEST_CASES)))
|
||||||
DOXYGEN_ERROR_TEST_CASES := $(filter doxygen_%, $(C_ERROR_TEST_CASES))
|
DOXYGEN_ERROR_TEST_CASES := $(sort $(filter doxygen_%, $(C_ERROR_TEST_CASES)))
|
||||||
C_ERROR_TEST_CASES := $(filter-out $(DOXYGEN_ERROR_TEST_CASES), $(C_ERROR_TEST_CASES))
|
C_ERROR_TEST_CASES := $(sort $(filter-out $(DOXYGEN_ERROR_TEST_CASES), $(C_ERROR_TEST_CASES)))
|
||||||
|
|
||||||
# Always use C++ for Doxygen tests, there doesn't seem to be any need to
|
# Always use C++ for Doxygen tests, there doesn't seem to be any need to
|
||||||
# distinguish between C and C++ Doxygen tests.
|
# distinguish between C and C++ Doxygen tests.
|
||||||
|
|
|
||||||
1
Examples/test-suite/errors/cpp_final_destructor.stderr
Normal file
1
Examples/test-suite/errors/cpp_final_destructor.stderr
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
cpp_final_destructor.i:7: Warning 525: Destructor BaseFinal::~BaseFinal() is final, BaseFinal cannot be a director class.
|
||||||
14
Examples/test-suite/errors/pp_unknowndirective3.i
Normal file
14
Examples/test-suite/errors/pp_unknowndirective3.i
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
%module xxx
|
||||||
|
|
||||||
|
// Testing is_digits detecting gcc linemarkers
|
||||||
|
|
||||||
|
// These are valid
|
||||||
|
# 1 "/usr/include/stdc-predef.h" 1 3 4
|
||||||
|
# 123 "header1.h"
|
||||||
|
|
||||||
|
// These are invalid
|
||||||
|
#a1 'a.h'
|
||||||
|
#1b 'b.h'
|
||||||
|
#1c1 'c.h'
|
||||||
|
#d1d 'd.h'
|
||||||
|
|
||||||
4
Examples/test-suite/errors/pp_unknowndirective3.stderr
Normal file
4
Examples/test-suite/errors/pp_unknowndirective3.stderr
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
pp_unknowndirective3.i:10: Error: Unknown SWIG preprocessor directive: a1 (if this is a block of target language code, delimit it with %{ and %})
|
||||||
|
pp_unknowndirective3.i:11: Error: Unknown SWIG preprocessor directive: 1b (if this is a block of target language code, delimit it with %{ and %})
|
||||||
|
pp_unknowndirective3.i:12: Error: Unknown SWIG preprocessor directive: 1c1 (if this is a block of target language code, delimit it with %{ and %})
|
||||||
|
pp_unknowndirective3.i:13: Error: Unknown SWIG preprocessor directive: d1d (if this is a block of target language code, delimit it with %{ and %})
|
||||||
|
|
@ -73,7 +73,18 @@ INCLUDES = -I$(abs_top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)
|
||||||
|
|
||||||
%.multicpptest:
|
%.multicpptest:
|
||||||
$(setup)
|
$(setup)
|
||||||
+$(swig_and_compile_multi_cpp)
|
mkdir -p gopath/$*/src 2>/dev/null || true
|
||||||
|
if ! test -d gopath/$*/src/swigtests; then \
|
||||||
|
(cd gopath/$*/src && ln -s . swigtests); \
|
||||||
|
fi
|
||||||
|
+for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
|
||||||
|
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
|
||||||
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
|
LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
|
||||||
|
TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \
|
||||||
|
GOMOD="$*" \
|
||||||
|
$(LANGUAGE)$(VARIANT)_cpp; \
|
||||||
|
done
|
||||||
$(run_multi_testcase)
|
$(run_multi_testcase)
|
||||||
|
|
||||||
li_windows.cpptest:
|
li_windows.cpptest:
|
||||||
|
|
@ -82,50 +93,55 @@ li_windows.cpptest:
|
||||||
|
|
||||||
multi_import.multicpptest:
|
multi_import.multicpptest:
|
||||||
$(setup)
|
$(setup)
|
||||||
|
mkdir -p gopath/multi_import/src 2>/dev/null || true
|
||||||
|
if ! test -d gopath/multi_import/src/swigtests; then \
|
||||||
|
(cd gopath/multi_import/src && ln -s . swigtests); \
|
||||||
|
fi
|
||||||
for f in multi_import_b multi_import_a; do \
|
for f in multi_import_b multi_import_a; do \
|
||||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
|
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
|
LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
|
||||||
TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \
|
TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \
|
||||||
|
GOMOD="multi_import" \
|
||||||
$(LANGUAGE)$(VARIANT)_cpp; \
|
$(LANGUAGE)$(VARIANT)_cpp; \
|
||||||
done
|
done
|
||||||
$(run_multi_testcase)
|
$(run_multi_testcase)
|
||||||
|
|
||||||
go_subdir_import.multicpptest:
|
go_subdir_import.multicpptest:
|
||||||
$(setup)
|
$(setup)
|
||||||
mkdir -p testdir/go_subdir_import/
|
mkdir -p gopath/go_subdir_import/src 2>/dev/null || true
|
||||||
mkdir -p gopath/src/testdir/go_subdir_import/
|
if ! test -d gopath/go_subdir_import/src/swigtests; then \
|
||||||
|
(cd gopath/go_subdir_import/src && ln -s . swigtests); \
|
||||||
|
fi
|
||||||
|
mkdir -p testdir/go_subdir_import 2>/dev/null || true
|
||||||
|
mkdir -p gopath/go_subdir_import/src/testdir/go_subdir_import 2>/dev/null || true
|
||||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
|
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
LIBS='$(LIBS)' INTERFACEPATH='$(SRCDIR)$(INTERFACEDIR)go_subdir_import_b.i' \
|
LIBS='$(LIBS)' INTERFACEPATH='$(SRCDIR)$(INTERFACEDIR)go_subdir_import_b.i' \
|
||||||
INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT) -outdir .' NOLINK=true \
|
INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT) -outdir .' NOLINK=true \
|
||||||
TARGET='$(TARGETPREFIX)go_subdir_import_b$(TARGETSUFFIX)' INTERFACEDIR='$(INTERFACEDIR)' \
|
TARGET='$(TARGETPREFIX)go_subdir_import_b$(TARGETSUFFIX)' INTERFACEDIR='$(INTERFACEDIR)' \
|
||||||
INTERFACE='testdir/go_subdir_import/go_subdir_import_b.i' \
|
INTERFACE='testdir/go_subdir_import/go_subdir_import_b.i' \
|
||||||
|
GOMOD="go_subdir_import" \
|
||||||
$(LANGUAGE)$(VARIANT)_cpp;
|
$(LANGUAGE)$(VARIANT)_cpp;
|
||||||
for f in testdir/go_subdir_import/go_subdir_import_c go_subdir_import_a ; do \
|
for f in testdir/go_subdir_import/go_subdir_import_c go_subdir_import_a ; do \
|
||||||
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
|
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' \
|
||||||
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
|
||||||
LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
|
LIBS='$(LIBS)' INCLUDES='$(INCLUDES)' SWIGOPT='$(SWIGOPT)' NOLINK=true \
|
||||||
TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \
|
TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR='$(INTERFACEDIR)' INTERFACE="$$f.i" \
|
||||||
|
GOMOD="go_subdir_import" \
|
||||||
$(LANGUAGE)$(VARIANT)_cpp; \
|
$(LANGUAGE)$(VARIANT)_cpp; \
|
||||||
done
|
done
|
||||||
if $(GOGCC); then \
|
|
||||||
cp gopath/src/testdir/go_subdir_import/go_subdir_import_b/go_subdir_import_b.a gopath/src/testdir/go_subdir_import/go_subdir_import_b.gox; \
|
|
||||||
cp gopath/src/testdir/go_subdir_import/go_subdir_import_b/go_subdir_import_b.a .; \
|
|
||||||
cp gopath/src/testdir/go_subdir_import/go_subdir_import_c/go_subdir_import_c.a gopath/src/testdir/go_subdir_import/go_subdir_import_c.gox; \
|
|
||||||
cp gopath/src/testdir/go_subdir_import/go_subdir_import_c/go_subdir_import_c.a testdir/go_subdir_import/; \
|
|
||||||
fi
|
|
||||||
$(run_multi_testcase)
|
$(run_multi_testcase)
|
||||||
|
|
||||||
# Runs the testcase.
|
# Runs the testcase.
|
||||||
run_testcase = \
|
run_testcase = \
|
||||||
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||||
if $(GOGCC) ; then \
|
if $(GOGCC) ; then \
|
||||||
$(COMPILETOOL) $(GCCGO) -c -g -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
$(COMPILETOOL) $(GCCGO) -c -g -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||||
$(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.a; \
|
$(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ gopath/src/$*/$*.a; \
|
||||||
elif $(GO12) || $(GO13) || $(GO15); then \
|
elif $(GO12) || $(GO13) || $(GO15); then \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld $(CC) -extldflags "$(CFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L gopath/src/$* -linkmode external -extld $(CC) -extldflags "$(CFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
||||||
else \
|
else \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
||||||
|
|
@ -136,11 +152,11 @@ run_testcase = \
|
||||||
run_testcase_cpp = \
|
run_testcase_cpp = \
|
||||||
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||||
if $(GOGCC) ; then \
|
if $(GOGCC) ; then \
|
||||||
$(COMPILETOOL) $(GCCGO) -c -g -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
$(COMPILETOOL) $(GCCGO) -c -g -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||||
$(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.a -lstdc++; \
|
$(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ gopath/src/$*/$*.a -lstdc++; \
|
||||||
elif $(GO12) || $(GO13) || $(GO15); then \
|
elif $(GO12) || $(GO13) || $(GO15); then \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I gopath/src/$* $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L gopath/src/$* -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
||||||
else \
|
else \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
||||||
|
|
@ -150,18 +166,24 @@ run_testcase_cpp = \
|
||||||
|
|
||||||
run_multi_testcase = \
|
run_multi_testcase = \
|
||||||
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
if test -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
|
||||||
if $(GOGCC) ; then \
|
if $(GO15) || $(GOGCC); then \
|
||||||
$(COMPILETOOL) $(GCCGO) -c -g -I . -I gopath/src $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
|
||||||
files=`cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list`; \
|
files=`cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list`; \
|
||||||
$(COMPILETOOL) $(GCCGO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ `for f in $$files; do echo $$f.a; done` -lstdc++; \
|
mkdir gopath/$*/src/$* 2>/dev/null || true; \
|
||||||
elif $(GO12) || $(GO13) || $(GO15); then \
|
cp $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) gopath/$*/src/$*; \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
GOPATH="`pwd`/gopath/$*"; \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -linkmode external -extld $(CXX) -extldflags "$(CXXFLAGS) $(OSXOLDGOLINKFLAGS)" -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
export GOPATH; \
|
||||||
else \
|
CGO_CPPFLAGS="$(CPPFLAGS) $(INCLUDES) `for f in $$files; do echo -I ../$$f; done`"; \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
|
export CGO_CPPFLAGS; \
|
||||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT:-`go env GOROOT`}/pkg/$${GOOS:-`go env GOOS`}_$${GOARCH:-`go env GOARCH`}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
|
CGO_CFLAGS="$(CFLAGS)"; \
|
||||||
fi && \
|
export CGO_CFLAGS; \
|
||||||
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \
|
CGO_CXXFLAGS="$(CXXFLAGS)"; \
|
||||||
|
export CGO_CXXFLAGS; \
|
||||||
|
CGO_LDFLAGS="$(LDFLAGS) -lm"; \
|
||||||
|
export CGO_LDFLAGS; \
|
||||||
|
(cd gopath/$*/src/$* && \
|
||||||
|
$(GO) build `if $(GOGCC); then echo -compiler=gccgo; fi` -o ../../../../$*_runme) && \
|
||||||
|
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \
|
||||||
|
fi; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%.clean:
|
%.clean:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "./abstract_access"
|
import "abstract_access"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
d := abstract_access.NewD()
|
d := abstract_access.NewD()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "./abstract_typedef2"
|
import "abstract_typedef2"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
abstract_typedef2.NewA_UF()
|
abstract_typedef2.NewA_UF()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "./abstract_typedef"
|
import "abstract_typedef"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
e := abstract_typedef.NewEngine()
|
e := abstract_typedef.NewEngine()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "./abstract_virtual"
|
import "abstract_virtual"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
abstract_virtual.NewD()
|
abstract_virtual.NewD()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import wrap "./argout"
|
import wrap "argout"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ip := wrap.New_intp()
|
ip := wrap.New_intp()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import . "./array_member"
|
import . "array_member"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
f := NewFoo()
|
f := NewFoo()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import . "./arrays_global"
|
import . "arrays_global"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
SetArray_i(GetArray_const_i())
|
SetArray_i(GetArray_const_i())
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import . "./char_binary"
|
import . "char_binary"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
t := NewTest()
|
t := NewTest()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "./class_ignore"
|
import "class_ignore"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
a := class_ignore.NewBar()
|
a := class_ignore.NewBar()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "./class_scope_weird"
|
import "class_scope_weird"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
f := class_scope_weird.NewFoo()
|
f := class_scope_weird.NewFoo()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import . "./compactdefaultargs"
|
import . "compactdefaultargs"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
defaults1 := NewDefaults1(1000)
|
defaults1 := NewDefaults1(1000)
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"./constover"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"constover"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import . "./constructor_copy"
|
import . "constructor_copy"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
f1 := NewFoo1(3)
|
f1 := NewFoo1(3)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "./contract"
|
import "contract"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
contract.Test_preassert(1, 2)
|
contract.Test_preassert(1, 2)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
import . "./cpp11_strongly_typed_enumerations"
|
import . "cpp11_strongly_typed_enumerations"
|
||||||
|
|
||||||
func enumCheck(actual int, expected int) int {
|
func enumCheck(actual int, expected int) int {
|
||||||
if actual != expected {
|
if actual != expected {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "./cpp_enum"
|
import "cpp_enum"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
f := cpp_enum.NewFoo()
|
f := cpp_enum.NewFoo()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Note: This example assumes that namespaces are flattened
|
// Note: This example assumes that namespaces are flattened
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "./cpp_namespace"
|
import "cpp_namespace"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
n := cpp_namespace.Fact(4)
|
n := cpp_namespace.Fact(4)
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue