Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove compatibility with OCaml 4.02 (makes ctypes stubs compatible with ocaml-multicore for free) #673

Merged
merged 1 commit into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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