From 3920ad1ebd896c59a11e193aa967f9d85fc52ba8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Dec 2017 08:44:34 +0200 Subject: Add support for C17 now that both GCC 8 and Clang 6 recognize -std=c17 --- build2/c/init.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'build2/c') 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)); -- cgit v1.1