Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please fix build with ocaml 4.08 #35

Closed
rosset opened this issue Jul 3, 2019 · 4 comments
Closed

please fix build with ocaml 4.08 #35

rosset opened this issue Jul 3, 2019 · 4 comments

Comments

@rosset
Copy link

rosset commented Jul 3, 2019

please fix build with ocaml 4.08

@t-bltg
Copy link

t-bltg commented Aug 18, 2019

Trying to build with OCaml 4.08.1 throws this error:

<...>/bin/ocamlc.opt -unsafe-string -g -w -3 -unsafe-string -unsafe-string -unsafe-string -unsafe-string   -I src/utils/extlib  -I src/utils/cdk  -I src/utils/bitstring  -I src/utils/lib  -I src/utils/ocamlrss  -I src/utils/xml-light  -I src/utils/net  -I tools  -I src/daemon/common  -I src/daemon/driver  -I src/utils/mp3tagui  -I src/config/unix  -I src/networks/direct_connect  -I src/networks/fasttrack  -I src/networks/fileTP  -I src/networks/bittorrent  -I src/networks/donkey -I +camlp4 -c src/utils/bitstring/bitstring.ml
File "src/utils/net/geoip.ml", line 228, characters 2-17:
228 |   Array1.map_file (Unix.descr_of_in_channel file) 
        ^^^^^^^^^^^^^^^
Error: Unbound value Array1.map_file

@XVilka
Copy link

XVilka commented Sep 13, 2019

Are there any updates? @ygrek

@ygrek
Copy link
Owner

ygrek commented Oct 1, 2019

ftr patch to build with 4.08 (but breaks compatibility with older OCaml):

diff --git a/src/utils/net/geoip.ml b/src/utils/net/geoip.ml
index aeec24d4..105ea2eb 100644
--- a/src/utils/net/geoip.ml
+++ b/src/utils/net/geoip.ml
@@ -225,8 +225,8 @@ type geoip_database = {
 } 
 
 let new_map file =
-  Array1.map_file (Unix.descr_of_in_channel file) 
-    int8_unsigned c_layout false (-1)
+  array1_of_genarray @@ Unix.map_file (Unix.descr_of_in_channel file)
+    int8_unsigned c_layout false [|-1|]
 
 let unpack filename =
   let ext = String.lowercase (Filename2.extension filename) in

@ygrek
Copy link
Owner

ygrek commented Nov 26, 2019

fixed in aec80b9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants