type_int.hpp
Go to the documentation of this file.
#pragma once
#include "setup.hpp"
#if GLM_HAS_MAKE_SIGNED
# include <type_traits>
#endif
#if GLM_HAS_EXTENDED_INTEGER_TYPE
# include <cstdint>
#endif
namespace glm{
namespace detail
{
# if GLM_HAS_EXTENDED_INTEGER_TYPE
typedef std::int8_t int8;
typedef std::int16_t int16;
typedef std::int32_t int32;
typedef std::int64_t int64;
typedef std::uint8_t uint8;
typedef std::uint16_t uint16;
typedef std::uint32_t uint32;
typedef std::uint64_t uint64;
# else
# if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
typedef int64_t sint64;
typedef uint64_t uint64;
# elif GLM_COMPILER & GLM_COMPILER_VC
typedef signed __int64 sint64;
typedef unsigned __int64 uint64;
# elif GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic ignored "-Wlong-long"
__extension__ typedef signed long long sint64;
__extension__ typedef unsigned long long uint64;
# elif (GLM_COMPILER & GLM_COMPILER_CLANG)
# pragma clang diagnostic ignored "-Wc++11-long-long"
typedef signed long long sint64;
typedef unsigned long long uint64;
# else//unknown compiler
typedef signed long long sint64;
typedef unsigned long long uint64;
# endif//GLM_COMPILER
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef sint64 int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef uint64 uint64;
#endif//
typedef signed int lowp_int_t;
typedef signed int mediump_int_t;
typedef signed int highp_int_t;
typedef unsigned int lowp_uint_t;
typedef unsigned int mediump_uint_t;
typedef unsigned int highp_uint_t;
# if GLM_HAS_MAKE_SIGNED
using std::make_signed;
using std::make_unsigned;
# else//GLM_HAS_MAKE_SIGNED
template <typename genType>
struct make_signed
{};
template <>
struct make_signed<char>
{
typedef char type;
};
template <>
struct make_signed<short>
{
typedef short type;
};
template <>
struct make_signed<int>
{
typedef int type;
};
template <>
struct make_signed<long>
{
typedef long type;
};
template <>
struct make_signed<unsigned char>
{
typedef char type;
};
template <>
struct make_signed<unsigned short>
{
typedef short type;
};
template <>
struct make_signed<unsigned int>
{
typedef int type;
};
template <>
struct make_signed<unsigned long>
{
typedef long type;
};
template <typename genType>
struct make_unsigned
{};
template <>
struct make_unsigned<char>
{
typedef unsigned char type;
};
template <>
struct make_unsigned<short>
{
typedef unsigned short type;
};
template <>
struct make_unsigned<int>
{
typedef unsigned int type;
};
template <>
struct make_unsigned<long>
{
typedef unsigned long type;
};
template <>
struct make_unsigned<unsigned char>
{
typedef unsigned char type;
};
template <>
struct make_unsigned<unsigned short>
{
typedef unsigned short type;
};
template <>
struct make_unsigned<unsigned int>
{
typedef unsigned int type;
};
template <>
struct make_unsigned<unsigned long>
{
typedef unsigned long type;
};
template <>
struct make_signed<long long>
{
typedef long long type;
};
template <>
struct make_signed<unsigned long long>
{
typedef long long type;
};
template <>
struct make_unsigned<long long>
{
typedef unsigned long long type;
};
template <>
struct make_unsigned<unsigned long long>
{
typedef unsigned long long type;
};
# endif//GLM_HAS_MAKE_SIGNED
}//namespace detail
typedef detail::int8 int8;
typedef detail::int16 int16;
typedef detail::int32 int32;
typedef detail::int64 int64;
typedef detail::uint8 uint8;
typedef detail::uint16 uint16;
typedef detail::uint32 uint32;
typedef detail::uint64 uint64;
typedef detail::lowp_int_t lowp_int;
typedef detail::mediump_int_t mediump_int;
typedef detail::highp_int_t highp_int;
typedef detail::lowp_uint_t lowp_uint;
typedef detail::mediump_uint_t mediump_uint;
typedef detail::highp_uint_t highp_uint;
#if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef mediump_int int_t;
#elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef highp_int int_t;
#elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef mediump_int int_t;
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
typedef lowp_int int_t;
#else
# error "GLM error: multiple default precision requested for signed integer types"
#endif
#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef mediump_uint uint_t;
#elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef highp_uint uint_t;
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef mediump_uint uint_t;
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
typedef lowp_uint uint_t;
#else
# error "GLM error: multiple default precision requested for unsigned integer types"
#endif
typedef unsigned int uint;
// check type sizes
#ifndef GLM_STATIC_ASSERT_NULL
GLM_STATIC_ASSERT(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform");
GLM_STATIC_ASSERT(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform");
GLM_STATIC_ASSERT(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform");
GLM_STATIC_ASSERT(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform");
GLM_STATIC_ASSERT(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform");
GLM_STATIC_ASSERT(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
GLM_STATIC_ASSERT(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
GLM_STATIC_ASSERT(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
#endif//GLM_STATIC_ASSERT_NULL
}//namespace glm
glm::highp_uint
detail::highp_uint_t highp_uint
High precision unsigned integer.
Definition: type_int.hpp:259
glm::uint
unsigned int uint
Unsigned integer type.
Definition: type_int.hpp:288
glm::lowp_uint
detail::lowp_uint_t lowp_uint
Low precision unsigned integer.
Definition: type_int.hpp:245
glm::mediump_int
detail::mediump_int_t mediump_int
Medium precision signed integer.
Definition: type_int.hpp:231
glm::int8
detail::int8 int8
8 bit signed integer type.
Definition: type_int.hpp:206
glm::uint8_t
detail::uint8 uint8_t
8 bit unsigned integer type.
Definition: fwd.hpp:877
glm::int64
detail::int64 int64
64 bit signed integer type.
Definition: type_int.hpp:209
glm::int8_t
detail::int8 int8_t
8 bit signed integer type.
Definition: fwd.hpp:268
glm::mediump_uint
detail::mediump_uint_t mediump_uint
Medium precision unsigned integer.
Definition: type_int.hpp:252
glm::uint16
detail::uint16 uint16
16 bit unsigned integer type.
Definition: type_int.hpp:212
setup.hpp
GLM Core
glm::int16
detail::int16 int16
16 bit signed integer type.
Definition: type_int.hpp:207
glm::uint8
detail::uint8 uint8
8 bit unsigned integer type.
Definition: type_int.hpp:211
glm::uint32
detail::uint32 uint32
32 bit unsigned integer type.
Definition: type_int.hpp:213
glm::int32_t
detail::int32 int32_t
32 bit signed integer type.
Definition: fwd.hpp:276
glm
Definition: _noise.hpp:11
glm::uint64_t
detail::uint64 uint64_t
64 bit unsigned integer type.
Definition: fwd.hpp:889
glm::highp_int
detail::highp_int_t highp_int
High precision signed integer.
Definition: type_int.hpp:238
glm::uint64
detail::uint64 uint64
64 bit unsigned integer type.
Definition: type_int.hpp:214
glm::uint32_t
detail::uint32 uint32_t
32 bit unsigned integer type.
Definition: fwd.hpp:885
glm::int32
detail::int32 int32
32 bit signed integer type.
Definition: type_int.hpp:208
glm::int16_t
detail::int16 int16_t
16 bit signed integer type.
Definition: fwd.hpp:272
glm::int64_t
detail::int64 int64_t
64 bit signed integer type.
Definition: fwd.hpp:280
glm::uint16_t
detail::uint16 uint16_t
16 bit unsigned integer type.
Definition: fwd.hpp:881
glm::lowp_int
detail::lowp_int_t lowp_int
Low precision signed integer.
Definition: type_int.hpp:224