From b6b6fa0efb4a39527d417d5c88f1126ef9fab85a Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Thu, 11 Jul 2019 14:49:14 +0200 Subject: [PATCH 1/4] Compatibility with mirage+dune --- bigstringaf.opam | 2 +- lib/bigstringaf.ml | 6 +++--- lib/bigstringaf.mli | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bigstringaf.opam b/bigstringaf.opam index 89b096b..91e7445 100644 --- a/bigstringaf.opam +++ b/bigstringaf.opam @@ -13,7 +13,7 @@ build: [ depends: [ "dune" {build} "alcotest" {with-test} - "base-bigarray" + "bigarray-compat" "ocaml" {>= "4.03.0"} ] depopts: [ diff --git a/lib/bigstringaf.ml b/lib/bigstringaf.ml index cab76a0..ed0fe0b 100644 --- a/lib/bigstringaf.ml +++ b/lib/bigstringaf.ml @@ -1,12 +1,12 @@ type bigstring = - (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t + (char, Bigarray_compat.int8_unsigned_elt, Bigarray_compat.c_layout) Bigarray_compat.Array1.t type t = bigstring -let create size = Bigarray.(Array1.create char c_layout size) +let create size = Bigarray_compat.(Array1.create char c_layout size) let empty = create 0 -module BA1 = Bigarray.Array1 +module BA1 = Bigarray_compat.Array1 let length t = BA1.dim t diff --git a/lib/bigstringaf.mli b/lib/bigstringaf.mli index ba9d9da..92866db 100644 --- a/lib/bigstringaf.mli +++ b/lib/bigstringaf.mli @@ -9,7 +9,7 @@ So here they are. Go crazy. *) type t = - (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t + (char, Bigarray_compat.int8_unsigned_elt, Bigarray_compat.c_layout) Bigarray_compat.Array1.t (** {2 Constructors} *) From bbc8a4c6cb4d9de0c35c01dae022cff5506d3ba3 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Thu, 11 Jul 2019 15:08:31 +0200 Subject: [PATCH 2/4] Add bigarray-compat on bigstringaf.{xen,freestanding} --- lib/freestanding/dune | 2 +- lib/xen/dune | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/freestanding/dune b/lib/freestanding/dune index 0d294dd..b540ea3 100644 --- a/lib/freestanding/dune +++ b/lib/freestanding/dune @@ -2,7 +2,7 @@ (name bigstringaf_freestanding) (public_name bigstringaf.freestanding) (optional) - (libraries bigarray ocaml-freestanding) + (libraries bigarray-compat ocaml-freestanding) (c_names bigstringaf_stubs) (c_flags (:include cflags.sexp))) diff --git a/lib/xen/dune b/lib/xen/dune index 6ebc6f9..bcd888d 100644 --- a/lib/xen/dune +++ b/lib/xen/dune @@ -2,7 +2,7 @@ (name bigstringaf_xen) (public_name bigstringaf.xen) (optional) - (libraries bigarray mirage-xen-posix) + (libraries bigarray-compat mirage-xen-posix) (c_names bigstringaf_stubs) (c_flags (:include cflags.sexp))) From d2fbfe5945c20c7aab42291e342eb9044802808f Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Thu, 11 Jul 2019 15:30:24 +0200 Subject: [PATCH 3/4] Add bigarray-compat on bigstringaf dune file --- lib/dune | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dune b/lib/dune index 45a36ab..3b8c040 100644 --- a/lib/dune +++ b/lib/dune @@ -1,7 +1,7 @@ (library (name bigstringaf) (public_name bigstringaf) - (libraries bigarray) + (libraries bigarray-compat) (flags (:standard -safe-string)) (c_names bigstringaf_stubs) From 542592d557a2a779a55da98be35e0f923d6859b8 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Fri, 12 Jul 2019 14:21:58 +0200 Subject: [PATCH 4/4] Add :standard in c_flags on C stubs --- lib/dune | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dune b/lib/dune index 3b8c040..1eaf41f 100644 --- a/lib/dune +++ b/lib/dune @@ -5,7 +5,7 @@ (flags (:standard -safe-string)) (c_names bigstringaf_stubs) - (c_flags (-Wall -Wextra -Wpedantic)) + (c_flags (:standard -Wall -Wextra -Wpedantic)) (js_of_ocaml (javascript_files runtime.js)) )