fix(os): update windows compile error

This commit is contained in:
afwerar 2022-05-14 11:15:21 +08:00
parent 61729d6805
commit 2e3a64a569
1 changed files with 13 additions and 17 deletions

View File

@ -238,24 +238,20 @@ int32_t taosWcharToMb(char *pStr, TdWchar wchar) { return wctomb(pStr, wchar); }
int32_t taosWcharsToMbs(char *pStrs, TdWchar *pWchars, int32_t size) { return wcstombs(pStrs, pWchars, size); } int32_t taosWcharsToMbs(char *pStrs, TdWchar *pWchars, int32_t size) { return wcstombs(pStrs, pWchars, size); }
char *taosStrCaseStr(const char *str, const char *pattern) { char *taosStrCaseStr(const char *str, const char *pattern) {
#ifdef WINDOWS size_t i;
size_t i;
if (!*pattern) if (!*pattern)
return (char*)str; return (char*)str;
for (; *str; str++) { for (; *str; str++) {
if (toupper(*str) == toupper(*pattern)) { if (toupper(*str) == toupper(*pattern)) {
for (i = 1;; i++) { for (i = 1;; i++) {
if (!pattern[i]) if (!pattern[i])
return (char*)str; return (char*)str;
if (toupper(str[i]) != toupper(pattern[i])) if (toupper(str[i]) != toupper(pattern[i]))
break; break;
}
}
} }
return NULL; }
#else }
return strcasestr(str, pattern); return NULL;
#endif
} }