diff --git a/0001-Test-32-bit.patch b/0001-Test-32-bit.patch deleted file mode 100644 index 6a998c9..0000000 --- a/0001-Test-32-bit.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 2ee6d22606c4676685cf9c67befc30638f30cbd7 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Thu, 15 Mar 2018 15:30:51 +0000 -Subject: [PATCH 01/11] Test 32-bit - ---- - .travis.yml | 37 ++++++++++++++++++++++++++++--------- - 1 file changed, 28 insertions(+), 9 deletions(-) - -diff --git a/.travis.yml b/.travis.yml -index 363888a..adef916 100644 ---- a/.travis.yml -+++ b/.travis.yml -@@ -2,12 +2,31 @@ language: c - sudo: required - install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh - script: bash -ex .travis-opam.sh --env: -- - OCAML_VERSION=4.02 -- - OCAML_VERSION=4.03 -- - OCAML_VERSION=4.04 -- - OCAML_VERSION=4.05 -- - OCAML_VERSION=4.06 --os: -- - linux -- - osx -+matrix: -+ include: -+ - env: OCAML_VERSION=4.02 -+ os: osx -+ - env: OCAML_VERSION=4.03 -+ os: osx -+ - env: OCAML_VERSION=4.04 -+ os: osx -+ - env: OCAML_VERSION=4.05 -+ os: osx -+ - env: OCAML_VERSION=4.06 -+ os: osx -+ - env: OCAML_VERSION=4.02 -+ os: linux -+ - env: OCAML_VERSION=4.03 -+ os: linux -+ - env: OCAML_VERSION=4.04 -+ os: linux -+ - env: OCAML_VERSION=4.05 -+ os: linux -+ - env: OCAML_VERSION=4.06 -+ os: linux -+ - env: OCAML_VERSION=4.06 OPAM_SWITCH=4.06.1+32bit -+ os: linux -+ addons: -+ apt: -+ packages: -+ - gcc-multilib --- -2.15.1 - diff --git a/0002-IO-restore-compilation-on-32-bit-broken-in-1.7.3.patch b/0002-IO-restore-compilation-on-32-bit-broken-in-1.7.3.patch deleted file mode 100644 index e051299..0000000 --- a/0002-IO-restore-compilation-on-32-bit-broken-in-1.7.3.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 21784d25591db39fe74ea2626bd703ba8b2b2181 Mon Sep 17 00:00:00 2001 -From: ygrek -Date: Sun, 15 Apr 2018 18:48:33 +0300 -Subject: [PATCH 02/11] IO: restore compilation on 32-bit (broken in 1.7.3) - -close #46 ---- - CHANGES | 3 +++ - src/IO.ml | 4 ++++ - src/configure.ml | 1 + - 3 files changed, 8 insertions(+) - -diff --git a/CHANGES b/CHANGES -index 98c143a..5686ee4 100644 ---- a/CHANGES -+++ b/CHANGES -@@ -1,3 +1,6 @@ -+1.7.5 ? -+ * IO: restore compilation on 32-bit (broken in 1.7.3) -+ - 1.7.4 (2018-03-12) - * fix tests with OCaml 4.06 - -diff --git a/src/IO.ml b/src/IO.ml -index 5dc6262..c4c00bf 100644 ---- a/src/IO.ml -+++ b/src/IO.ml -@@ -574,7 +574,9 @@ let write_i31 ch n = - write_32 ch n - - let write_i32 ch n = -+#ifndef WORD_SIZE_32 - if n < -0x8000_0000 || n > 0x7FFF_FFFF then raise (Overflow "write_i32"); -+#endif - write_32 ch n - - let write_real_i32 ch n = -@@ -678,7 +680,9 @@ let write_i31 ch n = - write_32 ch n - - let write_i32 ch n = -+#ifndef WORD_SIZE_32 - if n < -0x8000_0000 || n > 0x7FFF_FFFF then raise (Overflow "write_i32"); -+#endif - write_32 ch n - - let write_real_i32 ch n = -diff --git a/src/configure.ml b/src/configure.ml -index e04ded7..1f92c89 100644 ---- a/src/configure.ml -+++ b/src/configure.ml -@@ -10,6 +10,7 @@ let () = - print_endline (if Sys.ocaml_version >= "4.04.0" then "-D OCAML4_04 " else ""); - print_endline (if Sys.ocaml_version >= "4.05.0" then "-D OCAML4_05 " else ""); - print_endline (if Sys.ocaml_version >= "4.06.0" then "-D OCAML4_06 " else ""); -+ print_endline (if Sys.word_size = 32 then "-D WORD_SIZE_32 " else ""); - show_bytes "-D WITH_BYTES"; - exit 0 - | [|_;"-compile-args"|] -> --- -2.15.1 - diff --git a/0003-Correct-31-bit-IO-test-on-32-bit.patch b/0003-Correct-31-bit-IO-test-on-32-bit.patch deleted file mode 100644 index adc06a4..0000000 --- a/0003-Correct-31-bit-IO-test-on-32-bit.patch +++ /dev/null @@ -1,26 +0,0 @@ -From e247b3d7ca9eb94bcd80c0fb62864dad2056e8f3 Mon Sep 17 00:00:00 2001 -From: David Allsopp -Date: Thu, 15 Mar 2018 23:01:55 +0000 -Subject: [PATCH 03/11] Correct 31-bit IO test on 32-bit - -Failure cases can't be triggered. ---- - test/test_IO.ml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/test_IO.ml b/test/test_IO.ml -index 3dce9e2..94b5113 100644 ---- a/test/test_IO.ml -+++ b/test/test_IO.ml -@@ -73,7 +73,7 @@ let test_u16 () = - - let test_i31 () = - let values = [~-0x40000000;-1;0;1;0x3FFFFFFF] in -- let invalid = [~-0x40000001;0x40000000] in -+ let invalid = if Sys.word_size = 32 then [] else [~-0x40000001;0x40000000] in - let test = test_write_read values invalid string_of_int in - test IO.write_i31 IO.read_i31; - test IO.BigEndian.write_i31 IO.BigEndian.read_i31; --- -2.15.1 - diff --git a/0004-IO-also-disable-useless-overflow-tests-on-32-bit.patch b/0004-IO-also-disable-useless-overflow-tests-on-32-bit.patch deleted file mode 100644 index 0087206..0000000 --- a/0004-IO-also-disable-useless-overflow-tests-on-32-bit.patch +++ /dev/null @@ -1,36 +0,0 @@ -From c7499c9d228dad3537253862cd7f08c2ddf84dd4 Mon Sep 17 00:00:00 2001 -From: ygrek -Date: Sun, 15 Apr 2018 19:16:46 +0300 -Subject: [PATCH 04/11] IO: also disable useless overflow tests on 32-bit - ---- - src/IO.ml | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/IO.ml b/src/IO.ml -index c4c00bf..fd719cd 100644 ---- a/src/IO.ml -+++ b/src/IO.ml -@@ -570,7 +570,9 @@ let write_32 ch n = - write_byte ch (n asr 24) - - let write_i31 ch n = -+#ifndef WORD_SIZE_32 - if n < -0x4000_0000 || n > 0x3FFF_FFFF then raise (Overflow "write_i31"); -+#endif - write_32 ch n - - let write_i32 ch n = -@@ -676,7 +678,9 @@ let write_32 ch n = - write_byte ch n - - let write_i31 ch n = -+#ifndef WORD_SIZE_32 - if n < -0x4000_0000 || n > 0x3FFF_FFFF then raise (Overflow "write_i31"); -+#endif - write_32 ch n - - let write_i32 ch n = --- -2.15.1 - diff --git a/0005-IO-read_i32_as_int.patch b/0005-IO-read_i32_as_int.patch deleted file mode 100644 index 47a34bc..0000000 --- a/0005-IO-read_i32_as_int.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 829bb430c222948717f182e59dac2dbbac89fa5b Mon Sep 17 00:00:00 2001 -From: ygrek -Date: Sun, 15 Apr 2018 20:19:48 +0300 -Subject: [PATCH 05/11] IO: + read_i32_as_int - ---- - src/IO.ml | 18 ++++++++++++------ - src/IO.mli | 6 +++++- - test/test_IO.ml | 15 +++++++++++++-- - 3 files changed, 30 insertions(+), 9 deletions(-) - -diff --git a/src/IO.ml b/src/IO.ml -index fd719cd..45b73a0 100644 ---- a/src/IO.ml -+++ b/src/IO.ml -@@ -496,19 +496,22 @@ let read_i16 i = - - let sign_bit_i32 = lnot 0x7FFF_FFFF - --let read_i31 ch = -+let read_32 ~i31 ch = - let ch1 = read_byte ch in - let ch2 = read_byte ch in - let ch3 = read_byte ch in - let ch4 = read_byte ch in - if ch4 land 128 <> 0 then begin -- if ch4 land 64 = 0 then raise (Overflow "read_i31"); -+ if i31 && ch4 land 64 = 0 then raise (Overflow "read_i31"); - ch1 lor (ch2 lsl 8) lor (ch3 lsl 16) lor ((ch4 land 127) lsl 24) lor sign_bit_i32 - end else begin -- if ch4 land 64 <> 0 then raise (Overflow "read_i31"); -+ if i31 && ch4 land 64 <> 0 then raise (Overflow "read_i31"); - ch1 lor (ch2 lsl 8) lor (ch3 lsl 16) lor (ch4 lsl 24) - end - -+let read_i31 ch = read_32 ~i31:true ch -+let read_i32_as_int ch = read_32 ~i31:false ch -+ - let read_i32 = read_i31 - - let read_real_i32 ch = -@@ -620,19 +623,22 @@ let read_i16 i = - - let sign_bit_i32 = lnot 0x7FFF_FFFF - --let read_i31 ch = -+let read_32 ~i31 ch = - let ch4 = read_byte ch in - let ch3 = read_byte ch in - let ch2 = read_byte ch in - let ch1 = read_byte ch in - if ch4 land 128 <> 0 then begin -- if ch4 land 64 = 0 then raise (Overflow "read_i31"); -+ if i31 && ch4 land 64 = 0 then raise (Overflow "read_i31"); - ch1 lor (ch2 lsl 8) lor (ch3 lsl 16) lor ((ch4 land 127) lsl 24) lor sign_bit_i32 - end else begin -- if ch4 land 64 <> 0 then raise (Overflow "read_i31"); -+ if i31 && ch4 land 64 <> 0 then raise (Overflow "read_i31"); - ch1 lor (ch2 lsl 8) lor (ch3 lsl 16) lor (ch4 lsl 24) - end - -+let read_i31 ch = read_32 ~i31:true ch -+let read_i32_as_int ch = read_32 ~i31:false ch -+ - let read_i32 = read_i31 - - let read_real_i32 ch = -diff --git a/src/IO.mli b/src/IO.mli -index ddf0cd4..f0236eb 100644 ---- a/src/IO.mli -+++ b/src/IO.mli -@@ -209,11 +209,14 @@ val read_i16 : input -> int - - val read_i31 : input -> int - (** Read a signed 32-bit integer. Raise [Overflow] if the -- read integer cannot be represented as a Caml 31-bit integer. *) -+ read integer cannot be represented as an OCaml 31-bit integer. *) - - val read_i32 : input -> int - (** Deprecated, same as read_i31 *) - -+val read_i32_as_int : input -> int -+(** Read a signed 32-bit integer, represented as OCaml integer, wrapping around 31-bit int on 32-bit architecture *) -+ - val read_real_i32 : input -> int32 - (** Read a signed 32-bit integer as an OCaml int32. *) - -@@ -280,6 +283,7 @@ sig - val read_i16 : input -> int - val read_i31 : input -> int - val read_i32 : input -> int -+ val read_i32_as_int : input -> int - val read_real_i32 : input -> int32 - val read_i64 : input -> int64 - val read_float32 : input -> float -diff --git a/test/test_IO.ml b/test/test_IO.ml -index 94b5113..f2988fc 100644 ---- a/test/test_IO.ml -+++ b/test/test_IO.ml -@@ -72,14 +72,24 @@ let test_u16 () = - () - - let test_i31 () = -- let values = [~-0x40000000;-1;0;1;0x3FFFFFFF] in -- let invalid = if Sys.word_size = 32 then [] else [~-0x40000001;0x40000000] in -+ let values = [~-0x4000_0000;-1;0;1;0x3FFF_FFFF] in -+ let invalid = if Sys.word_size = 32 then [] else [~-0x4000_0001;0x4000_0000] in - let test = test_write_read values invalid string_of_int in - test IO.write_i31 IO.read_i31; - test IO.BigEndian.write_i31 IO.BigEndian.read_i31; - () - - let test_i32 () = -+ let min_i32 = Int32.to_int Int32.min_int in -+ let max_i32 = Int32.to_int Int32.max_int in -+ let values = [~-0x4000_0000;-1;0;1;0x3FFF_FFFF] @ if Sys.word_size = 32 then [] else [min_i32;max_i32] in -+ let invalid = if Sys.word_size = 32 then [] else [min_i32-1;max_i32+1] in -+ let test = test_write_read values invalid string_of_int in -+ test IO.write_i32 IO.read_i32_as_int; -+ test IO.BigEndian.write_i32 IO.BigEndian.read_i32_as_int; -+ () -+ -+let test_real_i32 () = - let values = [Int32.min_int;-1l;0l;1l;Int32.max_int] in - let invalid = [] in - let test = test_write_read values invalid Int32.to_string in -@@ -89,6 +99,7 @@ let test_i32 () = - - let () = - Util.register1 "IO" "i32" test_i32; -+ Util.register1 "IO" "real_i32" test_real_i32; - Util.register1 "IO" "i31" test_i31; - Util.register1 "IO" "u16" test_u16; - Util.register1 "IO" "i16" test_i16; --- -2.15.1 - diff --git a/0006-fix-build-on-4.07-Hashtbl.-seq.patch b/0006-fix-build-on-4.07-Hashtbl.-seq.patch deleted file mode 100644 index 61f9aa3..0000000 --- a/0006-fix-build-on-4.07-Hashtbl.-seq.patch +++ /dev/null @@ -1,99 +0,0 @@ -From c07b232d391d1e41485a8e109507511282475c20 Mon Sep 17 00:00:00 2001 -From: ygrek -Date: Sun, 27 May 2018 18:47:46 -0700 -Subject: [PATCH 06/11] fix build on 4.07 (Hashtbl.*seq) - ---- - src/configure.ml | 1 + - src/extHashtbl.mli | 35 ++++++++++++++++++++++++++++++++--- - 2 files changed, 33 insertions(+), 3 deletions(-) - -diff --git a/src/configure.ml b/src/configure.ml -index 1f92c89..f60897d 100644 ---- a/src/configure.ml -+++ b/src/configure.ml -@@ -10,6 +10,7 @@ let () = - print_endline (if Sys.ocaml_version >= "4.04.0" then "-D OCAML4_04 " else ""); - print_endline (if Sys.ocaml_version >= "4.05.0" then "-D OCAML4_05 " else ""); - print_endline (if Sys.ocaml_version >= "4.06.0" then "-D OCAML4_06 " else ""); -+ print_endline (if Sys.ocaml_version >= "4.07.0" then "-D OCAML4_07 " else ""); - print_endline (if Sys.word_size = 32 then "-D WORD_SIZE_32 " else ""); - show_bytes "-D WITH_BYTES"; - exit 0 -diff --git a/src/extHashtbl.mli b/src/extHashtbl.mli -index b2b194a..3acc87c 100644 ---- a/src/extHashtbl.mli -+++ b/src/extHashtbl.mli -@@ -74,7 +74,7 @@ module Hashtbl : - val reset : ('a,'b) t -> unit - val randomize : unit -> unit - -- type statistics = { -+ type statistics = Hashtbl.statistics = { - num_bindings: int; - num_buckets: int; - max_bucket_length: int; -@@ -95,8 +95,7 @@ module Hashtbl : - (** {6 Older Functions} *) - - (** Please refer to the Ocaml Manual for documentation of these -- functions. (note : functor support removed to avoid code -- duplication). *) -+ functions. *) - - (** @before 4.00.0 [random] is ignored *) - val create : ?random:bool -> int -> ('a, 'b) t -@@ -113,6 +112,16 @@ module Hashtbl : - val hash : 'a -> int - val hash_param : int -> int -> 'a -> int - -+#ifdef OCAML4_07 -+ (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) -+ val to_seq : ('a,'b) t -> ('a * 'b) Seq.t -+ val to_seq_keys : ('a,_) t -> 'a Seq.t -+ val to_seq_values : (_,'b) t -> 'b Seq.t -+ val add_seq : ('a,'b) t -> ('a * 'b) Seq.t -> unit -+ val replace_seq : ('a,'b) t -> ('a * 'b) Seq.t -> unit -+ val of_seq : ('a * 'b) Seq.t -> ('a, 'b) t -+#endif -+ - (** Functor interface forwards directly to stdlib implementation (i.e. no enum functions) *) - - module type HashedType = -@@ -150,6 +159,16 @@ module type S = - #ifdef OCAML4 - val stats: 'a t -> statistics - #endif -+ -+#ifdef OCAML4_07 -+ (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) -+ val to_seq : 'a t -> (key * 'a) Seq.t -+ val to_seq_keys : _ t -> key Seq.t -+ val to_seq_values : 'a t -> 'a Seq.t -+ val add_seq : 'a t -> (key * 'a) Seq.t -> unit -+ val replace_seq : 'a t -> (key * 'a) Seq.t -> unit -+ val of_seq : (key * 'a) Seq.t -> 'a t -+#endif - end - - module Make (H : HashedType) : S with type key = H.t -@@ -186,6 +205,16 @@ module type SeededS = - val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b - val length : 'a t -> int - val stats: 'a t -> statistics -+ -+#ifdef OCAML4_07 -+ (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) -+ val to_seq : 'a t -> (key * 'a) Seq.t -+ val to_seq_keys : _ t -> key Seq.t -+ val to_seq_values : 'a t -> 'a Seq.t -+ val add_seq : 'a t -> (key * 'a) Seq.t -> unit -+ val replace_seq : 'a t -> (key * 'a) Seq.t -> unit -+ val of_seq : (key * 'a) Seq.t -> 'a t -+#endif - end - - module MakeSeeded (H : SeededHashedType) : SeededS with type key = H.t --- -2.15.1 - diff --git a/0007-sync-stdlib-to-4.07-_seq.patch b/0007-sync-stdlib-to-4.07-_seq.patch deleted file mode 100644 index be8792b..0000000 --- a/0007-sync-stdlib-to-4.07-_seq.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 0107909dc68b1ad67ec09f355e07c61fbe221895 Mon Sep 17 00:00:00 2001 -From: ygrek -Date: Sun, 27 May 2018 21:10:45 -0700 -Subject: [PATCH 07/11] sync stdlib to 4.07 (*_seq) - ---- - src/extArray.mli | 7 +++++++ - src/extBuffer.mli | 8 ++++++++ - src/extList.mli | 6 ++++++ - src/extString.mli | 7 +++++++ - 4 files changed, 28 insertions(+) - -diff --git a/src/extArray.mli b/src/extArray.mli -index c21d324..0188c24 100644 ---- a/src/extArray.mli -+++ b/src/extArray.mli -@@ -164,4 +164,11 @@ sig - external unsafe_get : 'a array -> int -> 'a = "%array_unsafe_get" - external unsafe_set : 'a array -> int -> 'a -> unit = "%array_unsafe_set" - -+#ifdef OCAML4_07 -+ (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) -+ val to_seq : 'a array -> 'a Seq.t -+ val to_seqi : 'a array -> (int * 'a) Seq.t -+ val of_seq : 'a Seq.t -> 'a array -+#endif -+ - end -diff --git a/src/extBuffer.mli b/src/extBuffer.mli -index 898ada9..7a90e58 100644 ---- a/src/extBuffer.mli -+++ b/src/extBuffer.mli -@@ -81,4 +81,12 @@ val add_utf_16be_uchar : t -> Uchar.t -> unit - - #endif - -+#ifdef OCAML4_07 -+(** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) -+val to_seq : t -> char Seq.t -+val to_seqi : t -> (int * char) Seq.t -+val add_seq : t -> char Seq.t -> unit -+val of_seq : char Seq.t -> t -+#endif -+ - end -diff --git a/src/extList.mli b/src/extList.mli -index c53a73b..0d3fbea 100644 ---- a/src/extList.mli -+++ b/src/extList.mli -@@ -245,6 +245,12 @@ module List : - @since 4.02.0 *) - #endif - -+#ifdef OCAML4_07 -+ (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) -+ val to_seq : 'a list -> 'a Seq.t -+ val of_seq : 'a Seq.t -> 'a list -+#endif -+ - (** {6 Exceptions} *) - - exception Empty_list -diff --git a/src/extString.mli b/src/extString.mli -index 322775e..4e0119c 100644 ---- a/src/extString.mli -+++ b/src/extString.mli -@@ -206,6 +206,13 @@ module String : - val compare : t -> t -> int - val equal : t -> t -> bool - -+#ifdef OCAML4_07 -+ (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) -+ val to_seq : t -> char Seq.t -+ val to_seqi : t -> (int * char) Seq.t -+ val of_seq : char Seq.t -> t -+#endif -+ - (**/**) - - external unsafe_get : string -> int -> char = "%string_unsafe_get" --- -2.15.1 - diff --git a/0008-Hashtbl-simplify-and-make-test-std.ml-happy.patch b/0008-Hashtbl-simplify-and-make-test-std.ml-happy.patch deleted file mode 100644 index d18fefe..0000000 --- a/0008-Hashtbl-simplify-and-make-test-std.ml-happy.patch +++ /dev/null @@ -1,74 +0,0 @@ -From fd4f13d0a2e2b67a3917a057b0f4c6276606dc59 Mon Sep 17 00:00:00 2001 -From: ygrek -Date: Sun, 27 May 2018 22:05:28 -0700 -Subject: [PATCH 08/11] Hashtbl: simplify and make test/std.ml happy - ---- - src/extHashtbl.mli | 34 ++++++++++++++-------------------- - 1 file changed, 14 insertions(+), 20 deletions(-) - -diff --git a/src/extHashtbl.mli b/src/extHashtbl.mli -index 3acc87c..2135a0b 100644 ---- a/src/extHashtbl.mli -+++ b/src/extHashtbl.mli -@@ -124,6 +124,18 @@ module Hashtbl : - - (** Functor interface forwards directly to stdlib implementation (i.e. no enum functions) *) - -+#ifdef OCAML4_07 -+ -+module type HashedType = Hashtbl.HashedType -+module type S = Hashtbl.S -+module Make = Hashtbl.Make -+ -+module type SeededHashedType = Hashtbl.SeededHashedType -+module type SeededS = Hashtbl.SeededS -+module MakeSeeded = Hashtbl.MakeSeeded -+ -+#else -+ - module type HashedType = - sig - type t -@@ -159,16 +171,6 @@ module type S = - #ifdef OCAML4 - val stats: 'a t -> statistics - #endif -- --#ifdef OCAML4_07 -- (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) -- val to_seq : 'a t -> (key * 'a) Seq.t -- val to_seq_keys : _ t -> key Seq.t -- val to_seq_values : 'a t -> 'a Seq.t -- val add_seq : 'a t -> (key * 'a) Seq.t -> unit -- val replace_seq : 'a t -> (key * 'a) Seq.t -> unit -- val of_seq : (key * 'a) Seq.t -> 'a t --#endif - end - - module Make (H : HashedType) : S with type key = H.t -@@ -205,19 +207,11 @@ module type SeededS = - val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b - val length : 'a t -> int - val stats: 'a t -> statistics -- --#ifdef OCAML4_07 -- (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) -- val to_seq : 'a t -> (key * 'a) Seq.t -- val to_seq_keys : _ t -> key Seq.t -- val to_seq_values : 'a t -> 'a Seq.t -- val add_seq : 'a t -> (key * 'a) Seq.t -> unit -- val replace_seq : 'a t -> (key * 'a) Seq.t -> unit -- val of_seq : (key * 'a) Seq.t -> 'a t --#endif - end - - module MakeSeeded (H : SeededHashedType) : SeededS with type key = H.t -+#endif -+ - #endif - - end --- -2.15.1 - diff --git a/0009-cppo-simplify-defines.patch b/0009-cppo-simplify-defines.patch deleted file mode 100644 index 901e7c3..0000000 --- a/0009-cppo-simplify-defines.patch +++ /dev/null @@ -1,459 +0,0 @@ -From d4560e7f6322d567c0b73ea6111ccf316884db51 Mon Sep 17 00:00:00 2001 -From: ygrek -Date: Sun, 27 May 2018 22:57:28 -0700 -Subject: [PATCH 09/11] cppo: simplify defines - ---- - src/configure.ml | 13 +++++-------- - src/extArray.ml | 8 ++++---- - src/extArray.mli | 6 +++--- - src/extBuffer.ml | 2 +- - src/extBuffer.mli | 6 +++--- - src/extBytes.ml | 2 +- - src/extHashtbl.ml | 10 +++++----- - src/extHashtbl.mli | 22 +++++++++++----------- - src/extList.ml | 10 +++++----- - src/extList.mli | 4 ++-- - src/extString.ml | 16 ++++++++-------- - src/extString.mli | 2 +- - 12 files changed, 49 insertions(+), 52 deletions(-) - -diff --git a/src/configure.ml b/src/configure.ml -index f60897d..3059466 100644 ---- a/src/configure.ml -+++ b/src/configure.ml -@@ -1,16 +1,13 @@ -+open Printf -+ - let show_bytes s = -- let (_:int) = Sys.command (Printf.sprintf "ocamlfind query -format %s bytes" (Filename.quote s)) in () -+ let (_:int) = Sys.command (sprintf "ocamlfind query -format %s bytes" (Filename.quote s)) in () - - let () = - match Sys.argv with - | [|_;"-cppo-args"|] -> -- print_endline (if Sys.ocaml_version >= "4.00.0" then "-D OCAML4 " else ""); -- print_endline (if Sys.ocaml_version >= "4.02.0" then "-D OCAML4_02 " else ""); -- print_endline (if Sys.ocaml_version >= "4.03.0" then "-D OCAML4_03 " else ""); -- print_endline (if Sys.ocaml_version >= "4.04.0" then "-D OCAML4_04 " else ""); -- print_endline (if Sys.ocaml_version >= "4.05.0" then "-D OCAML4_05 " else ""); -- print_endline (if Sys.ocaml_version >= "4.06.0" then "-D OCAML4_06 " else ""); -- print_endline (if Sys.ocaml_version >= "4.07.0" then "-D OCAML4_07 " else ""); -+ let version = Scanf.sscanf Sys.ocaml_version "%d.%d." (fun major minor -> major * 100 + minor) in -+ printf "-D 'OCAML %d'\n" version; - print_endline (if Sys.word_size = 32 then "-D WORD_SIZE_32 " else ""); - show_bytes "-D WITH_BYTES"; - exit 0 -diff --git a/src/extArray.ml b/src/extArray.ml -index 5e9522d..b633a88 100644 ---- a/src/extArray.ml -+++ b/src/extArray.ml -@@ -37,7 +37,7 @@ let rev xs = - rev_in_place ys; - ys - --#ifndef OCAML4_03 -+#if OCAML < 403 - let for_all p xs = - let n = length xs in - let rec loop i = -@@ -164,7 +164,7 @@ let of_enum e = - | Some x -> x - | None -> assert false) - --#ifndef OCAML4_03 -+#if OCAML < 403 - let iter2 f a1 a2 = - if Array.length a1 <> Array.length a2 - then raise (Invalid_argument "Array.iter2"); -@@ -178,9 +178,9 @@ let map2 f a1 a2 = - Array.init (Array.length a1) (fun i -> f a1.(i) a2.(i)) - #endif - --#ifdef OCAML4_03 -+#if OCAML >= 403 - #else --#ifdef OCAML4_02 -+#if OCAML >= 402 - let create_float = make_float - #else - let make_float n = make n 0. -diff --git a/src/extArray.mli b/src/extArray.mli -index 0188c24..4d6d08f 100644 ---- a/src/extArray.mli -+++ b/src/extArray.mli -@@ -110,7 +110,7 @@ sig - - (** These functions are reimplemented in extlib when they are missing from the stdlib *) - --#ifdef OCAML4_03 -+#if OCAML >= 403 - external create_float : int -> float array = "caml_make_float_vect" - #else - val create_float : int -> float array -@@ -118,7 +118,7 @@ sig - - val make_float : int -> float array - --#ifdef OCAML4_06 -+#if OCAML >= 406 - module Floatarray : - sig - external create : int -> floatarray = "caml_floatarray_create" -@@ -164,7 +164,7 @@ sig - external unsafe_get : 'a array -> int -> 'a = "%array_unsafe_get" - external unsafe_set : 'a array -> int -> 'a -> unit = "%array_unsafe_set" - --#ifdef OCAML4_07 -+#if OCAML >= 407 - (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) - val to_seq : 'a array -> 'a Seq.t - val to_seqi : 'a array -> (int * 'a) Seq.t -diff --git a/src/extBuffer.ml b/src/extBuffer.ml -index 1ea87bb..7bcb694 100644 ---- a/src/extBuffer.ml -+++ b/src/extBuffer.ml -@@ -4,7 +4,7 @@ module Buffer = struct - - include Buffer - --#ifndef OCAML4_02 -+#if OCAML < 402 - (* The uses of unsafe_{of,to}_string above are not semantically - justified, as the Buffer implementation may very well capture and - share parts of its internal buffer, or of input string given as -diff --git a/src/extBuffer.mli b/src/extBuffer.mli -index 7a90e58..cc9c7fc 100644 ---- a/src/extBuffer.mli -+++ b/src/extBuffer.mli -@@ -67,13 +67,13 @@ val add_channel : t -> in_channel -> int -> unit - - val output_buffer : out_channel -> t -> unit - --#ifdef OCAML4_05 -+#if OCAML >= 405 - - val truncate : t -> int -> unit - - #endif - --#ifdef OCAML4_06 -+#if OCAML >= 406 - - val add_utf_8_uchar : t -> Uchar.t -> unit - val add_utf_16le_uchar : t -> Uchar.t -> unit -@@ -81,7 +81,7 @@ val add_utf_16be_uchar : t -> Uchar.t -> unit - - #endif - --#ifdef OCAML4_07 -+#if OCAML >= 407 - (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) - val to_seq : t -> char Seq.t - val to_seqi : t -> (int * char) Seq.t -diff --git a/src/extBytes.ml b/src/extBytes.ml -index e7b6bb6..ec5c932 100644 ---- a/src/extBytes.ml -+++ b/src/extBytes.ml -@@ -1,4 +1,4 @@ --#if defined OCAML4_02 || defined WITH_BYTES -+#if OCAML >= 402 || defined WITH_BYTES - module Bytes = Bytes - #else - module Bytes = struct -diff --git a/src/extHashtbl.ml b/src/extHashtbl.ml -index cced881..140e9c2 100644 ---- a/src/extHashtbl.ml -+++ b/src/extHashtbl.ml -@@ -22,7 +22,7 @@ - module Hashtbl = - struct - --#ifdef OCAML4 -+#if OCAML >= 400 - external old_hash_param : - int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc" - #endif -@@ -31,7 +31,7 @@ module Hashtbl = - | Empty - | Cons of 'a * 'b * ('a, 'b) h_bucketlist - --#ifdef OCAML4 -+#if OCAML >= 400 - type ('a, 'b) h_t = { - mutable size: int; - mutable data: ('a, 'b) h_bucketlist array; -@@ -47,7 +47,7 @@ module Hashtbl = - - include Hashtbl - --#ifndef OCAML4 -+#if OCAML < 400 - let create ?random:_ n = Hashtbl.create (* no seed *) n - #endif - -@@ -108,7 +108,7 @@ module Hashtbl = - data = Array.map loop (h_conv h).data; - } - --#ifdef OCAML4 -+#if OCAML >= 400 - (* copied from stdlib :( *) - let key_index h key = - (* compatibility with old hash tables *) -@@ -142,7 +142,7 @@ module Hashtbl = - let pos = key_index h key in - loop (Array.unsafe_get (h_conv h).data pos) - --#ifndef OCAML4_05 -+#if OCAML < 405 - let find_opt h key = - let rec loop = function - | Empty -> None -diff --git a/src/extHashtbl.mli b/src/extHashtbl.mli -index 2135a0b..5153fd5 100644 ---- a/src/extHashtbl.mli -+++ b/src/extHashtbl.mli -@@ -70,7 +70,7 @@ module Hashtbl : - (** Return the number of elements inserted into the Hashtbl - (including duplicates) *) - --#ifdef OCAML4 -+#if OCAML >= 400 - val reset : ('a,'b) t -> unit - val randomize : unit -> unit - -@@ -87,7 +87,7 @@ module Hashtbl : - val seeded_hash : int -> 'a -> int - #endif - --#ifdef OCAML4_03 -+#if OCAML >= 403 - val is_randomized : unit -> bool - val filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unit - #endif -@@ -112,7 +112,7 @@ module Hashtbl : - val hash : 'a -> int - val hash_param : int -> int -> 'a -> int - --#ifdef OCAML4_07 -+#if OCAML >= 407 - (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) - val to_seq : ('a,'b) t -> ('a * 'b) Seq.t - val to_seq_keys : ('a,_) t -> 'a Seq.t -@@ -124,7 +124,7 @@ module Hashtbl : - - (** Functor interface forwards directly to stdlib implementation (i.e. no enum functions) *) - --#ifdef OCAML4_07 -+#if OCAML >= 407 - - module type HashedType = Hashtbl.HashedType - module type S = Hashtbl.S -@@ -149,33 +149,33 @@ module type S = - type 'a t - val create : int -> 'a t - val clear : 'a t -> unit --#ifdef OCAML4 -+#if OCAML >= 400 - val reset : 'a t -> unit - #endif - val copy : 'a t -> 'a t - val add : 'a t -> key -> 'a -> unit - val remove : 'a t -> key -> unit - val find : 'a t -> key -> 'a --#ifdef OCAML4_05 -+#if OCAML >= 405 - val find_opt : 'a t -> key -> 'a option - #endif - val find_all : 'a t -> key -> 'a list - val replace : 'a t -> key -> 'a -> unit - val mem : 'a t -> key -> bool - val iter : (key -> 'a -> unit) -> 'a t -> unit --#ifdef OCAML4_03 -+#if OCAML >= 403 - val filter_map_inplace: (key -> 'a -> 'a option) -> 'a t -> unit - #endif - val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b - val length : 'a t -> int --#ifdef OCAML4 -+#if OCAML >= 400 - val stats: 'a t -> statistics - #endif - end - - module Make (H : HashedType) : S with type key = H.t - --#ifdef OCAML4 -+#if OCAML >= 400 - module type SeededHashedType = - sig - type t -@@ -194,14 +194,14 @@ module type SeededS = - val add : 'a t -> key -> 'a -> unit - val remove : 'a t -> key -> unit - val find : 'a t -> key -> 'a --#ifdef OCAML4_05 -+#if OCAML >= 405 - val find_opt : 'a t -> key -> 'a option - #endif - val find_all : 'a t -> key -> 'a list - val replace : 'a t -> key -> 'a -> unit - val mem : 'a t -> key -> bool - val iter : (key -> 'a -> unit) -> 'a t -> unit --#ifdef OCAML4_03 -+#if OCAML >= 403 - val filter_map_inplace: (key -> 'a -> 'a option) -> 'a t -> unit - #endif - val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b -diff --git a/src/extList.ml b/src/extList.ml -index faea94f..2ec5cee 100644 ---- a/src/extList.ml -+++ b/src/extList.ml -@@ -369,9 +369,9 @@ let combine l1 l2 = - - let sort ?(cmp=compare) = List.sort cmp - --#ifndef OCAML4_06 -+#if OCAML < 406 - let rec init size f = -- if size = 0 then [] -+ if size = 0 then [] - else if size < 0 then invalid_arg "ExtList.init" - else - let rec loop dst n = -@@ -407,7 +407,7 @@ let mapi f = function - loop r 1 t; - inj r - --#ifndef OCAML4 -+#if OCAML < 400 - let iteri f l = - let rec loop n = function - | [] -> () -@@ -523,11 +523,11 @@ let of_enum e = - r) h e in - h.tl - --#ifndef OCAML4_03 -+#if OCAML < 403 - let cons x l = x :: l - #endif - --#ifndef OCAML4_05 -+#if OCAML < 405 - - let assoc_opt k l = try Some (assoc k l) with Not_found -> None - let assq_opt k l = try Some (assq k l) with Not_found -> None -diff --git a/src/extList.mli b/src/extList.mli -index 0d3fbea..57cbd00 100644 ---- a/src/extList.mli -+++ b/src/extList.mli -@@ -239,13 +239,13 @@ module List : - val fast_sort : ('a -> 'a -> int) -> 'a list -> 'a list - val merge : ('a -> 'a -> int) -> 'a list -> 'a list -> 'a list - --#ifdef OCAML4_02 -+#if OCAML >= 402 - val sort_uniq : ('a -> 'a -> int) -> 'a list -> 'a list - (** Same as {!List.sort}, but also remove duplicates. - @since 4.02.0 *) - #endif - --#ifdef OCAML4_07 -+#if OCAML >= 407 - (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) - val to_seq : 'a list -> 'a Seq.t - val of_seq : 'a Seq.t -> 'a list -diff --git a/src/extString.ml b/src/extString.ml -index 5dfed8e..b000dd4 100644 ---- a/src/extString.ml -+++ b/src/extString.ml -@@ -26,7 +26,7 @@ module String = struct - - include String - --#ifndef OCAML4_02 -+#if OCAML < 402 - let init len f = - let s = Bytes.create len in - for i = 0 to len - 1 do -@@ -99,7 +99,7 @@ let strip ?(chars=" \t\r\n") s = - done; - sub s p (!l - p + 1) - --#ifndef OCAML4 -+#if OCAML < 400 - let trim s = strip ~chars:" \t\r\n\012" s - #endif - -@@ -184,7 +184,7 @@ let of_enum e = - (* 's' doesn't escape and will never be mutated again *) - Bytes.unsafe_to_string s - --#ifndef OCAML4 -+#if OCAML < 400 - let map f s = - let len = length s in - let sc = Bytes.create len in -@@ -195,7 +195,7 @@ let map f s = - Bytes.unsafe_to_string sc - #endif - --#ifndef OCAML4_02 -+#if OCAML < 402 - let mapi f s = - let len = length s in - let sc = Bytes.create len in -@@ -206,7 +206,7 @@ let mapi f s = - Bytes.unsafe_to_string sc - #endif - --#ifndef OCAML4 -+#if OCAML < 400 - let iteri f s = - for i = 0 to length s - 1 do - let () = f i (unsafe_get s i) in () -@@ -281,7 +281,7 @@ let replace ~str ~sub ~by = - with - Invalid_string -> (false, String.sub str 0 (String.length str)) - --#ifndef OCAML4_03 -+#if OCAML < 403 - let uppercase_ascii = uppercase - let lowercase_ascii = lowercase - let capitalize_ascii = capitalize -@@ -290,7 +290,7 @@ let uncapitalize_ascii = uncapitalize - let equal = (=) - #endif - --#ifndef OCAML4_04 -+#if OCAML < 404 - let split_on_char sep s = - let r = ref [] in - let j = ref (length s) in -@@ -303,7 +303,7 @@ let split_on_char sep s = - sub s 0 !j :: !r - #endif - --#ifndef OCAML4_05 -+#if OCAML < 405 - - let rec index_rec_opt s lim i c = - if i >= lim then None else -diff --git a/src/extString.mli b/src/extString.mli -index 4e0119c..a92a583 100644 ---- a/src/extString.mli -+++ b/src/extString.mli -@@ -206,7 +206,7 @@ module String : - val compare : t -> t -> int - val equal : t -> t -> bool - --#ifdef OCAML4_07 -+#if OCAML >= 407 - (** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *) - val to_seq : t -> char Seq.t - val to_seqi : t -> (int * char) Seq.t --- -2.15.1 - diff --git a/0010-install.ml-fix-and-deprecate.patch b/0010-install.ml-fix-and-deprecate.patch deleted file mode 100644 index 80b9e32..0000000 --- a/0010-install.ml-fix-and-deprecate.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 6835d9a4b7ccc4148803359c02c2617f2b649556 Mon Sep 17 00:00:00 2001 -From: ygrek -Date: Sun, 27 May 2018 23:17:36 -0700 -Subject: [PATCH 10/11] install.ml: fix and deprecate - ---- - src/install.ml | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/install.ml b/src/install.ml -index 2071eac..5406cbe 100644 ---- a/src/install.ml -+++ b/src/install.ml -@@ -196,9 +196,8 @@ let install() = - if doc && not (Sys.file_exists doc_dir) then run (sprintf "mkdir %s" doc_dir); - (* generate *) - let defines = -- (if Sys.ocaml_version >= "4.00.0" then "-D OCAML4" else "") -- ^ " " ^ -- (if Sys.ocaml_version >= "4.02.0" then "-D OCAML4_02" else "") -+ let version = Scanf.sscanf Sys.ocaml_version "%d.%d." (fun major minor -> major * 100 + minor) in -+ sprintf "-D 'OCAML %d' %s" version (if Sys.word_size = 32 then "-D WORD_SIZE_32 " else ""); - in - let pp = sprintf "-pp \"cppo %s\"" defines in - let ocamlc fmt = ksprintf (fun s -> run (sprintf "ocamlc %s %s" pp s)) fmt in -@@ -254,6 +253,7 @@ let install() = - end; - ;; - try -+ print_endline "\nATTENTION! install.ml is deprecated and will be removed in next release. Please use Makefile instead.\n"; - install(); - print_endline "Done."; - with --- -2.15.1 - diff --git a/0011-fix-quoting-on-windows.patch b/0011-fix-quoting-on-windows.patch deleted file mode 100644 index 4654dd1..0000000 --- a/0011-fix-quoting-on-windows.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b63c9082eaf15ce18443e07b50272038f92927d0 Mon Sep 17 00:00:00 2001 -From: ygrek -Date: Mon, 28 May 2018 18:05:56 -0700 -Subject: [PATCH 11/11] fix quoting on windows - ---- - src/configure.ml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/configure.ml b/src/configure.ml -index 3059466..f13d63e 100644 ---- a/src/configure.ml -+++ b/src/configure.ml -@@ -7,7 +7,7 @@ let () = - match Sys.argv with - | [|_;"-cppo-args"|] -> - let version = Scanf.sscanf Sys.ocaml_version "%d.%d." (fun major minor -> major * 100 + minor) in -- printf "-D 'OCAML %d'\n" version; -+ printf "-D \\\"OCAML %d\\\"\n" version; - print_endline (if Sys.word_size = 32 then "-D WORD_SIZE_32 " else ""); - show_bytes "-D WITH_BYTES"; - exit 0 --- -2.15.1 - diff --git a/ocaml-extlib.spec b/ocaml-extlib.spec index ad1d4f1..054919d 100644 --- a/ocaml-extlib.spec +++ b/ocaml-extlib.spec @@ -3,26 +3,14 @@ %global debug_package %{nil} Name: ocaml-extlib -Version: 1.7.4 -Release: 3%{?dist} +Version: 1.7.5 +Release: 1%{?dist} Summary: OCaml ExtLib additions to the standard library License: LGPLv2+ with exceptions URL: https://github.com/ygrek/ocaml-extlib Source0: https://github.com/ygrek/ocaml-extlib/releases/download/%{version}/extlib-%{version}.tar.gz -Patch0001: 0001-Test-32-bit.patch -Patch0002: 0002-IO-restore-compilation-on-32-bit-broken-in-1.7.3.patch -Patch0003: 0003-Correct-31-bit-IO-test-on-32-bit.patch -Patch0004: 0004-IO-also-disable-useless-overflow-tests-on-32-bit.patch -Patch0005: 0005-IO-read_i32_as_int.patch -Patch0006: 0006-fix-build-on-4.07-Hashtbl.-seq.patch -Patch0007: 0007-sync-stdlib-to-4.07-_seq.patch -Patch0008: 0008-Hashtbl-simplify-and-make-test-std.ml-happy.patch -Patch0009: 0009-cppo-simplify-defines.patch -Patch0010: 0010-install.ml-fix-and-deprecate.patch -Patch0011: 0011-fix-quoting-on-windows.patch - BuildRequires: ocaml >= 4.00.1 BuildRequires: ocaml-findlib-devel >= 1.3.3-3 BuildRequires: ocaml-camlp4-devel @@ -93,6 +81,10 @@ make install -j1 %changelog +* Wed Jul 11 2018 Richard W.M. Jones - 1.7.5-1 +- New upstream version 1.7.5. +- Remove patches which are all included in this release. + * Wed Jun 20 2018 Richard W.M. Jones - 1.7.4-3 - Bump release and rebuild. diff --git a/sources b/sources index 1ae2af0..00eb353 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (extlib-1.7.4.tar.gz) = 76f097229ff558310fdb4fb821ea7fc39c4b70945af4b396a921684e5b8fc70fb934ca57c1e444cbb4c840886088b3a1df43e4d0c9a38a7e2742f1491e977bfa +SHA512 (extlib-1.7.5.tar.gz) = a2a368cf4f76b8a568b237efbb806bb6d16f9f46de1a3149d6381dadf9c464482276e160f9d4ae296f2540b6dd6f880a2cdb356133d31fa6001db4a392c3cb7f