Commit graph

3,748 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
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
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
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
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
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
Zackery Spytz
9149a9766c Fix compiler warnings when SWIGRUNTIME_DEBUG is defined 2019-01-19 17:14:46 -07: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
Zackery Spytz
05589508a6 [OCaml] Add the caml_ prefix to some OCaml functions
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.
2019-01-14 20:45:13 -07:00
Zackery Spytz
83df4e8ed6 [OCaml] Fix and re-enable the string_simple, minherit, and unions tests
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
2019-01-13 17:28:00 -07:00
William S Fulton
7c4d29ae9a Merge branch 'ZackerySpytz-OCaml_int64_t'
* ZackerySpytz-OCaml_int64_t:
  Add changes entry for fixing OCaml int64_t compile problem
  Fix OCaml version detection if caml/version.h is not available
  [OCaml] Use int64_t instead of int64 for OCaml versions >= 4.03.0

Conflicts:
	CHANGES.current
2019-01-12 13:56:00 +00:00
William S Fulton
48d9e3bc02 Fix OCaml version detection if caml/version.h is not available
Needed for OCaml versions < 4.02.0
Issue #1403
2019-01-12 13:42:29 +00:00
William S Fulton
d6cd52f586 Fix OCAML typemap warnings wrapping C code
Fixes:
Lib/ocaml/typemaps.i:366: Warning 453: Can't apply (SWIGTYPE &). No typemaps are defined.
Lib/ocaml/typemaps.i:367: Warning 453: Can't apply (SWIGTYPE &&). No typemaps are defined.
Lib/ocaml/typemaps.i:372: Warning 453: Can't apply (SWIGTYPE &). No typemaps are defined.
2019-01-11 19:35:17 +00:00
William S Fulton
b64d685d5f Merge branch 'ZackerySpytz-OCaml-fix-member-var-access'
* ZackerySpytz-OCaml-fix-member-var-access:
  OCaml's classHandler() requires name, not sym:name.
  [OCaml] Fix member var getters and setters
2019-01-11 18:42:19 +00:00
Zackery Spytz
65f2111915 [OCaml] Use int64_t instead of int64 for OCaml versions >= 4.03.0
OCaml's int64 type was replaced with the C99 int64_t in OCaml 4.03.0.
b868c05ec9

Closes #1194.
2019-01-08 21:36:06 -07:00
William S Fulton
b463870b0c Add missing VOID definition to windows.i
Closes #358
2019-01-07 18:46:14 +00:00
Zackery Spytz
4a912668fc [OCaml] Fix member var getters and setters
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.
2019-01-06 09:40:25 -07:00
William S Fulton
6a80ec314a Merge branch 'typecheck-null-nonpointers'
* 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
2019-01-03 08:13:19 +00:00
Zackery Spytz
5988c3bb24 [OCaml] Replace SWIGSTATIC with SWIGINTERN
Use SWIGINTERN to silence unused function warnings.

In addition, remove the declarations for SWIG_MustGetPtr(),
wrap_delete_void(), enum_to_int(), and int_to_enum() -- these
lacked definitions and caused compiler warnings.
2019-01-01 06:28:35 -07:00
William S Fulton
330201018a Fix overloading for non-pointers and NULL - MzScheme 2018-12-30 17:12:33 +00:00
William S Fulton
cbc1f7f171 Overloading for non-pointers and NULL - Chicken
Rework this to be consistent with other target languages
2018-12-30 17:03:26 +00:00
William S Fulton
b48339cfca Fix overloading for non-pointers and NULL - Scilab 2018-12-30 14:22:13 +00:00
William S Fulton
f181d20dd1 Fix overloading for non-pointers and NULL - R 2018-12-30 13:46:51 +00:00
William S Fulton
b7db45661a Fix overloading for non-pointers and NULL - Php 2018-12-30 12:00:49 +00:00
William S Fulton
e354ba8cdc Fix overloading for non-pointers and NULL - Octave 2018-12-30 11:25:41 +00:00
William S Fulton
cd7772a274 Fix overloading for non-pointers and NULL - Lua 2018-12-30 10:54:53 +00:00
William S Fulton
ec8d978995 Overloading for non-pointers and NULL - Javascript
Overloading support for Javascript is generally incomplete as there are
no typecheck typemaps, so the overloading and NULL support added here
doesn't work and won't work until the typecheck typemaps are
implemented.
2018-12-30 10:11:35 +00:00
Zackery Spytz
c74ef14bb2 Update a dead link. 2018-12-30 02:51:58 -07:00
Zackery Spytz
701dc125e1 [OCaml] Add missing keywords to ocamlkw.swg
The asr, land, lor, lsl, lsr, lxor, mod, and nonrec keywords were
missing from ocamlkw.swg.
2018-12-30 02:50:46 -07:00
William S Fulton
eb151e43be Fix overloading for non-pointers and NULL - Guile 2018-12-30 09:26:33 +00:00
William S Fulton
12eb0f81ae Fix overloading for non-pointers and NULL - Tcl 2018-12-29 14:55:43 +00:00
William S Fulton
b1178cf130 Fix overloading for non-pointers and NULL - Perl 2018-12-29 14:15:59 +00:00
William S Fulton
d14c97408d Fix overloading for non-pointers and NULL - Ruby 2018-12-29 14:15:51 +00:00
William S Fulton
ef8a92578b Correct Python implicitconv code
Py_None is only possible with implicitconv so move this block of code
into the implicitconv if block.
2018-12-29 12:09:04 +00:00
William S Fulton
3efea1f4ab Fix typecheck typemaps for non-pointers and NULL
The typecheck typemaps succeed for non pointers (SWIGTYPE, SWIGTYPE&,
SWIGTYPE&&) when the equivalent to C NULL is passed from the target
language. This commit implements a fix for Python to not accept a Python
None for non-pointer types.

