aboutsummaryrefslogtreecommitdiff
path: root/build2/cxx/link.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/cxx/link.cxx')
-rw-r--r--build2/cxx/link.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/build2/cxx/link.cxx b/build2/cxx/link.cxx
index b80fc8b..88181aa 100644
--- a/build2/cxx/link.cxx
+++ b/build2/cxx/link.cxx
@@ -459,18 +459,23 @@ namespace build2
//
string d ("-DLIB");
- //@@ CASE
-
- auto upcase = [] (char c)
+ auto upcase_sanitize = [] (char c) -> char
{
- const unsigned char shift ('a' - 'A');
- return c >= 'a' && c <='z' ? c - shift : c;
+ if (c >= 'a' && c <='z')
+ {
+ const unsigned char shift ('a' - 'A');
+ return c - shift;
+ }
+ else if (c == '-' || c == '+' || c == '.')
+ return '_';
+ else
+ return c;
};
transform (t.name.begin (),
t.name.end (),
back_inserter (d),
- upcase);
+ upcase_sanitize);
d += '_';
d += suffix;