swig/CHANGES.current

330 lines
14 KiB
Plaintext

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.
Issue # numbers mentioned below can be found on Github. For more details, add
the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.3.0 (in progress)
===========================
2024-09-11: olly
[Perl] #630 Fix wrapping of C++11 enum class when -const command line
option is specified.
2024-09-07: wsfulton
#2875 Fix swig-4.1.0 regression using the %interface family of macros
for multiple inheritance and common bases.
2024-09-06: olly
[Python] Stop documenting to define SWIG_FILE_WITH_INIT - this does
not actually do anything (and apparently never has!)
2024-09-05: wsfulton
#2845 Fix duplicate friend wrappers for friend declarations in nested
classes.
2024-09-03: olly
#3010 Improve handling of zero bytes in input files. This is
certainly a corner case, but GCC and clang both accept zero bytes
at least in comments, and SWIG's current handling is to ignore
the zero byte and all following characters up to and including the
next newline, so for example if a // comment contains a zero byte
SWIG would quietly ignore the next line.
2024-08-30: olly
#2996 Fix generic string literal handling to handle embedded zero
bytes. This allows such strings to work for C# (with %csconst), D
(with %dmanifestconst), Go and Java (with %javaconst). For other
target languages SWIG-generated wrappers still truncate such string
literals at a zero byte (which is probably the best we can do for
target languages where the native string can't contain zero bytes).
2024-08-23: wsfulton
[Java] #2991 Document solutions for mismatch in C++ access specifiers
and Java access modifiers in an inheritance hierarchy.
2024-08-19: wsfulton
[Python] #2993 Add missing std::filesystem namespace to std_filesystem.i.
2024-08-17: olly
#904 #1907 #2579 Fix string literal and character literal wrapping bugs.
2024-08-15: olly
Fix parsing of octal string escapes. We now stop when the next
character is digit 8 or 9, and stop after 3 octal digits even if
the next character is an octal digit.
2024-08-15: olly
SWIG now gives an error for digits 8 and 9 in octal constants -
previously these were quietly accepted resulting in a bogus value.
C++11 binary constants are now treated similarly - only digits 0
and 1 were allowed before, but trying to use other digits now gives
a clearer error.
2024-08-12: olly
#657 Allow unmatched ' and " in #error and #warning.
2024-08-09: wsfulton
[Java] Add the constantsmodifiers pragma so that the visibility for the
Java constants interface can be changed from public to default.
2024-08-02: vadz
[Python] #2966 Fix overloaded Doxygen comments. Sometimes the Doxygen
comments were not combined into one Pydoc comment.
2024-08-01: olly
Fix wrapping of string constants containing bytes 0-8, 11, 12 or
14-31 followed by a digit '0' to '7'. We were emitting these bytes
as a one or two character octal escape sequence which when
interpreted would include the following character.
2024-07-27: olly
#2087 Fix parsing of `noexcept` on a function pointer type used
as the type of a function parameter. We currently generate
invalid C++ code if we try to wrap the function parameter, but
at least the user can `%ignore` the parameter or the whole
function, whereas the parse error was hard to work around.
2024-07-26: olly
Support parsing `noexcept(X)` in expressions, including deducing
its type (which is always `bool`).
2024-07-21: wsfulton
[Python] Add missing slot for init in struct _specialization_cache
needed for python-3.13 builtin wrappers.
2024-07-21: shadchin
[Python] #2968 Add missing tp_versions_used slot needed for python-3.13.
2024-07-19: olly
-Wallkw now includes keywords for Javascript.
2024-07-19: vadz
[Javascript] #2940 Names of object properties can be keywords in
Javascript so don't auto-rename them to have a leading underscore.
2024-07-18: olly
#1917 Stop removing `f` and `F` suffixes from float literals.
This was resulting in incorrect generated C# and Java code. For
some cases such as `#define CONSTANT 1.0f` this was a regression
introduced in 4.2.0 when we started more correctly wrapping these
as `float` rather than `double`.
2024-07-15: vadz
#2941 Suppress warning WARN_PARSE_USING_UNDEF for ignored using declarations.
2024-07-03: wsfulton
#2860 Enhance Windows.html documentation for the popular Visual C++ compiler
recommending users to correctly set the __cplusplus macro in order to benefit
from modern standards based features that SWIG provides.
2024-07-02: erezgeva
[Python, Ruby] #2870 Change the thread safety options for the director code
that manages C++ director pointer ownership. Please define SWIG_THREADS to
turn on thread safety. For Python, this can also be done via the threads
module option or -threads. Implementation now includes a C++11 std::mutex option
as priority over WIN32 and pthread mutexes. See director_guard.swg for further
implementation details.
2024-06-28: vadz
#2935 Fix instantiation of specialized template where the primary template
is a forward class template declaration.
2024-06-16: wsfulton
#2927 Don't ignore overloaded friend functions that are also declared
constexpr.
2024-06-15: wsfulton
[Python] Removed deprecated pytuplehlp.swg file and t_output_helper.
Use SWIG_Python_AppendOutput instead of t_output_helper.
2024-06-15: vadz
[Python] #2907 Fix returning null from functions with output parameters.
Ensures OUTPUT typemaps are handled consistently.
New declaration of SWIG_Python_AppendOutput is now:
SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void);
The 3rd parameter is new and the new $isvoid special variable should be
passed to it, indicating whether or not the wrapped function returns void.
*** POTENTIAL INCOMPATIBILITY ***
2024-06-15: wsfulton
#2907 Add $isvoid special variable which expands to 1 if the
wrapped function has a void return, otherwise expands to 0.
2024-06-14: jschueller
#2863 Support Python 3.13 (currently in prerelease).
2024-06-13: erezgeva
#2609 Fix Java typemap (const char *STRING, size_t LENGTH) to
marshall as Java String instead of Java byte[]. If the old behaviour
is required, replace with typemap (const void *BYTES, size_t LENGTH).
Add multi-argument typemaps to most languages:
(const char *STRING, size_t LENGTH)
All languages now use a target language string type for this typemap.
New multi-argument typemaps have been added to most target languages
for use with C raw data (cdata):
(const void *BYTES, size_t LENGTH) to
Statically typed languages use a byte array for this typemap, while
scripting languages remain using a string.
*** POTENTIAL INCOMPATIBILITY ***
* Raw C data: Go uses byte array and int64 for size.
Users can use the (const char *STRING, size_t LENGTH) typemaps for strings.
2024-06-06: olly
Support alignof(T) for arbitrary type T, and deduce the type of
alignof(T) as size_t.
2024-06-06: olly
#2919 Support parsing `sizeof(X)` for any expression or type X by
skipping balanced parentheses. We don't need to actually parse X
since the type of sizeof is always size_t.
2024-06-05: leakec
#2873 Fix -fvirtual and using declarations for inheriting base class methods
corner case.
2024-05-31: wsfulton
[C#, D, Java, Javascript, Lua] Fix %nspace and %nspacemove for nested
classes and enums in a class. For example:
%nspace Space::OuterClass80;
namespace Space {
struct OuterClass80 {
struct InnerClass80 {
struct BottomClass80 {};
};
enum InnerEnum80 { ie80a, ie80b };
};
}
Previously the following were additionally required for some languages:
%nspace Space::OuterClass80::InnerClass80;
%nspace Space::OuterClass80::InnerClass80::Bottom80;
Now the appropriate nspace setting is taken from the outer class.
A new warning has also been introduced to check and correct conflicting
nspace usage, for example if the following is additionally added:
%nspacemove(AnotherSpace) Space::OuterClass80::InnerClass80;
The following warning appears as an inner class can't be moved outside
of the outer class:
Warning 406: Ignoring nspace setting (AnotherSpace) for 'Space::OuterClass80::InnerClass80',
Warning 406: as it conflicts with the nspace setting (Space) for outer class 'Space::OuterClass80'.
2024-05-31: wsfulton
[C#, D, Java, Javascript, Lua] #2782 Enhance the nspace feature with
%nspacemove for moving a class or enum into a differently named target
language equivalent of a namespace.
2024-05-31: binaire10
[Ruby] #2906 Fix SWIG wrappers for std::map and std::vector to
work with Ruby's "select".
2024-05-30: olly
#2914 Handle alternative operator names in C++ preprocessor
expressions. Handle full set of alternative operator names in
C++ expressions (previously only "and", "or" and "not" were
understood).
2024-05-15: olly
#2868 Support C++17 fold expressions.
2024-05-15: olly
#2876 Report error if parser stack depth exceeded. Previously SWIG
would quietly exit with status 0 in this situation.
2024-04-12: pfusik
[Javascript] #2869 Fix JavaScript _wrap_getCPtr on 64-bit Windows
2024-04-12: wsfulton
[Javascript, MzScheme, Python, Ruby] #202 Remove the vast majority of the
/*@SWIG:...*/ locator strings in the generated wrappers for these 4 languages
to help with reproducible builds.
2024-04-08: thewtex
[Python] #2856 Include stdlib.h for more recent Python Stable ABI
2024-03-28: olly
Fix preprocessor to handle C-style comment ending **/ in macro argument.
2024-03-27: wsfulton
[Python] #2844 Fix for using more than one std::string_view type in a method.
2024-03-27: wsfulton
[R] #2847 Add missing std::vector<long> and std::vector<long long> typemaps
which were missing depending on whether or not SWIGWORDSIZE64 was defined.
2024-03-25: wsfulton
[Python] #2826 Stricter stable ABI conformance.
1. Use Py_DecRef and Py_IncRef when Py_LIMITED_API is defined instead of
macro equivalents, such as Py_INCREF.
2. Don't use PyUnicode_GetLength from python-3.7 and later.
3. Use PyObject_Free instead of deprecated equivalents.
2024-03-25: olly
#2848 Fix elision of comma before ##__VA_ARGS__ which we document
as supported but seems to have not worked since before 2009.
2024-03-11: wsfulton
[C#] #2829 Improve handling and documentation of missing enum base type
information.
2024-03-07: wsfulton
[Ocaml] Fix SWIGTYPE MOVE 'in' typemap to fix compilation error.
2024-03-07: wsfulton
Add SWIGTYPE MOVE 'typecheck' typemaps to remove warning 472
(SWIGWARN_TYPEMAP_TYPECHECK_UNDEF).
2024-03-06: wsfulton
Add support for std::unique_ptr & typemaps. Non-const inputs implement
move semantics from proxy class to C++ layer, otherwise const inputs
and all reference returns behave like any other lvalue reference to a class.
2024-03-06: wsfulton
[Javascript, MzScheme, Octave] Support NULL being passed into char* typemaps.
2024-03-06: christophe-calmejane,wsfulton
#2650 Add support for movable std::unique_ptr by adding in std::unique_ptr &&
input typemaps. The std::unique && output typemaps do not support move
semantics by default and behave like lvalue references.
2024-03-06: wsfulton
Add missing use of move constructor instead of copy constructor when
passing movable types by value. This was previously implemented only for
parameters passed to a global function or static member function and is
now extended to parameters passed to member methods as well as constructors.
2024-03-01: olly
[Java] #2819 Suppress Java removal warnings for uses of
System.runFinalization(). SWIG will need to stop relying on
finalize methods, but we know that and meanwhile these warnings
make the testsuite output noisy. Fix use of deprecated form
of Runtime.exec() in the doxygen example.
2024-02-28: wsfulton
#1754 Fix compilation errors in generated code when instantiating a templated
static method within a template (non-static methods and constructors were
always okay). For example:
template <typename T> class X {
template <class InputIterator>
static void fn(InputIterator first, InputIterator last) { ... }
};
class SimpleIterator { ... };
%extend X<int> {
%template(fn) fn<SimpleIterator>;
}