From ade763571a19b5e222ac626a6b3bc10685e542a1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Jul 2017 20:30:48 +0200 Subject: Use binary mode when pre-parsing translation unit Failed that, the module export position we obtain cannot be reliably seeked to. --- build2/cc/compile.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index 681cfc9..76be8e6 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -2431,8 +2431,9 @@ namespace build2 env.empty () ? nullptr : env.data ()); } - ifdstream is (move (pr.in_ofd), - fdstream_mode::text | fdstream_mode::skip); + // Use binary mode to obtain consistent positions. + // + ifdstream is (move (pr.in_ofd), fdstream_mode::skip); parser p; translation_unit tu (p.parse (is, rels)); -- cgit v1.1