2010-08-09 13:28:56 +00:00
|
|
|
#ifndef NALL_STDINT_HPP
|
|
|
|
#define NALL_STDINT_HPP
|
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
using uint = unsigned int;
|
|
|
|
|
2010-08-09 13:28:56 +00:00
|
|
|
#if defined(_MSC_VER)
|
|
|
|
typedef signed char int8_t;
|
|
|
|
typedef signed short int16_t;
|
|
|
|
typedef signed int int32_t;
|
|
|
|
typedef signed long long int64_t;
|
|
|
|
typedef int64_t intmax_t;
|
|
|
|
#if defined(_WIN64)
|
|
|
|
typedef int64_t intptr_t;
|
|
|
|
#else
|
|
|
|
typedef int32_t intptr_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef unsigned char uint8_t;
|
|
|
|
typedef unsigned short uint16_t;
|
|
|
|
typedef unsigned int uint32_t;
|
|
|
|
typedef unsigned long long uint64_t;
|
|
|
|
typedef uint64_t uintmax_t;
|
|
|
|
#if defined(_WIN64)
|
|
|
|
typedef uint64_t uintptr_t;
|
|
|
|
#else
|
|
|
|
typedef uint32_t uintptr_t;
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#include <stdint.h>
|
|
|
|
#endif
|
|
|
|
|
2015-05-16 07:37:13 +00:00
|
|
|
#if defined(__SIZEOF_INT128__)
|
|
|
|
using int128_t = signed __int128;
|
|
|
|
using uint128_t = unsigned __int128;
|
|
|
|
#endif
|
|
|
|
|
2010-08-09 13:28:56 +00:00
|
|
|
namespace nall {
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" );
|
|
|
|
static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size");
|
|
|
|
static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size");
|
|
|
|
static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size");
|
|
|
|
|
|
|
|
static_assert(sizeof(uint8_t) == 1, "int8_t is not of the correct size" );
|
|
|
|
static_assert(sizeof(uint16_t) == 2, "int16_t is not of the correct size");
|
|
|
|
static_assert(sizeof(uint32_t) == 4, "int32_t is not of the correct size");
|
|
|
|
static_assert(sizeof(uint64_t) == 8, "int64_t is not of the correct size");
|
|
|
|
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|