From 402acb60c606e0db0f3f8b924f61f4cc135ce40a Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Fri, 6 May 2022 09:49:37 +0800 Subject: [PATCH] fix(os): fix win max func error. --- cmake/cmake.define | 2 ++ include/libs/function/tudf.h | 4 ++-- source/os/src/osDir.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/cmake.define b/cmake/cmake.define index 1655154506..d1d9266bca 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.16) set(CMAKE_VERBOSE_MAKEFILE OFF) +SET(BUILD_SHARED_LIBS "OFF") + #set output directory SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build/lib) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/build/bin) diff --git a/include/libs/function/tudf.h b/include/libs/function/tudf.h index 22314e4bd6..0000972f5e 100644 --- a/include/libs/function/tudf.h +++ b/include/libs/function/tudf.h @@ -144,7 +144,7 @@ static FORCE_INLINE int32_t udfColEnsureCapacity(SUdfColumn* pColumn, int32_t ne return TSDB_CODE_SUCCESS; } - int allocCapacity = MAX(data->rowsAlloc, 8); + int allocCapacity = TMAX(data->rowsAlloc, 8); while (allocCapacity < newCapacity) { allocCapacity *= UDF_MEMORY_EXP_GROWTH; } @@ -238,7 +238,7 @@ static FORCE_INLINE int32_t udfColSetRow(SUdfColumn* pColumn, uint32_t currentRo data->varLenCol.payloadLen += dataLen; } } - data->numOfRows = MAX(currentRow + 1, data->numOfRows); + data->numOfRows = TMAX(currentRow + 1, data->numOfRows); return 0; } diff --git a/source/os/src/osDir.c b/source/os/src/osDir.c index 6d90773d1b..19e4defafc 100644 --- a/source/os/src/osDir.c +++ b/source/os/src/osDir.c @@ -44,7 +44,7 @@ int wordexp(char *words, wordexp_t *pwordexp, int flags) { return -1; } - printf("parse relative path:%s to abs path:%s\n", words, pwordexp->wordPos); + // printf("parse relative path:%s to abs path:%s\n", words, pwordexp->wordPos); return 0; }