Issue #1202
2018-12-29 11:45:46 +00:00
William S Fulton
5a388863fa director_thread test fixes for MacOS
Add extra debugging and correctly detect MacOS using __APPLE__ macro
2018-12-21 19:08:15 +00:00
William S Fulton
d835c69d65 Merge branch 'java-director-thread-name'
* java-director-thread-name:
  Add changes entry for setting Java thread name
  Increased Java thread name size.
  Java directors - more generic thread name setting
  Use prctl method to get thread names, which is available on all NDK versions
  Actually, pthread_getname_np is only available in recent versions of Android (API level >= 26).
  Set thread name when attaching to Android JVM in SWIG Java director
2018-12-20 21:23:29 +00:00
William S Fulton
f948a756bb Increased Java thread name size.
MacOS thread_info.h can handle thread names up to 64 characters.
See issue #1334.
2018-12-20 21:21:54 +00:00
William S Fulton
26b8523fc4
Merge pull request #1382 from lpchambers/master
[Python] Add missing keywords 'async' and 'await' to pythonkw.swg.
2018-12-20 08:25:16 +00:00
William S Fulton
d9ecff1fca Merge branch 'chlandsi-master'
* chlandsi-master:
  Testcase for testing __new__ override Python 3.6 fix
  fix for creating new shadow class in python 3.6
2018-12-20 08:12:41 +00:00
Lewis Chambers
83ab3567dc [Python] Add missing keywords 'async' and 'await' to pythonkw.swg. 2018-12-20 09:21:50 +10:00
William S Fulton
e523556be3
Merge pull request #1375 from tlby/issue-1374
repair uses of EXTEND() in Perl typemaps
2018-12-16 15:01:42 +00:00
Robert Stone
871ece78e6 repair uses of EXTEND() in Perl typemaps
closes #1374
 * enhance testing around multiple return values
   Examples/test-suite/perl5/scilab_multivalue_runme.pl fails in
   perl-5.28.1 compiled with -DDEBUGING without the typemap updates
 * repair EXTEND() handling in typemaps
 * Use PL_sv_undef for VOID_Object
2018-12-11 15:51:14 -08:00
William S Fulton
b8fc71b5f8 Remove functions associated with tp_print that are now redundant
Removes SwigPyPacked_print and swig_varlink_print
2018-12-11 08:08:14 +00:00
Andrew Rogers
f8bf286a6e #1368: AV in tp_print caused by mismatched Python/extension CRT usage 2018-12-11 07:54:57 +00:00
William S Fulton
0147fb2e64 Workaround for incorrect output formatting 2018-12-06 07:44:34 +00:00
William S Fulton
009415e43b Cosmetic changes in SWIG_globals
Make local variable name standards compliant
2018-12-04 22:15:52 +00:00
Andrew Rogers
0fecd1538f Cleanup accessing/decref of globals, to avoid code bloat in init function. 2018-11-27 23:30:51 +00:00