Back to Mame

0.9.8: type_int.hpp Source File

3rdparty/glm/doc/api/a00113_source.html

latest15.7 KB
Original Source

| | 0.9.8 |

type_int.hpp

Go to the documentation of this file.

1

4 #pragma once

5

6 #include "setup.hpp"

7 #if GLM_HAS_MAKE_SIGNED

8 # include <type_traits>

9 #endif

10

11 #if GLM_HAS_EXTENDED_INTEGER_TYPE

12 # include <cstdint>

13 #endif

14

15 namespace glm{

16 namespace detail

17 {

18 # if GLM_HAS_EXTENDED_INTEGER_TYPE

19typedef std::int8_tint8;

20typedef std::int16_tint16;

21typedef std::int32_tint32;

22typedef std::int64_tint64;

23

24typedef std::uint8_tuint8;

25typedef std::uint16_tuint16;

26typedef std::uint32_tuint32;

27typedef std::uint64_tuint64;

28 # else

29 # if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available

30typedef int64_t sint64;

31typedef uint64_tuint64;

32

33 # elif GLM_COMPILER & GLM_COMPILER_VC

34typedef signed __int64 sint64;

35typedef unsigned __int64 uint64;

36

37 # elif GLM_COMPILER & GLM_COMPILER_GCC

38 # pragma GCC diagnostic ignored "-Wlong-long"

39 __extension__ typedef signed long long sint64;

40 __extension__ typedef unsigned long longuint64;

41

42 # elif (GLM_COMPILER & GLM_COMPILER_CLANG)

43 # pragma clang diagnostic ignored "-Wc++11-long-long"

44typedef signed longlong sint64;

45typedef unsigned long longuint64;

46

47 # else//unknown compiler

48typedef signed longlong sint64;

49typedef unsigned long longuint64;

50 # endif//GLM_COMPILER

51

52typedef signed charint8;

53typedef signed shortint16;

54typedef signed intint32;

55typedef sint64 int64;

56

57typedef unsigned charuint8;

58typedef unsigned shortuint16;

59typedef unsigned intuint32;

60typedef uint64 uint64;

61 #endif//

62

63typedef signed int lowp_int_t;

64typedef signed int mediump_int_t;

65typedef signed int highp_int_t;

66

67typedef unsigned int lowp_uint_t;

68typedef unsigned int mediump_uint_t;

69typedef unsigned int highp_uint_t;

70

71 # if GLM_HAS_MAKE_SIGNED

72using std::make_signed;

73using std::make_unsigned;

74

75 # else//GLM_HAS_MAKE_SIGNED

76template <typename genType>

77struct make_signed

78 {};

79

80template <>

81struct make_signed<char>

82 {

83typedef char type;

84 };

85

86template <>

87struct make_signed<short>

88 {

89typedef short type;

90 };

91

92template <>

93struct make_signed<int>

94 {

95typedef int type;

96 };

97

98template <>

99struct make_signed<long>

100 {

101typedef long type;

102 };

103

104template <>

105struct make_signed<unsigned char>

106 {

107typedef char type;

108 };

109

110template <>

111struct make_signed<unsigned short>

112 {

113typedef short type;

114 };

115

116template <>

117struct make_signed<unsigned int>

118 {

119typedef int type;

120 };

121

122template <>

123struct make_signed<unsigned long>

124 {

125typedef long type;

126 };

127

128template <typename genType>

129struct make_unsigned

130 {};

131

132template <>

133struct make_unsigned<char>

134 {

135typedef unsigned char type;

136 };

137

138template <>

139struct make_unsigned<short>

140 {

141typedef unsigned short type;

142 };

143

144template <>

145struct make_unsigned<int>

146 {

147typedef unsigned int type;

148 };

149

150template <>

151struct make_unsigned<long>

152 {

153typedef unsigned long type;

154 };

155

156template <>

157struct make_unsigned<unsigned char>

158 {

159typedef unsigned char type;

160 };

161

162template <>

163struct make_unsigned<unsigned short>

164 {

165typedef unsigned short type;

166 };

167

168template <>

169struct make_unsigned<unsigned int>

170 {

171typedef unsigned int type;

172 };

173

174template <>

175struct make_unsigned<unsigned long>

176 {

177typedef unsigned long type;

178 };

179

180template <>

181struct make_signed<long long>

182 {

183typedef long long type;

184 };

185

186template <>

187struct make_signed<unsigned long long>

188 {

189typedef long long type;

190 };

191

192template <>

193struct make_unsigned<long long>

194 {

195typedef unsigned long long type;

196 };

197

198template <>

199struct make_unsigned<unsigned long long>

200 {

201typedef unsigned long long type;

202 };

203 # endif//GLM_HAS_MAKE_SIGNED

204 }//namespace detail

205

206typedef detail::int8 int8;

207typedef detail::int16 int16;

208typedef detail::int32 int32;

209typedef detail::int64 int64;

210

211typedef detail::uint8 uint8;

212typedef detail::uint16 uint16;

213typedef detail::uint32 uint32;

214typedef detail::uint64 uint64;

215

218

224typedef detail::lowp_int_t lowp_int;

225

231typedef detail::mediump_int_t mediump_int;

232

238typedef detail::highp_int_t highp_int;

239

245typedef detail::lowp_uint_t lowp_uint;

246

252typedef detail::mediump_uint_t mediump_uint;

253

259typedef detail::highp_uint_t highp_uint;

260

261 #if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))

262typedef mediump_int int_t;

263 #elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))

264typedef highp_int int_t;

265 #elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))

266typedef mediump_int int_t;

267 #elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))

268typedef lowp_int int_t;

269 #else

270 # error "GLM error: multiple default precision requested for signed integer types"

271 #endif

272

273 #if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))

274typedef mediump_uint uint_t;

275 #elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))

276typedef highp_uint uint_t;

277 #elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))

278typedef mediump_uint uint_t;

279 #elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))

280typedef lowp_uint uint_t;

281 #else

282 # error "GLM error: multiple default precision requested for unsigned integer types"

283 #endif

284

288typedef unsigned intuint;

289

291

293 // check type sizes

294 #ifndef GLM_STATIC_ASSERT_NULL

295 GLM_STATIC_ASSERT(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform");

296 GLM_STATIC_ASSERT(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform");

297 GLM_STATIC_ASSERT(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform");

298 GLM_STATIC_ASSERT(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform");

299

300 GLM_STATIC_ASSERT(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform");

301 GLM_STATIC_ASSERT(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform");

302 GLM_STATIC_ASSERT(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform");

303 GLM_STATIC_ASSERT(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform");

304 #endif//GLM_STATIC_ASSERT_NULL

305

306 }//namespace glm

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::uint

unsigned int uint

Unsigned integer type.

Definition: type_int.hpp:288

glm::uint16

detail::uint16 uint16

16 bit unsigned integer type.

Definition: type_int.hpp:212

glm::lowp_int

detail::lowp_int_t lowp_int

Low precision signed integer.

Definition: type_int.hpp:224

glm

Definition: _noise.hpp:11

glm::int16

detail::int16 int16

16 bit signed integer type.

Definition: type_int.hpp:207

glm::lowp_uint

detail::lowp_uint_t lowp_uint

Low precision unsigned integer.

Definition: type_int.hpp:245

glm::highp_int

detail::highp_int_t highp_int

High precision signed integer.

Definition: type_int.hpp:238

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::uint64_t

detail::uint64 uint64_t

64 bit unsigned integer type.

Definition: fwd.hpp:889

setup.hpp

GLM Core

glm::uint64

detail::uint64 uint64

64 bit unsigned integer type.

Definition: type_int.hpp:214

glm::mediump_int

detail::mediump_int_t mediump_int

Medium precision signed integer.

Definition: type_int.hpp:231

glm::highp_uint

detail::highp_uint_t highp_uint

High precision unsigned integer.

Definition: type_int.hpp:259

glm::mediump_uint

detail::mediump_uint_t mediump_uint

Medium precision unsigned integer.

Definition: type_int.hpp:252

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


Generated by 1.8.10