diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index c70ca8662eaf1b3b2c73f526f7892585632da189..c328e5745327aefb1d9028c8c8cc13ce04d3f770 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -22,6 +22,7 @@ extern "C" { #include #include +#include "osDef.h" #include "taos.h" #define TSDB__packed @@ -161,7 +162,7 @@ extern tDataTypeDescriptor tDataTypeDesc[11]; bool isValidDataType(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) { case TSDB_DATA_TYPE_BOOL: return *(uint8_t *)val == TSDB_DATA_BOOL_NULL; diff --git a/src/os/inc/osString.h b/src/os/inc/osString.h index 1e1953c81ddaf42a86ed8c04965dcbf46792db12..b2846a31bccfc61865d5729d93d48a484e0eb9b7 100644 --- a/src/os/inc/osString.h +++ b/src/os/inc/osString.h @@ -41,8 +41,9 @@ extern "C" { (dst)[(size)-1] = 0; \ } while (0); -// TAOS_OS_FUNC_STRING_STR2INT64 -int64_t tsosStr2int64(char *str); +#ifndef TAOS_OS_FUNC_STRING_STR2INT64 + int64_t tsosStr2int64(char *str); +#endif // USE_LIBICONV int32_t taosUcs4ToMbs(void *ucs4, int32_t ucs4_max_len, char *mbs); diff --git a/src/os/inc/osTime.h b/src/os/inc/osTime.h index e2d3e081a1223a391ed046fcf309c0f6ef2061c2..cd2553f75336bc00225b4292638b3eb96f082ae9 100644 --- a/src/os/inc/osTime.h +++ b/src/os/inc/osTime.h @@ -23,7 +23,7 @@ extern "C" { #include "os.h" #include "taosdef.h" -#ifndef TAOS_OS_DEF_TIME +#ifndef TAOS_OS_FUNC_TIME_DEF #define MILLISECOND_PER_SECOND ((int64_t)1000L) #endif #define MILLISECOND_PER_MINUTE (MILLISECOND_PER_SECOND * 60) diff --git a/src/os/inc/osWindows.h b/src/os/inc/osWindows.h index b44a41832e2fdcd17e72e3b754fa0a42c39b3775..a8c2243253f7768c4682acedeaabb25b197cad55 100644 --- a/src/os/inc/osWindows.h +++ b/src/os/inc/osWindows.h @@ -43,6 +43,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -124,6 +125,7 @@ typedef int (*__compar_fn_t)(const void *, const void *); #define socklen_t int #define htobe64 htonll #define twrite write +#define getpid _getpid int gettimeofday(struct timeval *tv, struct timezone *tz); struct tm *localtime_r(const time_t *timep, struct tm *result); diff --git a/src/os/src/windows/CMakeLists.txt b/src/os/src/windows/CMakeLists.txt index dc60b736ea2ca1d223f1f9bbb4206195c63a08ff..60fab63cd12a3f2c976c458c6be686009350ee96 100644 --- a/src/os/src/windows/CMakeLists.txt +++ b/src/os/src/windows/CMakeLists.txt @@ -1,11 +1,15 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TDengine) -IF (TD_WINDOWS_64) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread) - INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) - INCLUDE_DIRECTORIES(inc) - AUX_SOURCE_DIRECTORY(src SRC) - ADD_LIBRARY(os ${SRC}) - TARGET_LINK_LIBRARIES(os winmm IPHLPAPI ws2_32) -ENDIF () +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/iconv) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/regex) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/os/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) +INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc) +AUX_SOURCE_DIRECTORY(. SRC) + +ADD_LIBRARY(os ${SRC}) + +TARGET_LINK_LIBRARIES(os winmm IPHLPAPI ws2_32) diff --git a/src/os/src/windows/w64File.c b/src/os/src/windows/w64File.c index 54a95297ac092a8df8ec262df98f53d32c05dc9d..f2c59c3639ead8e980d0bf1ce9c7a43c8dbb629b 100644 --- a/src/os/src/windows/w64File.c +++ b/src/os/src/windows/w64File.c @@ -37,10 +37,9 @@ void taosGetTmpfilePath(const char *fileNamePrefix, char *dstPath) { snprintf(dstPath, PATH_MAX, tmpPath, getpid(), rand); } - #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); int writeLen = 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 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 diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index 902c8b66e4512e79e30d1e40bd6b201f787d56fb..15a8923d2126df480165f082b33f5919e8aac351 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -10,19 +10,12 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/lz4/inc) INCLUDE_DIRECTORIES(inc) 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) - #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) ELSEIF (TD_WINDOWS_64) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/pthread) - 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) ENDIF () ADD_LIBRARY(trpc ${SRC}) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 2521c582d10d1d90aa91ef210892be2283316240..d91ef075ef980215a03389c3e9d4c826fd41bf35 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -34,38 +34,7 @@ ELSEIF (TD_WINDOWS_64) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/iconv) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/regex) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) - LIST(APPEND SRC ./src/hash.c) - 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) + AUX_SOURCE_DIRECTORY(src SRC) ADD_LIBRARY(tutil ${SRC}) TARGET_LINK_LIBRARIES(tutil iconv regex pthread osdetail winmm IPHLPAPI ws2_32 lz4) ELSEIF(TD_DARWIN_64)