From 8178a81a34ea8d67fc814828352b8a902dec6b58 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 13 May 2021 16:07:53 +0800 Subject: [PATCH] fix compile error --- src/util/src/tskiplist.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/src/tskiplist.c b/src/util/src/tskiplist.c index 1bf6385288..842ded19a6 100644 --- a/src/util/src/tskiplist.c +++ b/src/util/src/tskiplist.c @@ -546,7 +546,12 @@ static FORCE_INLINE int32_t getSkipListNodeRandomHeight(SSkipList *pSkipList) { const uint32_t factor = 4; int32_t n = 1; + +#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) + while ((rand() % factor) == 0 && n <= pSkipList->maxLevel) { +#else while ((rand_r(&(pSkipList->seed)) % factor) == 0 && n <= pSkipList->maxLevel) { +#endif n++; } -- GitLab