From 4d42ec1b22a630eb0c8f099946a726834eb77040 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 6 Aug 2020 15:12:05 +0800 Subject: [PATCH] TD-1057 --- src/tsdb/CMakeLists.txt | 4 +++- src/tsdb/inc/tsdbMain.h | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/tsdb/CMakeLists.txt b/src/tsdb/CMakeLists.txt index 6f532716da..cef1d0bba7 100644 --- a/src/tsdb/CMakeLists.txt +++ b/src/tsdb/CMakeLists.txt @@ -7,7 +7,9 @@ AUX_SOURCE_DIRECTORY(src SRC) IF (TD_LINUX) ADD_LIBRARY(tsdb ${SRC}) TARGET_LINK_LIBRARIES(tsdb common tutil) - # Someone has no gtest directory, so comment it # ADD_SUBDIRECTORY(tests) +ELSEIF (TD_WINDOWS) + ADD_LIBRARY(tsdb ${SRC}) + TARGET_LINK_LIBRARIES(tsdb common tutil) ENDIF () diff --git a/src/tsdb/inc/tsdbMain.h b/src/tsdb/inc/tsdbMain.h index 5a06dfa65a..adce60c24d 100644 --- a/src/tsdb/inc/tsdbMain.h +++ b/src/tsdb/inc/tsdbMain.h @@ -15,6 +15,7 @@ #ifndef _TD_TSDB_MAIN_H_ #define _TD_TSDB_MAIN_H_ +#include "os.h" #include "hash.h" #include "tcoding.h" #include "tglobal.h" @@ -67,7 +68,7 @@ typedef struct STable { char* sql; void* cqhandle; SRWLatch latch; // TODO: implementa latch functions - T_REF_DECLARE(); + T_REF_DECLARE() } STable; typedef struct { @@ -115,7 +116,7 @@ typedef struct { } STableData; typedef struct { - T_REF_DECLARE(); + T_REF_DECLARE() SRWLatch latch; TSKEY keyFirst; TSKEY keyLast; @@ -127,10 +128,19 @@ typedef struct { } SMemTable; enum { TSDB_UPDATE_META, TSDB_DROP_META }; + +#ifdef WINDOWS +#pragma pack(push ,1) +typedef struct { +#else typedef struct __attribute__((packed)){ +#endif char act; uint64_t uid; } SActObj; +#ifdef WINDOWS +#pragma pack(pop) +#endif typedef struct { int len;