aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-11-30 09:12:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-11-30 13:03:07 +0200
commit99e984424520545bfab9632115b727deeea11812 (patch)
tree375d33ef2f45c5bac4884eed4c0ac16308a5b462 /libbuild2
parent449f183b9eb4da6ceb97fdb5fda1c767760315c2 (diff)
Disable __import recognition since GCC now uses [[__translated]]
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/cc/parser+module.test.testscript2
-rw-r--r--libbuild2/cc/parser.cxx8
2 files changed, 6 insertions, 4 deletions
diff --git a/libbuild2/cc/parser+module.test.testscript b/libbuild2/cc/parser+module.test.testscript
index 1f21ef4..91cbe45 100644
--- a/libbuild2/cc/parser+module.test.testscript
+++ b/libbuild2/cc/parser+module.test.testscript
@@ -44,7 +44,7 @@ EOI
$* <<EOI
import "foo.h";
import <sys/foo.h>;
-__import "/usr/include/stdio.h";
+import "/usr/include/stdio.h" [[__translated]];
EOI
: import-part
diff --git a/libbuild2/cc/parser.cxx b/libbuild2/cc/parser.cxx
index 5e6f43a..9559b87 100644
--- a/libbuild2/cc/parser.cxx
+++ b/libbuild2/cc/parser.cxx
@@ -79,8 +79,10 @@ namespace build2
// for details.
//
// Additionally, when include is translated to an import, it's
- // normally replaced with the special __import keyword since it
- // may appear in C context.
+ // normally replaced with special import (special since it may
+ // appear in C context); it could be a special keyword (GCC used
+ // to call it __import) or it can have a special attribute (GCC
+ // currently marks it with [[__translated]]).
//
if (bb == 0 && t.first)
{
@@ -113,7 +115,7 @@ namespace build2
else
n = false;
}
- else if (id == "import" || id == "__import")
+ else if (id == "import" /*|| id == "__import"*/)
{
l_->next (t);