From eaa421c62d8399226e5bb6a7691c1505756812ed Mon Sep 17 00:00:00 2001 From: Fardale Date: Sun, 17 May 2020 00:11:04 +0200 Subject: [PATCH] chore(int): include module Int for ocaml >= 4.08 --- src/core/CCInt.ml | 2 ++ src/core/CCInt.mli | 2 ++ src/core/dune | 3 ++- src/core/mkshims.ml | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/CCInt.ml b/src/core/CCInt.ml index 17e41695..1d64460b 100644 --- a/src/core/CCInt.ml +++ b/src/core/CCInt.ml @@ -3,6 +3,8 @@ open CCShims_ +include CCShimsInt_ + type t = int type 'a iter = ('a -> unit) -> unit diff --git a/src/core/CCInt.mli b/src/core/CCInt.mli index 11a07b08..8cef2434 100644 --- a/src/core/CCInt.mli +++ b/src/core/CCInt.mli @@ -3,6 +3,8 @@ (** {1 Basic Int functions} *) +include module type of CCShimsInt_ + type t = int val zero : t diff --git a/src/core/dune b/src/core/dune index 0b99c77d..3831a985 100644 --- a/src/core/dune +++ b/src/core/dune @@ -6,7 +6,8 @@ (rule (targets CCShims_.ml CCShimsList_.ml CCShimsFun_.ml CCShimsFun_.mli - CCShimsArray_.ml CCShimsFormat_.ml CCShimsMkLet_.ml CCShimsArrayLabels_.ml) + CCShimsArray_.ml CCShimsFormat_.ml CCShimsMkLet_.ml CCShimsArrayLabels_.ml + CCShimsInt_.ml) (deps ./mkshims.exe) (action (run ./mkshims.exe))) diff --git a/src/core/mkshims.ml b/src/core/mkshims.ml index 8f018966..f0b615bd 100644 --- a/src/core/mkshims.ml +++ b/src/core/mkshims.ml @@ -150,6 +150,9 @@ let shims_let_op_post_408 = end[@@inline] " +let shims_int_pre_408 = "" +let shims_int_post_408 = "include Int" + let () = C.main ~name:"mkshims" (fun c -> let version = C.ocaml_config_var_exn c "version" in @@ -168,4 +171,5 @@ let () = write_file "CCShimsFun_.ml" (if (major, minor) >= (4,8) then shims_fun_post_408 else shims_fun_pre_408); write_file "CCShimsFun_.mli" (if (major, minor) >= (4,8) then shims_fun_mli_post_408 else shims_fun_mli_pre_408); write_file "CCShimsMkLet_.ml" (if (major, minor) >= (4,8) then shims_let_op_post_408 else shims_let_op_pre_408); + write_file "CCShimsInt_.ml" (if (major, minor) >= (4,8) then shims_int_post_408 else shims_int_pre_408); )