Skip to content

Commit 881af12

Browse files
committed
CCInt64(chore): conditionally define function existing in newer OCaml
1 parent 54cd6dd commit 881af12

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/core/CCInt64.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
include Int64
44

5+
[@@@iflt 4.13]
6+
57
let min : t -> t -> t = Stdlib.min
68
let max : t -> t -> t = Stdlib.max
9+
10+
[@@@endif]
11+
712
let sign i = compare i zero
813

914
(* use FNV:

src/core/CCInt64.mli

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ include module type of struct
1818
include Int64
1919
end
2020

21+
[@@@iflt 4.13]
22+
2123
val min : t -> t -> t
2224
(** [min x y] returns the minimum of the two integers [x] and [y].
2325
@since 3.0 *)
@@ -26,10 +28,15 @@ val max : t -> t -> t
2628
(** [max x y] returns the maximum of the two integers [x] and [y].
2729
@since 3.0 *)
2830

31+
[@@@endif]
32+
[@@@iflt 5.1]
33+
2934
val hash : t -> int
3035
(** [hash x] computes the hash of [x], a non-negative integer.
3136
Uses FNV since 3.10 *)
3237

38+
[@@@endif]
39+
3340
val hash_to_int64 : t -> t
3441
(** Like {!hash} but does not truncate.
3542
Uses FNV.

0 commit comments

Comments
 (0)