From 96438b4268c68ad549949436c9f5752fb8ab83fe Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 14 Jun 2021 12:57:22 +0100 Subject: [PATCH] Remove compatibility with OCaml 4.02 (makes ctypes stubs compatible with ocaml-multicore for free) --- .github/workflows/test.yml | 2 -- ctypes.opam | 2 +- src/cstubs/cstubs_emit_c.ml | 3 +-- src/ctypes-foreign/ffi_call_stubs.c | 4 ++-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0448fda5d..9380ddf1f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/ctypes.opam b/ctypes.opam index 060904c3b..31617e76c 100644 --- a/ctypes.opam +++ b/ctypes.opam @@ -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"} diff --git a/src/cstubs/cstubs_emit_c.ml b/src/cstubs/cstubs_emit_c.ml index ab2def4f2..fad21dfad 100644 --- a/src/cstubs/cstubs_emit_c.ml +++ b/src/cstubs/cstubs_emit_c.ml @@ -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 diff --git a/src/ctypes-foreign/ffi_call_stubs.c b/src/ctypes-foreign/ffi_call_stubs.c index 139cc0dd6..85e07ba98 100644 --- a/src/ctypes-foreign/ffi_call_stubs.c +++ b/src/ctypes-foreign/ffi_call_stubs.c @@ -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);