Three status: Disabled, Experimental and Supported.
Any target language classified as 'Experimental' will issue new warning
524 SWIGWARN_LANG_EXPERIMENTAL.
Any target language classified as 'Disabled' will error out.
Languages will be classified in forthcoming commits.
Issue #1437
* ahnolds-autodoc:
Apparently nicely lining things up violates pep8, so don't try
Don't use bool in the generated files for C compatability
Properly handle destructors as methods for autodoc and fix some stray newlines
Fixing a bug where the cached doxygen docstring could be deleted while still in use, causing swig to segfault
Fixing docstrings for variables and static functions for consistency
Fixes so that fastproxy and autodoc work correctly with both low-level C API and high-level Python Shadow API
Updating the changelog
Also check documentation on the low-level API
Fix a bug where anonymous arguments were misnumbered when used in constructors
Fixing python docstring handling for -fastproxy
Conflicts:
CHANGES.current
SWIG now requires a target language to be specified instead of
defaulting to wrapping for Tcl. Specifying swig --help without
a target language now just shows the generic help. The -nolang
option has been removed.
* ZackerySpytz-OCaml-eliminate-wno-write-strings:
[OCaml] Remove support for OCaml versions < 3.12.0
[OCaml] Fix toplevel creation for ocamlmktop versions >= 4.04.0
[OCaml] Eliminate use of -Wno-write-strings
The OCaml module was generating invalid code for director classes
which contain methods with exception specifications. The fix is based
on some of the code in python.cxx's classDirectorMethod().
This commit fixes compilation failures for a number of director unit
tests.
Add director_exception_catches_runme.ml,
director_exception_nothrow_runme.ml, and director_ignore_runme.ml.
The OCaml module was generating duplicate declarations in the ml
and mli files for overloaded functions. For every wrapper function
created for an overloaded function, it would generate a duplicate of
the dispatch function in the ml and mli files.
In addition, add the SWIG banner to generated ml and mli files.
Don't convert string literals to char * in the strings_test example.
In constantWrapper(), use SwigType_str() instead of SwigType_lstr()
in order to keep const qualifiers.
OCaml's variableWrapper() wasn't calling emit_action_code() for
in/out typemaps, which meant that %allowexception was being ignored.
In addition, remove all comments in the typemaps in Lib/ocaml. In the
case of the allowexcept test, one of the typemap comments caused
compilation to fail because it became nested within another comment
in an %exception block.
Re-enable the allowexcept test.
Add allowexcept_runme.ml.
Backport changes to Python version of make_autodocParmList() to Ruby and
Octave modules, which use similar code.
In particular, this improves handling of parameters clashing with the
language keywords/reserved words for these languages as well.
One of side effects of 15b369028f was that
the default values were only included in Python doc strings if we could
be sure that they could be interpreted as valid Python expressions, but
this change was actually undesirable as it may be useful to see C++
expression for the default value in the doc string even when it isn't
valid in Python.
Undo this part of the change and extend autodoc unit test to check that
this stays fixed.
Closes#1271.
These remaining warnings are due to the design of Python's C API,
so suppress them by casting via void(*)(void) (which GCC documents
as the way to suppress this warning).
Closes#1259.
* vadz-better-param-names:
Enable keyword arguments for keyword_rename unit test
Update error messages test suite
Add more tests for Python parameter renaming
Improve handling parameters clashing with language keywords
The OCaml module was generating dead code in the wrappers for
overloaded functions. Only the generated dispatch function needs to
allocate an array for the passed arguments.
In addition, add overload_extend, overload_rename and overload_subtype
runtime tests.
- Static method wrappers were using the 'fastproxy' approach by default.
This is inconsistent with instance method wrappers. The fastproxy approach
is now turned off by default to be consistent with instance methods.
Static method wrappers can now also be controlled using the -fastproxy and
-olddefs options.
Example:
struct Klass {
static int statmethod(int a = 2);
};
generates:
class Klass(object):
...
@staticmethod
def statmethod(a=2):
return _example.Klass_statmethod(a)
instead of:
class Klass(object):
...
statmethod = staticmethod(_example.Klass_statmethod)
- Modernise wrappers for static methods to use decorator syntax - @staticmethod.
- Add missing runtime test for static class methods and using the actual
class method.
Previously, only Python tried to preserve the original parameter name
(by prepending or appending an underscore to it, but otherwise keeping
the original name) if it conflicted with one of the language keywords,
while all the other languages replaced the parameter name with a
meaningless "argN" in this case.
Now do this for all languages as this results in more readable generated
code and there doesn't seem to be any reason to restrict this to Python
only.
OCaml's constantWrapper() was adding unneeded quotes when wrapping
static const member chars.
Add runtime tests for char_constant, chartest, and
static_const_member.
In OCaml 3.08.0, many functions in the OCaml C API were renamed to
include a caml_ prefix. Their previous names were retained as macros
in caml/compatibility.h and were (apparently) deprecated.
Rename occurrences of alloc_string, alloc_tuple, callback, callback2,
callback3, copy_double, copy_int64, copy_string, failwith, and modify
in the OCaml module.
The OCaml module requires OCaml >= 3.08.3, so this change is safe
for all supported OCaml versions.
In classHandler(), assign sym:name to the classname global so that it
can be used in membervariableHandler().
Add a small runme test for li_std_vector.
Use swigp4 when compiling the runme tests.
Add `membervariableHandler()` to the `OCAML` class in ocaml.cxx (it is
partly based on the code in python.cxx and octave.cxx).
In Lib/ocaml/class.swg, wrapped classes/structs were not being added
to `class_master_list`. This is fixed by adding a call to
`register_class_byname`.
Add a unit test in the form of struct_value_runme.ml.
The docstring was not encapsulated within /* */ comments.
The implementation had code for autodoc strings being either single or
multi-line and then adding extra newlines. However, in practice only multi-line
autodoc string are ever generated, so this bit of code handling was removed.
The docstring feature does not attempt to add newlines depending on the
existence of newlines in the docstring.
Closes#538
* typecheck-null-nonpointers:
Fix overloading for non-pointers and NULL - MzScheme
Overloading for non-pointers and NULL - Chicken
Fix overloading for non-pointers and NULL - Scilab
Fix overloading for non-pointers and NULL - R
Fix overloading for non-pointers and NULL - Php
Fix overloading for non-pointers and NULL - Octave
Fix overloading for non-pointers and NULL - Lua
Overloading for non-pointers and NULL - Javascript
Fix overloading for non-pointers and NULL - Guile
Fix overloading for non-pointers and NULL - Tcl
Fix overloading for non-pointers and NULL - Perl
Fix overloading for non-pointers and NULL - Ruby
Add test for overloading and NULL
Correct Python implicitconv code
Fix typecheck typemaps for non-pointers and NULL
Global functions previously generated two definitions, eg:
def foo():
return _example.foo()
foo = _example.foo
The first definition is replaced by the second definition and so the second definition
is the one used when the method is actually called. Now just the first definition is
generated by default and if the -fastproxy command line option is used, just the second
definition is generated. The second definition is faster as it avoids the proxy Python
method as it calls the low-level C wrapper directly. Using both -fastproxy and -olddefs
command line options will restore the previously generated code as it will generate both
method definitions.
With this change, the wrappers for global C/C++ functions and C++ class methods now work
in the same way wrt to generating just a proxy method by default and control via
-fastproxy/-olddefs options.
Closes#639.