Skip to content

Commit

Permalink
Merge pull request #8 from kit-ty-kate/500
Browse files Browse the repository at this point in the history
Add support for OCaml 5.00
  • Loading branch information
dinosaure committed Feb 24, 2022
2 parents 47c6060 + bae50a9 commit 75e9fbf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .ocamlformat
@@ -1,3 +1,4 @@
version=0.20.1
break-sequences=true
doc-comments=before
field-space=loose
Expand Down
1 change: 1 addition & 0 deletions mmap.opam
Expand Up @@ -12,6 +12,7 @@ build: [
depends: [
"ocaml" {>= "4.02.3"}
"dune" {>= "1.6"}
"bigarray-compat"
]
synopsis: "File mapping functionality"
description: """
Expand Down
2 changes: 1 addition & 1 deletion src/dune
@@ -1,7 +1,7 @@
(library
(public_name mmap)
(modules mmap)
(libraries unix bigarray))
(libraries unix bigarray-compat))

(rule
(with-stdout-to selected (run %{ocaml} %{dep:which_mmap.ml} %{ocaml_version})))
Expand Down
6 changes: 3 additions & 3 deletions src/mmap.mli
Expand Up @@ -4,10 +4,10 @@ module V1 : sig
val map_file :
Unix.file_descr
-> ?pos:int64
-> ('a, 'b) Bigarray.kind
-> 'c Bigarray.layout
-> ('a, 'b) Bigarray_compat.kind
-> 'c Bigarray_compat.layout
-> bool
-> int array
-> ('a, 'b, 'c) Bigarray.Genarray.t
-> ('a, 'b, 'c) Bigarray_compat.Genarray.t
(** [map_file] is the same as {!Unix.map_file} in OCaml >= 4.06.0 *)
end
2 changes: 1 addition & 1 deletion src/mmap_bigarray.ml
Expand Up @@ -72,7 +72,7 @@ module V1 = struct
]

let map_file fd ?pos kind layout shared dims =
try Bigarray.Genarray.map_file fd ?pos kind layout shared dims
try Bigarray_compat.Genarray.map_file fd ?pos kind layout shared dims
with Sys_error description as exn ->
try
let error_code =
Expand Down
2 changes: 1 addition & 1 deletion test/test.ml
@@ -1,4 +1,4 @@
open Bigarray
open Bigarray_compat

(* Test harness *)

Expand Down

0 comments on commit 75e9fbf

Please sign in to comment.