| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add Swig_obligatory_macros which must be called by each
target language to define SWIG_VERSION correctly
in the generated code, as well as the language specific
macro SWIGXXX where XXX is the target language name.
Drop the #ifdef SWIGXXX that was previously generated -
I can't see the point of this and if users are defining
this macro somehow, then users will need to change this
Closes #1050
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure that SWIG_VERSION is defined both at SWIG-time and in the
generated C/C++ wrapper code (it was only defined in the wrapper
for some target languages previously).
SWIGGO and SWIGJAVASCRIPT are now defined in the generated wrappers
to match behaviour for all other target languages.
Stop defining SWIGVERSION in the wrapper. This only happened as a
side-effect of how SWIG_VERSION was defined but was never documented and
is redundant.
The new testcase also checks that SWIG is defined at SWIG-time but not
in the generated wrapper, and that exactly one of a list of
target-language specific macros is defined.
Fixes #1050
|
|
|
|
|
| |
Avoid UTF-32 to UTF-8 conversion then get string from UTF-8
Missing change that should have gone into eaf468e9e8d3ef17f397ef6bc5e73807a2bf3594
|
|
|
|
|
| |
Avoid UTF-32 to UTF-8 conversion then get string from UTF-8
Issue #2369
|
|
|
|
| |
To fix overloading when using these types.
|
|
|
|
|
|
|
|
|
|
|
|
| |
For implementing full move semantics when passing parameters by value.
Based on SWIGTYPE && and std::unique_ptr typemaps which implement move
semantics.
Added for all languages, but untested for: Go, Ocaml, R, Scilab (and
unlikely to be fully functional for same reasons as for std::unique_ptr
support).
Issue #999
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replicated Java implementation.
Fully implemented for:
- C#
- D
- Guile
- Javascript (UTL)
- Lua
- MzScheme
- Octave (UTL)
- Perl (UTL)
- PHP
- Python (UTL)
- Ruby (UTL)
- Tcl (UTL)
PHP std::auto_ptr std::unique_ptr minor tweaks and testcase corrections
|
| |
|
|
|
|
| |
Ported from std::unique, behaviour is identical with regard to memory ownership/handling
|
| |
|
|
|
|
| |
Based on Java implementation.
|
|
|
|
|
| |
More removal of casts in the out typemaps when copying objects to enable
C++ compilers to possibly make use of move semantics.
|
|
|
|
|
|
|
| |
The directorin typemaps in the director methods now use std::move on the
input parameter when copying the object from the stack to the heap prior
to the callback into the target language, thereby taking advantage of
move semantics if available.
|
| |
|
|
|
|
|
|
|
| |
Simple copy of current auto_ptr support (just suppport for
functions returning std::unique_ptr).
Closes #1722
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enhance SWIGTYPE "out" typemaps to use std::move when copying
objects, thereby making use of move semantics when wrapping a function returning
by value if the returned type supports move semantics.
Wrapping functions that return move only types 'by value' now work out the box
without having to provide custom typemaps.
The implementation removed all casts in the "out" typemaps to allow the compiler to
appropriately choose calling a move constructor, where possible, otherwise a copy
constructor. The implementation alsoand required modifying SwigValueWrapper to
change a cast operator from:
SwigValueWrapper::operator T&() const;
to
#if __cplusplus >=201103L
SwigValueWrapper::operator T&&() const;
#else
SwigValueWrapper::operator T&() const;
#endif
This is not backwards compatible for C++11 and later when using the valuewrapper feature
if a cast is explicitly being made in user supplied "out" typemaps. Suggested change
in custom "out" typemaps for C++11 and later code:
1. Try remove the cast altogether to let the compiler use an appropriate implicit cast.
2. Change the cast, for example, from static_cast<X &> to static_cast<X &&>, using the
__cplusplus macro if all versions of C++ need to be supported.
Issue #999
Closes #1044
More about the commit:
Added some missing "varout" typemaps for Ocaml which was falling back to
use "out" typemaps as they were missing.
Ruby std::set fix for SwigValueWrapper C++11 changes.
|
|
|
|
| |
More Python std::wstring directors Python testing
|
|
|
|
| |
Updates for #1706
|
| |
|
|
|
|
| |
std::wstring parameters on SWIG directors were being truncated to a single character due to marshalling inconsistencies.
This patch applies the same MarshalAs(UnmanagedType.LPWStr) attribute to director delegate methods and allows std::wstrings to be successfully received in the C# code via director calls.
|
|
|
|
| |
Throw an ApplicationException for std::wstring and wchar_t * strings
|
|
|
|
|
| |
Use more appropriate unsigned short (2 byte type) pointer
for C# ctype instead of wchar_t pointer
|
|
|
|
|
|
| |
Initial contributions for Linux provided in issue #1233, modified to work
on both Windows and Linux. Dual support is possible by detecting
the sizeof wchar_t which is different on each of these systems.
|
| |
|
|
|
|
| |
Issue #998
|
| |
|
|
|
|
|
|
| |
This is necessary for regex-like renames (where you can't use the #define trick
as is done in many of the %keywordwarn directives). It's now unnecessary to print
the "renaming to '`x`'" code explicitly by the kw.swg files.
|
|
|
|
| |
Fixes #998
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add ability to change the modifiers for the C# and Java
interface generated when using the %interface macros.
For C# use the 'csinterfacemodifiers' typemap.
For Java use the 'javainterfacemodifiers' typemap.
For example:
%typemap(csinterfacemodifiers) X "internal interface"
Closes #1874
|
| |
|
|
|
|
| |
Issue reported by Carlos Frederico Biscaya on swig-user mailing list.
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
* bugfix/616-csharp-bool-array:
Add changes entry to fix C# bool[]
Quieten failing bool[] testcase message
Skip failing bool[] test cases when running under mono
Change C# bool[] typemaps to marshall as 1-byte
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Default marshalling for bool[] now uses 1-byte entries in the array, to
ensure array contents is as expected in C++.
When running under mono csharp_lib_arrays_bool testcase will fail
due to an apparent bug in mono. Works correctly under Microsoft's
runtime. See https://github.com/mono/mono/issues/15592
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Notably make them work for primitive types, such as "int".
Doing this requires using "object" instead of the actual C# type of the
variable to store the current value in the iterator, as we don't
currently have a "csnullabletype" typemap that would expand to "T" for
nullable types and "T?" for the other ones. This is a bit ugly, but it
shouldn't matter much for the generated code and is already done in
std::vector<> typemaps.
Also add a simple unit test verifying the basic functionality for such
vectors.
Closes #1568.
|
|/
|
|
|
|
|
|
| |
This is just a mistake remaining from generalizing the old
string-specific typemap to any type.
Fix it now and update a unit test to test for sets of objects other than
strings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Workaround clang++ 9.1.0 error not knowing std::vector<bool>::const_reference
is actually typedef to bool:
li_std_vector_wrap.cxx:1838:40: error: no matching constructor for initialization of 'std::vector<bool>::const_reference'
Workaround is use
const value_type& getitem(int index) throw (std::out_of_range) { ...
// bool specialization:
bool getitem(int index) throw (std::out_of_range) { ...
instead of
const_reference_type getitem(int index) throw (std::out_of_range) { ...
Although the following would be better, it would require a more
complicated implementation:
const_reference_type getitem(int index) throw (std::out_of_range) { ...
// bool specialization:
bool getitem(int index) throw (std::out_of_range) { ...
|
|
|
|
| |
For users who have typemaps for the parameters in the setitem or set methods.
|
|
|
|
|
|
| |
For users who have typemaps for the parameters in the setitem method.
Correct definitions of const_reference to match the those in the
(C++11) standard.
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes two warnings in each wrapper:
warning : CA2002 : Microsoft.Reliability : 'examplePINVOKE.SWIGPendingException.Retrieve()' locks on a reference of type 'Type'. Replace this with a lock against an object with strong-identity.
warning : CA2002 : Microsoft.Reliability : 'examplePINVOKE.SWIGPendingException.Set(Exception)' locks on a reference of type 'Type'. Replace this with a lock against an object with strong-identity.
Use lock statement advice not to use typeof for locks, see
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/lock-statement
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously just the Dispose() method was generated.
Now the Dispose() and Dispose(bool disposing) methods are generated.
Changes are required if custom "csfinalize", "csdestruct" or "csdestruct_derived"
typemaps are being used. Details in #421 on Github. SWIG will error out if one of
the "csfinalize, "csdestruct" or "csdestruct_derived" typemaps are found. Example
error message:
foo.h:60: Error: A deprecated csfinalize typemap was found for Foo, please remove
it and replace all csdestruct, csdestruct_derived and csfinalize typemaps by the
csdispose, csdispose_derived, csdisposing and csdisposing_derived typemaps.
Closes #421
|
|
|
|
|
|
| |
Better to use the actual type rather than void* in the implementaton.
It also mean the %apply that was used in the implementation won't
inadvertently affect users other use of void* types.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Assignable fixes are based on those used by C# std::vector where the
default wrappers work if there is no operator== available in the
template type. Enhanced wrappers are obtained via a macro:
SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass)
%template(ListKlass) std::list<SomeNamespace::Klass>;
Remove bool specialization (left over from the original std::vector
wrappers).
Add in missing typedefs.
|
| |
|
|
|
|
| |
Mention that these typemaps require .NET 4 or greater.
|
|
|
|
|
|
| |
These implementations are not optimized, i.e. are done in a naive way in
C#, rather than using C++ functions more efficiently, but are better
than nothing.
|
|
|
|
|
|
|
|
| |
Create new Lib/csharp/std_set.i based on the existing std_map.i and run
li_std_set unit test for C# as well.
Notice that the set operations defined by the base ISet<> interface are
not implemented yet.
|