From 3b4fa16497326bc902dbd72fc294f0c0469ccafb Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 13 Dec 2024 13:30:24 +1000 Subject: [PATCH] win32: compile fix Signed-off-by: Ronnie Sahlberg --- include/win32/win32_compat.h | 5 +++++ lib/libnfs.c | 4 ++++ lib/multithreading.c | 6 ++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/win32/win32_compat.h b/include/win32/win32_compat.h index 4e7ff7a1..70214b79 100755 --- a/include/win32/win32_compat.h +++ b/include/win32/win32_compat.h @@ -35,6 +35,11 @@ THE SOFTWARE. #include #include // For size_t type +/* We always have multithreading for windows */ +#ifndef HAVE_MULTITHREADING +#define HAVE_MULTITHREADING 1 +#endif + typedef unsigned long fsblkcnt_t; typedef unsigned long fsfilcnt_t; typedef unsigned int uid_t; diff --git a/lib/libnfs.c b/lib/libnfs.c index b9a9b500..48b190c0 100755 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -66,6 +66,10 @@ #include #endif +#ifdef WIN32 +#include +#endif + #include #include #include diff --git a/lib/multithreading.c b/lib/multithreading.c index 0f5c6212..b04cd5be 100644 --- a/lib/multithreading.c +++ b/lib/multithreading.c @@ -224,7 +224,9 @@ int nfs_mt_sem_wait(libnfs_sem_t *sem) } #endif -#elif WIN32 +#endif /* HAVE_PTHREAD */ + +#ifdef WIN32 nfs_tid_t nfs_mt_get_tid(void) { return GetCurrentThreadId(); @@ -340,7 +342,7 @@ int nfs_mt_sem_wait(libnfs_sem_t* sem) return 0; } -#endif +#endif /* WIN32 */ #endif /* HAVE_MULTITHREADING */