CCInt64(chore): conditionally define function existing in newer OCaml

This commit is contained in:
Fardale 2024-12-25 19:30:26 +01:00
parent 54cd6dd83d
commit 881af122e4
2 changed files with 12 additions and 0 deletions

View file

@ -2,8 +2,13 @@
include Int64 include Int64
[@@@iflt 4.13]
let min : t -> t -> t = Stdlib.min let min : t -> t -> t = Stdlib.min
let max : t -> t -> t = Stdlib.max let max : t -> t -> t = Stdlib.max
[@@@endif]
let sign i = compare i zero let sign i = compare i zero
(* use FNV: (* use FNV:

View file

@ -18,6 +18,8 @@ include module type of struct
include Int64 include Int64
end end
[@@@iflt 4.13]
val min : t -> t -> t val min : t -> t -> t
(** [min x y] returns the minimum of the two integers [x] and [y]. (** [min x y] returns the minimum of the two integers [x] and [y].
@since 3.0 *) @since 3.0 *)
@ -26,10 +28,15 @@ val max : t -> t -> t
(** [max x y] returns the maximum of the two integers [x] and [y]. (** [max x y] returns the maximum of the two integers [x] and [y].
@since 3.0 *) @since 3.0 *)
[@@@endif]
[@@@iflt 5.1]
val hash : t -> int val hash : t -> int
(** [hash x] computes the hash of [x], a non-negative integer. (** [hash x] computes the hash of [x], a non-negative integer.
Uses FNV since 3.10 *) Uses FNV since 3.10 *)
[@@@endif]
val hash_to_int64 : t -> t val hash_to_int64 : t -> t
(** Like {!hash} but does not truncate. (** Like {!hash} but does not truncate.
Uses FNV. Uses FNV.