diff options
Diffstat (limited to 'lib/common/BoxPlatform.h')
-rw-r--r-- | lib/common/BoxPlatform.h | 67 |
1 files changed, 13 insertions, 54 deletions
diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h index 617aa031..35ad7a2c 100644 --- a/lib/common/BoxPlatform.h +++ b/lib/common/BoxPlatform.h @@ -23,7 +23,7 @@ #ifdef _MSC_VER #include "BoxConfig-MSVC.h" -#include "BoxVersion.h" +#define NEED_BOX_VERSION_H #else #include "BoxConfig.h" #endif @@ -40,9 +40,12 @@ #endif #endif +#include "emu.h" + #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif + #ifdef HAVE_INTTYPES_H #include <inttypes.h> #else @@ -105,67 +108,25 @@ #endif #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_U_INT8_T - #define HAVE_U_INT16_T - #define HAVE_U_INT32_T - #define HAVE_U_INT64_T -#endif // WIN32 && !__MINGW32__ - -// Define missing types -#ifndef HAVE_UINT8_T - typedef u_int8_t uint8_t; -#endif - -#ifndef HAVE_UINT16_T - typedef u_int16_t uint16_t; -#endif - -#ifndef HAVE_UINT32_T - typedef u_int32_t uint32_t; -#endif - -#ifndef HAVE_UINT64_T - typedef u_int64_t uint64_t; -#endif - -#ifndef HAVE_U_INT8_T - typedef uint8_t u_int8_t; -#endif - -#ifndef HAVE_U_INT16_T - typedef uint16_t u_int16_t; -#endif - -#ifndef HAVE_U_INT32_T - typedef uint32_t u_int32_t; +#if !HAVE_DECL_INFTIM + #define INFTIM -1 #endif -#ifndef HAVE_U_INT64_T - typedef uint64_t u_int64_t; -#endif +// Define O_BINARY for Unix compatibility with Windows :-) +// MSVC 2010 and newer MinGW define this in fcntl.h, which is probably +// not included by this point, so include it now so that we can detect +// if we need O_BINARY -#if !HAVE_DECL_INFTIM - #define INFTIM -1 +#ifdef HAVE_FCNTL_H +# include <fcntl.h> #endif -// for Unix compatibility with Windows :-) #ifndef O_BINARY #define O_BINARY 0 #endif #ifdef WIN32 - typedef u_int64_t InodeRefType; + typedef uint64_t InodeRefType; #else typedef ino_t InodeRefType; #endif @@ -174,8 +135,6 @@ #define WIN32_LEAN_AND_MEAN #endif -#include "emu.h" - #ifdef WIN32 #define INVALID_FILE INVALID_HANDLE_VALUE typedef HANDLE tOSFileHandle; |