These were officially deprecated in 2001, and attempts to use them have
resulted in a warning (including a pointer to what to update them to)
for most if not all of that time.
Fixes#1984
Prevent segfaults when too few arguments are passed to a function.
Length checks are not needed for the wrappers of overloaded
functions -- the generated dispatch function already checks.
Add default_args_runme.ml.
Fix minor errors in some runtime tests. Extra args were being passed
in some cases.
* ZackerySpytz-OCaml-classDirectorMethod-CAMLreturn:
[OCaml] Fix possible GC issues in generated director code
Conflicts:
Examples/test-suite/ocaml/director_unroll_runme.ml
If a class was given the director feature, it was not possible
to use ctors with multiple parameters.
Add director_default_runme.ml (it is based on
director_default_runme.java).
The result of caml_named_value() can be cached for (slightly)
improved performance.
This is mentioned in the OCaml reference manual.
https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#sec453
In addition, fix incorrect use of CAMLreturn() in
caml_ptr_val_internal().
If given, the OCaml module will place the docstring at the very
beginning of the generated mli file, where it can be read by the
OCamldoc tool.
The implementation is based on the equivalent features in the Python
and Ruby modules.
* 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.
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.
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.
- Fixes generation of director method declarations containing C++11 ref-qualifiers.
- Fixes generation of director method declarations returning more complex types such
as const ref pointers.
- Rewrite Swig_method_call to use more up to date code in the core.
The directorin typemaps will now generate a temporary variable
(specified after the type), such as:
%typemap(directorin) MyType (MyType *temp) { ... use temp ... }
The shared_ptr director typemaps have been fixed for use in functions
that take more than one parameter.
Provide -cppext as a general command line option for setting the
extension used for generated C++ files (previously it was specific
to the PHP backend). Deprecate the equivalent -suffix option
provided by the Ocaml backend, but continue to support that for
now.