Merge pull request #12463 from taosdata/fix/ZhiqiangWang/fix-15189-update-windows-compile-error
fix(os): update windows compile error
This commit is contained in:
commit
25b5b20e35
|
@ -37,6 +37,7 @@ typedef int32_t TdUcs4;
|
||||||
#define wcstombs WCSTOMBS_FUNC_TAOS_FORBID
|
#define wcstombs WCSTOMBS_FUNC_TAOS_FORBID
|
||||||
#define wcsncpy WCSNCPY_FUNC_TAOS_FORBID
|
#define wcsncpy WCSNCPY_FUNC_TAOS_FORBID
|
||||||
#define wchar_t WCHAR_T_TYPE_TAOS_FORBID
|
#define wchar_t WCHAR_T_TYPE_TAOS_FORBID
|
||||||
|
#define strcasestr STR_CASE_STR_FORBID
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
|
@ -69,6 +70,8 @@ int32_t taosMbsToWchars(TdWchar *pWchars, const char *pStrs, int32_t size);
|
||||||
int32_t taosWcharToMb(char *pStr, TdWchar wchar);
|
int32_t taosWcharToMb(char *pStr, TdWchar wchar);
|
||||||
int32_t taosWcharsToMbs(char *pStrs, TdWchar *pWchars, int32_t size);
|
int32_t taosWcharsToMbs(char *pStrs, TdWchar *pWchars, int32_t size);
|
||||||
|
|
||||||
|
char *taosStrCaseStr(const char *str, const char *pattern);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -236,3 +236,22 @@ int32_t taosMbsToWchars(TdWchar *pWchars, const char *pStrs, int32_t size) { ret
|
||||||
int32_t taosWcharToMb(char *pStr, TdWchar wchar) { return wctomb(pStr, wchar); }
|
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) {
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
if (!*pattern)
|
||||||
|
return (char*)str;
|
||||||
|
|
||||||
|
for (; *str; str++) {
|
||||||
|
if (toupper(*str) == toupper(*pattern)) {
|
||||||
|
for (i = 1;; i++) {
|
||||||
|
if (!pattern[i])
|
||||||
|
return (char*)str;
|
||||||
|
if (toupper(str[i]) != toupper(pattern[i]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
|
@ -509,7 +509,7 @@ void shellPrintField(const char *val, TAOS_FIELD *field, int32_t width, int32_t
|
||||||
|
|
||||||
bool shellIsLimitQuery(const char *sql) {
|
bool shellIsLimitQuery(const char *sql) {
|
||||||
//todo refactor
|
//todo refactor
|
||||||
if (strcasestr(sql, " limit ") != NULL) {
|
if (taosStrCaseStr(sql, " limit ") != NULL) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue