aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-22 12:48:16 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-22 13:15:42 +0300
commitf9ad47ad11f1166b038a57ad5d3691414c05b050 (patch)
tree98fa73bbcba6920d38800c67d944d1847db76965
parented6432add13b0ee9c35a9bbd261e068969f0462d (diff)
Make use of butl::sanitize_identifier()
-rw-r--r--build2/cc/common.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/build2/cc/common.cxx b/build2/cc/common.cxx
index aa0ff59..aa0eb89 100644
--- a/build2/cc/common.cxx
+++ b/build2/cc/common.cxx
@@ -910,15 +910,8 @@ namespace build2
//
string d ("-DLIB");
- auto upcase_sanitize = [] (char c)
- {
- return (c == '-' || c == '+' || c == '.') ? '_' : ucase (c);
- };
-
- transform (t.name.begin (),
- t.name.end (),
- back_inserter (d),
- upcase_sanitize);
+ d += sanitize_identifier (
+ ucase (const_cast<const string&> (t.name)));
d += '_';
d += suffix;