summaryrefslogtreecommitdiff
path: root/lib/common/BoxPlatform.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/BoxPlatform.h')
-rwxr-xr-xlib/common/BoxPlatform.h45
1 files changed, 44 insertions, 1 deletions
diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h
index 6ddd1643..55065796 100755
--- a/lib/common/BoxPlatform.h
+++ b/lib/common/BoxPlatform.h
@@ -11,13 +11,24 @@
#ifndef BOXPLATFORM__H
#define BOXPLATFORM__H
+#ifdef WIN32
+#define DIRECTORY_SEPARATOR "\\"
+#define DIRECTORY_SEPARATOR_ASCHAR '\\'
+#else
#define DIRECTORY_SEPARATOR "/"
-#define DIRECTORY_SEPARATOR_ASCHAR '/'
+#define DIRECTORY_SEPARATOR_ASCHAR '/'
+#endif
#define PLATFORM_DEV_NULL "/dev/null"
#include "config.h"
+#ifdef WIN32
+ // need msvcrt version 6.1 or higher for _gmtime64()
+ // must define this before importing <sys/types.h>
+ #define __MSVCRT_VERSION__ 0x0601
+#endif
+
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -51,6 +62,27 @@
#define STRUCTURE_PACKING_FOR_WIRE_USE_HEADERS
#endif
+#if defined WIN32 && !defined __MINGW32__
+ typedef __int8 int8_t;
+ typedef __int16 int16_t;
+ typedef __int32 int32_t;
+ typedef __int64 int64_t;
+
+ typedef unsigned __int8 u_int8_t;
+ typedef unsigned __int16 u_int16_t;
+ typedef unsigned __int32 u_int32_t;
+ typedef unsigned __int64 u_int64_t;
+
+ #define HAVE_UINT8_T
+ #define HAVE_UINT16_T
+ #define HAVE_UINT32_T
+ #define HAVE_UINT64_T
+
+ typedef unsigned int uid_t;
+ typedef unsigned int gid_t;
+ typedef int pid_t;
+#endif // WIN32 && !__MINGW32__
+
// Define missing types
#ifndef HAVE_UINT8_T
typedef u_int8_t uint8_t;
@@ -88,4 +120,15 @@
#define INFTIM -1
#endif
+#ifdef WIN32
+ typedef u_int64_t InodeRefType;
+#else
+ typedef ino_t InodeRefType;
+#endif
+
+#ifdef WIN32
+ #define WIN32_LEAN_AND_MEAN
+ #include "emu.h"
+#endif
+
#endif // BOXPLATFORM__H