aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/lexer.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-06-24 11:43:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-06-24 11:43:45 +0200
commit1958b829f22e3b69d4c4c23662e0d1c7c4d2e62b (patch)
treefb94b1cba0d34e9b4cc6e1834495a9bd1e62a289 /build2/cc/lexer.cxx
parentff8ed209cd80799199e0b2e3d37213d549bc342f (diff)
Make VC compatible with 'export module M;' by fixing up preprocessed output
Diffstat (limited to 'build2/cc/lexer.cxx')
-rw-r--r--build2/cc/lexer.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/build2/cc/lexer.cxx b/build2/cc/lexer.cxx
index faf73c8..ba6ea18 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 ();