aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/functions-string.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/functions-string.cxx')
-rw-r--r--libbuild2/functions-string.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/libbuild2/functions-string.cxx b/libbuild2/functions-string.cxx
index 1e93943..55715fe 100644
--- a/libbuild2/functions-string.cxx
+++ b/libbuild2/functions-string.cxx
@@ -21,6 +21,29 @@ namespace build2
//
// f["string"] = [](strings v) {return v;};
+ // Compare ASCII strings ignoring case and returning the boolean value.
+ //
+ f["icasecmp"] = [](string x, string y)
+ {
+ return icasecmp (x, y) == 0;
+ };
+
+ f["icasecmp"] = [](string x, names y)
+ {
+ return icasecmp (x, convert<string> (move (y))) == 0;
+ };
+
+ f["icasecmp"] = [](names x, string y)
+ {
+ return icasecmp (convert<string> (move (x)), y) == 0;
+ };
+
+ f[".icasecmp"] = [](names x, names y)
+ {
+ return icasecmp (convert<string> (move (x)),
+ convert<string> (move (y))) == 0;
+ };
+
// String-specific overloads from builtins.
//
function_family b (m, "builtin");