Skip to content

Commit

Permalink
win32: fix build with MSVC
Browse files Browse the repository at this point in the history
strndup doesn't exist, but there's a compat version for that.
  • Loading branch information
robUx4 committed Dec 16, 2024
1 parent c8f31ce commit f7cc1fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/win32/win32_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib/nfs_v4.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
#include <pwd.h>
#endif

#ifdef WIN32
#include <win32/win32_compat.h>
#endif

#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
Expand Down

0 comments on commit f7cc1fe

Please sign in to comment.