提交 2f985c1f 编写于 作者: wafwerar's avatar wafwerar

os: fix develop win32 compile error

上级 d6a1149b
...@@ -242,8 +242,14 @@ IF (TD_WINDOWS) ...@@ -242,8 +242,14 @@ IF (TD_WINDOWS)
ADD_DEFINITIONS(-DPTW32_BUILD) ADD_DEFINITIONS(-DPTW32_BUILD)
ADD_DEFINITIONS(-D_MBCS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) ADD_DEFINITIONS(-D_MBCS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
SET(CMAKE_GENERATOR "NMake Makefiles" CACHE INTERNAL "" FORCE) SET(CMAKE_GENERATOR "NMake Makefiles" CACHE INTERNAL "" FORCE)
IF (CMAKE_DEPFILE_FLAGS_C)
SET(CMAKE_DEPFILE_FLAGS_C "")
ENDIF ()
IF (CMAKE_DEPFILE_FLAGS_CXX)
SET(CMAKE_DEPFILE_FLAGS_CXX "")
ENDIF ()
IF (NOT TD_GODLL) IF (NOT TD_GODLL)
SET(COMMON_FLAGS "/nologo /WX /wd4018 /wd4999 /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-") SET(COMMON_FLAGS "/nologo /wd4018 /wd4999 /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-")
IF (MSVC AND (MSVC_VERSION GREATER_EQUAL 1900)) IF (MSVC AND (MSVC_VERSION GREATER_EQUAL 1900))
SET(COMMON_FLAGS "${COMMON_FLAGS} /Wv:18") SET(COMMON_FLAGS "${COMMON_FLAGS} /Wv:18")
ENDIF () ENDIF ()
......
...@@ -116,7 +116,7 @@ static void mnodePrintUserAuth() { ...@@ -116,7 +116,7 @@ static void mnodePrintUserAuth() {
pIter = mnodeGetNextUser(pIter, &pUser); pIter = mnodeGetNextUser(pIter, &pUser);
if (pUser == NULL) break; if (pUser == NULL) break;
char *base64 = base64_encode((const unsigned char *)pUser->pass, TSDB_KEY_LEN * 2); char *base64 = taos_base64_encode((const unsigned char *)pUser->pass, TSDB_KEY_LEN * 2);
fprintf(fp, "user:%24s auth:%s\n", pUser->user, base64); fprintf(fp, "user:%24s auth:%s\n", pUser->user, base64);
free(base64); free(base64);
......
...@@ -104,7 +104,7 @@ int32_t httpGenTaosdAuthToken(HttpContext *pContext, char *token, int32_t maxLen ...@@ -104,7 +104,7 @@ int32_t httpGenTaosdAuthToken(HttpContext *pContext, char *token, int32_t maxLen
tstrncpy(buffer + sizeof(pContext->user), pContext->pass, size); tstrncpy(buffer + sizeof(pContext->user), pContext->pass, size);
char *encrypt = taosDesEncode(KEY_DES_4, buffer, TSDB_USER_LEN + HTTP_PASSWORD_LEN); char *encrypt = taosDesEncode(KEY_DES_4, buffer, TSDB_USER_LEN + HTTP_PASSWORD_LEN);
char *base64 = base64_encode((const unsigned char *)encrypt, TSDB_USER_LEN + HTTP_PASSWORD_LEN); char *base64 = taos_base64_encode((const unsigned char *)encrypt, TSDB_USER_LEN + HTTP_PASSWORD_LEN);
size_t len = strlen(base64); size_t len = strlen(base64);
tstrncpy(token, base64, len + 1); tstrncpy(token, base64, len + 1);
......
...@@ -25,7 +25,7 @@ extern "C" { ...@@ -25,7 +25,7 @@ extern "C" {
#include "tutil.h" #include "tutil.h"
unsigned char *base64_decode(const char *value, int inlen, int *outlen); unsigned char *base64_decode(const char *value, int inlen, int *outlen);
char *base64_encode(const unsigned char *value, int vlen); char *taos_base64_encode(const unsigned char *value, int vlen);
char *taosDesEncode(int64_t key, char *src, int len); char *taosDesEncode(int64_t key, char *src, int len);
char *taosDesDecode(int64_t key, char *src, int len); char *taosDesDecode(int64_t key, char *src, int len);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// deprecated this file for bug prone // deprecated this file for bug prone
// base64 encode // base64 encode
static char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
char *base64_encode(const unsigned char *value, int vlen) { char *taos_base64_encode(const unsigned char *value, int vlen) {
unsigned char oval = 0; unsigned char oval = 0;
char * result = (char *)malloc((size_t)(vlen * 4) / 3 + 10); char * result = (char *)malloc((size_t)(vlen * 4) / 3 + 10);
char * out = result; char * out = result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册