Not being able to do it is too restrictive in practice and just forces
to use raw DOH pointers, which is not really less dangerous than adding
the assignment operator and reset() method to this class.
There doesn't seem to be any unit tests covering this, but the old code
was wrong because it didn't replace periods used as namespace separators
with underscores, which resulted in periods appearing in the output when
nested namespace were used.
Fix this and also reuse the now fixed getNamespacedName() in
getEnumName() which contained its own buggy version of the same code.
It doesn't seem necessary to muck with sym:name explicitly when we
construct the fully qualified name using getNamespacedName() later
anyhow.
Moreover, the overridden version had a bug which resulted in a crash in
template_empty_inherit unit test and simply removing it entirely allows
the test to pass (without breaking anything else).
This is done not so much to fix the memory leak per se (as there are
gazillions of other ones remaining), but to show that the return value
of getProxyName() does need to be freed, as this was unclear previously,
with it being freed in one place where this function was used, but not
in the other one, here.
Also state this explicitly in the function comment.
Handle char constants defined using #define or %constant correctly.
Also handle static member const variables, which didn't work at all
before, and quote values of such variables of char type.
It's not significantly simpler to use "goto" in this function, so just
replace it with "return".
Also remove the unnecessary checks for strings being deleted being
non-null, as they always are.
No real changes.
We need to make a copy instead of directly returning whatever sym::name
points to, as this value can be overwritten with something different
later, resulting in weird problems with the value of "proxyname"
attribute changing "on its own".
After this bug fix, a few more unit tests pass.
There is no need to override it just to call the base class version.
Also remove the outdated comment, as %extend is supported currently
(albeit with some bugs remaining).
No real changes.
Don't mark functions not intended to be overridden (nor overriding those
in the base class) as "virtual", this is useless and confusing.
No real changes.
By delegating to the base class instead we not only save quite a few
lines of code, but gain support for ctors/dtors defined using %extend,
which didn't work before, allowing to reenable some of the previously
failing tests.
This is useless and the C-specific version didn't handle template
methods added with %extend correctly, so removing this code also fixes
some (but not all yet) failures in extend_template_method.cpptest unit
test.
This is never going to work and just results in generating uncompilable
code.
In principle, we could either generate wrappers for these functions
while still handling the struct as a plain C struct, or switch to
generating class-like wrappers for it if it's %extended with any
functions, but for now just ignore them as this is the simplest thing to
do.
Incidentally, this makes the default_args_c test pass again now, after
the last merge with master pulled in such %extend directives into it.
0f88f9997c (probably accidentally) changed
this file to be executable, undo this as it doesn't make sense for a
source file to have this mode.
See #1242.
* annotation_quoting:
Examples: Unify string quoting in the Python sources
Test-suite: Unify string quoting in the Python sources
Tools: Unify string quoting in the Python sources
Generator: Unify string quoting in generated Python sources
Generator: Remove trailing whitespaces in the Python module
* patch-1:
nested_inheritance_interface testcase enhancement
Add nested_inheritance_interface test for csharp
Fix class name for nested classes
Add nested_inheritance_interface test
Fix class name for nested classes
Conflicts:
CHANGES.current
The feature %interface_impl from swiginterface.i differ on generated function
name from JNI wrapper class when using nested classes without flatnested.
This PR removes the closing `?>` PHP tag from generated files. [PSR-2](https://www.php-fig.org/psr/psr-2/) states:
> The closing `?>` tag MUST be omitted from files containing only PHP.
A problem might occur if files with any character after the closing tag are used with `include` or `require`. It might trigger an output and disallow HTTP header manipulation. See the popular [_headers already sent_](https://stackoverflow.com/a/8028987/1847340) debate on SO.
Output is once again:
$ swig -versioon
Unable to find option or file '-versioon', Use 'swig -help' for more information.
instead of
$ swig -versioon
No target language specified
Added to the javadestruct, javadestruct_derived, ddispose, ddispose_derived
typemaps to mirror enhanced flexibility in the csdisposing and
csdisposing_derived (C#) typemaps. If provided the contents are generated
as the delete/dispose method's parameters declaration.
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
The low-level API for setting static member variables stopped working
when the fastunpack option was turned on by default. The PyMethodDef
setup requires METH_O, not METH_VARARGS with fastunpack.
* REnums2018:
Fix R return by C++11 const ref enum classes
Remove unused code in r.cxx
extra doc on anonymous enums
ENH:
FIX: references to enums now functioning
DOC: Extended documentation on enumeration support in R
FIX: Corrected path to output from R tests
Reformat comments in R module
ENH: Run test for enum_thorough in R
Code style changes post review
ENH: R Module: Enumerations with values set by calls to C code, allowing arbitarily complex value expressions.
Setting enum values with calls to the C code.
There is some consolidation work to be done. The
core of the change is getRClassName2, which will
probably eventually replace getRClassName.
getRClassName seems to be in a funny state, with
a middle argument that is commented out and never
used.
My next step is to verify whether the new version
can replace it.
arbitarily complex value expressions.
R-side initialization of the enumeration structure employs
delayedAssign, which allows the initialization code to be
sourced before loading the shared library, which is the
usual behaviour for code in an R package.