aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-12 08:44:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-12 08:44:34 +0200
commit3920ad1ebd896c59a11e193aa967f9d85fc52ba8 (patch)
tree1d6e6c045bc72253a2928ac396d0d780ff67818d
parent9a74261b18ffc9ecaf6416110df56a51f6d1d3e7 (diff)
Add support for C17 now that both GCC 8 and Clang 6 recognize -std=c17
-rw-r--r--build2/c/init.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/build2/c/init.cxx b/build2/c/init.cxx
index bc97266..d55bd51 100644
--- a/build2/c/init.cxx
+++ b/build2/c/init.cxx
@@ -65,14 +65,18 @@ namespace build2
// So let's say C99 is supported from 10.0 and C11 from 11.0. And
// C90 is supported by everything we care to support.
//
+ // C17 is a bug-fix version of C11 so here we assume it is the same
+ // as C11.
+ //
if (v == nullptr)
;
else if (*v != "90")
{
uint64_t cver (ci.version.major);
- if ((*v == "99" && cver < 16) || // Since VS2010/10.0.
- (*v == "11" && cver < 17)) // Since VS2012/11.0.
+ if ((*v == "99" && cver < 16) || // Since VS2010/10.0.
+ ((*v == "11" ||
+ *v == "17") && cver < 17)) // Since VS2012/11.0.
{
fail << "C" << *v << " is not supported by " << ci.signature <<
info << "required by " << project (rs) << '@' << rs.out_path ();
@@ -94,6 +98,7 @@ namespace build2
if (*v == "90") o += "c90";
else if (*v == "99") o += "c9x";
else if (*v == "11") o += "c1x";
+ else if (*v == "17") o += "c17"; // GCC 8, Clang 6.
else o += *v; // In case the user specifies e.g., 'gnu11'.
r.push_back (move (o));