diff options
author | Martin Ebourne <martin@ebourne.me.uk> | 2005-12-12 20:50:00 +0000 |
---|---|---|
committer | Martin Ebourne <martin@ebourne.me.uk> | 2005-12-12 20:50:00 +0000 |
commit | 3bedf8846f4d7a5cb38276b274662d62a36dcd52 (patch) | |
tree | 9d51de8b0f3d06ba6549a5a1958e52f592343140 /lib/common/BoxPlatform.h | |
parent | 81d8eda2419e7a23088a98cdfc52a305c9ceac0d (diff) |
Marged chris/win32/merge/07-win32-fixes at r210 to trunk
Diffstat (limited to 'lib/common/BoxPlatform.h')
-rwxr-xr-x | lib/common/BoxPlatform.h | 45 |
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 |