libnfs.c: always pass the attributes to the callback for recursive lookups
[deb_libnfs.git] / win32 / win32_compat.h
index 2ddb0ff281a7abf8065a6f87a7019cf667753769..67e44e48fccad69b511167edf6496c13787c2a00 100644 (file)
@@ -22,22 +22,22 @@ THE SOFTWARE.
 */
 /*Adaptions by memphiz@xbmc.org*/
 
-#ifdef WIN32
 #ifndef win32_COMPAT_H_
 #define win32_COMPAT_H_
 #define NO_IPv6 1
 
 #include <winsock2.h>
 #include <ws2tcpip.h>
+#include <Ws2ipdef.h>
 #include <basetsd.h>
 #include <io.h>
 #include <sys/stat.h>
+#include <time.h>
 
 typedef int uid_t;
 typedef int gid_t;
 typedef int socklen_t;
 
-
 #define S_IRUSR 0000400
 #define S_IWUSR 0000200
 #define S_IXUSR 0000100
@@ -53,12 +53,34 @@ typedef int socklen_t;
 #define F_GETFL  3
 #define F_SETFL  4
 
+#ifndef S_IFIFO
+#define S_IFIFO        0x1000  /* FIFO */
+#endif
+
+#ifndef S_IFBLK
+#define S_IFBLK        0x3000  /* Block: Is this ever set under w32? */
+#endif
+
+#ifndef S_IFSOCK
+#define S_IFSOCK 0x0           /* not defined in mingw either */
+#endif
+
+#ifndef major
+#define major(a) 0
+#endif
+
+#ifndef minor
+#define minor(a) 0
+#endif
+
 #define O_NONBLOCK 0x40000000
 #define O_SYNC 0
 
 #define MSG_DONTWAIT 0
 #define ssize_t SSIZE_T
 
+#if(_WIN32_WINNT < 0x0600)
+
 #define POLLIN      0x0001    /* There is data to read */
 #define POLLPRI     0x0002    /* There is urgent data to read */
 #define POLLOUT     0x0004    /* Writing now will not block */
@@ -71,14 +93,18 @@ struct pollfd {
     short events;     /* requested events */
     short revents;    /* returned events */
 };
+#endif
+
+#define close closesocket
+#define ioctl ioctlsocket
 
 /* Wrapper macros to call misc. functions win32 is missing */
 #define poll(x, y, z)        win32_poll(x, y, z)
-#define inet_aton(x, y)      win32_inet_aton(x, y)
 #define inet_pton(x,y,z)     win32_inet_pton(x,y,z)
-int     win32_inet_aton(const char *, struct in_addr *);
 int     win32_inet_pton(int af, const char * src, void * dst);
-int     win32_poll(struct pollfd *fds, int nfsd, int timeout);
+int     win32_poll(struct pollfd *fds, unsigned int nfsd, int timeout);
+int     win32_gettimeofday(struct timeval *tv, struct timezone *tz);
+
+#define DllExport
 
 #endif//win32_COMPAT_H_
-#endif//WIN32