summaryrefslogtreecommitdiff
path: root/dev-ml/extlib/files/0002-caml_hash_univ_param-was-removed-for-OCaml-pre-4.00-.patch
blob: 59a6843f3a151567c234d5540ce5e4f040d46e62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 574e8eae2d358b6db62c2d062b194a7aa06ac02c Mon Sep 17 00:00:00 2001
From: Kate <kit.ty.kate@disroot.org>
Date: Fri, 6 Nov 2020 14:10:26 +0000
Subject: [PATCH 2/2] caml_hash_univ_param was removed for OCaml (pre-4.00
 function)

---
 src/extHashtbl.ml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/extHashtbl.ml b/src/extHashtbl.ml
index 140e9c2..3c69df4 100644
--- a/src/extHashtbl.ml
+++ b/src/extHashtbl.ml
@@ -22,7 +22,7 @@
 module Hashtbl =
   struct
 
-#if OCAML >= 400
+#if OCAML >= 400 && OCAML < 412
   external old_hash_param :
     int -> int -> 'a -> int = "caml_hash_univ_param" "noalloc"
 #endif
@@ -114,7 +114,11 @@ module Hashtbl =
     (* compatibility with old hash tables *)
     if Obj.size (Obj.repr h) >= 3
     then (seeded_hash_param 10 100 (h_conv h).seed key) land (Array.length (h_conv h).data - 1)
+  #if OCAML >= 412
+    else failwith "Old hash function not supported anymore"
+  #else
     else (old_hash_param 10 100 key) mod (Array.length (h_conv h).data)
+  #endif
 #else
   let key_index h key = (hash key) mod (Array.length (h_conv h).data)
 #endif
-- 
2.30.0