Merge branch 'master' into doxygen
Fix the usual conflicts in autodoc unit test due to fixing the divergences in autodoc generation between builtin and default cases in this branch.
This commit is contained in:
commit
db65ae5aea
371 changed files with 9776 additions and 3152 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -66,6 +66,7 @@ CCache/ccache_swig_config.h
|
|||
CCache/config.h
|
||||
CCache/config.log
|
||||
CCache/config.status
|
||||
CCache/config_win32.h
|
||||
Examples/Makefile
|
||||
Examples/d/example.mk
|
||||
Examples/guile/Makefile
|
||||
|
|
@ -85,6 +86,8 @@ swig.spec
|
|||
# Build Artifacts
|
||||
.dirstamp
|
||||
CCache/ccache-swig
|
||||
CCache/ccache-swig.1
|
||||
CCache/web/ccache-swig-man.html
|
||||
Lib/swigwarn.swg
|
||||
Source/CParse/parser.c
|
||||
Source/CParse/parser.h
|
||||
|
|
|
|||
50
.travis.yml
50
.travis.yml
|
|
@ -6,9 +6,6 @@ matrix:
|
|||
env: SWIGLANG=
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- compiler: gcc
|
||||
os: linux
|
||||
env: SWIGLANG=
|
||||
- compiler: gcc
|
||||
os: linux
|
||||
env: SWIGLANG=
|
||||
|
|
@ -55,6 +52,8 @@ matrix:
|
|||
- compiler: gcc
|
||||
os: linux
|
||||
env: SWIGLANG=javascript ENGINE=node
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- compiler: gcc
|
||||
os: linux
|
||||
env: SWIGLANG=javascript ENGINE=jsc
|
||||
|
|
@ -75,6 +74,11 @@ matrix:
|
|||
env: SWIGLANG=lua VER=5.3
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- compiler: gcc
|
||||
os: linux
|
||||
env: SWIGLANG=ocaml
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- compiler: gcc
|
||||
os: linux
|
||||
env: SWIGLANG=octave SWIGJOBS=-j2 # 3.8
|
||||
|
|
@ -160,6 +164,14 @@ matrix:
|
|||
env: SWIGLANG=python SWIG_FEATURES=-builtin
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=python SWIG_FEATURES=-builtin SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=python SWIG_FEATURES=-builtin SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1 PY3=3 VER=3.5
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- compiler: gcc
|
||||
os: linux
|
||||
env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.4
|
||||
|
|
@ -219,6 +231,10 @@ matrix:
|
|||
env: SWIGLANG=csharp SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=go SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=java SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
||||
sudo: required
|
||||
|
|
@ -227,10 +243,26 @@ matrix:
|
|||
env: SWIGLANG=python SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=r CPP11=1 # Note: making 'R CMD SHLIB' use a different compiler is non-trivial
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=ruby SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=tcl SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=csharp SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=go SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=java SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
||||
sudo: required
|
||||
|
|
@ -239,6 +271,14 @@ matrix:
|
|||
env: SWIGLANG=python SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=ruby SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- os: linux
|
||||
env: SWIGLANG=tcl SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1
|
||||
sudo: required
|
||||
dist: trusty
|
||||
- compiler: gcc
|
||||
os: osx
|
||||
env: SWIGLANG=
|
||||
|
|
@ -280,6 +320,10 @@ matrix:
|
|||
env: SWIGLANG=tcl
|
||||
|
||||
allow_failures:
|
||||
# Started failing after upgrade from Guile 2.0.14 to Guile 2.2.0
|
||||
- compiler: clang
|
||||
os: osx
|
||||
env: SWIGLANG=guile
|
||||
# Lots of failing tests currently
|
||||
- compiler: gcc
|
||||
os: linux
|
||||
|
|
|
|||
8
ANNOUNCE
8
ANNOUNCE
|
|
@ -1,8 +1,8 @@
|
|||
*** ANNOUNCE: SWIG 3.0.13 (in progress) ***
|
||||
*** ANNOUNCE: SWIG 4.0.0 (in progress) ***
|
||||
|
||||
http://www.swig.org
|
||||
|
||||
We're pleased to announce SWIG-3.0.13, the latest SWIG release.
|
||||
We're pleased to announce SWIG-4.0.0, the latest SWIG release.
|
||||
|
||||
What is SWIG?
|
||||
=============
|
||||
|
|
@ -27,11 +27,11 @@ Availability
|
|||
============
|
||||
The release is available for download on Sourceforge at
|
||||
|
||||
http://prdownloads.sourceforge.net/swig/swig-3.0.13.tar.gz
|
||||
http://prdownloads.sourceforge.net/swig/swig-4.0.0.tar.gz
|
||||
|
||||
A Windows version is also available at
|
||||
|
||||
http://prdownloads.sourceforge.net/swig/swigwin-3.0.13.zip
|
||||
http://prdownloads.sourceforge.net/swig/swigwin-4.0.0.zip
|
||||
|
||||
Please report problems with this release to the swig-devel mailing list,
|
||||
details at http://www.swig.org/mail.html.
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ bindir=@bindir@
|
|||
mandir=@mandir@
|
||||
INSTALLCMD=@INSTALL@
|
||||
PACKAGE_NAME=@PACKAGE_NAME@
|
||||
PROGRAM_NAME=@PROGRAM_NAME@
|
||||
# Soft link test can be skipped on systems that don't support soft linking
|
||||
NOSOFTLINKSTEST=
|
||||
|
||||
|
|
@ -17,13 +18,10 @@ SWIG=swig
|
|||
SWIG_LIB=../$(srcdir)/../Lib
|
||||
EXEEXT=@EXEEXT@
|
||||
|
||||
# Use standard autoconf approach to transform executable name using --program-prefix and --program-suffix
|
||||
transform = @program_transform_name@
|
||||
|
||||
LIBS= @LIBS@
|
||||
OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \
|
||||
cleanup.o snprintf.o unify.o
|
||||
HEADERS = ccache.h mdfour.h
|
||||
HEADERS = ccache.h mdfour.h config.h config_win32.h
|
||||
|
||||
all: $(PACKAGE_NAME)$(EXEEXT)
|
||||
|
||||
|
|
@ -32,7 +30,7 @@ Makefile: $(srcdir)/Makefile.in ./config.status
|
|||
$(SHELL) ./config.status
|
||||
|
||||
# Note that HTML documentation is actually generated and used from the main SWIG documentation Makefile
|
||||
docs: $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/ccache-man.html
|
||||
docs: $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/$(PACKAGE_NAME)-man.html
|
||||
|
||||
$(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
||||
|
|
@ -40,40 +38,43 @@ $(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS)
|
|||
$(srcdir)/$(PACKAGE_NAME).1: $(srcdir)/ccache.yo
|
||||
-yodl2man -o $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/ccache.yo
|
||||
|
||||
$(srcdir)/web/ccache-man.html: $(srcdir)/ccache.yo
|
||||
yodl2html -o $(srcdir)/web/ccache-man.html $(srcdir)/ccache.yo
|
||||
$(srcdir)/web/$(PACKAGE_NAME)-man.html: $(srcdir)/ccache.yo
|
||||
yodl2html -o $(srcdir)/web/$(PACKAGE_NAME)-man.html $(srcdir)/ccache.yo
|
||||
|
||||
install: $(PACKAGE_NAME)$(EXEEXT)
|
||||
@echo "Installing $(PACKAGE_NAME)"
|
||||
@echo "Installing $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)"
|
||||
@echo "Installing $(DESTDIR)${bindir}/$(PROGRAM_NAME)$(EXEEXT)"
|
||||
${INSTALLCMD} -d $(DESTDIR)${bindir}
|
||||
${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)
|
||||
${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/$(PROGRAM_NAME)$(EXEEXT)
|
||||
|
||||
install-docs: $(srcdir)/$(PACKAGE_NAME).1
|
||||
@echo "Installing $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1"
|
||||
@echo "Installing $(DESTDIR)${mandir}/man1/$(PROGRAM_NAME).1"
|
||||
${INSTALLCMD} -d $(DESTDIR)${mandir}/man1
|
||||
${INSTALLCMD} -m 644 $(srcdir)/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1
|
||||
${INSTALLCMD} -m 644 $(srcdir)/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/$(PROGRAM_NAME).1
|
||||
|
||||
uninstall: $(PACKAGE_NAME)$(EXEEXT)
|
||||
rm -f $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)
|
||||
rm -f $(DESTDIR)${bindir}/$(PROGRAM_NAME)$(EXEEXT)
|
||||
|
||||
uninstall-docs: $(srcdir)/$(PACKAGE_NAME).1
|
||||
rm -f $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1
|
||||
rm -f $(DESTDIR)${mandir}/man1/$(PROGRAM_NAME).1
|
||||
|
||||
clean:
|
||||
clean: clean-docs
|
||||
/bin/rm -f $(OBJS) *~ $(PACKAGE_NAME)$(EXEEXT)
|
||||
|
||||
clean-docs:
|
||||
rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/$(PACKAGE_NAME)-man.html
|
||||
|
||||
test: test.sh
|
||||
SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' $(srcdir)/test.sh
|
||||
SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' CCACHE='../$(PACKAGE_NAME)' CCACHE_PROG=$(PROGRAM_NAME) $(srcdir)/test.sh
|
||||
|
||||
check: test
|
||||
|
||||
distclean: clean
|
||||
/bin/rm -f Makefile config.h config.sub config.log build-stamp config.status ccache_swig_config.h
|
||||
/bin/rm -f Makefile config.h config.sub config.log build-stamp config.status ccache_swig_config.h config_win32.h
|
||||
/bin/rm -rf autom4te.cache
|
||||
|
||||
maintainer-clean: distclean
|
||||
/bin/rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/ccache-man.html
|
||||
/bin/rm -f $(srcdir)/$(PACKAGE_NAME).1 $(srcdir)/web/$(PACKAGE_NAME)-man.html
|
||||
|
||||
|
||||
# FIXME: To fix this, test.sh needs to be able to take ccache from the
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "config.h"
|
||||
#else
|
||||
#include <sys/locking.h>
|
||||
#define PACKAGE_NAME "ccache-swig.exe"
|
||||
#include "config_win32.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
#define STATUS_FATAL 4
|
||||
#define STATUS_NOCACHE 5
|
||||
|
||||
#define MYNAME PACKAGE_NAME
|
||||
#define MYNAME PROGRAM_NAME
|
||||
|
||||
#define LIMIT_MULTIPLE 0.8
|
||||
|
||||
|
|
|
|||
3
CCache/config_win32.h.in
Normal file
3
CCache/config_win32.h.in
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#if !defined(PROGRAM_NAME)
|
||||
#define PROGRAM_NAME "@PROGRAM_NAME@.exe"
|
||||
#endif
|
||||
|
|
@ -7,6 +7,7 @@ AC_CONFIG_SRCDIR([ccache.h])
|
|||
AC_MSG_NOTICE([Configuring ccache])
|
||||
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_FILES([config_win32.h])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
|
|
@ -14,6 +15,20 @@ AC_PROG_CPP
|
|||
AC_PROG_INSTALL
|
||||
AC_ARG_PROGRAM # for program_transform_name
|
||||
|
||||
AC_SUBST(PROGRAM_NAME)
|
||||
if test "x$program_prefix" != "xNONE" -a "x$program_prefix" != "x"
|
||||
then
|
||||
PROGRAM_NAME="$program_prefix$PACKAGE_NAME"
|
||||
else
|
||||
PROGRAM_NAME="$PACKAGE_NAME"
|
||||
fi
|
||||
if test "x$program_suffix" != "xNONE" -a "x$program_suffix" != "x"
|
||||
then
|
||||
PROGRAM_NAME="$PROGRAM_NAME$program_suffix"
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(PROGRAM_NAME, "$PROGRAM_NAME", [Define my program name])
|
||||
|
||||
AC_DEFINE([_GNU_SOURCE], 1,
|
||||
[Define _GNU_SOURCE so that we get all necessary prototypes])
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,12 @@ fi
|
|||
PATH="`echo $PATH | \
|
||||
sed -e 's!:/usr\(/local\)*/lib\([0-9]\)*/ccache\(/\)*!!g'`"
|
||||
|
||||
CCACHE=../ccache-swig
|
||||
if test -n "$CCACHE"; then
|
||||
CCACHE="$CCACHE"
|
||||
else
|
||||
CCACHE=../ccache-swig
|
||||
fi
|
||||
|
||||
TESTDIR=test.$$
|
||||
|
||||
test_failed() {
|
||||
|
|
@ -406,6 +411,10 @@ swigtests() {
|
|||
# main program
|
||||
rm -rf $TESTDIR
|
||||
mkdir $TESTDIR
|
||||
if test -n "$CCACHE_PROG"; then
|
||||
ln -s $CCACHE $TESTDIR/$CCACHE_PROG
|
||||
CCACHE=./$CCACHE_PROG
|
||||
fi
|
||||
cd $TESTDIR || exit 1
|
||||
|
||||
unset CCACHE_DIR
|
||||
|
|
|
|||
4
CHANGES
4
CHANGES
|
|
@ -5,7 +5,7 @@ See the RELEASENOTES file for a summary of changes in each release.
|
|||
Issue # numbers mentioned below can be found on Github. For more details, add
|
||||
the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
||||
|
||||
Version 3.0.13 (27 Jan 2017)
|
||||
Version 3.0.12 (27 Jan 2017)
|
||||
============================
|
||||
|
||||
2017-01-27: wsfulton
|
||||
|
|
@ -21116,7 +21116,7 @@ Version 1.3.7 (September 3, 2001)
|
|||
typedef __name vector<T>;
|
||||
%enddef
|
||||
|
||||
An a specific instantiation is created in exactly the same way:
|
||||
A specific instantiation is created in exactly the same way:
|
||||
|
||||
%template(intvec) vector<int>;
|
||||
|
||||
|
|
|
|||
435
CHANGES.current
435
CHANGES.current
|
|
@ -4,6 +4,437 @@ See the RELEASENOTES file for a summary of changes in each release.
|
|||
Issue # numbers mentioned below can be found on Github. For more details, add
|
||||
the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
||||
|
||||
Version 3.0.13 (in progress)
|
||||
============================
|
||||
Version 4.0.0 (in progress)
|
||||
===========================
|
||||
|
||||
2017-09-18: wsfulton
|
||||
Fix type promotion wrapping constant expressions of the form:
|
||||
# define EXPR_MIXED1 (0x80 + 11.1) - 1
|
||||
This was previously an integral type instead of a floating point type.
|
||||
|
||||
2017-09-17: wsfulton
|
||||
Fix generated code for constant expressions containing wchar_t L literals such as:
|
||||
# define __WCHAR_MAX (0x7fffffff + L'\0')
|
||||
# define __WCHAR_MIN (-__WCHAR_MAX - 1)
|
||||
|
||||
2017-09-10: mlamarre
|
||||
[Python] Patch #1083. Define_DEBUG to 1 to do exactly like Visual Studio
|
||||
/LDd, /MDd or /MTd compiler options.
|
||||
|
||||
2017-08-25: wsfulton
|
||||
Issue #1059. Add support for C++11 ref-qualifiers on non-static member functions.
|
||||
Members with lvalue ref-qualifiers such as:
|
||||
|
||||
struct RQ {
|
||||
void m1(int x) &;
|
||||
void m2(int x) const &;
|
||||
};
|
||||
|
||||
are wrapped like any other member function. Member functions with rvalue ref-qualifiers
|
||||
are ignored by default, such as:
|
||||
|
||||
struct RQ {
|
||||
void m3(int x) &&;
|
||||
void m4(int x) const &&;
|
||||
};
|
||||
|
||||
example.i:7: Warning 405: Method with rvalue ref-qualifier m3(int) && ignored.
|
||||
example.i:8: Warning 405: Method with rvalue ref-qualifier m4(int) const && ignored.
|
||||
|
||||
These can be unignored and exposed to the target language, see further documentation in
|
||||
CPlusPlus11.html.
|
||||
|
||||
2017-08-16: wsfulton
|
||||
Fix #1063. Add using declarations to templates into typedef table.
|
||||
|
||||
Using declarations to templates were missing in SWIG's internal typedef tables.
|
||||
This led to a few problems, such as, templates that did not instantiate and generated
|
||||
C++ code that did not compile as SWIG did not know what scope the template was
|
||||
in. This happened mostly when a using declaration was used on a template type in a
|
||||
completely unrelated namespace.
|
||||
|
||||
2017-08-16: wsfulton
|
||||
Fix type lookup in the presence of using directives and using declarations.
|
||||
|
||||
Fix some cases of type lookup failure via a combination of both using directives and
|
||||
using declarations resulting in C++ code that did not compile as the generated type was
|
||||
not fully qualified for use in the global namespace. Example below:
|
||||
|
||||
namespace Space5 {
|
||||
namespace SubSpace5 {
|
||||
namespace SubSubSpace5 {
|
||||
struct F {};
|
||||
}
|
||||
}
|
||||
using namespace SubSpace5;
|
||||
using SubSubSpace5::F;
|
||||
void func(SubSubSpace5::F f);
|
||||
}
|
||||
|
||||
2017-08-16: wsfulton
|
||||
Issue #1051. %template scope enforcement and class definition fixes.
|
||||
|
||||
The scoping rules around %template have been specified and enforced.
|
||||
The %template directive for a class template is the equivalent to an
|
||||
explicit instantiation of a C++ class template. The scope for a valid
|
||||
%template instantiation is now the same as the scope required for a
|
||||
valid explicit instantiation of a C++ template. A definition of the
|
||||
template for the explicit instantiation must be in scope where the
|
||||
instantiation is declared and must not be enclosed within a different
|
||||
namespace.
|
||||
|
||||
For example, a few %template and C++ explicit instantiations of std::vector
|
||||
are shown below:
|
||||
|
||||
// valid
|
||||
namespace std {
|
||||
%template(vin) vector<int>;
|
||||
template class vector<int>;
|
||||
}
|
||||
|
||||
// valid
|
||||
using namespace std;
|
||||
%template(vin) vector<int>;
|
||||
template class vector<int>;
|
||||
|
||||
// valid
|
||||
using std::vector;
|
||||
%template(vin) vector<int>;
|
||||
template class vector<int>;
|
||||
|
||||
// ill-formed
|
||||
namespace unrelated {
|
||||
using std::vector;
|
||||
%template(vin) vector<int>;
|
||||
template class vector<int>;
|
||||
}
|
||||
|
||||
// ill-formed
|
||||
namespace unrelated {
|
||||
using namespace std;
|
||||
%template(vin) vector<int>;
|
||||
template class vector<int>;
|
||||
}
|
||||
|
||||
// ill-formed
|
||||
namespace unrelated {
|
||||
namespace std {
|
||||
%template(vin) vector<int>;
|
||||
template class vector<int>;
|
||||
}
|
||||
}
|
||||
|
||||
// ill-formed
|
||||
namespace unrelated {
|
||||
%template(vin) std::vector<int>;
|
||||
template class std::vector<int>;
|
||||
}
|
||||
|
||||
When the scope is incorrect, an error now occurs such as:
|
||||
|
||||
cpp_template_scope.i:34: Error: 'vector' resolves to 'std::vector' and
|
||||
was incorrectly instantiated in scope 'unrelated' instead of within scope 'std'.
|
||||
|
||||
Previously SWIG accepted the ill-formed examples above but this led to
|
||||
numerous subtle template scope problems especially in the presence of
|
||||
using declarations and using directives as well as with %feature and %typemap.
|
||||
|
||||
Actually, a valid instantiation is one which conforms to the C++03
|
||||
standard as C++11 made a change to disallow using declarations and
|
||||
using directives to find a template.
|
||||
|
||||
// valid C++03, ill-formed C++11
|
||||
using std::vector;
|
||||
template class vector<int>;
|
||||
|
||||
Similar fixes for defining classes using forward class references have
|
||||
also been put in place. For example:
|
||||
|
||||
namespace Space1 {
|
||||
struct A;
|
||||
}
|
||||
namespace Space2 {
|
||||
struct Space1::A {
|
||||
void x();
|
||||
}
|
||||
}
|
||||
|
||||
will now error out with:
|
||||
|
||||
cpp_class_definition.i:5: Error: 'Space1::A' resolves to 'Space1::A' and
|
||||
was incorrectly instantiated in scope 'Space2' instead of within scope 'Space1'.
|
||||
|
||||
2017-08-16: wsfulton
|
||||
Fix scope lookup for template parameters containing unary scope operators.
|
||||
|
||||
Fixes cases like:
|
||||
|
||||
namespace Alloc {
|
||||
template<typename T> struct Rebind {
|
||||
typedef int Integer;
|
||||
};
|
||||
}
|
||||
%template(RebindBucket) Alloc::Rebind< Bucket >;
|
||||
OR
|
||||
%template(RebindBucket) Alloc::Rebind< ::Bucket >;
|
||||
|
||||
Alloc::Rebind< Bucket >::Integer Bucket1();
|
||||
Alloc::Rebind< ::Bucket >::Integer Bucket2();
|
||||
Alloc::Rebind<::template TemplateBucket<double>>::Integer Bucket3();
|
||||
|
||||
2017-08-16: wsfulton
|
||||
For templates only, the template parameters are fully resolved when
|
||||
handling typemaps. Without this, it is too hard to have decent rules
|
||||
to apply typemaps when parameter types are typedef'd and template
|
||||
parameters have default values.
|
||||
|
||||
Fixes %clear for typedefs in templates, eg:
|
||||
|
||||
%typemap("in") XXX<int>::Long "..."
|
||||
template typename<T> struct XXX {
|
||||
typedef long Long;
|
||||
};
|
||||
%clear XXX<int>::Long;
|
||||
|
||||
as the typemap was previously incorrectly stored as a typemap for long
|
||||
instead of XXX<int>::Long.
|
||||
|
||||
2017-08-05: olly
|
||||
[C++11] Allow static_assert at the top level (and disallow it right
|
||||
after template<T>). Fixes https://github.com/swig/swig/issues/1031
|
||||
reported by Artem V L.
|
||||
|
||||
2017-08-02: wsfulton
|
||||
Fix incorrectly shown warning when an empty template instantiation was used on a
|
||||
class used as a base class and that base class was explicitly ignored with %ignore.
|
||||
Example of the warning which will no longer appear:
|
||||
|
||||
Warning 401: Base class 'Functor< int,int >' has no name as it is an empty
|
||||
template instantiated with '%template()'. Ignored.
|
||||
|
||||
2017-07-17: fflexo
|
||||
[Java] #674 Add std_list.i to add support for std::list containers. The Java proxy
|
||||
extends java.util.AbstractSequentialList and makes the C++ std::list container look
|
||||
and feel much like a java.util.LinkedList from Java.
|
||||
|
||||
2017-07-07: wsfulton
|
||||
[Python] Fix display of documented template types when using the autodoc
|
||||
feature. For example when wrapping:
|
||||
|
||||
%feature("autodoc");
|
||||
template<typename X> struct T {};
|
||||
%template(TInteger) T<int>;
|
||||
|
||||
the generated documentation contains:
|
||||
"""Proxy of C++ T< int > class."""
|
||||
instead of:
|
||||
"""Proxy of C++ T<(int)> class."""
|
||||
and
|
||||
"""__init__(TInteger self) -> TInteger"""
|
||||
instead of
|
||||
"""__init__(T<(int)> self) -> TInteger"""
|
||||
|
||||
2017-06-27: nihaln
|
||||
[PHP] Update the OUTPUT Typemap to add return statement to the
|
||||
PHP Wrapper.
|
||||
|
||||
2017-06-27: nihaln
|
||||
[PHP] Update the enum and value examples to use the OO wrappers
|
||||
rather than the flat functions produced with -noproxy. There's
|
||||
not been a good reason to use -noproxy for since PHP5 OO wrapping
|
||||
was fixed back in 2005.
|
||||
|
||||
2017-06-23: m7thon
|
||||
[Python] fix and improve default argument handling:
|
||||
|
||||
1. Fix negative octals. Currently not handled correctly by `-py3`
|
||||
(unusual case, but incorrect).
|
||||
2. Fix arguments of type "octal + something" (e.g. `0640 | 04`).
|
||||
Currently drops everything after the first octal. Nasty!
|
||||
3. Fix bool arguments "0 + something" (e.g. `0 | 1`) are always
|
||||
"False" (unusual case, but incorrect).
|
||||
4. Remove special handling of "TRUE" and "FALSE" from
|
||||
`convertValue` since there's no reason these have to match
|
||||
"true" and "false".
|
||||
5. Remove the Python 2 vs. Python 3 distinction based on the
|
||||
`-py3` flag. Now the same python code is produced for default
|
||||
arguments for Python 2 and Python 3. For this, octal default
|
||||
arguments, e.g. 0644, are now wrapped as `int('644', 8)`. This
|
||||
is required, as Python 2 and Python 3 have incompatible syntax
|
||||
for octal literals.
|
||||
|
||||
Fixes #707
|
||||
|
||||
2017-06-21: futatuki
|
||||
#1004 - Fix ccache-swig executable name to respect configure's --program-prefix and
|
||||
--program-suffix values if used.
|
||||
|
||||
2017-06-21: tamuratak
|
||||
[Ruby] #911 - Add std::wstring support.
|
||||
|
||||
2017-06-19: wsfulton
|
||||
[Python] Fix handling of rich comparisons when wrapping overloaded operators:
|
||||
|
||||
operator< operator<= operator> operator>= operator== operator!=
|
||||
|
||||
Previously a TypeError was always thrown if the type was not correct. NotImplemented
|
||||
is now returned from these wrapped functions if the type being compared with is
|
||||
not correct. The subsequent behaviour varies between different versions of Python
|
||||
and the comparison function being used, but is now consistent with normal Python
|
||||
behaviour. For example, for the first 4 operator overloads above, a TypeError
|
||||
'unorderable types' is thrown in Python 3, but Python 2 will return True or False.
|
||||
NotImplemented should be returned when the comparison cannot be done, see PEP 207 and
|
||||
https://docs.python.org/3/library/constants.html#NotImplemented
|
||||
|
||||
Note that the bug was only present when overloaded operators did not also have a
|
||||
function overload.
|
||||
|
||||
Fixes SF bug #1208 (3441262) and SF patch #303.
|
||||
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2017-06-17: fabrice102
|
||||
[Go] Fix Go callback example. Fixes github #600, #955, #1000.
|
||||
|
||||
2017-06-16: wsfulton
|
||||
Make sure warning and error messages are not split up by other processes writing to
|
||||
stdout at the same time.
|
||||
|
||||
2017-06-16: wsfulton
|
||||
[R] Fix wrapping function pointers containing rvalue and lvalue reference parameters.
|
||||
|
||||
2017-06-13: olly
|
||||
[Perl] Fix testsuite to work without . in @INC - it was removed in
|
||||
Perl 5.26 for security reasons, and has also been removed from
|
||||
older versions in some distros. Fixes
|
||||
https://github.com/swig/swig/issues/997 reported by lfam.
|
||||
|
||||
2017-06-03: wsfulton
|
||||
Fix %import on a file containing a file scope %fragment forced inclusion to not
|
||||
generate the fragment contents as %import should not result in code being generated.
|
||||
The behaviour is now the same as importing code insertion blocks.
|
||||
Wrapping FileC.i in the following example will result in no generated code, whereas
|
||||
previously "#include <limits.h>" was generated:
|
||||
|
||||
// FileA.i
|
||||
%fragment("<limits.h>", "header") %{
|
||||
#include <limits.h>
|
||||
%}
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
%}
|
||||
%fragment("<limits.h>");
|
||||
|
||||
// FileC.i
|
||||
%import "FileA.i"
|
||||
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2017-05-26: Volker Diels-Grabsch, vadz
|
||||
[Java] #842 Extend from java.util.AbstractList<> and implement java.util.RandomAccess for
|
||||
std::vector wrappers. This notably allows to iterate over wrapped vectors in a natural way.
|
||||
2017-05-30: davidcl
|
||||
[Scilab] #994 Undefined symbol error when loading in Scilab 6
|
||||
|
||||
2017-05-25: asibross
|
||||
[Java] #370 #417 Missing smart pointer handling in Java director extra methods
|
||||
swigReleaseOwnership() and swigTakeOwnership().
|
||||
|
||||
2017-05-23: wsfulton
|
||||
[Java] #230 #759 Fix Java shared_ptr and directors for derived classes java compilation
|
||||
error.
|
||||
|
||||
For shared_ptr proxy proxy classes, add a protected method swigSetCMemOwn for modifying
|
||||
the swigCMemOwn and swigCMemOwnDerived member variables which are used by various other
|
||||
methods for controlling memory ownership.
|
||||
|
||||
2017-05-21: Sghirate
|
||||
[Java, C#, D] #449 Remove unnecessary use of dynamic_cast in directors to enable
|
||||
non-RTTI compilation.
|
||||
|
||||
2017-05-21: wsfulton
|
||||
[Python] #993 Fix handling of default -ve unsigned values, such as:
|
||||
void f(unsigned = -1U);
|
||||
|
||||
2017-05-20: jschueller
|
||||
[Python] #991 Fix E731 PEP8 warning: do not assign a lambda expression
|
||||
|
||||
2017-05-16: nihal95
|
||||
[PHP] Add %pragma version directive to allow the version of the
|
||||
extension to be set. Patch #970, fixes #360.
|
||||
|
||||
2017-05-13: yag00
|
||||
Patch #975 - Add support for noexcept on director methods.
|
||||
|
||||
2017-04-27: redbrain
|
||||
Issue #974, Patch #976 - Fix preprocessor handling of macros with commas in a comment.
|
||||
|
||||
2017-04-25: jleveque
|
||||
[Lua] #959 - Fix Visual Studio C4244 conversion warnings in Lua wrappers.
|
||||
|
||||
2017-04-21: tamuratak
|
||||
[Ruby] #964 - Add shared_ptr director typemaps.
|
||||
|
||||
2017-04-20: wsfulton
|
||||
[Ruby] #586, #935 Add assert for invalid NULL type parameter when calling SWIG_Ruby_NewPointerObj.
|
||||
|
||||
2017-04-20: tamuratak
|
||||
[Ruby] #930, #937 - Fix containers of std::shared_ptr.
|
||||
Upcasting, const types (eg vector<shared_ptr<const T>>) and NULL/nullptr support added.
|
||||
|
||||
2017-04-12: smarchetto
|
||||
[Scilab] New parameter targetversion to specify the Scilab target version (5, 6, ..) for code generation
|
||||
With Scilab 6 target specified, identifier names truncation is disabled (no longer necessary)
|
||||
|
||||
2017-03-24: tamuratak
|
||||
[Ruby] Fix #939 - Wrapping std::vector<bool> fix due to incorrect null checks
|
||||
on VALUE obj.
|
||||
|
||||
2017-03-17: vadz
|
||||
[C#] #947 Add support for std::complex<T>
|
||||
|
||||
2017-03-17: wsfulton
|
||||
[Go] Fix handling of typedef'd function pointers and typedef'd member function pointers
|
||||
such as:
|
||||
|
||||
typedef int (*FnPtr_td)(int, int);
|
||||
int do_op(int x, int y, FnPtr_td op);
|
||||
|
||||
2017-03-16: wsfulton
|
||||
Add support for member const function pointers such as:
|
||||
|
||||
int fn(short (Funcs::* parm)(bool)) const;
|
||||
|
||||
Also fix parsing of references/pointers and qualifiers to member
|
||||
pointers such as:
|
||||
|
||||
int fn(short (Funcs::* const parm)(bool));
|
||||
int fn(short (Funcs::* & parm)(bool));
|
||||
|
||||
2017-03-10: wsfulton
|
||||
Extend C++11 alternate function syntax parsing to support const and noexcept, such as:
|
||||
|
||||
auto sum1(int x, int y) const -> int { return x + y; }
|
||||
auto sum2(int x, int y) noexcept -> int { return x + y; }
|
||||
|
||||
2017-02-29: tamuratak
|
||||
[Ruby] #917 - Add Enumerable module to all container class wrappers. It was missing
|
||||
for std::list, std::multiset, std::unordered_multiset and std::unordered_map.
|
||||
|
||||
2017-02-27: assambar
|
||||
[C++11] Extend parser to support throw specifier in combination
|
||||
with override and/or final.
|
||||
|
||||
2017-02-10: tamuratak
|
||||
[Ruby] #883 - Add support for C++11 hash tables:
|
||||
std::unordered_map
|
||||
std::unordered_set
|
||||
std::unordered_multimap
|
||||
std::unordered_multiset
|
||||
|
||||
2017-02-08: jcsharp
|
||||
[C#] #887 Improve std::vector<T> wrapper constructors -
|
||||
Replace constructor taking ICollection with IEnumerable and also add IEnumerable<T>
|
||||
constructor to avoid the boxing and unboxing overhead of the original constructor,
|
||||
when the type parameter is a value type.
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ SWIG directives. SWIG can be furnished with a header file, but an
|
|||
interface can also be generated without library headers by supplying a
|
||||
simple text file--called the interface file, which is typically named
|
||||
with a <tt>.i</tt> extension--containing any foreign declarations of
|
||||
identifiers you wish to use. The most common approach is to use a an
|
||||
identifiers you wish to use. The most common approach is to use an
|
||||
interface file with directives to parse the needed headers. A straight
|
||||
parse of library headers will result in usable code, but SWIG
|
||||
directives provides much freedom in how a user might tailor the
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ All the steps required to compile and use a simple hierarchy of classes for shap
|
|||
|
||||
<p>
|
||||
First create an Android project called <tt>SwigClass</tt> in a subdirectory called <tt>class</tt>.
|
||||
The steps below create and build a the JNI C++ app.
|
||||
The steps below create and build the JNI C++ app.
|
||||
Adjust the <tt>--target</tt> id as mentioned earlier in the <a href="Android.html#Android_examples_intro">Examples introduction</a>.
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ following conditions need to be met:
|
|||
|
||||
|
||||
<p>
|
||||
ccache was inspired by the compilercache shell script script written
|
||||
ccache was inspired by the compilercache shell script written
|
||||
by Erik Thiele and I would like to thank him for an excellent piece of
|
||||
work. See
|
||||
<a href="http://www.erikyyy.de/compilercache/">http://www.erikyyy.de/compilercache/</a>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
<li><a href="#CPlusPlus11_noexcept">Exception specifications and noexcept</a>
|
||||
<li><a href="#CPlusPlus11_alignment">Control and query object alignment</a>
|
||||
<li><a href="#CPlusPlus11_attributes">Attributes</a>
|
||||
<li><a href="#CPlusPlus11_ref_qualifiers">Methods with ref-qualifiers</a>
|
||||
</ul>
|
||||
<li><a href="#CPlusPlus11_standard_library_changes">Standard library changes</a>
|
||||
<ul>
|
||||
|
|
@ -877,7 +878,8 @@ so in this case it is entirely possible to pass an int instead of a double to <t
|
|||
|
||||
|
||||
<p>
|
||||
SWIG correctly parses the new <tt>static_assert</tt> declarations.
|
||||
SWIG correctly parses the new <tt>static_assert</tt> declarations (though 3.0.12 and earlier
|
||||
had a bug which meant this wasn't accepted at file scope).
|
||||
This is a C++ compile time directive so there isn't anything useful that SWIG can do with it.
|
||||
</p>
|
||||
|
||||
|
|
@ -970,6 +972,104 @@ int [[attr1]] i [[attr2, attr3]];
|
|||
[[noreturn, nothrow]] void f [[noreturn]] ();
|
||||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="CPlusPlus11_ref_qualifiers">7.2.29 Methods with ref-qualifiers</a></H3>
|
||||
|
||||
|
||||
<p>
|
||||
C++11 non-static member functions can be declared with ref-qualifiers.
|
||||
Member functions declared with a <tt>&</tt> lvalue ref-qualifiers are wrapped like any other function without ref-qualifiers.
|
||||
Member functions declared with a <tt>&&</tt> rvalue ref-qualifiers are ignored by default
|
||||
as they are unlikely to be required from non-C++ languages where the concept of <i>rvalue-ness</i>
|
||||
for the implied *this pointer does not apply.
|
||||
The warning is hidden by default, but can be displayed as described in the section on <a href="Warnings.html#Warnings_nn4">Enabling extra warnings</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Consider:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
struct RQ {
|
||||
void m1(int x) &;
|
||||
void m2(int x) &&;
|
||||
};
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
The only wrapped method will be the lvalue ref-qualified method <tt>m1</tt>
|
||||
and if SWIG is run with the <tt>-Wextra</tt> command-line option, the following warning will be issued indicating <tt>m2</tt> is not wrapped:
|
||||
</p>
|
||||
|
||||
<div class="shell">
|
||||
<pre>
|
||||
example.i:7: Warning 405: Method with rvalue ref-qualifier m2(int) && ignored.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
If you unignore the method as follows, wrappers for <tt>m2</tt> will be generated:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
%feature("ignore", "0") RQ::m2(int x) &&;
|
||||
struct RQ {
|
||||
void m1(int x) &;
|
||||
void m2(int x) &&;
|
||||
};
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
Inspection of the generated C++ code, will show that <tt>std::move</tt> is used on the instance
|
||||
of the <tt>RQ *</tt> class:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
RQ *arg1 = (RQ *) 0 ;
|
||||
int arg2 ;
|
||||
|
||||
arg1 = ...marshalled from target language...
|
||||
arg2 = ...marshalled from target language...
|
||||
|
||||
std::move(*arg1).m2(arg2);
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
This will compile but when run, the move effects may not be what you want.
|
||||
As stated earlier, rvalue ref-qualifiers aren't really applicable outside the world of C++.
|
||||
However, if you really know what you are doing, full control over the call to the method is
|
||||
possible via the low-level "action" feature.
|
||||
This feature completely replaces the call to the underlying function, that is, the last line in the snippet of code above.
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
%feature("ignore", "0") RQ::m2(int x) &&;
|
||||
%feature("action") RQ::m2(int x) && %{
|
||||
RQ().m2(arg2);
|
||||
%}
|
||||
struct RQ {
|
||||
void m1(int x) &;
|
||||
void m2(int x) &&;
|
||||
};
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
resulting in:
|
||||
</p>
|
||||
|
||||
<div class="code"><pre>
|
||||
RQ *arg1 = (RQ *) 0 ;
|
||||
int arg2 ;
|
||||
|
||||
arg1 = ...marshalled from target language...
|
||||
arg2 = ...marshalled from target language...
|
||||
|
||||
RQ().m2(arg2);
|
||||
</pre></div>
|
||||
|
||||
<p>
|
||||
<b>Compatibility note:</b> SWIG-4.0.0 was the first version to support ref-qualifiers.
|
||||
</p>
|
||||
<H2><a name="CPlusPlus11_standard_library_changes">7.3 Standard library changes</a></H2>
|
||||
|
||||
|
||||
|
|
@ -994,7 +1094,8 @@ Variadic template support requires further work to provide substantial tuple wra
|
|||
|
||||
<p>
|
||||
The new hash tables in the STL are <tt>unordered_set</tt>, <tt>unordered_multiset</tt>, <tt>unordered_map</tt>, <tt>unordered_multimap</tt>.
|
||||
These are not available in SWIG, but in principle should be easily implemented by adapting the current STL containers.
|
||||
These are not available in all target languages.
|
||||
Any missing support can in principle be easily implemented by adapting the current STL containers.
|
||||
</p>
|
||||
|
||||
<H3><a name="CPlusPlus11_regular_expressions">7.3.4 Regular expressions</a></H3>
|
||||
|
|
@ -1175,5 +1276,6 @@ Phew, that is a lot of hard work to get a callback working.
|
|||
You could just go with the more attractive option of just using <tt>double</tt> as the return type in the function declaration instead of <tt>result_of</tt>!
|
||||
</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -677,7 +677,7 @@ As a result, we get the following method in the module class:
|
|||
<div class="code">
|
||||
<pre>
|
||||
public static void myArrayCopy(int[] sourceArray, int[] targetArray, int nitems) {
|
||||
examplePINVOKE.myArrayCopy(sourceArray, targetArray, nitems);
|
||||
examplePINVOKE.myArrayCopy(sourceArray, targetArray, nitems);
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
|
@ -997,9 +997,9 @@ When the following C# code is executed:
|
|||
<div class="code">
|
||||
<pre>
|
||||
public class runme {
|
||||
static void Main() {
|
||||
example.positivesonly(-1);
|
||||
}
|
||||
static void Main() {
|
||||
example.positivesonly(-1);
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
|
@ -1772,7 +1772,7 @@ should pass the call on to <tt>CSharpDefaults.DefaultMethod(int)</tt>using the C
|
|||
|
||||
|
||||
<p>
|
||||
When using <a href="Modules.html#Modules">multiple modules</a> it is is possible to compile each SWIG generated wrapper
|
||||
When using <a href="Modules.html#Modules">multiple modules</a> it is possible to compile each SWIG generated wrapper
|
||||
into a different assembly.
|
||||
However, by default the generated code may not compile if
|
||||
generated classes in one assembly use generated classes in another assembly.
|
||||
|
|
@ -1846,12 +1846,12 @@ and the following usage from C# after running the code through SWIG:
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
Wheel wheel = new Bike(10).getWheel();
|
||||
Console.WriteLine("wheel size: " + wheel.size);
|
||||
// Simulate a garbage collection
|
||||
global::System.GC.Collect();
|
||||
global::System.GC.WaitForPendingFinalizers();
|
||||
global::System.Console.WriteLine("wheel size: " + wheel.size);
|
||||
Wheel wheel = new Bike(10).getWheel();
|
||||
Console.WriteLine("wheel size: " + wheel.size);
|
||||
// Simulate a garbage collection
|
||||
global::System.GC.Collect();
|
||||
global::System.GC.WaitForPendingFinalizers();
|
||||
global::System.Console.WriteLine("wheel size: " + wheel.size);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1980,9 +1980,9 @@ and more or less equivalent usage from C#
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
Container container = new Container();
|
||||
Element element = new Element(20);
|
||||
container.setElement(element);
|
||||
Container container = new Container();
|
||||
Element element = new Element(20);
|
||||
container.setElement(element);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1993,14 +1993,14 @@ In order to understand why, consider a garbage collection occuring...
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
Container container = new Container();
|
||||
Element element = new Element(20);
|
||||
container.setElement(element);
|
||||
Console.WriteLine("element.value: " + container.getElement().value);
|
||||
// Simulate a garbage collection
|
||||
global::System.GC.Collect();
|
||||
global::System.GC.WaitForPendingFinalizers();
|
||||
global::System.Console.WriteLine("element.value: " + container.getElement().value);
|
||||
Container container = new Container();
|
||||
Element element = new Element(20);
|
||||
container.setElement(element);
|
||||
Console.WriteLine("element.value: " + container.getElement().value);
|
||||
// Simulate a garbage collection
|
||||
global::System.GC.Collect();
|
||||
global::System.GC.WaitForPendingFinalizers();
|
||||
global::System.Console.WriteLine("element.value: " + container.getElement().value);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -228,7 +228,6 @@
|
|||
<li><a href="SWIGPlus.html#SWIGPlus_nn12">Static members</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_member_data">Member data</a>
|
||||
</ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_default_args">Default arguments</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn15">Protection</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn16">Enums and constants</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn17">Friends</a>
|
||||
|
|
@ -236,16 +235,27 @@
|
|||
<li><a href="SWIGPlus.html#SWIGPlus_nn19">Pass and return by value</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn20">Inheritance</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn21">A brief discussion of multiple inheritance, pointers, and type checking</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_overloaded_methods">Wrapping Overloaded Functions and Methods</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_default_args">Default arguments</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_overloaded_methods">Overloaded functions and methods</a>
|
||||
<ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn24">Dispatch function generation</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn25">Ambiguity in Overloading</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn25">Ambiguity in overloading</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Renaming and ambiguity resolution</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn27">Comments on overloading</a>
|
||||
</ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn28">Wrapping overloaded operators</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn28">Overloaded operators</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_class_extension">Class extension</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nn30">Templates</a>
|
||||
<ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_template_directive">The %template directive</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_template_functions">Function templates</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_template_classes">Default template arguments</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_template_class_inheritance">Template base classes</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_template_specialization">Template specialization</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_template_member">Member templates</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_template_scoping">Scoping and templates</a>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_template_more">More on templates</a>
|
||||
</ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_namespaces">Namespaces</a>
|
||||
<ul>
|
||||
<li><a href="SWIGPlus.html#SWIGPlus_nspace">The nspace feature for namespaces</a>
|
||||
|
|
@ -300,6 +310,7 @@
|
|||
<li><a href="CPlusPlus11.html#CPlusPlus11_noexcept">Exception specifications and noexcept</a>
|
||||
<li><a href="CPlusPlus11.html#CPlusPlus11_alignment">Control and query object alignment</a>
|
||||
<li><a href="CPlusPlus11.html#CPlusPlus11_attributes">Attributes</a>
|
||||
<li><a href="CPlusPlus11.html#CPlusPlus11_ref_qualifiers">Methods with ref-qualifiers</a>
|
||||
</ul>
|
||||
<li><a href="CPlusPlus11.html#CPlusPlus11_standard_library_changes">Standard library changes</a>
|
||||
<ul>
|
||||
|
|
@ -347,26 +358,32 @@
|
|||
<div class="sectiontoc">
|
||||
<ul>
|
||||
<li><a href="Library.html#Library_nn2">The %include directive and library search path</a>
|
||||
<li><a href="Library.html#Library_nn3">C Arrays and Pointers</a>
|
||||
<li><a href="Library.html#Library_nn3">C arrays and pointers</a>
|
||||
<ul>
|
||||
<li><a href="Library.html#Library_nn4">cpointer.i</a>
|
||||
<li><a href="Library.html#Library_carrays">carrays.i</a>
|
||||
<li><a href="Library.html#Library_nn6">cmalloc.i</a>
|
||||
<li><a href="Library.html#Library_nn7">cdata.i</a>
|
||||
</ul>
|
||||
<li><a href="Library.html#Library_nn8">C String Handling</a>
|
||||
<li><a href="Library.html#Library_nn8">C string handling</a>
|
||||
<ul>
|
||||
<li><a href="Library.html#Library_nn9">Default string handling</a>
|
||||
<li><a href="Library.html#Library_nn10">Passing binary data</a>
|
||||
<li><a href="Library.html#Library_nn11">Using %newobject to release memory</a>
|
||||
<li><a href="Library.html#Library_nn12">cstring.i</a>
|
||||
</ul>
|
||||
<li><a href="Library.html#Library_stl_cpp_library">STL/C++ Library</a>
|
||||
<li><a href="Library.html#Library_stl_cpp_library">STL/C++ library</a>
|
||||
<ul>
|
||||
<li><a href="Library.html#Library_std_string">std::string</a>
|
||||
<li><a href="Library.html#Library_std_vector">std::vector</a>
|
||||
<li><a href="Library.html#Library_stl_exceptions">STL exceptions</a>
|
||||
<li><a href="Library.html#Library_std_shared_ptr">shared_ptr smart pointer</a>
|
||||
<ul>
|
||||
<li><a href="Library.html#Library_shared_ptr_basics">shared_ptr basics</a>
|
||||
<li><a href="Library.html#Library_shared_ptr_inheritance">shared_ptr and inheritance</a>
|
||||
<li><a href="Library.html#Library_shared_ptr_templates">shared_ptr and templates</a>
|
||||
<li><a href="Library.html#Library_shared_ptr_directors">shared_ptr and directors</a>
|
||||
</ul>
|
||||
<li><a href="Library.html#Library_std_auto_ptr">auto_ptr smart pointer</a>
|
||||
</ul>
|
||||
<li><a href="Library.html#Library_nn16">Utility Libraries</a>
|
||||
|
|
@ -1614,6 +1631,11 @@
|
|||
<li><a href="Python.html#Python_nn77">Byte string output conversion</a>
|
||||
<li><a href="Python.html#Python_2_unicode">Python 2 Unicode</a>
|
||||
</ul>
|
||||
<li><a href="Python.html#Python_multithreaded">Support for Multithreaded Applications</a>
|
||||
<ul>
|
||||
<li><a href="Python.html#Python_thread_UI">UI for Enabling Multithreading Support</a>
|
||||
<li><a href="Python.html#Python_thread_performance">Multithread Performance</a>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- INDEX -->
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ In this case, the exception handler is only attached to declarations
|
|||
named "allocate". This would include both global and member
|
||||
functions. The names supplied to <tt>%exception</tt> follow the same
|
||||
rules as for <tt>%rename</tt> described in the section on
|
||||
<a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>.
|
||||
<a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Renaming and ambiguity resolution</a>.
|
||||
For example, if you wanted to define
|
||||
an exception handler for a specific class, you might write this:
|
||||
</p>
|
||||
|
|
@ -516,7 +516,7 @@ The special variables are often used in situations where method calls are logged
|
|||
$action
|
||||
}
|
||||
catch (MemoryError) {
|
||||
croak("Out of memory in $decl");
|
||||
croak("Out of memory in $decl");
|
||||
}
|
||||
}
|
||||
void log(const char *message);
|
||||
|
|
@ -796,7 +796,7 @@ involving <tt>%feature</tt>:
|
|||
</div>
|
||||
|
||||
<p>
|
||||
The name matching rules outlined in the <a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Ambiguity resolution and renaming</a>
|
||||
The name matching rules outlined in the <a href="SWIGPlus.html#SWIGPlus_ambiguity_resolution_renaming">Renaming and ambiguity resolution</a>
|
||||
section applies to all <tt>%feature</tt> directives.
|
||||
In fact the <tt>%rename</tt> directive is just a special form of <tt>%feature</tt>.
|
||||
The matching rules mean that features are very flexible and can be applied with
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ class SomeClass : AnInterface, AnotherInterface {
|
|||
...
|
||||
}
|
||||
</pre></div>
|
||||
<p>For this to work, <tt>AnInterface</tt> and <tt>AnotherInterface</tt> have to be in scope. If SWIG is not in split proxy mode, this is already the case, but it it is, they have to be added to the import list via the <tt>dimports</tt> typemap. Additionally, the import statement depends on the package SWIG is configured to emit the modules to.</p>
|
||||
<p>For this to work, <tt>AnInterface</tt> and <tt>AnotherInterface</tt> have to be in scope. If SWIG is not in split proxy mode, this is already the case, but if it is, they have to be added to the import list via the <tt>dimports</tt> typemap. Additionally, the import statement depends on the package SWIG is configured to emit the modules to.</p>
|
||||
<p>The <tt>$importtype</tt> macro helps you to elegantly solve this problem:</p>
|
||||
<div class="code"><pre>
|
||||
%typemap(dimports) RemoteMpe %{
|
||||
|
|
|
|||
|
|
@ -729,7 +729,7 @@ For instance, the following example uses <tt>%rename</tt> in reverse to generate
|
|||
<div class="code">
|
||||
<pre>
|
||||
%rename(foo) foo_i(int);
|
||||
%rename(foo) foo_d(double;
|
||||
%rename(foo) foo_d(double);
|
||||
|
||||
void foo_i(int);
|
||||
void foo_d(double);
|
||||
|
|
@ -1576,7 +1576,7 @@ return the node for the first class member.
|
|||
|
||||
<div class="indent">
|
||||
Returns the last child node. You might use this if you wanted to append a new
|
||||
node to the of a class.
|
||||
node to the children of a class.
|
||||
</div>
|
||||
|
||||
<p>
|
||||
|
|
@ -2592,36 +2592,36 @@ command line options, simply use code similar to this:
|
|||
<pre>
|
||||
void Language::main(int argc, char *argv[]) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (argv[i]) {
|
||||
if (strcmp(argv[i], "-interface") == 0) {
|
||||
if (argv[i+1]) {
|
||||
interface = NewString(argv[i+1]);
|
||||
Swig_mark_arg(i);
|
||||
Swig_mark_arg(i+1);
|
||||
i++;
|
||||
} else {
|
||||
Swig_arg_error();
|
||||
}
|
||||
} else if (strcmp(argv[i], "-globals") == 0) {
|
||||
if (argv[i+1]) {
|
||||
global_name = NewString(argv[i+1]);
|
||||
Swig_mark_arg(i);
|
||||
Swig_mark_arg(i+1);
|
||||
i++;
|
||||
} else {
|
||||
Swig_arg_error();
|
||||
}
|
||||
} else if ((strcmp(argv[i], "-proxy") == 0)) {
|
||||
proxy_flag = 1;
|
||||
Swig_mark_arg(i);
|
||||
} else if (strcmp(argv[i], "-keyword") == 0) {
|
||||
use_kw = 1;
|
||||
Swig_mark_arg(i);
|
||||
} else if (strcmp(argv[i], "-help") == 0) {
|
||||
fputs(usage, stderr);
|
||||
}
|
||||
...
|
||||
if (argv[i]) {
|
||||
if (strcmp(argv[i], "-interface") == 0) {
|
||||
if (argv[i+1]) {
|
||||
interface = NewString(argv[i+1]);
|
||||
Swig_mark_arg(i);
|
||||
Swig_mark_arg(i+1);
|
||||
i++;
|
||||
} else {
|
||||
Swig_arg_error();
|
||||
}
|
||||
} else if (strcmp(argv[i], "-globals") == 0) {
|
||||
if (argv[i+1]) {
|
||||
global_name = NewString(argv[i+1]);
|
||||
Swig_mark_arg(i);
|
||||
Swig_mark_arg(i+1);
|
||||
i++;
|
||||
} else {
|
||||
Swig_arg_error();
|
||||
}
|
||||
} else if ((strcmp(argv[i], "-proxy") == 0)) {
|
||||
proxy_flag = 1;
|
||||
Swig_mark_arg(i);
|
||||
} else if (strcmp(argv[i], "-keyword") == 0) {
|
||||
use_kw = 1;
|
||||
Swig_mark_arg(i);
|
||||
} else if (strcmp(argv[i], "-help") == 0) {
|
||||
fputs(usage, stderr);
|
||||
}
|
||||
...
|
||||
}
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
|
@ -3164,7 +3164,7 @@ these kinds of problems.
|
|||
</p>
|
||||
|
||||
<dt> <b>Examples/Makefile.in</b>
|
||||
<dd> Nothing special here; see comments at top the of this file
|
||||
<dd> Nothing special here; see comments at the top of this file
|
||||
and look to the existing languages for examples.
|
||||
|
||||
<dt> <b>Examples/qux99/check.list</b>
|
||||
|
|
|
|||
|
|
@ -639,12 +639,12 @@ public:
|
|||
virtual ~FooBarAbstract() {};
|
||||
|
||||
std::string FooBar() {
|
||||
return this->Foo() + ", " + this->Bar();
|
||||
return this->Foo() + ", " + this->Bar();
|
||||
};
|
||||
|
||||
protected:
|
||||
virtual std::string Foo() {
|
||||
return "Foo";
|
||||
return "Foo";
|
||||
};
|
||||
|
||||
virtual std::string Bar() = 0;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue