Commit graph

21,035 commits

Author SHA1 Message Date
William S Fulton
1069cfbfd5 Merge branch 'ZackerySpytz-OCaml-define-CAML_NAME_SPACE'
* ZackerySpytz-OCaml-define-CAML_NAME_SPACE:
  [OCaml] Define CAML_NAME_SPACE before including caml/ headers
2019-01-31 07:32:12 +00:00
William S Fulton
528f33e9e5 Merge branch 'ZackerySpytz-OCaml-eliminate-wno-write-strings'
* 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
2019-01-31 07:29:09 +00:00
William S Fulton
280ce63100 Merge branch 'ZackerySpytz-OCaml-template_opaque-using_extend-runtime-tests'
* ZackerySpytz-OCaml-template_opaque-using_extend-runtime-tests:
  [OCaml] Runtime tests for template_opaque, using_extend and some others
2019-01-31 07:25:11 +00:00
William S Fulton
a8406f3d60 Merge branch 'ZackerySpytz-OCaml-doc-fixes'
* ZackerySpytz-OCaml-doc-fixes:
  [OCaml] Some OCaml documentation fixes
2019-01-31 07:23:09 +00:00
William S Fulton
526b2cf0ae Merge branch 'ZackerySpytz-OCaml-director-classes-throw'
* ZackerySpytz-OCaml-director-classes-throw:
  [OCaml] Fix handling of exception specifications for director classes
2019-01-31 07:21:50 +00:00
William S Fulton
c6d2c7703e Merge branch 'ZackerySpytz-OCaml-overloaded-duplicates'
* ZackerySpytz-OCaml-overloaded-duplicates:
  [OCaml] Don't generate duplicate declarations for overloaded functions
2019-01-31 07:18:22 +00:00
William S Fulton
2b788c47fa Merge branch 'ZackerySpytz-OCaml-inctest-li_cpointer_cpp-runtime-tests'
* ZackerySpytz-OCaml-inctest-li_cpointer_cpp-runtime-tests:
  [OCaml] Runtime tests for inctest, li_cpointer_cpp and some others
2019-01-31 07:15:03 +00:00
William S Fulton
3c8cfac27b Merge branch 'ZackerySpytz-OCaml-allowexcept-test'
* ZackerySpytz-OCaml-allowexcept-test:
  [OCaml] Fix %allowexception
2019-01-31 07:11:49 +00:00
William S Fulton
12b8d70d97 Add placeholder for Experimental documentation section
[skip ci]
2019-01-29 19:17:56 +00:00
William S Fulton
b324d9d6bb Add info about the Supported and Experimental language module status
This is the result of an email discussion on the swig-devel mailing list
back in March 2017 titled "Radical new approach to development and
moving towards version 3.1 or version 4.0"

A new section in the Introduction chapter has been added, titled
"Target languages". The Extending chapter has the main details in a
new section called "Target language status".
2019-01-29 18:55:44 +00:00
Zackery Spytz
0b0b77f343 [OCaml] Define CAML_NAME_SPACE before including caml/ headers
When this macro is not defined, the caml/ headers will define
macros without the caml_ prefix as aliases for some functions in the
OCaml C API.

For example, caml/compatibility.h defines `invalid_argument` as an
alias for `caml_invalid_argument` when CAML_NAME_SPACE is not defined,
which breaks code that uses std::invalid_argument.

Rename some functions that were missed in
05589508a6.
2019-01-28 06:56:18 -07:00
Zackery Spytz
c0059ae2cb [OCaml] Remove support for OCaml versions < 3.12.0 2019-01-28 02:16:15 -07:00
Zackery Spytz
f78358d9aa [OCaml] Runtime tests for template_opaque, using_extend and some others
Add runtime tests for namespace_virtual_method, template_opaque,
using_extend, using_inherit, using_pointers, using_private, and
varargs_overload.
2019-01-27 06:50:51 -07:00
Zackery Spytz
fba77056de [OCaml] Some OCaml documentation fixes
Fix some typos.

Update some filenames after 8f7bc4cc10
(replace example_prog.ml with runme.ml).

