From e28cc8d0705b2812e532488216442c5f461ac241 Mon Sep 17 00:00:00 2001 From: xclerc Date: Mon, 6 Nov 2017 09:30:50 +0100 Subject: [PATCH] Fix regression introduced by PR303. --- src/context.ml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/context.ml b/src/context.ml index 0b3fe93e..bc0383f0 100644 --- a/src/context.ml +++ b/src/context.ml @@ -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