From 74e7d8787200302d7a47535cd8d87e158ae10f92 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 10 Dec 2019 22:55:13 -0600 Subject: [PATCH] fix: backport a pseudo Floatarray pre 4.06 --- src/core/CCArray.ml | 2 +- src/core/mkshims.ml | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/core/CCArray.ml b/src/core/CCArray.ml index 30cacf03..86c5ef06 100644 --- a/src/core/CCArray.ml +++ b/src/core/CCArray.ml @@ -729,7 +729,7 @@ include Infix (* test consistency of interfaces *) (*$inject - module FA = Array.Floatarray + module FA = CCShimsArray_.Floatarray module type L = module type of CCArray with module Floatarray := FA module type LL = module type of CCArrayLabels with module Floatarray := FA *) diff --git a/src/core/mkshims.ml b/src/core/mkshims.ml index 7c38512c..ba9fb11c 100644 --- a/src/core/mkshims.ml +++ b/src/core/mkshims.ml @@ -74,6 +74,12 @@ let shims_list_pre_408 = " " let shims_list_post_408 = "include List" +let shims_array_pre_406 = " + include Array + module Floatarray = struct end + type 'a t = 'a array + " + let shims_array_pre_408 = " include Array type 'a t = 'a array @@ -138,7 +144,10 @@ let () = let major, minor = Scanf.sscanf version "%u.%u" (fun maj min -> maj, min) in write_file "CCShims_.ml" (if (major, minor) >= (4,7) then shims_post_407 else shims_pre_407); write_file "CCShimsList_.ml" (if (major, minor) >= (4,8) then shims_list_post_408 else shims_list_pre_408); - write_file "CCShimsArray_.ml" (if (major, minor) >= (4,8) then shims_array_post_408 else shims_array_pre_408); + write_file "CCShimsArray_.ml" + (if (major, minor) >= (4,8) then shims_array_post_408 + else if (major, minor) >= (4,6) then shims_fmt_pre_408 + else shims_array_pre_406); write_file "CCShimsFormat_.ml" (if (major, minor) >= (4,8) then shims_fmt_post_408 else shims_fmt_pre_408); 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);