ocaml-containers/src/monomorphic/mkshims.ml
Simon Cruanes 96ed8a37ab feat: introduce shim modules for 4.08 compat
- also make `unlabel` an explicit operation
- use `Stdlib` instead of `Pervasives`
- remove some warnings in Format
2019-06-14 18:26:14 -05:00

11 lines
393 B
OCaml

module C = Configurator.V1
let shims_pre_408 = "module Stdlib = Pervasives"
let shims_post_408 = "module Stdlib = Stdlib"
let () =
C.main ~name:"mkshims" (fun c ->
let version = C.ocaml_config_var_exn c "version" in
let major, minor = Scanf.sscanf version "%u.%u" (fun maj min -> maj, min) in
print_endline (if (major, minor) >= (4,8) then shims_post_408 else shims_pre_408))