diff --git a/.travis.yml b/.travis.yml index 6bf3e3c37..ac97dc6b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,12 @@ matrix: env: SWIGLANG= - os: linux env: SWIGLANG= SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1 + sudo: required + dist: trusty - os: linux - env: SWIGLANG= SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP14=1 + env: SWIGLANG= SWIG_CC=gcc-6 SWIG_CXX=g++-6 + sudo: required + dist: trusty - compiler: gcc os: linux env: SWIGLANG=csharp @@ -20,6 +24,11 @@ matrix: - compiler: gcc os: linux env: SWIGLANG=go + - compiler: gcc + os: linux + env: SWIGLANG=go VER=1.5 + sudo: required + dist: trusty - compiler: gcc os: linux env: SWIGLANG=guile @@ -38,6 +47,11 @@ matrix: - compiler: gcc os: linux env: SWIGLANG=lua + - compiler: gcc + os: linux + env: SWIGLANG=lua VER=5.3 + sudo: required + dist: trusty - compiler: gcc os: linux env: SWIGLANG=octave SWIGJOBS=-j2 # 3.2 @@ -77,6 +91,9 @@ matrix: - compiler: gcc os: linux env: SWIGLANG=python PY3=3 VER=3.5 + - compiler: gcc + os: linux + env: SWIGLANG=python SWIG_FEATURES=-builtin VER=2.6 - compiler: gcc os: linux env: SWIGLANG=python SWIG_FEATURES=-builtin @@ -86,6 +103,9 @@ matrix: - compiler: gcc os: linux env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.5 + - compiler: gcc + os: linux + env: SWIGLANG=python SWIG_FEATURES=-builtin PY3=3 VER=3.5 SWIGOPTPY3= - compiler: gcc os: linux env: SWIGLANG=python SWIG_FEATURES=-O @@ -109,10 +129,28 @@ matrix: env: SWIGLANG=tcl - os: linux env: SWIGLANG=csharp SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1 + sudo: required + dist: trusty - os: linux env: SWIGLANG=java SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1 + sudo: required + dist: trusty - os: linux env: SWIGLANG=python SWIG_CC=gcc-5 SWIG_CXX=g++-5 CPP11=1 + sudo: required + dist: trusty + - os: linux + env: SWIGLANG=csharp SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1 + sudo: required + dist: trusty + - os: linux + env: SWIGLANG=java SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1 + sudo: required + dist: trusty + - os: linux + env: SWIGLANG=python SWIG_CC=gcc-6 SWIG_CXX=g++-6 CPP14=1 + sudo: required + dist: trusty - os: osx env: SWIGLANG= SWIG_CC=gcc-4.2 SWIG_CXX=g++-4.2 - compiler: clang diff --git a/ANNOUNCE b/ANNOUNCE index b06aa53d2..53c5bbc59 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,8 +1,8 @@ -*** ANNOUNCE: SWIG 3.0.9 (in progress) *** +*** ANNOUNCE: SWIG 3.0.11 (in progress) *** http://www.swig.org -We're pleased to announce SWIG-3.0.9, the latest SWIG release. +We're pleased to announce SWIG-3.0.11, 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.9.tar.gz + http://prdownloads.sourceforge.net/swig/swig-3.0.11.tar.gz A Windows version is also available at - http://prdownloads.sourceforge.net/swig/swigwin-3.0.9.zip + http://prdownloads.sourceforge.net/swig/swigwin-3.0.11.zip Please report problems with this release to the swig-devel mailing list, details at http://www.swig.org/mail.html. diff --git a/CCache/ccache.c b/CCache/ccache.c index e7dd1d30a..c5c510388 100644 --- a/CCache/ccache.c +++ b/CCache/ccache.c @@ -130,6 +130,7 @@ static void failed(void) exit(1); } args_add_prefix(orig_args, p); + free(p); } if (ccache_verbose) { @@ -490,7 +491,9 @@ static void find_hash(ARGS *args) /* also include the hash of the compiler name - as some compilers use hard links and behave differently depending on the real name */ if (st.st_nlink > 1) { - hash_string(str_basename(args->argv[0])); + char *path = str_basename(args->argv[0]); + hash_string(path); + free(path); } hash_int(st.st_size); @@ -523,6 +526,7 @@ static void find_hash(ARGS *args) input_base, tmp_string(), i_extension); x_asprintf(&path_stderr, "%s/tmp.cpp_stderr.%s", temp_dir, tmp_string()); + free(input_base); if (!direct_i_file) { /* run cpp on the input file to obtain the .i */ @@ -781,6 +785,7 @@ static void find_compiler(int argc, char **argv) /* support user override of the compiler */ if ((path=getenv("CCACHE_CC"))) { + free(base); base = x_strdup(path); } @@ -791,8 +796,10 @@ static void find_compiler(int argc, char **argv) stats_update(STATS_COMPILER); cc_log("could not find compiler (%s)\n", base); perror(base); + free(base); exit(1); } + free(base); } @@ -1076,6 +1083,7 @@ static void process_args(int argc, char **argv) if (strlen(p) < 2) { cc_log("badly formed dependency file %s\n", output_file); stats_update(STATS_ARGS); + free(default_depfile_name); failed(); return; } @@ -1093,6 +1101,7 @@ static void process_args(int argc, char **argv) strcat(default_depfile_name, ".d"); args_add(stripped_args, "-MF"); args_add(stripped_args, default_depfile_name); + free(default_depfile_name); } if (!dependency_target_specified) { @@ -1117,6 +1126,7 @@ static void process_args(int argc, char **argv) exit(1); } args_add_prefix(stripped_args, p); + free(p); } } @@ -1305,6 +1315,7 @@ static void setup_uncached_err(void) if (putenv(buf) == -1) { cc_log("putenv failed\n"); + close(uncached_fd); stats_update(STATS_ERROR); failed(); } diff --git a/CCache/ccache.h b/CCache/ccache.h index dcbb03f0c..a79d88322 100644 --- a/CCache/ccache.h +++ b/CCache/ccache.h @@ -20,7 +20,9 @@ #include #include #else -#define _WIN32_WINNT 0x0500 +#ifndef _WIN32_WINNT + #define _WIN32_WINNT 0x0500 +#endif #include #include #endif diff --git a/CCache/execute.c b/CCache/execute.c index 165b91e66..6df025e95 100644 --- a/CCache/execute.c +++ b/CCache/execute.c @@ -267,6 +267,7 @@ char *find_executable(const char *name, const char *exclude_name) } free(fname); } + free(path); return NULL; #endif diff --git a/CCache/stats.c b/CCache/stats.c index d2122bcd3..4d01d2afa 100644 --- a/CCache/stats.c +++ b/CCache/stats.c @@ -138,7 +138,10 @@ static void stats_update_size(enum stats stat, size_t size, size_t numfiles) memset(counters, 0, sizeof(counters)); - if (lock_fd(fd) != 0) return; + if (lock_fd(fd) != 0) { + close(fd); + return; + } /* read in the old stats */ stats_read_fd(fd, counters); diff --git a/CCache/unify.c b/CCache/unify.c index a93d48a02..7a36476a1 100644 --- a/CCache/unify.c +++ b/CCache/unify.c @@ -281,6 +281,7 @@ int unify_hash(const char *fname) fd = open(fname, O_RDONLY|O_BINARY); if (fd == -1 || fstat(fd, &st) != 0) { cc_log("Failed to open preprocessor output %s\n", fname); + if (fd != -1) close(fd); stats_update(STATS_PREPROCESSOR); return -1; } @@ -289,12 +290,12 @@ int unify_hash(const char *fname) lines in preprocessor output. I have seen lines of over 100k in length, so this is well worth it */ map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); + close(fd); if (map == (char *)-1) { cc_log("Failed to mmap %s\n", fname); stats_update(STATS_PREPROCESSOR); return -1; } - close(fd); /* pass it through the unifier */ unify((unsigned char *)map, st.st_size); diff --git a/CCache/util.c b/CCache/util.c index 66f9823b9..ef90e2336 100644 --- a/CCache/util.c +++ b/CCache/util.c @@ -189,9 +189,11 @@ void copy_fd(int fd_in, int fd_out) { while ((n = gzread(gz_in, buf, sizeof(buf))) > 0) { if (write(fd_out, buf, n) != n) { + gzclose(gz_in); fatal("Failed to copy fd"); } } + gzclose(gz_in); } static int _copy_file(const char *src, const char *dest, int mode) { @@ -248,9 +250,11 @@ static int _copy_file(const char *src, const char *dest, int mode) { } if (mode == COPY_TO_CACHE) { - gz_out = gzdopen(dup(fd_out), "wb"); + int dup_fd_out = dup(fd_out); + gz_out = gzdopen(dup_fd_out, "wb"); if (!gz_out) { gzclose(gz_in); + close(dup_fd_out); close(fd_out); free(tmp_name); return -1; @@ -459,6 +463,7 @@ int create_cachedirtag(const char *dir) f = fopen(filename, "w"); if (!f) goto error; if (fwrite(CACHEDIR_TAG, sizeof(CACHEDIR_TAG)-1, 1, f) != 1) { + fclose(f); goto error; } if (fclose(f)) goto error; @@ -485,7 +490,7 @@ void x_asprintf(char **ptr, const char *format, ...) } va_end(ap); - if (!ptr) fatal("out of memory in x_asprintf"); + if (!*ptr) fatal("out of memory in x_asprintf"); } /* diff --git a/CHANGES b/CHANGES index 198230775..0146ac7ac 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,244 @@ SWIG (Simplified Wrapper and Interface Generator) See the CHANGES.current file for changes in the current version. See the RELEASENOTES file for a summary of changes in each release. +Version 3.0.10 (12 Jun 2016) +============================ + +2016-06-06: mromberg + [Python] Patch #698. Add support for -relativeimport for python 2.7, so -py3 is no + longer also required for relative import support. + +2016-06-05: mromberg + [Python] Patch #694 - Fix package import regressions introduced in swig-3.0.9. + + 1) The code in 3.0.9 did not fall back to 'import _foo' if 'import bar._foo' failed + (assuming bar.foo was the main module). Every place _foo is imported now first tries + it from the package where foo was found and if that fails tries _foo as a global module. + + 2) The separate block of Python code that injected code to pull in the attributes + from _foo when -builtin is used made use of the -py3 switch to either do + 'from ._foo import *' or "from _foo import *". This block of code no longer does this + and instead checks the Python version at runtime to switch between the two syntaxes. + + In summary, swig-3.0.10 has been modified to ease the creation of wrapper modules + that can be fully made part of a Python package. SWIG no longer + assumes the dynamically linked C module is a global module. + The dynamic module can now be placed into either the same package as the pure Python + module or as a global module. Both locations are used by the Python wrapper to + locate the C module. + + However, this could cause a backwards incompatibility with some code + that was relying on the ability of "from package import _module" to + pull attributes out of the package directly. If your code populates a + module (which is also a package) with attributes that are SWIG + generated modules which were not loaded in a conventional way, + swig-3.0.8 and earlier may have worked due to 'from package import + _module' bypassing a real import and pulling your module in as an + attribute. This will no longer work. Since this is not a common (or + even recommended) practice, most folk should not be affected. + + *** POTENTIAL INCOMPATIBILITY *** + +2016-05-31: wsfulton + Fix #690 - Smart pointer to %ignored class doesn't expose inherited methods. + Regression introduced in swig-3.0.9. + +Version 3.0.9 (29 May 2016) +=========================== + +2016-05-24: mromberg + [Python] Patch #612 - Add support for Python's implicit namespace packages. + +2016-05-23: wsfulton + [Ruby] Fix #602 - Error handling regression of opaque pointers introduced + in swig-3.0.8 when C functions explicitly reset a pointer using 'DATA_PTR(self) = 0'. + An ObjectPreviouslyDeleted error was incorrectly thrown when the pointer was used + as a parameter. + +2016-05-17: tamuratak + [Ruby] Patch #651 - Correct overloaded function error message when function is + using %newobject. + +2016-05-17: aurelj + [Ruby] Patch #582 - add support for docstring option in %module() + +2016-05-14: wsfulton + Fix #434 - Passing classes by value as parameters in director methods did not create + a copy of the argument leading to invalid memory accesses if the object was used + after the upcall into the target language. Passing arguments by value shouldn't give + rise to these sorts of memory problems and so the objects are now copied and ownership + of their lifetime is controlled by the target language. + +2016-05-07: wsfulton + Fix #611. Fix assertion handling defaultargs when using %extend for a template + class and the extended methods contain default arguments. + +2016-05-05: ejulian + [Python] Patch #617. Fix operator/ wrappers. + +2016-05-02: wsfulton + Fix #669. Don't issue warning about ignoring base classes when the derived class is + itself ignored. + +2016-04-18: ianlancetaylor + [Go] Fix use of goout typemap when calling base method by + forcing the "type" attribute to the value we need. + +2016-04-17: ianlancetaylor + [Go] Fixes for Go 1.6: avoid returning Go pointers from + directors that return string values; add a trailing 0 byte + when treating Go string as C char*. + +2016-04-06: smarchetto + [Scilab] #552 Make Scilab runtime keep track of pointer types + Instead of a Scilab pointer which has no type, SWIG Scilab maps a + pointer to a structure tlist containing the pointer adress and its type. + +2016-04-02: ahnolds + [Python] Apply #598. Fix misleading error message when attempting to read a non-existent + attribute. The previous cryptic error message: + AttributeError: type object 'object' has no attribute '__getattr__' + is now replaced with one mentioning the attribute name, eg: + AttributeError: 'Foo' object has no attribute 'bar' + +2016-04-02: derkuci + [Python] Patch #610 to fix #607. + Fix single arguments when using python -builtin -O with %feature("compactdefaultargs") + +2016-03-31: wsfulton + Fixes #594. Fix assertion for some languages when wrapping a C++11 enum class that + is private in a class. + + Also don't wrap private enums for a few languages that attempted to do so. + +2016-03-31: wsfulton + [Java] unsigned long long marshalling improvements when a negative number + is passed from Java to C. A cast to signed long long in the C layer will now + result in the expected value. No change for positive numbers passed to C. + Fixes #623. + +2016-03-22: alexwarg + [Lua] #398 Fix lua __getitem + inheritance + The new handling of classes in Lua (not merging methods into the derived classes) + breaks for classes that provide a __getitem function. The __getitem function + prevents method calls to any method defined in a base class. This fix calls + __getitem only if the member is not found using recursive lookup. + +2016-03-18: ptomulik + [Python] #563 Stop generating unnecessary _swigconstant helpers. + +2016-03-16: richardbeare + [R] #636 Add extra std::vector numeric types + +2016-03-14: wsfulton + [Java] Add std_array.i for C++11 std::array support. + +2016-03-12: wsfulton + [Java, C#, D] Fix static const char member variables wrappers with %javaconst(1) + %csconst(1) or %dmanifestconst. + This fixes the case when an integer is used as the initializer, such as: + + struct W { static const char w = 100; }; + + Fix generated code parsing enum values using char escape sequences + when these values appear in the Java code (usually when using %javaconst(1)) + such as: + + enum X { x1 = '\n', x2 = '\1' }; + + Similarly for static const member char variables such as: + + struct Y { static const char y = '\n'; } + + Likewise for D and %dmanifestconstant. For C# and %csconst(1), char + values in C# are now hex escaped as C# doesn't support C octal escaping. + +2016-03-11: wsfulton + [Java C#] Add support for treating C++ base classes as Java interfaces + instead of Java proxy classes. This enable some sort of support for + multiple inheritance. The implementation is in swiginterface.i and + provides additional macros (see Java.html for full documentation): + + %interface(CTYPE) + %interface_impl(CTYPE) + %interface_custom("PROXY", "INTERFACE", CTYPE) + +2016-03-01: wsfulton + Add rstrip encoder for use in %rename. This is like the strip encoder but + strips the symbol's suffix instead of the prefix. The example below + will rename SomeThingCls to SomeThing and AnotherThingCls to AnotherThing: + + %rename("%(rstrip:[Cls])s") ""; + + class SomeThingCls {}; + struct AnotherThingCls {}; + +2016-03-01: olly + Fix isfinite() check to work with GCC6. Fixes + https://github.com/swig/swig/issues/615 reported by jplesnik. + +2016-02-17: olly + [Python] Add missing keywords 'as' and 'with' to pythonkw.swg. + +2016-02-07: kwwette + [Octave] recognise various unary functions + * Use __float__() for numeric conversions, e.g. when calling double() + * Map various unary functions, e.g. abs() to __abs__(), see full list + in section 32.3.10 of manual; only available in Octave 3.8.0 or later + +2016-02-07: kwwette + [Octave] export function swig_octave_prereq() for testing Octave version + +2016-02-06: pjohangustavsson + [C#] Fix duplicate symbol problems when linking the source generated + from multiple SWIG modules into one shared library for the -namespace + option. The namespace is now mangled into the global PInvoke function + names. + + *** POTENTIAL INCOMPATIBILITY *** + +2016-01-27: ahnolds + [Python] Added support for differentiating between Python Bytes + and Unicode objects using by defining SWIG_PYTHON_STRICT_BYTE_CHAR + and SWIG_PYTHON_STRICT_UNICODE_WCHAR. + +2016-01-27: steeve + [Go] Ensure structs are properly packed between gc and GCC/clang. + +2016-01-25: ahnolds + [Python] Support the full Python test suite in -classic mode + * Convert long/unsigned long/long long/unsigned long long to PyInt + rather than PyLong when possible. Certain python functions like + len() require a PyInt when operating on old-style classes. + * Add support for static methods in classic mode, including support + for pythonappend, pythonprepend, and docstrings. + * Removing the use of __swig_getmethods__ for static member methods + since they will always be found by the standard argument lookup + * Fix a bug where the wrong type of exception was caught when + checking for new-style class support + +2016-01-23: ahnolds + [Go] Enable support for the Go test-suite on OSX: + * The linker on OSX requires that all symbols (even weak symbols) + are defined at link time. Because the function _cgo_topofstack is + only defined starting in Go version 1.4, we explicitly mark it as + undefined for older versions of Go on OSX. + * Avoid writing empty swigargs structs, since empty structs are not + allowed in extern "C" blocks. + +2016-01-12: olly + [Javascript] Look for "nodejs" as well as "node", as it's packaged + as the former on Debian. + +2016-01-12: olly + [Javascript] For v8 >= 4.3.0, use V8_MAJOR_VERSION. + Fixes https://github.com/swig/swig/issues/561. + +2016-01-10: ahnolds + Improved size_t and ptrdiff_t typemaps to support large values + on platforms where sizeof(size_t) > sizeof(unsigned long) and + sizeof(ptrdiff_t) > sizeof(long). + Version 3.0.8 (31 Dec 2015) =========================== @@ -587,7 +825,7 @@ Version 3.0.3 (30 Dec 2014) 2014-10-21: wsfulton Fix issue #242 - Use of the "kwargs" feature no longer automatically turns on the "compactdefaultargs" feature if the target language does not support kwargs. - Only Java and Python support kwargs, so this affects all the other languages. + This change affects all languages except Python and Ruby. *** POTENTIAL INCOMPATIBILITY *** diff --git a/CHANGES.current b/CHANGES.current index 8ab562781..f6fee14ca 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -2,155 +2,96 @@ Below are the changes for the current release. See the CHANGES file for changes in older releases. See the RELEASENOTES file for a summary of changes in each release. -Version 3.0.9 (in progress) -=========================== +Version 3.0.11 (in progress) +============================ -2016-04-06: smarchetto - [Scilab] #552 Make Scilab runtime keep track of pointer types - Instead of a Scilab pointer which has no type, SWIG Scilab maps a - pointer to a structure tlist containing the pointer adress and its type. - -2016-04-02: ahnolds - [Python] Apply #598. Fix misleading error message when attempting to read a non-existent - attribute. The previous cryptic error message: - AttributeError: type object 'object' has no attribute '__getattr__' - is now replaced with one mentioning the attribute name, eg: - AttributeError: 'Foo' object has no attribute 'bar' - -2016-04-02: derkuci - [Python] Patch #610 to fix #607. - Fix single arguments when using python -builtin -O with %feature("compactdefaultargs") - -2016-03-31: wsfulton - Fixes #594. Fix assertion for some languages when wrapping a C++11 enum class that - is private in a class. - - Also don't wrap private enums for a few languages that attempted to do so. - -2016-03-31: wsfulton - [Java] unsigned long long marshalling improvements when a negative number - is passed from Java to C. A cast to signed long long in the C layer will now - result in the expected value. No change for positive numbers passed to C. - Fixes #623. - -2016-03-22: alexwarg - [Lua] #398 Fix lua __getitem + inheritance - The new handling of classes in Lua (not merging methods into the derived classes) - breaks for classes that provide a __getitem function. The __getitem function - prevents method calls to any method defined in a base class. This fix calls - __getitem only if the member is not found using recursive lookup. - -2016-03-18: ptomulik - [Python] #563 Stop generating unnecessary _swigconstant helpers. - -2016-03-16: richardbeare - [R] #636 Add extra std::vector numeric types - -2016-03-14: wsfulton - [Java] Add std_array.i for C++11 std::array support. - -2016-03-12: wsfulton - [Java, C#, D] Fix static const char member variables wrappers with %javaconst(1) - %csconst(1) or %dmanifestconst. - This fixes the case when an integer is used as the initializer, such as: - - struct W { static const char w = 100; }; - - Fix generated code parsing enum values using char escape sequences - when these values appear in the Java code (usually when using %javaconst(1)) - such as: - - enum X { x1 = '\n', x2 = '\1' }; - - Similarly for static const member char variables such as: - - struct Y { static const char y = '\n'; } - - Likewise for D and %dmanifestconstant. For C# and %csconst(1), char - values in C# are now hex escaped as C# doesn't support C octal escaping. - -2016-03-11: wsfulton - [Java C#] Add support for treating C++ base classes as Java interfaces - instead of Java proxy classes. This enable some sort of support for - multiple inheritance. The implementation is in swiginterface.i and - provides additional macros (see Java.html for full documentation): - - %interface(CTYPE) - %interface_impl(CTYPE) - %interface_custom("PROXY", "INTERFACE", CTYPE) - -2016-03-01: wsfulton - Add rstrip encoder for use in %rename. This is like the strip encoder but - strips the symbol's suffix instead of the prefix. The example below - will rename SomeThingCls to SomeThing and AnotherThingCls to AnotherThing: - - %rename("%(rstrip:[Cls])s") ""; - - class SomeThingCls {}; - struct AnotherThingCls {}; - -2016-03-01: olly - Fix isfinite() check to work with GCC6. Fixes - https://github.com/swig/swig/issues/615 reported by jplesnik. - -2016-02-17: olly - [Python] Add missing keywords 'as' and 'with' to pythonkw.swg. - -2016-02-07: kwwette - [Octave] recognise various unary functions - * Use __float__() for numeric conversions, e.g. when calling double() - * Map various unary functions, e.g. abs() to __abs__(), see full list - in section 32.3.10 of manual; only available in Octave 3.8.0 or later - -2016-02-07: kwwette - [Octave] export function swig_octave_prereq() for testing Octave version - -2016-02-06: pjohangustavsson - [C#] Fix duplicate symbol problems when linking the source generated - from multiple SWIG modules into one shared library for the -namespace - option. The namespace is now mangled into the global PInvoke function - names. +2016-09-12: xypron + [C#] Patch #786 Keyword rename to be CLS compliant by adding an underscore + suffix instead of an underscore suffix to the C symbol name. Please use an explicit + %rename to rename the symbol with a _ prefix if you want the old symbol name. *** POTENTIAL INCOMPATIBILITY *** -2016-01-27: ahnolds - [Python] Added support for differentiating between Python Bytes - and Unicode objects using by defining SWIG_PYTHON_STRICT_BYTE_CHAR - and SWIG_PYTHON_STRICT_UNICODE_WCHAR. +2016-09-09: olly + [Python] Fix import handling for Python 2.6 to work in a frozen + application. Fixes #145, reported by Thomas Kluyver. -2016-01-27: steeve - [Go] Ensure structs are properly packed between gc and GCC/clang. +2016-09-02: smarchetto + [Scilab] Pointers are mapped to mlist instead of tlist + (mlist better for scilab overloading) -2016-01-25: ahnolds - [Python] Support the full Python test suite in -classic mode - * Convert long/unsigned long/long long/unsigned long long to PyInt - rather than PyLong when possible. Certain python functions like - len() require a PyInt when operating on old-style classes. - * Add support for static methods in classic mode, including support - for pythonappend, pythonprepend, and docstrings. - * Removing the use of __swig_getmethods__ for static member methods - since they will always be found by the standard argument lookup - * Fix a bug where the wrong type of exception was caught when - checking for new-style class support +2016-09-02: olly + [PHP] Fix "out" typemap for member function pointers and "in" + typemap for char INPUT[ANY]. -2016-01-23: ahnolds - [Go] Enable support for the Go test-suite on OSX: - * The linker on OSX requires that all symbols (even weak symbols) - are defined at link time. Because the function _cgo_topofstack is - only defined starting in Go version 1.4, we explicitly mark it as - undefined for older versions of Go on OSX. - * Avoid writing empty swigargs structs, since empty structs are not - allowed in extern "C" blocks. +2016-09-01: wsfulton + [Python] More efficient Python slicing. + Call reserve for container types that support it to avoid repeated + memory reallocations for new slices or slices that grow in size. -2016-01-12: olly - [Javascript] Look for "nodejs" as well as "node", as it's packaged - as the former on Debian. +2016-09-01: wsfulton + [Python] #771 - Make builtin types hashable by default. + Default hash is the underlying C/C++ pointer. This matches up with testing for + equivalence (Py_EQ in SwigPyObject_richcompare) which compares the pointers. -2016-01-12: olly - [Javascript] For v8 >= 4.3.0, use V8_MAJOR_VERSION. - Fixes https://github.com/swig/swig/issues/561. +2016-08-22: wsfulton + [Python] The following builtin slots can be customized like other slots via the + "python:" and "python:slot" features where is the appropriate slot name: + tp_allocs + tp_bases + tp_basicsize + tp_cache + tp_del + tp_dealloc + tp_flags + tp_frees + tp_getset + tp_is_gc + tp_maxalloc + tp_methods + tp_mro + tp_new + tp_next + tp_prev + tp_richcompare + tp_subclasses + tp_weaklist + was_sq_ass_slice + was_sq_slice -2016-01-10: ahnolds - Improved size_t and ptrdiff_t typemaps to support large values - on platforms where sizeof(size_t) > sizeof(unsigned long) and - sizeof(ptrdiff_t) > sizeof(long). + A few documentation improvements for slot customization. + +2016-08-09: joequant + [R] Patch #765 Fix extern "C" header includes for C++ code. + +2016-08-05: olly + [xml] Fix how the output filename is built to avoid problems when + it contains the embedded strings ".c", ".cpp" or ".cxx". + Fixes #540 reported by djack42. + +2016-07-01: wsfulton + Fix corner case of wrapping std::vector of T pointers where a pointer to a pointer of T + also exists in the wrapped code. SF Bug 2359417 (967). + +2016-06-26: wkalinin + [Java, C#] Patch #681 Fix seg fault when ignoring nested classes. + +2016-06-25: mromberg + [Python] #711 Fix -castmode and conversion of signed and unsigned integer types. + See 2015-12-23 CHANGES entry for details of these improvements when they were + implemented for the default options (ie not using -castmode). + +2016-06-25: ahnolds + Patch #730 - Fix %implicitconv for overloaded functions when using + -castmode or -fastdispatch options. + + The result is that in all overload cases where there are multiple possibilities + with the same number of arguments, the dispatch function will first check for + exact (aka non implicit) matches, and then subsequently check for implicit + casting matches. This was already happening in the normal dispatch situation, + and in the -fastdispatch case two passes through the candidates were happening, + just with SWIG_POINTER_IMPLICIT_CONV always set. After this patch, it is not set + on the first pass, and then set on the second pass. + +2016-06-25: liorgold + Patch #727 - Add support for C++11 type aliasing. diff --git a/Doc/Manual/CPlusPlus11.html b/Doc/Manual/CPlusPlus11.html index 714845bba..c825d8426 100644 --- a/Doc/Manual/CPlusPlus11.html +++ b/Doc/Manual/CPlusPlus11.html @@ -29,7 +29,7 @@
  • Strongly typed enumerations
  • Double angle brackets
  • Explicit conversion operators -
  • Alias templates +
  • Type alias and alias templates
  • Unrestricted unions
  • Variadic templates
  • New string literals @@ -52,7 +52,7 @@
  • General-purpose smart pointers
  • Extensible random number facility
  • Wrapper reference -
  • Polymorphous wrappers for function objects +
  • Polymorphic wrappers for function objects
  • Type traits for metaprogramming
  • Uniform method for computing return type of function objects @@ -603,9 +603,29 @@ Conversion operators either with or without explicit need renaming to a them available as a normal proxy method.

    -

    7.2.16 Alias templates

    +

    7.2.16 Type alias and alias templates

    +

    +A type alias is a statement of the form: +

    + +
    +using PFD = void (*)(double); // New introduced syntax
    +
    + +

    +which is equivalent to the old style typedef: +

    + +
    +typedef void (*PFD)(double);  // The old style
    +
    + +

    +SWIG supports type aliasing. +

    +

    The following is an example of an alias template: @@ -632,31 +652,6 @@ example.i:13: Warning 342: The 'using' keyword in template aliasing is not fully -

    -Similarly for non-template type aliasing: -

    - -
    -using PFD = void (*)(double); // New introduced syntax
    -
    - -

    -A warning will be issued: -

    - -
    -
    -example.i:17: Warning 341: The 'using' keyword in type aliasing is not fully supported yet.
    -
    -
    - - -

    The equivalent old style typedefs can be used as a workaround:

    - -
    -typedef void (*PFD)(double);  // The old style
    -
    -

    7.2.17 Unrestricted unions

    @@ -1034,7 +1029,7 @@ Users would need to write their own typemaps if wrapper references are being use

    -

    7.3.8 Polymorphous wrappers for function objects

    +

    7.3.8 Polymorphic wrappers for function objects

    diff --git a/Doc/Manual/Contents.html b/Doc/Manual/Contents.html index 856223ea3..3f283ecb9 100644 --- a/Doc/Manual/Contents.html +++ b/Doc/Manual/Contents.html @@ -287,7 +287,7 @@

  • Strongly typed enumerations
  • Double angle brackets
  • Explicit conversion operators -
  • Alias templates +
  • Type alias and alias templates
  • Unrestricted unions
  • Variadic templates
  • New string literals @@ -310,7 +310,7 @@
  • General-purpose smart pointers
  • Extensible random number facility
  • Wrapper reference -
  • Polymorphous wrappers for function objects +
  • Polymorphic wrappers for function objects
  • Type traits for metaprogramming
  • Uniform method for computing return type of function objects @@ -1529,7 +1529,7 @@
  • Built-in Types
  • Memory management
  • Python 2.2 and classic classes @@ -1594,6 +1594,14 @@
  • Absolute and relative imports
  • Enforcing absolute import semantics
  • Importing from __init__.py +
  • Implicit Namespace Packages +
  • Searching for the wrapper module +
  • Python 3 Support