diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-12 12:46:21 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-12 17:04:22 +0200 |
commit | 0fd7815cbc6557811df4f1b6ffb40461474b8534 (patch) | |
tree | f67b2d8a94f85027b3f1c98c4bf9acadd4b27d56 /build2/utility.cxx | |
parent | 9fa5f73d00905568e8979d0c93ec4a8f645c81d5 (diff) |
Implement c/cxx toolchain cross-hinting
Diffstat (limited to 'build2/utility.cxx')
-rw-r--r-- | build2/utility.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/build2/utility.cxx b/build2/utility.cxx index 971c1fb..3eda7e1 100644 --- a/build2/utility.cxx +++ b/build2/utility.cxx @@ -287,6 +287,21 @@ namespace build2 return false; } + string + apply_pattern (const char* s, const string* p) + { + if (p == nullptr) + return s; + + size_t i (p->find ('*')); + assert (i != string::npos); + + string r (*p, 0, i++); + r.append (s); + r.append (*p, i, p->size () - i); + return r; + } + unsigned int to_version (const string& s) { |