From ce177a4b12f2fef490683e53ccc9ee8f4d3e0bd6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 12 Jun 2017 08:33:28 +0200 Subject: Add workaround for Clang module import during preprocessing --- build2/utility.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'build2/utility.cxx') diff --git a/build2/utility.cxx b/build2/utility.cxx index 09a2342..2b3f785 100644 --- a/build2/utility.cxx +++ b/build2/utility.cxx @@ -277,34 +277,34 @@ namespace build2 } void - append_options (cstrings& args, const strings& sv) + append_options (cstrings& args, const strings& sv, size_t n) { - if (!sv.empty ()) + if (n != 0) { - args.reserve (args.size () + sv.size ()); + args.reserve (args.size () + n); - for (const string& s: sv) - args.push_back (s.c_str ()); + for (size_t i (0); i != n; ++i) + args.push_back (sv[i].c_str ()); } } void - append_options (strings& args, const strings& sv) + append_options (strings& args, const strings& sv, size_t n) { - if (!sv.empty ()) + if (n != 0) { - args.reserve (args.size () + sv.size ()); + args.reserve (args.size () + n); - for (const string& s: sv) - args.push_back (s); + for (size_t i (0); i != n; ++i) + args.push_back (sv[i]); } } void - hash_options (sha256& csum, const strings& sv) + hash_options (sha256& csum, const strings& sv, size_t n) { - for (const string& s: sv) - csum.append (s); + for (size_t i (0); i != n; ++i) + csum.append (sv[i]); } bool -- cgit v1.1