forked from Mirrorlandia_minetest/irrlicht
irrTypes.h: use standard header for number types
This commit is contained in:
parent
c4503eaf17
commit
32a45f8239
@ -6,29 +6,16 @@
|
|||||||
#define __IRR_TYPES_H_INCLUDED__
|
#define __IRR_TYPES_H_INCLUDED__
|
||||||
|
|
||||||
#include "IrrCompileConfig.h"
|
#include "IrrCompileConfig.h"
|
||||||
|
#include <stdint.h>
|
||||||
#if defined(__GNUC__)
|
|
||||||
#include <limits.h> // for __WORDSIZE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
|
|
||||||
//! 8 bit unsigned variable.
|
//! 8 bit unsigned variable.
|
||||||
/** This is a typedef for unsigned char, it ensures portability of the engine. */
|
typedef uint8_t u8;
|
||||||
#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
|
|
||||||
typedef unsigned __int8 u8;
|
|
||||||
#else
|
|
||||||
typedef unsigned char u8;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! 8 bit signed variable.
|
//! 8 bit signed variable.
|
||||||
/** This is a typedef for signed char, it ensures portability of the engine. */
|
typedef int8_t s8;
|
||||||
#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
|
|
||||||
typedef __int8 s8;
|
|
||||||
#else
|
|
||||||
typedef signed char s8;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! 8 bit character variable.
|
//! 8 bit character variable.
|
||||||
/** This is a typedef for char, it ensures portability of the engine. */
|
/** This is a typedef for char, it ensures portability of the engine. */
|
||||||
@ -37,68 +24,26 @@ typedef char c8;
|
|||||||
|
|
||||||
|
|
||||||
//! 16 bit unsigned variable.
|
//! 16 bit unsigned variable.
|
||||||
/** This is a typedef for unsigned short, it ensures portability of the engine. */
|
typedef uint16_t u16;
|
||||||
#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
|
|
||||||
typedef unsigned __int16 u16;
|
|
||||||
#else
|
|
||||||
typedef unsigned short u16;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! 16 bit signed variable.
|
//! 16 bit signed variable.
|
||||||
/** This is a typedef for signed short, it ensures portability of the engine. */
|
typedef int16_t s16;
|
||||||
#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
|
|
||||||
typedef __int16 s16;
|
|
||||||
#else
|
|
||||||
typedef signed short s16;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//! 32 bit unsigned variable.
|
//! 32 bit unsigned variable.
|
||||||
/** This is a typedef for unsigned int, it ensures portability of the engine. */
|
typedef uint32_t u32;
|
||||||
#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
|
|
||||||
typedef unsigned __int32 u32;
|
|
||||||
#else
|
|
||||||
typedef unsigned int u32;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! 32 bit signed variable.
|
//! 32 bit signed variable.
|
||||||
/** This is a typedef for signed int, it ensures portability of the engine. */
|
typedef int32_t s32;
|
||||||
#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
|
|
||||||
typedef __int32 s32;
|
|
||||||
#else
|
|
||||||
typedef signed int s32;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __IRR_HAS_S64
|
#ifdef __IRR_HAS_S64
|
||||||
//! 64 bit unsigned variable.
|
//! 64 bit unsigned variable.
|
||||||
/** This is a typedef for 64bit uint, it ensures portability of the engine. */
|
typedef uint64_t u64;
|
||||||
#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
|
|
||||||
typedef unsigned __int64 u64;
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
#if defined(__WORDSIZE) && __WORDSIZE == 64
|
|
||||||
typedef unsigned long int u64;
|
|
||||||
#else
|
|
||||||
__extension__ typedef unsigned long long u64;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
typedef unsigned long long u64;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! 64 bit signed variable.
|
//! 64 bit signed variable.
|
||||||
/** This is a typedef for 64bit int, it ensures portability of the engine. */
|
typedef int64_t s64;
|
||||||
#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
|
|
||||||
typedef __int64 s64;
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
#if defined(__WORDSIZE) && __WORDSIZE == 64
|
|
||||||
typedef long int s64;
|
|
||||||
#else
|
|
||||||
__extension__ typedef long long s64;
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
typedef long long s64;
|
|
||||||
#endif
|
|
||||||
#endif // __IRR_HAS_S64
|
#endif // __IRR_HAS_S64
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user