aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;