Skip to content

Commit

Permalink
Merge pull request #673 from kit-ty-kate/multicore
Browse files Browse the repository at this point in the history
Remove compatibility with OCaml 4.02 (makes ctypes stubs compatible with ocaml-multicore for free)
  • Loading branch information
yallop committed Jun 14, 2021
2 parents 853915f + 96438b4 commit b5924fc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
ocaml-version: 4.02.3
- os: ubuntu-latest
ocaml-version: 4.03.0
- os: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion ctypes.opam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ install: [
[make "install" "XEN=%{mirage-xen:enable}%"]
]
depends: [
"ocaml" {>= "4.02.3"}
"ocaml" {>= "4.03.0"}
"integers" { >= "0.3.0" }
"ocamlfind" {build}
"lwt" {with-test & >= "3.2.0"}
Expand Down
3 changes: 1 addition & 2 deletions src/cstubs/cstubs_emit_c.ml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ let camlop fmt : camlop -> unit = function
| `CAMLlocalN (e, c) -> Format.fprintf fmt "CAMLlocalN(@[%a@],@ @[%a@])"
cexp e cexp c
| `CAMLdrop ->
Format.fprintf fmt "caml_local_roots = caml__frame;"
(* Format.fprintf fmt "CAMLdrop()" *) (* 4.03+ only *)
Format.fprintf fmt "CAMLdrop()"

let rec ceff fmt : ceff -> unit = function
| #cexp as e -> cexp fmt e
Expand Down
4 changes: 2 additions & 2 deletions src/ctypes-foreign/ffi_call_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ value ctypes_call(value fnname, value function, value callspec_,
unsigned arg_idx;
for(arg_idx = 0; arg_idx < Wosize_val(callback_val_arr); arg_idx++) {
value arg_tuple = Field(callback_val_arr, arg_idx);
/* <4.02 initialize to 0; >=4.02 initialize to unit. */
if(arg_tuple == 0 || arg_tuple == Val_unit) continue;
/* >=4.02 initialize to unit. */
if(arg_tuple == Val_unit) continue;

value arg_ptr = Field(arg_tuple, 0);
value arg_offset = Field(arg_tuple, 1);
Expand Down

0 comments on commit b5924fc

Please sign in to comment.