Skip to content

Commit

Permalink
runtime: use Stdlib starting on 4.07
Browse files Browse the repository at this point in the history
  • Loading branch information
gasche committed Jun 25, 2019
1 parent 8814093 commit 7759bcb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/runtime/ppx_deriving_runtime.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ type nonrec int64 = int64
type nonrec 'a lazy_t = 'a lazy_t
type nonrec bytes = bytes

#if OCAML_VERSION >= (4, 07, 0)
module Stdlib = Stdlib

include Stdlib
#else
module Pervasives = Pervasives

module Char = Char
module String = String
module Printexc = Printexc
Expand All @@ -39,3 +45,4 @@ module Buffer = Buffer
module Result = Result

include Pervasives
#endif
8 changes: 8 additions & 0 deletions src/runtime/ppx_deriving_runtime.cppo.mli
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ type nonrec bytes = bytes
(** {2 Predefined modules}
{3 Operations on predefined types} *)

#if OCAML_VERSION >= (4, 07, 0)
module Stdlib : (module type of Stdlib)
(* @since OCaml 4.07.0 *)

include Stdlib
#else
module Pervasives : (module type of Pervasives with
type fpclass = Pervasives.fpclass and
type in_channel = Pervasives.in_channel and
Expand All @@ -31,6 +37,7 @@ module Pervasives : (module type of Pervasives with
type ('a, 'b, 'c, 'd, 'e, 'f) format6 = ('a, 'b, 'c, 'd, 'e, 'f) Pervasives.format6 and
type ('a, 'b, 'c, 'd) format4 = ('a, 'b, 'c, 'd) Pervasives.format4 and
type ('a, 'b, 'c) format = ('a, 'b, 'c) Pervasives.format)

include (module type of Pervasives with
type fpclass = Pervasives.fpclass and
type in_channel = Pervasives.in_channel and
Expand Down Expand Up @@ -83,3 +90,4 @@ module Format : (module type of Format with
type formatter_out_functions = Format.formatter_out_functions and
type formatter_tag_functions = Format.formatter_tag_functions and
type formatter = Format.formatter)
#endif

0 comments on commit 7759bcb

Please sign in to comment.