diff options
Diffstat (limited to 'src/mesa/main/glheader.h')
-rw-r--r-- | src/mesa/main/glheader.h | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index 1d0f178dc4a..5657976711e 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -64,22 +64,33 @@ #include <stdarg.h> -/* Get typedefs for uintptr_t and friends */ -#if defined(__MINGW32__) || defined(__NetBSD__) -# include <stdint.h> -#elif defined(_WIN32) -# include <BaseTsd.h> -# if _MSC_VER == 1200 - typedef UINT_PTR uintptr_t; -# endif -#elif defined(__INTERIX) -/* Interix 3.x has a gcc that shadows this. */ -# ifndef _UINTPTR_T_DEFINED - typedef unsigned long uintptr_t; -# define _UINTPTR_T_DEFINED +/* Get standard integer types */ +#if defined(_MSC_VER) + + typedef __int8 int8_t; + typedef unsigned __int8 uint8_t; + typedef __int16 int16_t; + typedef unsigned __int16 uint16_t; +# ifndef __eglplatform_h_ + typedef __int32 int32_t; +# endif + typedef unsigned __int32 uint32_t; + typedef __int64 int64_t; + typedef unsigned __int64 uint64_t; + +# if defined(_WIN64) + typedef __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +# else + typedef __int32 intptr_t; + typedef unsigned __int32 uintptr_t; # endif + +# define INT64_C(__val) __val##i64 +# define UINT64_C(__val) __val##ui64 + #else -# include <inttypes.h> +# include <stdint.h> #endif @@ -146,7 +157,8 @@ #include <byteswap.h> #define CPU_TO_LE32( x ) bswap_32( x ) #else /*__linux__*/ -#define CPU_TO_LE32( x ) ( x ) /* fix me for non-Linux big-endian! */ +#include <sys/endian.h> +#define CPU_TO_LE32( x ) bswap32( x ) #endif /*__linux__*/ #define MESA_BIG_ENDIAN 1 #else |