From 4c7a3c1350687d2913a2e008c2c41deceedcdead Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 28 Sep 2019 18:01:32 +0300 Subject: Adapt to renaming butl::casecmp() to icasecmp() --- libbuild2/cc/common.cxx | 2 +- libbuild2/cc/compile-rule.cxx | 2 +- libbuild2/cc/link-rule.cxx | 2 +- libbuild2/cc/msvc.cxx | 4 ++-- libbuild2/cc/windows-rpath.cxx | 4 ++-- libbuild2/utility.cxx | 16 ++++++++-------- libbuild2/utility.hxx | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libbuild2/cc/common.cxx b/libbuild2/cc/common.cxx index bfcb00c..7d929a8 100644 --- a/libbuild2/cc/common.cxx +++ b/libbuild2/cc/common.cxx @@ -985,7 +985,7 @@ namespace build2 // /LIBPATH: (case-insensitive). // if ((o[0] == '/' || o[0] == '-') && - casecmp (o.c_str () + 1, "LIBPATH:", 8) == 0) + icasecmp (o.c_str () + 1, "LIBPATH:", 8) == 0) d = dir_path (o, 9, string::npos); else continue; diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index d6adfd3..ac052b1 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -4558,7 +4558,7 @@ namespace build2 fc = f[fi - 1]; mc = m[mi - 1]; - if (casecmp (fc, mc) == 0) + if (icasecmp (fc, mc) == 0) { fsep = msep = false; continue; diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index 14e5b94..fb7588b 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -1762,7 +1762,7 @@ namespace build2 if ((c ? f.compare (p, string::npos, e) - : casecmp (f.c_str () + p, e)) != 0) + : icasecmp (f.c_str () + p, e)) != 0) return; } diff --git a/libbuild2/cc/msvc.cxx b/libbuild2/cc/msvc.cxx index d802b98..2d53b69 100644 --- a/libbuild2/cc/msvc.cxx +++ b/libbuild2/cc/msvc.cxx @@ -318,10 +318,10 @@ namespace build2 { const char* e (s.c_str () + n + 1); - if (casecmp (e, "obj", 3) == 0) + if (icasecmp (e, "obj", 3) == 0) obj = true; - if (casecmp (e, "dll", 3) == 0) + if (icasecmp (e, "dll", 3) == 0) dll = true; } } diff --git a/libbuild2/cc/windows-rpath.cxx b/libbuild2/cc/windows-rpath.cxx index 5583315..b5d82b1 100644 --- a/libbuild2/cc/windows-rpath.cxx +++ b/libbuild2/cc/windows-rpath.cxx @@ -94,7 +94,7 @@ namespace build2 // size_t p (path::traits_type::find_extension (f)); - if (p == string::npos || casecmp (f.c_str () + p + 1, "dll") != 0) + if (p == string::npos || icasecmp (f.c_str () + p + 1, "dll") != 0) return; } @@ -172,7 +172,7 @@ namespace build2 { size_t p (path::traits_type::find_extension (f)); - if (p != string::npos && casecmp (f.c_str () + p + 1, "dll") == 0) + if (p != string::npos && icasecmp (f.c_str () + p + 1, "dll") == 0) { // See if we can find a corresponding .pdb. // diff --git a/libbuild2/utility.cxx b/libbuild2/utility.cxx index ba50c5a..16bbd85 100644 --- a/libbuild2/utility.cxx +++ b/libbuild2/utility.cxx @@ -360,7 +360,7 @@ namespace build2 find_option (const char* o, const strings& strs, bool ic) { for (const string& s: strs) - if (ic ? casecmp (s, o) == 0 : s == o) + if (ic ? icasecmp (s, o) == 0 : s == o) return true; return false; @@ -370,7 +370,7 @@ namespace build2 find_option (const char* o, const cstrings& cstrs, bool ic) { for (const char* s: cstrs) - if (s != nullptr && (ic ? casecmp (s, o) : strcmp (s, o)) == 0) + if (s != nullptr && (ic ? icasecmp (s, o) : strcmp (s, o)) == 0) return true; return false; @@ -387,7 +387,7 @@ namespace build2 { for (const string& s: strs) for (const char* o: os) - if (ic ? casecmp (s, o) == 0 : s == o) + if (ic ? icasecmp (s, o) == 0 : s == o) return true; return false; @@ -401,7 +401,7 @@ namespace build2 for (const char* s: cstrs) if (s != nullptr) for (const char* o: os) - if ((ic ? casecmp (s, o) : strcmp (s, o)) == 0) + if ((ic ? icasecmp (s, o) : strcmp (s, o)) == 0) return true; return false; @@ -419,7 +419,7 @@ namespace build2 size_t n (strlen (p)); for (const string& s: reverse_iterate (strs)) - if ((ic ? casecmp (s, p, n) : s.compare (0, n, p)) == 0) + if ((ic ? icasecmp (s, p, n) : s.compare (0, n, p)) == 0) return &s; return nullptr; @@ -431,7 +431,7 @@ namespace build2 size_t n (strlen (p)); for (const char* s: reverse_iterate (cstrs)) - if (s != nullptr && (ic ? casecmp (s, p, n) : strncmp (s, p, n)) == 0) + if (s != nullptr && (ic ? icasecmp (s, p, n) : strncmp (s, p, n)) == 0) return s; return nullptr; @@ -453,7 +453,7 @@ namespace build2 for (const string& s: reverse_iterate (strs)) for (const char* p: ps) if ((ic - ? casecmp (s, p, strlen (p)) + ? icasecmp (s, p, strlen (p)) : s.compare (0, strlen (p), p)) == 0) return &s; @@ -469,7 +469,7 @@ namespace build2 if (s != nullptr) for (const char* p: ps) if ((ic - ? casecmp (s, p, strlen (p)) + ? icasecmp (s, p, strlen (p)) : strncmp (s, p, strlen (p))) == 0) return s; diff --git a/libbuild2/utility.hxx b/libbuild2/utility.hxx index f6b6d3a..8256fa4 100644 --- a/libbuild2/utility.hxx +++ b/libbuild2/utility.hxx @@ -61,9 +61,9 @@ namespace build2 using butl::compare_pointer_target; //using butl::hash_pointer_target; using butl::combine_hash; - using butl::casecmp; - using butl::case_compare_string; - using butl::case_compare_c_string; + using butl::icasecmp; + using butl::icase_compare_string; + using butl::icase_compare_c_string; using butl::lcase; using butl::alpha; using butl::alnum; -- cgit v1.1