Skip to content

Commit

Permalink
Merge pull request #508 from robUx4/raw-compat
Browse files Browse the repository at this point in the history
Fix win32 build of installed package
  • Loading branch information
sahlberg authored Dec 16, 2024
2 parents 100e58a + f7cc1fe commit bcf5c75
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
10 changes: 8 additions & 2 deletions include/win32/win32_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,20 @@ struct pollfd {
int getpid(void);
int win32_inet_pton(int af, const char * src, void * dst);
int win32_poll(struct pollfd *fds, unsigned int nfsd, int timeout);
int win32_gettimeofday(struct timeval *tv, struct timezone *tz);
#ifdef __MINGW32__
# define win32_gettimeofday mingw_gettimeofday
#else
struct timezone
{
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};
int win32_gettimeofday(struct timeval *tv, struct timezone *tz);
#endif

#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
6 changes: 0 additions & 6 deletions win32/win32_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,6 @@ int win32_poll(struct pollfd *fds, unsigned int nfds, int timo)
#endif

#ifndef __MINGW32__
struct timezone
{
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};

int win32_gettimeofday(struct timeval *tv, struct timezone *tz)
{
FILETIME ft;
Expand Down

0 comments on commit bcf5c75

Please sign in to comment.