From 4caa94d5c9c80848c5c07ce530fcc6cf1ce5eb00 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Sun, 13 Mar 2022 18:55:12 +0800 Subject: [PATCH] [TD-13767]: redefine Locale api. --- include/os/osLocale.h | 6 +++++- source/os/src/osLocale.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/os/osLocale.h b/include/os/osLocale.h index 6e313eb8cd..ddafd2e93c 100644 --- a/include/os/osLocale.h +++ b/include/os/osLocale.h @@ -17,12 +17,16 @@ #define _TD_OS_LOCALE_H_ #include "os.h" -#include "osString.h" #ifdef __cplusplus extern "C" { #endif +// If the error is in a third-party library, place this header file under the third-party library header file. +#ifndef ALLOW_FORBID_FUNC + #define setlocale SETLOCALE_FUNC_TAOS_FORBID +#endif + char *taosCharsetReplace(char *charsetstr); void taosGetSystemLocale(char *outLocale, char *outCharset); void taosSetSystemLocale(const char *inLocale, const char *inCharSet); diff --git a/source/os/src/osLocale.c b/source/os/src/osLocale.c index 47546f7deb..e9d6ed7c54 100644 --- a/source/os/src/osLocale.c +++ b/source/os/src/osLocale.c @@ -13,6 +13,7 @@ * along with this program. If not, see . */ +#define ALLOW_FORBID_FUNC #define _DEFAULT_SOURCE #include "osLocale.h"