From f7cc1fefc50209ac822e8f68f79150b142354fce Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Mon, 16 Dec 2024 10:06:20 +0100 Subject: [PATCH] win32: fix build with MSVC strndup doesn't exist, but there's a compat version for that. --- include/win32/win32_compat.h | 2 +- lib/nfs_v4.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/win32/win32_compat.h b/include/win32/win32_compat.h index e11bf70b..09f8eb11 100755 --- a/include/win32/win32_compat.h +++ b/include/win32/win32_compat.h @@ -163,7 +163,7 @@ int win32_gettimeofday(struct timeval *tv, struct timezone *tz); #define DllExport -#ifdef __MINGW32__ +#if defined(__MINGW32__) || defined(_MSC_VER) char* libnfs_strndup(const char *s, size_t n); #define strndup libnfs_strndup #endif diff --git a/lib/nfs_v4.c b/lib/nfs_v4.c index 948187de..60f03437 100644 --- a/lib/nfs_v4.c +++ b/lib/nfs_v4.c @@ -88,6 +88,10 @@ #include #endif +#ifdef WIN32 +#include +#endif + #include #include #include