未验证 提交 4e9e84b2 编写于 作者: wafwerar's avatar wafwerar 提交者: GitHub

fix(os): windows compile fail (#13062)

上级 b9b38df3
......@@ -242,8 +242,14 @@ IF (TD_WINDOWS)
ADD_DEFINITIONS(-DPTW32_BUILD)
ADD_DEFINITIONS(-D_MBCS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
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)
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))
SET(COMMON_FLAGS "${COMMON_FLAGS} /Wv:18")
ENDIF ()
......
......@@ -15,8 +15,9 @@
#ifndef __SHELL__
#define __SHELL__
#if !(defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32))
#include <sys/socket.h>
#endif
#include "stdbool.h"
#include "taos.h"
#include "taosdef.h"
......
......@@ -1115,7 +1115,7 @@ void _base64_encode_triple(unsigned char triple[3], char res[4]) {
}
}
int base64_encode(unsigned char *source, size_t sourcelen, char *target, size_t targetlen) {
int taos_base64_encode(unsigned char *source, size_t sourcelen, char *target, size_t targetlen) {
/* check if the result will fit in the target buffer */
if ((sourcelen + 2) / 3 * 4 > targetlen - 1) return 0;
......@@ -1180,7 +1180,7 @@ int wsclient_handshake() {
for (i = 0; i < 16; i++) {
key_nonce[i] = rand() & 0xff;
}
base64_encode(key_nonce, 16, websocket_key, 256);
taos_base64_encode(key_nonce, 16, websocket_key, 256);
if (args.token) {
snprintf(request_header, 1024,
"GET /rest/ws?token=%s HTTP/1.1\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nHost: "
......
......@@ -53,7 +53,7 @@ int32_t taosMkdirP(const char *dir) {
char tmp[256];
char *p = NULL;
size_t len;
int i;
size_t i;
snprintf(tmp, sizeof(tmp),"%s",dir);
len = strlen(tmp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册