Merge pull request #313 from janestreet/arch-sixtyfour-4.06-fix

Fix regression introduced by PR303.
This commit is contained in:
Rudi Grinberg 2017-11-06 17:12:57 +08:00 committed by GitHub
commit 723dc7669d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -115,11 +115,14 @@ let compare a b = compare a.name b.name
let get_arch_sixtyfour stdlib_dir =
let files = ["caml/config.h"; "caml/m.h"] in
let get_arch_sixtyfour_from file =
let config_h = Path.relative stdlib_dir file in
List.exists (Io.lines_of_file (Path.to_string config_h)) ~f:(fun line ->
match String.extract_blank_separated_words line with
| ["#define"; "ARCH_SIXTYFOUR"] -> true
| _ -> false)
let file_path = Path.to_string (Path.relative stdlib_dir file) in
if Sys.file_exists file_path then begin
List.exists (Io.lines_of_file file_path) ~f:(fun line ->
match String.extract_blank_separated_words line with
| ["#define"; "ARCH_SIXTYFOUR"] -> true
| _ -> false)
end else
false
in
List.exists ~f:get_arch_sixtyfour_from files