diff options
author | thegeorg <[email protected]> | 2022-06-03 10:53:07 +0300 |
---|---|---|
committer | thegeorg <[email protected]> | 2022-06-03 10:53:07 +0300 |
commit | a1d4361e379e2c72a469ad1bd64569cbc2db131f (patch) | |
tree | 0caddb240a10132376e4653a31578e117d33f9fd /contrib/libs/cxxsupp/openmp/kmp_str.cpp | |
parent | 41f55a521834080d9d703c099c0418cfff3a0546 (diff) |
Update contrib/libs/cxxsupp/openmp to 14.0.4
ref:77c6cdda99b217d50c4deadca11f5611fa0dc168
Diffstat (limited to 'contrib/libs/cxxsupp/openmp/kmp_str.cpp')
-rw-r--r-- | contrib/libs/cxxsupp/openmp/kmp_str.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/contrib/libs/cxxsupp/openmp/kmp_str.cpp b/contrib/libs/cxxsupp/openmp/kmp_str.cpp index ffce2b88ab3..e64f989fbc6 100644 --- a/contrib/libs/cxxsupp/openmp/kmp_str.cpp +++ b/contrib/libs/cxxsupp/openmp/kmp_str.cpp @@ -515,6 +515,31 @@ int __kmp_str_match(char const *target, int len, char const *data) { return ((len > 0) ? i >= len : (!target[i] && (len || !data[i]))); } // __kmp_str_match +// If data contains all of target, returns true, otherwise returns false. +// len should be the length of target +bool __kmp_str_contains(char const *target, int len, char const *data) { + int i = 0, j = 0, start = 0; + if (target == NULL || data == NULL) { + return FALSE; + } + while (target[i]) { + if (!data[j]) + return FALSE; + if (TOLOWER(target[i]) != TOLOWER(data[j])) { + j = start + 1; + start = j; + i = 0; + } else { + if (i == 0) + start = j; + j++; + i++; + } + } + + return i == len; +} // __kmp_str_contains + int __kmp_str_match_false(char const *data) { int result = __kmp_str_match("false", 1, data) || __kmp_str_match("off", 2, data) || |