summaryrefslogtreecommitdiff
path: root/os/windows
diff options
context:
space:
mode:
authorBruce Cran <bcran@fusionio.com>2013-10-08 15:05:27 +0100
committerJens Axboe <axboe@kernel.dk>2013-11-01 12:26:45 -0600
commitf16b7405fff7c3fc1da421b6bdf8552cc99c3156 (patch)
tree9d054bbd6c78772d3f99a9123e60a620b7223f66 /os/windows
parent44462517234f07e03c4dc71e5b5460cd70feeb07 (diff)
downloadfio-f16b7405fff7c3fc1da421b6bdf8552cc99c3156.tar.gz
fio-f16b7405fff7c3fc1da421b6bdf8552cc99c3156.tar.bz2
Update Windows code to fix build breakage
MinGW has been updated: this causes problems due to changes in header files, including COM stuff being pulled in resulting in 'interface' being a reserved keyword, and changes to a few POSIX definitions. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'os/windows')
-rwxr-xr-xos/windows/posix.c9
-rw-r--r--os/windows/posix/include/arpa/inet.h13
2 files changed, 22 insertions, 0 deletions
diff --git a/os/windows/posix.c b/os/windows/posix.c
index 49bce439..8153b455 100755
--- a/os/windows/posix.c
+++ b/os/windows/posix.c
@@ -12,6 +12,7 @@
#include <unistd.h>
#include <dirent.h>
#include <pthread.h>
+#include <time.h>
#include <semaphore.h>
#include <sys/shm.h>
#include <sys/mman.h>
@@ -872,6 +873,14 @@ uid_t geteuid(void)
return -1;
}
+in_addr_t inet_network(const char *cp)
+{
+ in_addr_t hbo;
+ in_addr_t nbo = inet_addr(cp);
+ hbo = ((nbo & 0xFF) << 24) + ((nbo & 0xFF00) << 8) + ((nbo & 0xFF0000) >> 8) + ((nbo & 0xFF000000) >> 24);
+ return hbo;
+}
+
const char* inet_ntop(int af, const void *restrict src,
char *restrict dst, socklen_t size)
{
diff --git a/os/windows/posix/include/arpa/inet.h b/os/windows/posix/include/arpa/inet.h
index 7e3bfb7e..59c50ad1 100644
--- a/os/windows/posix/include/arpa/inet.h
+++ b/os/windows/posix/include/arpa/inet.h
@@ -5,6 +5,19 @@
#include <inttypes.h>
typedef int socklen_t;
+typedef int in_addr_t;
+
+#define IP_MULTICAST_IF 2
+#define IP_MULTICAST_TTL 3
+#define IP_ADD_MEMBERSHIP 5
+
+struct ip_mreq
+{
+ struct in_addr imr_multiaddr;
+ struct in_addr imr_interface;
+};
+
+in_addr_t inet_network(const char *cp);
const char *inet_ntop(int af, const void *restrict src,
char *restrict dst, socklen_t size);