From 1958b829f22e3b69d4c4c23662e0d1c7c4d2e62b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 24 Jun 2017 11:43:45 +0200 Subject: Make VC compatible with 'export module M;' by fixing up preprocessed output --- build2/cc/lexer.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'build2/cc/lexer.cxx') diff --git a/build2/cc/lexer.cxx b/build2/cc/lexer.cxx index faf73c85..ba6ea18b 100644 --- a/build2/cc/lexer.cxx +++ b/build2/cc/lexer.cxx @@ -330,6 +330,13 @@ namespace build2 if (alpha (c) || c == '_') { + // This smells a little: we know skip_spaces() did not peek at + // the next character because this is not '/'. Which means the + // position in the stream must be of this character + 1. + // + if (buf_ != nullptr) + t.position = buf_->tellg () - 1; + string& id (t.value); id.clear (); -- cgit