提交 dc64d4ed 编写于 作者: S Shengliang Guan

[TD-1037]

上级 9d6896cc
...@@ -22,6 +22,7 @@ extern "C" { ...@@ -22,6 +22,7 @@ extern "C" {
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "osDef.h"
#include "taos.h" #include "taos.h"
#define TSDB__packed #define TSDB__packed
...@@ -161,7 +162,7 @@ extern tDataTypeDescriptor tDataTypeDesc[11]; ...@@ -161,7 +162,7 @@ extern tDataTypeDescriptor tDataTypeDesc[11];
bool isValidDataType(int32_t type); bool isValidDataType(int32_t type);
//bool isNull(const char *val, int32_t type); //bool isNull(const char *val, int32_t type);
static inline __attribute__((always_inline)) bool isNull(const char *val, int32_t type) { static FORCE_INLINE bool isNull(const char *val, int32_t type) {
switch (type) { switch (type) {
case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_BOOL:
return *(uint8_t *)val == TSDB_DATA_BOOL_NULL; return *(uint8_t *)val == TSDB_DATA_BOOL_NULL;
......
...@@ -41,8 +41,9 @@ extern "C" { ...@@ -41,8 +41,9 @@ extern "C" {
(dst)[(size)-1] = 0; \ (dst)[(size)-1] = 0; \
} while (0); } while (0);
// TAOS_OS_FUNC_STRING_STR2INT64 #ifndef TAOS_OS_FUNC_STRING_STR2INT64
int64_t tsosStr2int64(char *str); int64_t tsosStr2int64(char *str);
#endif
// USE_LIBICONV // USE_LIBICONV
int32_t taosUcs4ToMbs(void *ucs4, int32_t ucs4_max_len, char *mbs); int32_t taosUcs4ToMbs(void *ucs4, int32_t ucs4_max_len, char *mbs);
......
...@@ -23,7 +23,7 @@ extern "C" { ...@@ -23,7 +23,7 @@ extern "C" {
#include "os.h" #include "os.h"
#include "taosdef.h" #include "taosdef.h"
#ifndef TAOS_OS_DEF_TIME #ifndef TAOS_OS_FUNC_TIME_DEF
#define MILLISECOND_PER_SECOND ((int64_t)1000L) #define MILLISECOND_PER_SECOND ((int64_t)1000L)
#endif #endif
#define MILLISECOND_PER_MINUTE (MILLISECOND_PER_SECOND * 60) #define MILLISECOND_PER_MINUTE (MILLISECOND_PER_SECOND * 60)
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <WS2tcpip.h> #include <WS2tcpip.h>
#include <winbase.h> #include <winbase.h>
#include <Winsock2.h> #include <Winsock2.h>
#include <process.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -124,6 +125,7 @@ typedef int (*__compar_fn_t)(const void *, const void *); ...@@ -124,6 +125,7 @@ typedef int (*__compar_fn_t)(const void *, const void *);
#define socklen_t int #define socklen_t int
#define htobe64 htonll #define htobe64 htonll
#define twrite write #define twrite write
#define getpid _getpid
int gettimeofday(struct timeval *tv, struct timezone *tz); int gettimeofday(struct timeval *tv, struct timezone *tz);
struct tm *localtime_r(const time_t *timep, struct tm *result); struct tm *localtime_r(const time_t *timep, struct tm *result);
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_WINDOWS_64) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/iconv)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/regex)
INCLUDE_DIRECTORIES(inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
AUX_SOURCE_DIRECTORY(src SRC) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/os/inc)
ADD_LIBRARY(os ${SRC}) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc)
TARGET_LINK_LIBRARIES(os winmm IPHLPAPI ws2_32) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc)
ENDIF () AUX_SOURCE_DIRECTORY(. SRC)
ADD_LIBRARY(os ${SRC})
TARGET_LINK_LIBRARIES(os winmm IPHLPAPI ws2_32)
...@@ -37,10 +37,9 @@ void taosGetTmpfilePath(const char *fileNamePrefix, char *dstPath) { ...@@ -37,10 +37,9 @@ void taosGetTmpfilePath(const char *fileNamePrefix, char *dstPath) {
snprintf(dstPath, PATH_MAX, tmpPath, getpid(), rand); snprintf(dstPath, PATH_MAX, tmpPath, getpid(), rand);
} }
#define _SEND_FILE_STEP_ 1000 #define _SEND_FILE_STEP_ 1000
int taosTSendFileImp(FILE* out_file, FILE* in_file, int64_t* offset, int32_t count) { int taosFSendFileImp(FILE* out_file, FILE* in_file, int64_t* offset, int32_t count) {
fseek(in_file, (int32_t)(*offset), 0); fseek(in_file, (int32_t)(*offset), 0);
int writeLen = 0; int writeLen = 0;
uint8_t buffer[_SEND_FILE_STEP_] = { 0 }; uint8_t buffer[_SEND_FILE_STEP_] = { 0 };
...@@ -74,3 +73,8 @@ int taosTSendFileImp(FILE* out_file, FILE* in_file, int64_t* offset, int32_t cou ...@@ -74,3 +73,8 @@ int taosTSendFileImp(FILE* out_file, FILE* in_file, int64_t* offset, int32_t cou
return writeLen; return writeLen;
} }
ssize_t taosTSendFileImp(int dfd, int sfd, off_t *offset, size_t size) {
uError("taosTSendFileImp no implemented yet");
return 0;
}
\ No newline at end of file
...@@ -10,19 +10,12 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lz4/inc) ...@@ -10,19 +10,12 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lz4/inc)
INCLUDE_DIRECTORIES(inc) INCLUDE_DIRECTORIES(inc)
IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
AUX_SOURCE_DIRECTORY(./src SRC) AUX_SOURCE_DIRECTORY(src SRC)
ELSEIF (TD_DARWIN_64) ELSEIF (TD_DARWIN_64)
#LIST(APPEND SRC ./src/thaship.c)
#LIST(APPEND SRC ./src/trpc.c)
#LIST(APPEND SRC ./src/tstring.c)
#LIST(APPEND SRC ./src/tudp.c)
AUX_SOURCE_DIRECTORY(src SRC) AUX_SOURCE_DIRECTORY(src SRC)
ELSEIF (TD_WINDOWS_64) ELSEIF (TD_WINDOWS_64)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread)
LIST(APPEND SRC ./src/thaship.c) AUX_SOURCE_DIRECTORY(src SRC)
LIST(APPEND SRC ./src/trpc.c)
LIST(APPEND SRC ./src/tstring.c)
LIST(APPEND SRC ./src/tudp.c)
ENDIF () ENDIF ()
ADD_LIBRARY(trpc ${SRC}) ADD_LIBRARY(trpc ${SRC})
......
...@@ -34,38 +34,7 @@ ELSEIF (TD_WINDOWS_64) ...@@ -34,38 +34,7 @@ ELSEIF (TD_WINDOWS_64)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/iconv) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/iconv)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/regex) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/regex)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
LIST(APPEND SRC ./src/hash.c) AUX_SOURCE_DIRECTORY(src SRC)
LIST(APPEND SRC ./src/ihash.c)
LIST(APPEND SRC ./src/lz4.c)
LIST(APPEND SRC ./src/shash.c)
LIST(APPEND SRC ./src/tbase64.c)
LIST(APPEND SRC ./src/tcache.c)
LIST(APPEND SRC ./src/tcompression.c)
LIST(APPEND SRC ./src/textbuffer.c)
LIST(APPEND SRC ./src/tglobalcfg.c)
LIST(APPEND SRC ./src/thash.c)
LIST(APPEND SRC ./src/thashutil.c)
LIST(APPEND SRC ./src/thistogram.c)
LIST(APPEND SRC ./src/tidpool.c)
LIST(APPEND SRC ./src/tinterpolation.c)
LIST(APPEND SRC ./src/tlog.c)
LIST(APPEND SRC ./src/tlosertree.c)
LIST(APPEND SRC ./src/tmd5.c)
LIST(APPEND SRC ./src/tmem.c)
LIST(APPEND SRC ./src/tmempool.c)
LIST(APPEND SRC ./src/tmodule.c)
LIST(APPEND SRC ./src/tnote.c)
LIST(APPEND SRC ./src/tpercentile.c)
LIST(APPEND SRC ./src/tsched.c)
LIST(APPEND SRC ./src/tskiplist.c)
LIST(APPEND SRC ./src/tsocket.c)
LIST(APPEND SRC ./src/tstrbuild.c)
LIST(APPEND SRC ./src/ttime.c)
LIST(APPEND SRC ./src/ttimer.c)
LIST(APPEND SRC ./src/ttokenizer.c)
LIST(APPEND SRC ./src/ttypes.c)
LIST(APPEND SRC ./src/tutil.c)
LIST(APPEND SRC ./src/version.c)
ADD_LIBRARY(tutil ${SRC}) ADD_LIBRARY(tutil ${SRC})
TARGET_LINK_LIBRARIES(tutil iconv regex pthread osdetail winmm IPHLPAPI ws2_32 lz4) TARGET_LINK_LIBRARIES(tutil iconv regex pthread osdetail winmm IPHLPAPI ws2_32 lz4)
ELSEIF(TD_DARWIN_64) ELSEIF(TD_DARWIN_64)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册