From b03b111c2a9a5c99fd1d84c14c54e9fefb30b5c9 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 26 Jan 2024 14:38:58 +0800 Subject: [PATCH] make it compilable on windows and macos --- include/os/osThread.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/os/osThread.h b/include/os/osThread.h index 08575058ba..4ef4550419 100644 --- a/include/os/osThread.h +++ b/include/os/osThread.h @@ -69,11 +69,19 @@ typedef pthread_key_t TdThreadKey; #define taosThreadCleanupPush pthread_cleanup_push #define taosThreadCleanupPop pthread_cleanup_pop +#if !defined(WINDOWS) +#if defined(_TD_DARWIN_64) // MACOS +#define taosThreadRwlockAttrSetKindNP(A, B) ((void)0) +#else // LINUX #if _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200809L #define taosThreadRwlockAttrSetKindNP(A, B) pthread_rwlockattr_setkind_np(A, B) #else #define taosThreadRwlockAttrSetKindNP(A, B) ((void)0) #endif +#endif +#else // WINDOWS +#define taosThreadRwlockAttrSetKindNP(A, B) ((void)0) +#endif #if defined(WINDOWS) && !defined(__USE_PTHREAD) #define TD_PTHREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER_FORBID