Skip to content

Commit d8fdfbe

Browse files
authored
Use Stdlib instead of Pervasives (#22)
* Use Stdlib instead of Pervasives Pervasives was deprecated in favor of directly using Stdlib in 4.08 and then removed in the upcoming 5.0. This change makes javalib buildable with the multi-core 5.0~alpha ocaml. * Bump the package version to 3.2.2 NOTE: For some reason the package version in javalib.opam and in META was 3.2 while in opam repo it's 3.2.1 (ditto for sawja dependency spec). I changed the version to match x.y.z format.
1 parent 0699f90 commit d8fdfbe

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

javalib.opam

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
opam-version: "2.0"
22
name: "javalib"
3-
version: "3.2"
3+
version: "3.2.2"
44
maintainer: "Nicolas Barré <[email protected]>"
55
authors: "Javalib Development team"
66
homepage: "https://javalib-team.github.io/javalib/"
@@ -13,7 +13,7 @@ build: [
1313
]
1414
install: [make "install"]
1515
depends: [
16-
"ocaml" {>= "4.04"}
16+
"ocaml" {>= "4.08"}
1717
"conf-which" {build}
1818
"ocamlfind" {build}
1919
"camlzip" {>= "1.05"}

src/META.source

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.2"
1+
version = "3.2.2"
22
description = "library to parse Java .class files"
33
archive(native) = "javalib.cmxa"
44
archive(byte) = "javalib.cma"

src/jFile.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ let lookup c : cp_unit -> JClassLow.jclass =
120120
| `dir d ->
121121
if is_file (Filename.concat d c)
122122
then
123-
let ch = Pervasives.open_in_bin (Filename.concat d c) in
123+
let ch = Stdlib.open_in_bin (Filename.concat d c) in
124124
JLib.IO.input_channel ch
125125
else raise Not_found
126126
| `jar jar ->
@@ -156,7 +156,7 @@ let write_class_low output_dir classe =
156156
(mkdir
157157
(Filename.concat output_dir (Filename.dirname c))
158158
0o755);
159-
let f = Pervasives.open_out_bin (Filename.concat output_dir c) in
159+
let f = Stdlib.open_out_bin (Filename.concat output_dir c) in
160160
let output = JLib.IO.output_channel f in
161161
JUnparse.unparse_class_low_level output classe;
162162
JLib.IO.close_out output
@@ -171,7 +171,7 @@ let dir_sep =
171171
| _ -> assert false (* Inspirated from filename.ml in the stdlib *)
172172

173173
let extract_class_name_from_file file =
174-
let input = JLib.IO.input_channel (Pervasives.open_in_bin file) in
174+
let input = JLib.IO.input_channel (Stdlib.open_in_bin file) in
175175
let c = JParse.parse_class_low_level input in
176176
JLib.IO.close_in input;
177177
let cname = c.j_name in
@@ -291,7 +291,7 @@ let fold_string class_path f file =
291291
try
292292
apply_to_dir_or_class
293293
(function c ->
294-
let ch = Pervasives.open_in_bin c in
294+
let ch = Stdlib.open_in_bin c in
295295
let input = JLib.IO.input_channel ch in
296296
let classe = JParse.parse_class_low_level input in
297297
JLib.IO.close_in input;

src/ptrees/ptset.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ let elements s =
335335
in
336336
(* unfortunately there is no easy way to get the elements in ascending
337337
order with little-endian Patricia trees *)
338-
List.sort Pervasives.compare (elements_aux [] s)
338+
List.sort Stdlib.compare (elements_aux [] s)
339339

340340
let split x s =
341341
let coll k (l, b, r) =
@@ -599,7 +599,7 @@ module Big = struct
599599
| Branch (_,_,l,r) -> elements_aux (elements_aux acc r) l
600600
in
601601
(* we still have to sort because of possible negative elements *)
602-
List.sort Pervasives.compare (elements_aux [] s)
602+
List.sort Stdlib.compare (elements_aux [] s)
603603

604604
let split x s =
605605
let coll k (l, b, r) =

0 commit comments

Comments
 (0)