* 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 -o and -c options of ocamlc/ocamlopt were modified to be stricter
in 4.04.0.
da56cf6dfd
The changes in Examples/Makefile.in are compatible with earlier OCaml
versions (at least back to 3.12.0).
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.
Fix warnings in overload_numeric.i.
./../overload_numeric.i:36: Warning 509: Overloaded method Nums::over(short) effectively ignored,
./../overload_numeric.i:33: Warning 509: as it is shadowed by Nums::over(signed char).
./../overload_numeric.i:39: Warning 509: Overloaded method Nums::over(int) effectively ignored,
./../overload_numeric.i:33: Warning 509: as it is shadowed by Nums::over(signed char).
Add overload_numeric_runme.ml.
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.
* ZackerySpytz-OCaml-overloaded-bools-typecheck:
[OCaml] Remove the last remnants of libswigocaml
[OCaml] Fix the handling of bools in overloaded functions
Parameter renaming is not fully implemented. Mainly because there is no
C/C++ syntax to
for %rename to fully qualify a function's parameter name from outside
the function. Hence it
is not possible to implemented targetted warning suppression on one
parameter in one function.
Issue #1420
Use the SWIG_TYPECHECK_BOOL precedence level instead of
SWIG_TYPECHECK_INTEGER when checking for bools.
Add a runtime test in the form of overload_bool_runme.ml.
* 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.
This is required for the recently added Python test checking that an
argument clashing with a Python keyword is also renamed when using
keyword arguments and fixes this test failure when using -builtin Python
option.
- 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.
OCaml's constantWrapper() was adding unneeded quotes when wrapping
static const member chars.
Add runtime tests for char_constant, chartest, and
static_const_member.
copy_string() is a macro in the OCaml C API, so rename the function
to copy_str(). Add a runtime test.
The minherit runtime test was fixed by b64d685.
Use the proper syntax for accessing member variables in
unions_runme.ml
Add runtime tests for abstract_access, abstract_typedef,
abstract_typedef2, abstract_virtual, aggregate, cast_operator, and
constover. The aggregate and cast_operator tests are based on the
corresponding ruby tests, and the rest are based on python tests.
Use the [member-variable] syntax in using_protected_runme.ml as
required by the OCaml module's documentation and implementation.
Fix the return type for vec_write() in example.h in the OCaml stl
example.
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.