summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/generic.h4
-rw-r--r--lib/Handle.cc7
-rw-r--r--lib/Input.cc1
-rw-r--r--lib/Output.cc7
-rw-r--r--lib/fileutils.cc2
5 files changed, 14 insertions, 7 deletions
diff --git a/include/generic.h b/include/generic.h
index 28a3baf..4920beb 100644
--- a/include/generic.h
+++ b/include/generic.h
@@ -66,7 +66,7 @@ typedef long long int64;
typedef unsigned long long uint64;
#elif defined _WIN32
typedef _int64 int64;
-typedef unsigned _int64 int64;
+typedef unsigned _int64 uint64;
#else
#error Unsupported platform (need 64 bits ints definition)
#endif
@@ -119,7 +119,7 @@ inline T MIN(T a, T b) {
#if defined __linux__ || defined __CYGWIN32__
#define MKDIR(name) mkdir(name, 0777)
-#elif defined __WIN32__
+#elif defined __WIN32__ || defined _WIN32
#define MKDIR mkdir
#else
#error Unknow compiler/platform
diff --git a/lib/Handle.cc b/lib/Handle.cc
index 07a2752..1941254 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -4,9 +4,12 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#else
+#include <io.h>
#endif
+#include <fcntl.h>
#include "Handle.h"
#include "gettext.h"
diff --git a/lib/Input.cc b/lib/Input.cc
index 5109d2a..719c560 100644
--- a/lib/Input.cc
+++ b/lib/Input.cc
@@ -1,5 +1,4 @@
#include <stdio.h>
-#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
diff --git a/lib/Output.cc b/lib/Output.cc
index 99fff7a..2007757 100644
--- a/lib/Output.cc
+++ b/lib/Output.cc
@@ -6,9 +6,12 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#else
+#include <io.h>
#endif
+#include <fcntl.h>
#include "Output.h"
#include "Exceptions.h"
#include "gettext.h"
diff --git a/lib/fileutils.cc b/lib/fileutils.cc
index 6e3ef17..b637546 100644
--- a/lib/fileutils.cc
+++ b/lib/fileutils.cc
@@ -26,6 +26,8 @@
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#else
+#include <io.h>
#endif
#include "generic.h"