[skip ci]
2019-01-27 04:00:31 -07:00
Zackery Spytz
35663b1622 [OCaml] Fix handling of exception specifications for director classes
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.
2019-01-26 05:58:38 -07:00
Zackery Spytz
f1a29ef6ec [OCaml] Don't generate duplicate declarations for overloaded functions
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.
2019-01-25 08:45:59 -07:00
Zackery Spytz
25e650e7d8 [OCaml] Fix toplevel creation for ocamlmktop versions >= 4.04.0
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).
2019-01-25 01:58:48 -07:00
Zackery Spytz
4ca7cd7b27 [OCaml] Eliminate use of -Wno-write-strings
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.
2019-01-24 05:32:35 -07:00
Zackery Spytz
4d54d305fc [OCaml] Runtime tests for inctest, li_cpointer_cpp and some others
Add runtime tests for inctest, li_cpointer_cpp, newobject2,
special_variables, special_variable_macros, template_extend1, and
template_extend2.
2019-01-22 22:50:40 -07:00
Zackery Spytz
4074f788b3 [OCaml] Fix %allowexception
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.
2019-01-22 07:51:45 -07:00
William S Fulton
7118e4ef1e Update changes file.
[skip ci]
2019-01-22 08:18:09 +00:00
William S Fulton
a873d3810e Merge branch 'ZackerySpytz-OCaml-overload_numeric-warnings'
* ZackerySpytz-OCaml-overload_numeric-warnings:
  [OCaml] Some %typecheck precedence tweaks
2019-01-22 08:12:54 +00:00
William S Fulton
d02f65e26a Merge branch 'ZackerySpytz-OCaml-overload_method-typedef_class-runtime-tests'
* ZackerySpytz-OCaml-overload_method-typedef_class-runtime-tests:
  [OCaml] Runtime tests for overload_method, typedef_class and some others
2019-01-22 08:10:02 +00:00
William S Fulton
e49709d58f Merge branch 'ZackerySpytz-SWIGRUNTIME_DEBUG-compiler-warnings'
* ZackerySpytz-SWIGRUNTIME_DEBUG-compiler-warnings:
  Fix compiler warnings when SWIGRUNTIME_DEBUG is defined
2019-01-22 08:08:26 +00:00
William S Fulton
0e0c4eecfe Changes file update 2019-01-22 08:06:45 +00:00
William S Fulton
d04b51881e Merge branch 'vadz-other-langs-autodoc-params'
* vadz-other-langs-autodoc-params:
  Harmonize parameters in autodoc in Ruby and Octave with Python
2019-01-22 07:50:32 +00:00
William S Fulton
8a1ad6adc6 Merge branch 'vadz-py-restore-autodoc-defval'
* vadz-py-restore-autodoc-defval:
  Always include default parameter values in Python autodoc strings
2019-01-22 07:21:31 +00:00
Zackery Spytz
d5afcab9a6 [OCaml] Some %typecheck precedence tweaks
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.
2019-01-21 23:17:43 -07:00
William S Fulton
82513bbf8f Fix CCache test.sh when CC contains full path
Fixes symbolic link creation.
Also fixes test.sh when SWIG contains a full path.

Closes #1212
2019-01-21 18:08:30 +00:00
William S Fulton
d8478d671d Fix segfault using -python -noproxy and %pythonbegin 2019-01-21 07:50:48 +00:00
Zackery Spytz
8b083b4284 [OCaml] Runtime tests for overload_method, typedef_class and some others
Add runtime tests for overload_method, typedef_class,
typedef_inherit, typemap_arrays, typemap_delete, types_directive, and
valuewrapper.
2019-01-20 23:08:03 -07:00
Vadim Zeitlin
cd526caed4 Harmonize parameters in autodoc in Ruby and Octave with Python
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.
2019-01-21 01:08:45 +01:00
Vadim Zeitlin
1e22e791ef Always include default parameter values in Python autodoc strings
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.
2019-01-21 00:57:02 +01:00
William S Fulton
5c21de71c7 Fix configure.ac to work again with version 2.58 testing the D compiler
Remove use of _AC_DO_STDERR which became available in autoconf 2.60.

