Skip to content

Instantly share code, notes, and snippets.

@thierry-FreeBSD
Created April 7, 2022 13:16
Show Gist options
  • Save thierry-FreeBSD/ae10d3b518e9239dd5f859d70a151cd7 to your computer and use it in GitHub Desktop.
Save thierry-FreeBSD/ae10d3b518e9239dd5f859d70a151cd7 to your computer and use it in GitHub Desktop.
Fix compilation error on compare for geneweb 7.0.0
--- lib/util/mutil.ml.orig 2020-10-30 14:13:59 UTC
+++ lib/util/mutil.ml
@@ -536,7 +536,7 @@ let list_map_sort_uniq (fn : 'a -> 'b) l =
| [], l2 -> rev_append l2 accu
| l1, [] -> rev_append l1 accu
| h1::t1, h2::t2 ->
- let c = compare h1 h2 in
+ let c = Stdlib.compare h1 h2 in
if c = 0 then rev_merge t1 t2 (h1::accu)
else if c < 0
then rev_merge t1 l2 (h1::accu)
@@ -547,7 +547,7 @@ let list_map_sort_uniq (fn : 'a -> 'b) l =
| [], l2 -> rev_append l2 accu
| l1, [] -> rev_append l1 accu
| h1::t1, h2::t2 ->
- let c = compare h1 h2 in
+ let c = Stdlib.compare h1 h2 in
if c = 0 then rev_merge_rev t1 t2 (h1::accu)
else if c > 0
then rev_merge_rev t1 l2 (h1::accu)
@@ -559,7 +559,7 @@ let list_map_sort_uniq (fn : 'a -> 'b) l =
let x1 = fn x1 in
let x2 = fn x2 in
let s =
- let c = compare x1 x2 in
+ let c = Stdlib.compare x1 x2 in
if c = 0 then [x1] else if c < 0 then [x1; x2] else [x2; x1]
in
(s, tl)
@@ -568,25 +568,25 @@ let list_map_sort_uniq (fn : 'a -> 'b) l =
let x2 = fn x2 in
let x3 = fn x3 in
let s =
- let c = compare x1 x2 in
+ let c = Stdlib.compare x1 x2 in
if c = 0 then
- let c = compare x2 x3 in
+ let c = Stdlib.compare x2 x3 in
if c = 0 then [x2] else if c < 0 then [x2; x3] else [x3; x2]
else if c < 0 then
- let c = compare x2 x3 in
+ let c = Stdlib.compare x2 x3 in
if c = 0 then [x1; x2]
else if c < 0 then [x1; x2; x3]
else
- let c = compare x1 x3 in
+ let c = Stdlib.compare x1 x3 in
if c = 0 then [x1; x2]
else if c < 0 then [x1; x3; x2]
else [x3; x1; x2]
else
- let c = compare x1 x3 in
+ let c = Stdlib.compare x1 x3 in
if c = 0 then [x2; x1]
else if c < 0 then [x2; x1; x3]
else
- let c = compare x2 x3 in
+ let c = Stdlib.compare x2 x3 in
if c = 0 then [x2; x1]
else if c < 0 then [x2; x3; x1]
else [x3; x2; x1]
@@ -604,7 +604,7 @@ let list_map_sort_uniq (fn : 'a -> 'b) l =
let x1 = fn x1 in
let x2 = fn x2 in
let s =
- let c = compare x1 x2 in
+ let c = Stdlib.compare x1 x2 in
if c = 0 then [x1] else if c > 0 then [x1; x2] else [x2; x1]
in
(s, tl)
@@ -613,25 +613,25 @@ let list_map_sort_uniq (fn : 'a -> 'b) l =
let x2 = fn x2 in
let x3 = fn x3 in
let s =
- let c = compare x1 x2 in
+ let c = Stdlib.compare x1 x2 in
if c = 0 then
- let c = compare x2 x3 in
+ let c = Stdlib.compare x2 x3 in
if c = 0 then [x2] else if c > 0 then [x2; x3] else [x3; x2]
else if c > 0 then
- let c = compare x2 x3 in
+ let c = Stdlib.compare x2 x3 in
if c = 0 then [x1; x2]
else if c > 0 then [x1; x2; x3]
else
- let c = compare x1 x3 in
+ let c = Stdlib.compare x1 x3 in
if c = 0 then [x1; x2]
else if c > 0 then [x1; x3; x2]
else [x3; x1; x2]
else
- let c = compare x1 x3 in
+ let c = Stdlib.compare x1 x3 in
if c = 0 then [x2; x1]
else if c > 0 then [x2; x1; x3]
else
- let c = compare x2 x3 in
+ let c = Stdlib.compare x2 x3 in
if c = 0 then [x2; x1]
else if c > 0 then [x2; x3; x1]
else [x3; x2; x1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment