From adece72ba8bda3c7af82dec5d97091d188a8e08f Mon Sep 17 00:00:00 2001 From: Kate Date: Tue, 16 Nov 2021 21:55:33 +0000 Subject: [PATCH] Add support for OCaml 4.14 Signed-off-by: Kate --- compiler-stdlib/gen/gen.ml | 6 ++++++ src/base.ml | 2 ++ src/import0.ml | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler-stdlib/gen/gen.ml b/compiler-stdlib/gen/gen.ml index 2eeb65a0..10f055f8 100644 --- a/compiler-stdlib/gen/gen.ml +++ b/compiler-stdlib/gen/gen.ml @@ -6,6 +6,7 @@ module Ocaml_version : sig val v407 : t val v408 : t val v412 : t + val v414 : t val current : t val compare : t -> t -> int end = struct @@ -28,6 +29,7 @@ end = struct let v407 = parse "4.07" let v408 = parse "4.08" let v412 = parse "4.12" + let v414 = parse "4.14" let current = parse Sys.ocaml_version let compare ((a1, b1) : t) ((a2, b2) : t) = @@ -86,6 +88,10 @@ let () = then ( pr "module Atomic = struct end"; pr "module Either = struct end"); + if Ocaml_version.(compare current v414) < 0 + then ( + pr "module In_channel = struct end"; + pr "module Out_channel = struct end"); pr ""; pr "exception Not_found = Not_found" ;; diff --git a/src/base.ml b/src/base.ml index a00ec46f..a0fe1962 100644 --- a/src/base.ml +++ b/src/base.ml @@ -47,6 +47,7 @@ include ( with module Either := Shadow_stdlib.Either with module Float := Shadow_stdlib.Float with module Hashtbl := Shadow_stdlib.Hashtbl + with module In_channel := Shadow_stdlib.In_channel with module Int := Shadow_stdlib.Int with module Int32 := Shadow_stdlib.Int32 with module Int64 := Shadow_stdlib.Int64 @@ -55,6 +56,7 @@ include ( with module Map := Shadow_stdlib.Map with module Nativeint := Shadow_stdlib.Nativeint with module Option := Shadow_stdlib.Option + with module Out_channel := Shadow_stdlib.Out_channel with module Printf := Shadow_stdlib.Printf with module Queue := Shadow_stdlib.Queue with module Random := Shadow_stdlib.Random diff --git a/src/import0.ml b/src/import0.ml index 05a64917..08a232a2 100644 --- a/src/import0.ml +++ b/src/import0.ml @@ -109,7 +109,7 @@ module Caml = struct module Stack = Caml.Stack (** @canonical Caml.Stack *) - module Stream = Caml.Stream (** @canonical Caml.Stream *) + module Stream = Caml.Stream [@ocaml.warning "-3"] (** @canonical Caml.Stream *) module String = Caml.StdLabels.String (** @canonical Caml.StdLabels.String *)