From 72a3cb008f73c381387a33b90fac82d3132d24b0 Mon Sep 17 00:00:00 2001 From: Xavier Clerc Date: Thu, 2 Nov 2017 12:31:14 +0000 Subject: [PATCH] Look for `ARCH_SIXTYFOUR` in both `config.h` and `m.h`. --- src/context.ml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/context.ml b/src/context.ml index 9b18f32e..62006a98 100644 --- a/src/context.ml +++ b/src/context.ml @@ -113,11 +113,15 @@ let sexp_of_t t = let compare a b = compare a.name b.name let get_arch_sixtyfour stdlib_dir = - let config_h = Path.relative stdlib_dir "caml/config.h" 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 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) + in + List.exists ~f:get_arch_sixtyfour_from files let opam_config_var ~env ~cache var = match Hashtbl.find cache var with