Closes #1405
2019-01-20 17:06:43 +00:00
Zackery Spytz
9149a9766c Fix compiler warnings when SWIGRUNTIME_DEBUG is defined 2019-01-19 17:14:46 -07:00
Olly Betts
3b03f920e7 Suppress warnings about PyCFunction casts
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.
2019-01-20 12:27:36 +13:00
William S Fulton
8587fd7b0d Merge branch 'ZackerySpytz-OCaml-overloaded-bools-typecheck'
* ZackerySpytz-OCaml-overloaded-bools-typecheck:
  [OCaml] Remove the last remnants of libswigocaml
  [OCaml] Fix the handling of bools in overloaded functions
2019-01-19 23:06:56 +00:00
William S Fulton
65cab79071 Merge branch 'ZackerySpytz-OCaml-dead-code-overloaded-funcs'
* ZackerySpytz-OCaml-dead-code-overloaded-funcs:
  [OCaml] Fix dead code generation in overloaded function wrappers
2019-01-19 23:03:07 +00:00
William S Fulton
88b83a3a75 Merge branch 'ZackerySpytz-OCaml-fvirtual-overload_polymorphic-runtime-tests'
* ZackerySpytz-OCaml-fvirtual-overload_polymorphic-runtime-tests:
  [OCaml] Runtime tests for fvirtual, overload_polymorphic and some others
2019-01-19 23:00:18 +00:00
William S Fulton
6634016962 Merge branch 'ZackerySpytz-OCaml-error-msg-incorrect-overloaded-call'
* ZackerySpytz-OCaml-error-msg-incorrect-overloaded-call:
  [OCaml] Improve the error message for incorrect overloaded function calls
2019-01-19 22:59:12 +00:00
William S Fulton
8e1893f355 D warning suppressions in autodoc testcase 2019-01-19 19:52:40 +00:00
William S Fulton
d305b8a3fc update .gitignore for Python and OCaml 2019-01-19 19:52:40 +00:00
William S Fulton
721f6ddef1 Add autodoc and keyword argument tests 2019-01-19 19:52:40 +00:00
William S Fulton
1329ed7a5c Suppress rename warnings when parameter names are keywords
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
2019-01-19 19:52:34 +00:00
Zackery Spytz
6da9bd485e [OCaml] Remove the last remnants of libswigocaml
Parts of it were removed in 79785d403c

Remove the oc_bool type.
2019-01-18 23:48:46 -07:00
Zackery Spytz
b879ccdc3e [OCaml] Fix the handling of bools in overloaded functions
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.
2019-01-18 23:42:59 -07:00
William S Fulton
ffb7b30be9 Fix gdb error: Undefined command: "Printf".
The swig.gdb file provides the swigprint and locswigprint user-defined
commands which stopped working somewhere around gdb 8.0 - 8.2.
```
(gdb) swigprint n
Undefined command: "Printf".  Try "help".
(gdb) locswigprint n
Undefined command: "Printf".  Try "help".
(gdb)
```

I couldn't find any mention of gdb's Printf, but replacing Printf with
printf works and is documented at
https://sourceware.org/gdb/download/onlinedocs/gdb/Output.html#Output

Fixes issue #1420

[skip ci]
2019-01-18 07:35:47 +00:00
Zackery Spytz
f71ee5be67 [OCaml] Runtime tests for fvirtual, overload_polymorphic and some others
Add runtime tests for conversion, extend_typedef_class,
extend_constructor_destructor, fvirtual, overload_polymorphic,
template_rename, and using1.
2019-01-17 15:58:48 -07:00
William S Fulton
2e9b270cbb Merge branch 'vadz-better-param-names'
* 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
2019-01-17 18:19:36 +00:00
Zackery Spytz
b3f903722b [OCaml] Improve the error message for incorrect overloaded function calls
List the possible prototypes in the error message. The code was taken
from python.cxx's dispatchFunction().
2019-01-16 23:08:12 -07:00