1.0.2 API documentation: setup.hpp Source File

| 1.0.2 API documentation

setup.hpp
1 #ifndef GLM_SETUP_INCLUDED
2
3 #include <cassert>
4 #include <cstddef>
5
6 #define GLM_VERSION_MAJOR 1
7 #define GLM_VERSION_MINOR 0
8 #define GLM_VERSION_PATCH 2
9 #define GLM_VERSION_REVISION 0 // Deprecated
10 #define GLM_VERSION 1000 // Deprecated
11
12 #define GLM_MAKE_API_VERSION(variant, major, minor, patch) \
13 ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch)))
14
15 #define GLM_VERSION_COMPLETE GLM_MAKE_API_VERSION(0, GLM_VERSION_MAJOR, GLM_VERSION_MINOR, GLM_VERSION_PATCH)
16
17 #define GLM_SETUP_INCLUDED GLM_VERSION
18
19 #define GLM_GET_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U)
20 #define GLM_GET_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU)
21 #define GLM_GET_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU)
22 #define GLM_GET_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU)
23
25 // Active states
26
27 #define GLM_DISABLE 0
28 #define GLM_ENABLE 1
29
31 // Messages
32
33 #if defined(GLM_FORCE_MESSAGES)
34 # define GLM_MESSAGES GLM_ENABLE
35 #else
36 # define GLM_MESSAGES GLM_DISABLE
37 #endif
38
40 // Detect the platform
41
42 #include "../simd/platform.h"
43
45 // Build model
46
47 #if defined(_M_ARM64) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__)
48 # define GLM_MODEL GLM_MODEL_64
49 #elif defined(__i386__) || defined(__ppc__) || defined(__ILP32__) || defined(_M_ARM)
50 # define GLM_MODEL GLM_MODEL_32
51 #else
52 # define GLM_MODEL GLM_MODEL_32
53 #endif//
54
55 #if !defined(GLM_MODEL) && GLM_COMPILER != 0
56 # error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
57 #endif//GLM_MODEL
58
60 // C++ Version
61
62 // User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14, GLM_FORCE_CXX17, GLM_FORCE_CXX2A
63
64 #define GLM_LANG_CXX98_FLAG (1 << 1)
65 #define GLM_LANG_CXX03_FLAG (1 << 2)
66 #define GLM_LANG_CXX0X_FLAG (1 << 3)
67 #define GLM_LANG_CXX11_FLAG (1 << 4)
68 #define GLM_LANG_CXX14_FLAG (1 << 5)
69 #define GLM_LANG_CXX17_FLAG (1 << 6)
70 #define GLM_LANG_CXX20_FLAG (1 << 7)
71 #define GLM_LANG_CXXMS_FLAG (1 << 8)
72 #define GLM_LANG_CXXGNU_FLAG (1 << 9)
73
74 #define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG
75 #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG)
76 #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG)
77 #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG)
78 #define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG)
79 #define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG)
80 #define GLM_LANG_CXX20 (GLM_LANG_CXX17 | GLM_LANG_CXX20_FLAG)
81 #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG
82 #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG
83
84 #if (defined(_MSC_EXTENSIONS))
85 # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG
86 #elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT))
87 # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG
88 #else
89 # define GLM_LANG_EXT 0
90 #endif
91
92 #if (defined(GLM_FORCE_CXX_UNKNOWN))
93 # define GLM_LANG 0
94 #elif defined(GLM_FORCE_CXX20)
95 # define GLM_LANG (GLM_LANG_CXX20 | GLM_LANG_EXT)
96 # define GLM_LANG_STL11_FORCED
97 #elif defined(GLM_FORCE_CXX17)
98 # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT)
99 # define GLM_LANG_STL11_FORCED
100 #elif defined(GLM_FORCE_CXX14)
101 # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT)
102 # define GLM_LANG_STL11_FORCED
103 #elif defined(GLM_FORCE_CXX11)
104 # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT)
105 # define GLM_LANG_STL11_FORCED
106 #elif defined(GLM_FORCE_CXX03)
107 # define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT)
108 #elif defined(GLM_FORCE_CXX98)
109 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT)
110 #else
111 # if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG)
112 # if GLM_COMPILER >= GLM_COMPILER_VC15_7
113 # define GLM_LANG_PLATFORM _MSVC_LANG
114 # elif GLM_COMPILER >= GLM_COMPILER_VC15
115 # if _MSVC_LANG > 201402L
116 # define GLM_LANG_PLATFORM 201402L
117 # else
118 # define GLM_LANG_PLATFORM _MSVC_LANG
119 # endif
120 # else
121 # define GLM_LANG_PLATFORM 0
122 # endif
123 # else
124 # define GLM_LANG_PLATFORM 0
125 # endif
126
127 # if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L
128 # define GLM_LANG (GLM_LANG_CXX20 | GLM_LANG_EXT)
129 # elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L
130 # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT)
131 # elif __cplusplus == 201402L || __cplusplus == 201406L || __cplusplus == 201500L || GLM_LANG_PLATFORM == 201402L
132 # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT)
133 # elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L
134 # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT)
135 # elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__)
136 # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT)
137 # elif __cplusplus == 199711L
138 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT)
139 # else
140 # define GLM_LANG (0 | GLM_LANG_EXT)
141 # endif
142 #endif
143
145 // Has of C++ features
146
147 // http://clang.llvm.org/cxx_status.html
148 // http://gcc.gnu.org/projects/cxx0x.html
149 // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
150
151 #if (GLM_COMPILER & GLM_COMPILER_CUDA_RTC) == GLM_COMPILER_CUDA_RTC
152 # define GLM_HAS_CXX11_STL 0
153 #elif (GLM_COMPILER & GLM_COMPILER_HIP)
154 # define GLM_HAS_CXX11_STL 0
155 #elif GLM_COMPILER & GLM_COMPILER_CLANG
156 # if (defined(_LIBCPP_VERSION) || (GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED))
157 # define GLM_HAS_CXX11_STL 1
158 # else
159 # define GLM_HAS_CXX11_STL 0
160 # endif
161 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
162 # define GLM_HAS_CXX11_STL 1
163 #else
164 # define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
165 ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \
166 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
167 ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15))))
168 #endif
169
170 // N1720
171 #if GLM_COMPILER & GLM_COMPILER_CLANG
172 # define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert)
173 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
174 # define GLM_HAS_STATIC_ASSERT 1
175 #else
176 # define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
177 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
178 ((GLM_COMPILER & GLM_COMPILER_VC)) || \
179 ((GLM_COMPILER & GLM_COMPILER_HIP))))
180 #endif
181
182 // N1988
183 #if GLM_LANG & GLM_LANG_CXX11_FLAG
184 # define GLM_HAS_EXTENDED_INTEGER_TYPE 1
185 #else
186 # define GLM_HAS_EXTENDED_INTEGER_TYPE (\
187 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \
188 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
189 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)) || \
190 ((GLM_COMPILER & GLM_COMPILER_HIP)))
191 #endif
192
193 // N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
194 #if GLM_COMPILER & GLM_COMPILER_CLANG
195 # define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers)
196 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
197 # define GLM_HAS_INITIALIZER_LISTS 1
198 #else
199 # define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
200 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \
201 ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
202 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
203 ((GLM_COMPILER & GLM_COMPILER_HIP))))
204 #endif
205
206 // N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
207 #if GLM_COMPILER & GLM_COMPILER_CLANG
208 # define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions)
209 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
210 # define GLM_HAS_UNRESTRICTED_UNIONS 1
211 #else
212 # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
213 (GLM_COMPILER & GLM_COMPILER_VC) || \
214 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
215 ((GLM_COMPILER & GLM_COMPILER_HIP)))
216 #endif
217
218 // N2346
219 #if GLM_COMPILER & GLM_COMPILER_CLANG
220 # define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions)
221 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
222 # define GLM_HAS_DEFAULTED_FUNCTIONS 1
223 #else
224 # define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
225 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
226 ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
227 (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
228 ((GLM_COMPILER & GLM_COMPILER_HIP)))
229 #endif
230
231 // N2118
232 #if GLM_COMPILER & GLM_COMPILER_CLANG
233 # define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references)
234 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
235 # define GLM_HAS_RVALUE_REFERENCES 1
236 #else
237 # define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
238 ((GLM_COMPILER & GLM_COMPILER_VC)) || \
239 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
240 ((GLM_COMPILER & GLM_COMPILER_HIP))))
241 #endif
242
243 // N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
244 #if GLM_COMPILER & GLM_COMPILER_CLANG
245 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions)
246 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
247 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1
248 #else
249 # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
250 ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
251 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
252 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
253 ((GLM_COMPILER & GLM_COMPILER_HIP))))
254 #endif
255
256 // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
257 #if GLM_COMPILER & GLM_COMPILER_CLANG
258 # define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates)
259 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
260 # define GLM_HAS_TEMPLATE_ALIASES 1
261 #else
262 # define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
263 ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
264 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
265 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
266 ((GLM_COMPILER & GLM_COMPILER_HIP))))
267 #endif
268
269 // N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
270 #if GLM_COMPILER & GLM_COMPILER_CLANG
271 # define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for)
272 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
273 # define GLM_HAS_RANGE_FOR 1
274 #else
275 # define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
276 ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
277 ((GLM_COMPILER & GLM_COMPILER_VC)) || \
278 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
279 ((GLM_COMPILER & GLM_COMPILER_HIP))))
280 #endif
281
282 // N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
283 #if GLM_COMPILER & GLM_COMPILER_CLANG
284 # define GLM_HAS_ALIGNOF __has_feature(cxx_alignas)
285 #elif GLM_LANG & GLM_LANG_CXX11_FLAG
286 # define GLM_HAS_ALIGNOF 1
287 #else
288 # define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
289 ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \
290 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \
291 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
292 ((GLM_COMPILER & GLM_COMPILER_HIP))))
293 #endif
294
295 // N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
296 // N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
297 #if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr...
298 # define GLM_HAS_CONSTEXPR 0
299 #elif (GLM_COMPILER & GLM_COMPILER_CLANG)
300 # define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr)
301 #elif (GLM_LANG & GLM_LANG_CXX14_FLAG)
302 # define GLM_HAS_CONSTEXPR 1
303 #else
304 # define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\
305 ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \
306 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15))))
307 #endif
308
309 #if GLM_HAS_CONSTEXPR
310 # define GLM_CONSTEXPR constexpr
311 #else
312 # define GLM_CONSTEXPR
313 #endif
314
315 //
316 #if GLM_HAS_CONSTEXPR
317 # if (GLM_COMPILER & GLM_COMPILER_CLANG)
318 # if __has_feature(cxx_if_constexpr)
319 # define GLM_HAS_IF_CONSTEXPR 1
320 # else
321 # define GLM_HAS_IF_CONSTEXPR 0
322 # endif
323 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG)
324 # define GLM_HAS_IF_CONSTEXPR 1
325 # else
326 # define GLM_HAS_IF_CONSTEXPR 0
327 # endif
328 #else
329 # define GLM_HAS_IF_CONSTEXPR 0
330 #endif
331
332 #if GLM_HAS_IF_CONSTEXPR
333 # define GLM_IF_CONSTEXPR if constexpr
334 #else
335 # define GLM_IF_CONSTEXPR if
336 #endif
337
338 // [nodiscard]
339 #if GLM_LANG & GLM_LANG_CXX17_FLAG
340 # define GLM_NODISCARD [[nodiscard]]
341 #else
342 # define GLM_NODISCARD
343 #endif
344
345 //
346 #if GLM_LANG & GLM_LANG_CXX11_FLAG
347 # define GLM_HAS_ASSIGNABLE 1
348 #else
349 # define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
350 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \
351 ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))))
352 #endif
353
354 //
355 #define GLM_HAS_TRIVIAL_QUERIES 0
356
357 //
358 #if GLM_LANG & GLM_LANG_CXX11_FLAG
359 # define GLM_HAS_MAKE_SIGNED 1
360 #else
361 # define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
362 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
363 ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
364 ((GLM_COMPILER & GLM_COMPILER_HIP))))
365 #endif
366
367 //
368 #if defined(GLM_FORCE_INTRINSICS)
369 # define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\
370 ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
371 ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT))))
372 #else
373 # define GLM_HAS_BITSCAN_WINDOWS 0
374 #endif
375
376 #if GLM_LANG & GLM_LANG_CXX11_FLAG
377 # define GLM_HAS_NOEXCEPT 1
378 #else
379 # define GLM_HAS_NOEXCEPT 0
380 #endif
381
382 #if GLM_HAS_NOEXCEPT
383 # define GLM_NOEXCEPT noexcept
384 #else
385 # define GLM_NOEXCEPT
386 #endif
387
389 // OpenMP
390 #ifdef _OPENMP
391 # if GLM_COMPILER & GLM_COMPILER_GCC
392 # if GLM_COMPILER >= GLM_COMPILER_GCC61
393 # define GLM_HAS_OPENMP 45
394 # elif GLM_COMPILER >= GLM_COMPILER_GCC49
395 # define GLM_HAS_OPENMP 40
396 # elif GLM_COMPILER >= GLM_COMPILER_GCC47
397 # define GLM_HAS_OPENMP 31
398 # else
399 # define GLM_HAS_OPENMP 0
400 # endif
401 # elif GLM_COMPILER & GLM_COMPILER_CLANG
402 # if GLM_COMPILER >= GLM_COMPILER_CLANG38
403 # define GLM_HAS_OPENMP 31
404 # else
405 # define GLM_HAS_OPENMP 0
406 # endif
407 # elif GLM_COMPILER & GLM_COMPILER_VC
408 # define GLM_HAS_OPENMP 20
409 # elif GLM_COMPILER & GLM_COMPILER_INTEL
410 # if GLM_COMPILER >= GLM_COMPILER_INTEL16
411 # define GLM_HAS_OPENMP 40
412 # else
413 # define GLM_HAS_OPENMP 0
414 # endif
415 # else
416 # define GLM_HAS_OPENMP 0
417 # endif
418 #else
419 # define GLM_HAS_OPENMP 0
420 #endif
421
423 // nullptr
424
425 #if GLM_LANG & GLM_LANG_CXX0X_FLAG
426 # define GLM_CONFIG_NULLPTR GLM_ENABLE
427 #else
428 # define GLM_CONFIG_NULLPTR GLM_DISABLE
429 #endif
430
431 #if GLM_CONFIG_NULLPTR == GLM_ENABLE
432 # define GLM_NULLPTR nullptr
433 #else
434 # define GLM_NULLPTR 0
435 #endif
436
438 // Static assert
439
440 #if GLM_HAS_STATIC_ASSERT
441 # define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
442 #elif GLM_COMPILER & GLM_COMPILER_VC
443 # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
444 #else
445 # define GLM_STATIC_ASSERT(x, message) assert(x)
446 #endif//GLM_LANG
447
449 // Qualifiers
450
451 // User defines: GLM_CUDA_FORCE_DEVICE_FUNC, GLM_CUDA_FORCE_HOST_FUNC
452
453 #if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
454 # if defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC)
455 # error "GLM error: GLM_CUDA_FORCE_DEVICE_FUNC and GLM_CUDA_FORCE_HOST_FUNC should not be defined at the same time, GLM by default generates both device and host code for CUDA compiler."
456 # endif//defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC)
457
458 # if defined(GLM_CUDA_FORCE_DEVICE_FUNC)
459 # define GLM_CUDA_FUNC_DEF __device__
460 # define GLM_CUDA_FUNC_DECL __device__
461 # elif defined(GLM_CUDA_FORCE_HOST_FUNC)
462 # define GLM_CUDA_FUNC_DEF __host__
463 # define GLM_CUDA_FUNC_DECL __host__
464 # else
465 # define GLM_CUDA_FUNC_DEF __device__ __host__
466 # define GLM_CUDA_FUNC_DECL __device__ __host__
467 # endif//defined(GLM_CUDA_FORCE_XXXX_FUNC)
468 #else
469 # define GLM_CUDA_FUNC_DEF
470 # define GLM_CUDA_FUNC_DECL
471 #endif
472
473 #if defined(GLM_FORCE_INLINE)
474 # if GLM_COMPILER & GLM_COMPILER_VC
475 # define GLM_INLINE __forceinline
476 # define GLM_NEVER_INLINE __declspec(noinline)
477 # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)
478 # define GLM_INLINE inline __attribute__((__always_inline__))
479 # define GLM_NEVER_INLINE __attribute__((__noinline__))
480 # elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
481 # define GLM_INLINE __forceinline__
482 # define GLM_NEVER_INLINE __noinline__
483 # else
484 # define GLM_INLINE inline
485 # define GLM_NEVER_INLINE
486 # endif//GLM_COMPILER
487 #else
488 # define GLM_INLINE inline
489 # define GLM_NEVER_INLINE
490 #endif//defined(GLM_FORCE_INLINE)
491
492 #define GLM_CTOR_DECL GLM_CUDA_FUNC_DECL GLM_CONSTEXPR
493 #define GLM_FUNC_DISCARD_DECL GLM_CUDA_FUNC_DECL
494 #define GLM_FUNC_DECL GLM_NODISCARD GLM_CUDA_FUNC_DECL
495 #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE
496
497 // Do not use CUDA function qualifiers on CUDA compiler when functions are made default
498 #if GLM_HAS_DEFAULTED_FUNCTIONS
499 # define GLM_DEFAULTED_FUNC_DECL
500 # define GLM_DEFAULTED_FUNC_QUALIFIER GLM_INLINE
501 #else
502 # define GLM_DEFAULTED_FUNC_DECL GLM_FUNC_DISCARD_DECL
503 # define GLM_DEFAULTED_FUNC_QUALIFIER GLM_FUNC_QUALIFIER
504 #endif//GLM_HAS_DEFAULTED_FUNCTIONS
505 #if !defined(GLM_FORCE_CTOR_INIT)
506 # define GLM_DEFAULTED_DEFAULT_CTOR_DECL
507 # define GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_DEFAULTED_FUNC_QUALIFIER
508 #else
509 # define GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_FUNC_DISCARD_DECL
510 # define GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_FUNC_QUALIFIER
511 #endif//GLM_FORCE_CTOR_INIT
512
514 // Swizzle operators
515
516 // User defines: GLM_FORCE_SWIZZLE
517
518 #define GLM_SWIZZLE_DISABLED 0
519 #define GLM_SWIZZLE_OPERATOR 1
520 #define GLM_SWIZZLE_FUNCTION 2
521
522 #if defined(GLM_SWIZZLE)
523 # pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.")
524 # define GLM_FORCE_SWIZZLE
525 #endif
526
527 #if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && !defined(GLM_FORCE_XYZW_ONLY)
528 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR
529 #elif defined(GLM_FORCE_SWIZZLE)
530 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION
531 #else
532 # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED
533 #endif
534
536 // Allows using not basic types as genType
537
538 // #define GLM_FORCE_UNRESTRICTED_GENTYPE
539
540 #ifdef GLM_FORCE_UNRESTRICTED_GENTYPE
541 # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE
542 #else
543 # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE
544 #endif
545
547 // Allows using any scaler as float
548
549 // #define GLM_FORCE_UNRESTRICTED_FLOAT
550
551 #ifdef GLM_FORCE_UNRESTRICTED_FLOAT
552 # define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_ENABLE
553 #else
554 # define GLM_CONFIG_UNRESTRICTED_FLOAT GLM_DISABLE
555 #endif
556
558 // Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM
559 // to use a clip space between 0 to 1.
560 // Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM
561 // to use left handed coordinate system by default.
562
563 #define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE
564 #define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE
565 #define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan
566 #define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM
567
568 #define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT)
569 #define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT)
570 #define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT)
571 #define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT)
572
573 #ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE
574 # ifdef GLM_FORCE_LEFT_HANDED
575 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO
576 # else
577 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO
578 # endif
579 #else
580 # ifdef GLM_FORCE_LEFT_HANDED
581 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO
582 # else
583 # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO
584 # endif
585 #endif
586
588 // Qualifiers
589
590 #if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))
591 # define GLM_DEPRECATED __declspec(deprecated)
592 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name
593 #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL)
594 # if GLM_LANG & GLM_LANG_CXX14_FLAG
595 # define GLM_DEPRECATED [[deprecated]]
596 # else
597 # define GLM_DEPRECATED __attribute__((__deprecated__))
598 # endif
599 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment)))
600 #elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
601 # define GLM_DEPRECATED
602 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x)
603 #else
604 # define GLM_DEPRECATED
605 # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name
606 #endif
607
609
610 #ifdef GLM_FORCE_EXPLICIT_CTOR
611 # define GLM_EXPLICIT explicit
612 #else
613 # define GLM_EXPLICIT
614 #endif
615
617 // Length type: all length functions returns a length_t type.
618 // When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise
619 // length_t is a typedef of int like GLSL defines it.
620
621 #define GLM_LENGTH_INT 1
622 #define GLM_LENGTH_SIZE_T 2
623
624 #ifdef GLM_FORCE_SIZE_T_LENGTH
625 # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T
626 # define GLM_ASSERT_LENGTH(l, max) (assert ((l) < (max)))
627 #else
628 # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT
629 # define GLM_ASSERT_LENGTH(l, max) (assert ((l) >= 0 && (l) < (max)))
630 #endif
631
632 namespace glm
633 {
634 using std::size_t;
635 # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T
636 typedef size_t length_t;
637 # else
638 typedef int length_t;
639 # endif
640 }//namespace glm
641
643 // constexpr
644
645 #if GLM_HAS_CONSTEXPR
646 # define GLM_CONFIG_CONSTEXP GLM_ENABLE
647
648 namespace glm
649 {
650 template<typename T, std::size_t N>
651 constexpr std::size_t countof(T const (&)[N])
652 {
653 return N;
654 }
655 }//namespace glm
656 # define GLM_COUNTOF(arr) glm::countof(arr)
657 #elif defined(_MSC_VER)
658 # define GLM_CONFIG_CONSTEXP GLM_DISABLE
659
660 # define GLM_COUNTOF(arr) _countof(arr)
661 #else
662 # define GLM_CONFIG_CONSTEXP GLM_DISABLE
663
664 # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0])
665 #endif
666
668 // uint
669
670 namespace glm{
671 namespace detail
672 {
673 template<typename T>
674 struct is_int
675 {
676 enum test {value = 0};
677 };
678
679 template<>
680 struct is_int<unsigned int>
681 {
682 enum test {value = ~0};
683 };
684
685 template<>
686 struct is_int<signed int>
687 {
688 enum test {value = ~0};
689 };
690 }//namespace detail
691
692 typedef unsigned int uint;
693 }//namespace glm
694
696 // 64-bit int
697
698 #if GLM_HAS_EXTENDED_INTEGER_TYPE
699 # include <cstdint>
700 #endif
701
702 namespace glm{
703 namespace detail
704 {
705 # if GLM_HAS_EXTENDED_INTEGER_TYPE
706 typedef std::uint64_t uint64;
707 typedef std::int64_t int64;
708 # elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
709 typedef uint64_t uint64;
710 typedef int64_t int64;
711 # elif GLM_COMPILER & GLM_COMPILER_VC
712 typedef unsigned __int64 uint64;
713 typedef signed __int64 int64;
714 # elif GLM_COMPILER & GLM_COMPILER_GCC
715 # pragma GCC diagnostic ignored "-Wlong-long"
716 __extension__ typedef unsigned long long uint64;
717 __extension__ typedef signed long long int64;
718 # elif (GLM_COMPILER & GLM_COMPILER_CLANG)
719 # pragma clang diagnostic ignored "-Wc++11-long-long"
720 typedef unsigned long long uint64;
721 typedef signed long long int64;
722 # else//unknown compiler
723 typedef unsigned long long uint64;
724 typedef signed long long int64;
725 # endif
726 }//namespace detail
727 }//namespace glm
728
730 // make_unsigned
731
732 #if GLM_HAS_MAKE_SIGNED
733 # include <type_traits>
734
735 namespace glm{
736 namespace detail
737 {
738 using std::make_unsigned;
739 }//namespace detail
740 }//namespace glm
741
742 #else
743
744 namespace glm{
745 namespace detail
746 {
747 template<typename genType>
748 struct make_unsigned
749 {};
750
751 template<>
752 struct make_unsigned<char>
753 {
754 typedef unsigned char type;
755 };
756
757 template<>
758 struct make_unsigned<signed char>
759 {
760 typedef unsigned char type;
761 };
762
763 template<>
764 struct make_unsigned<short>
765 {
766 typedef unsigned short type;
767 };
768
769 template<>
770 struct make_unsigned<int>
771 {
772 typedef unsigned int type;
773 };
774
775 template<>
776 struct make_unsigned<long>
777 {
778 typedef unsigned long type;
779 };
780
781 template<>
782 struct make_unsigned<int64>
783 {
784 typedef uint64 type;
785 };
786
787 template<>
788 struct make_unsigned<unsigned char>
789 {
790 typedef unsigned char type;
791 };
792
793 template<>
794 struct make_unsigned<unsigned short>
795 {
796 typedef unsigned short type;
797 };
798
799 template<>
800 struct make_unsigned<unsigned int>
801 {
802 typedef unsigned int type;
803 };
804
805 template<>
806 struct make_unsigned<unsigned long>
807 {
808 typedef unsigned long type;
809 };
810
811 template<>
812 struct make_unsigned<uint64>
813 {
814 typedef uint64 type;
815 };
816 }//namespace detail
817 }//namespace glm
818 #endif
819
821 // Only use x, y, z, w as vector type components
822
823 #ifdef GLM_FORCE_XYZW_ONLY
824 # define GLM_CONFIG_XYZW_ONLY GLM_ENABLE
825 #else
826 # define GLM_CONFIG_XYZW_ONLY GLM_DISABLE
827 #endif
828
830 // Configure the use of defaulted initialized types
831
832 #define GLM_CTOR_INIT_DISABLE 0
833 #define GLM_CTOR_INITIALIZER_LIST 1
834 #define GLM_CTOR_INITIALISATION 2
835
836 #if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
837 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST
838 #elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
839 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION
840 #else
841 # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE
842 #endif
843
845 // Use SIMD instruction sets
846
847 #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)
848 # define GLM_CONFIG_SIMD GLM_ENABLE
849 #else
850 # define GLM_CONFIG_SIMD GLM_DISABLE
851 #endif
852
854 // Configure the use of defaulted function
855
856 #if GLM_HAS_DEFAULTED_FUNCTIONS
857 # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE
858 # define GLM_DEFAULT = default
859 #else
860 # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE
861 # define GLM_DEFAULT
862 #endif
863
864 #if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE && GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE
865 # define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_ENABLE
866 # define GLM_DEFAULT_CTOR GLM_DEFAULT
867 #else
868 # define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_DISABLE
869 # define GLM_DEFAULT_CTOR
870 #endif
871
873 // Configure the use of aligned gentypes
874
875 #ifdef GLM_FORCE_ALIGNED // Legacy define
876 # define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
877 #endif
878
879 #ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
880 # define GLM_FORCE_ALIGNED_GENTYPES
881 #endif
882
883 #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE))
884 # define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE
885 #else
886 # define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE
887 #endif
888
890 // Configure the use of anonymous structure as implementation detail
891
892 #if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE))
893 # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE
894 #else
895 # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE
896 #endif
897
899 // Silent warnings
900
901 #ifdef GLM_FORCE_WARNINGS
902 # define GLM_SILENT_WARNINGS GLM_DISABLE
903 #else
904 # define GLM_SILENT_WARNINGS GLM_ENABLE
905 #endif
906
908 // Precision
909
910 #define GLM_HIGHP 1
911 #define GLM_MEDIUMP 2
912 #define GLM_LOWP 3
913
914 #if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL)
915 # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP
916 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL)
917 # define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP
918 #elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL)
919 # define GLM_CONFIG_PRECISION_BOOL GLM_LOWP
920 #else
921 # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP
922 #endif
923
924 #if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT)
925 # define GLM_CONFIG_PRECISION_INT GLM_HIGHP
926 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT)
927 # define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP
928 #elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT)
929 # define GLM_CONFIG_PRECISION_INT GLM_LOWP
930 #else
931 # define GLM_CONFIG_PRECISION_INT GLM_HIGHP
932 #endif
933
934 #if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT)
935 # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP
936 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT)
937 # define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP
938 #elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT)
939 # define GLM_CONFIG_PRECISION_UINT GLM_LOWP
940 #else
941 # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP
942 #endif
943
944 #if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT)
945 # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP
946 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT)
947 # define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP
948 #elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT)
949 # define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP
950 #else
951 # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP
952 #endif
953
954 #if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE)
955 # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP
956 #elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE)
957 # define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP
958 #elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE)
959 # define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP
960 #else
961 # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP
962 #endif
963
965 // Check inclusions of different versions of GLM
966
967 #elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION))
968 # error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error."
969 #elif GLM_SETUP_INCLUDED == GLM_VERSION
970
972 // Messages
973
974 #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED)
975 # define GLM_MESSAGE_DISPLAYED
976 # define GLM_STR_HELPER(x) #x
977 # define GLM_STR(x) GLM_STR_HELPER(x)
978
979 // Report GLM version
980 # pragma message ("GLM: version " GLM_STR(GLM_VERSION_MAJOR) "." GLM_STR(GLM_VERSION_MINOR) "." GLM_STR(GLM_VERSION_PATCH))
981
982 // Report C++ language
983 # if (GLM_LANG & GLM_LANG_CXX20_FLAG) && (GLM_LANG & GLM_LANG_EXT)
984 # pragma message("GLM: C++ 20 with extensions")
985 # elif (GLM_LANG & GLM_LANG_CXX20_FLAG)
986 # pragma message("GLM: C++ 2A")
987 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT)
988 # pragma message("GLM: C++ 17 with extensions")
989 # elif (GLM_LANG & GLM_LANG_CXX17_FLAG)
990 # pragma message("GLM: C++ 17")
991 # elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT)
992 # pragma message("GLM: C++ 14 with extensions")
993 # elif (GLM_LANG & GLM_LANG_CXX14_FLAG)
994 # pragma message("GLM: C++ 14")
995 # elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT)
996 # pragma message("GLM: C++ 11 with extensions")
997 # elif (GLM_LANG & GLM_LANG_CXX11_FLAG)
998 # pragma message("GLM: C++ 11")
999 # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT)
1000 # pragma message("GLM: C++ 0x with extensions")
1001 # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG)
1002 # pragma message("GLM: C++ 0x")
1003 # elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT)
1004 # pragma message("GLM: C++ 03 with extensions")
1005 # elif (GLM_LANG & GLM_LANG_CXX03_FLAG)
1006 # pragma message("GLM: C++ 03")
1007 # elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT)
1008 # pragma message("GLM: C++ 98 with extensions")
1009 # elif (GLM_LANG & GLM_LANG_CXX98_FLAG)
1010 # pragma message("GLM: C++ 98")
1011 # else
1012 # pragma message("GLM: C++ language undetected")
1013 # endif//GLM_LANG
1014
1015 // Report compiler detection
1016 # if GLM_COMPILER & GLM_COMPILER_CUDA
1017 # pragma message("GLM: CUDA compiler detected")
1018 # elif GLM_COMPILER & GLM_COMPILER_HIP
1019 # pragma message("GLM: HIP compiler detected")
1020 # elif GLM_COMPILER & GLM_COMPILER_VC
1021 # pragma message("GLM: Visual C++ compiler detected")
1022 # elif GLM_COMPILER & GLM_COMPILER_CLANG
1023 # pragma message("GLM: Clang compiler detected")
1024 # elif GLM_COMPILER & GLM_COMPILER_INTEL
1025 # pragma message("GLM: Intel Compiler detected")
1026 # elif GLM_COMPILER & GLM_COMPILER_GCC
1027 # pragma message("GLM: GCC compiler detected")
1028 # else
1029 # pragma message("GLM: Compiler not detected")
1030 # endif
1031
1032 // Report build target
1033 # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64)
1034 # pragma message("GLM: x86 64 bits with AVX2 instruction set build target")
1035 # elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32)
1036 # pragma message("GLM: x86 32 bits with AVX2 instruction set build target")
1037
1038 # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64)
1039 # pragma message("GLM: x86 64 bits with AVX instruction set build target")
1040 # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32)
1041 # pragma message("GLM: x86 32 bits with AVX instruction set build target")
1042
1043 # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64)
1044 # pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target")
1045 # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32)
1046 # pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target")
1047
1048 # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64)
1049 # pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target")
1050 # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32)
1051 # pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target")
1052
1053 # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64)
1054 # pragma message("GLM: x86 64 bits with SSSE3 instruction set build target")
1055 # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32)
1056 # pragma message("GLM: x86 32 bits with SSSE3 instruction set build target")
1057
1058 # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64)
1059 # pragma message("GLM: x86 64 bits with SSE3 instruction set build target")
1060 # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32)
1061 # pragma message("GLM: x86 32 bits with SSE3 instruction set build target")
1062
1063 # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64)
1064 # pragma message("GLM: x86 64 bits with SSE2 instruction set build target")
1065 # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32)
1066 # pragma message("GLM: x86 32 bits with SSE2 instruction set build target")
1067
1068 # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64)
1069 # pragma message("GLM: x86 64 bits build target")
1070 # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32)
1071 # pragma message("GLM: x86 32 bits build target")
1072
1073 # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64)
1074 # pragma message("GLM: ARM 64 bits with Neon instruction set build target")
1075 # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32)
1076 # pragma message("GLM: ARM 32 bits with Neon instruction set build target")
1077
1078 # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64)
1079 # pragma message("GLM: ARM 64 bits build target")
1080 # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32)
1081 # pragma message("GLM: ARM 32 bits build target")
1082
1083 # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64)
1084 # pragma message("GLM: MIPS 64 bits build target")
1085 # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32)
1086 # pragma message("GLM: MIPS 32 bits build target")
1087
1088 # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64)
1089 # pragma message("GLM: PowerPC 64 bits build target")
1090 # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32)
1091 # pragma message("GLM: PowerPC 32 bits build target")
1092 # else
1093 # pragma message("GLM: Unknown build target")
1094 # endif//GLM_ARCH
1095
1096 // Report platform name
1097 # if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO)
1098 # pragma message("GLM: QNX platform detected")
1099 //# elif(GLM_PLATFORM & GLM_PLATFORM_IOS)
1100 //# pragma message("GLM: iOS platform detected")
1101 # elif(GLM_PLATFORM & GLM_PLATFORM_APPLE)
1102 # pragma message("GLM: Apple platform detected")
1103 # elif(GLM_PLATFORM & GLM_PLATFORM_WINCE)
1104 # pragma message("GLM: WinCE platform detected")
1105 # elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
1106 # pragma message("GLM: Windows platform detected")
1107 # elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL)
1108 # pragma message("GLM: Native Client detected")
1109 # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
1110 # pragma message("GLM: Android platform detected")
1111 # elif(GLM_PLATFORM & GLM_PLATFORM_LINUX)
1112 # pragma message("GLM: Linux platform detected")
1113 # elif(GLM_PLATFORM & GLM_PLATFORM_UNIX)
1114 # pragma message("GLM: UNIX platform detected")
1115 # elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN)
1116 # pragma message("GLM: platform unknown")
1117 # else
1118 # pragma message("GLM: platform not detected")
1119 # endif
1120
1121 // Report whether only xyzw component are used
1122 # if defined GLM_FORCE_XYZW_ONLY
1123 # pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.")
1124 # endif
1125
1126 // Report swizzle operator support
1127 # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
1128 # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.")
1129 # elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
1130 # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.")
1131 # else
1132 # pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.")
1133 # endif
1134
1135 // Report .length() type
1136 # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T
1137 # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.")
1138 # else
1139 # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.")
1140 # endif
1141
1142 # if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE
1143 # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.")
1144 # else
1145 # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.")
1146 # endif
1147
1148 # if GLM_SILENT_WARNINGS == GLM_ENABLE
1149 # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is defined. Ignores C++ warnings from using C++ language extensions.")
1150 # else
1151 # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is undefined. Shows C++ warnings from using C++ language extensions.")
1152 # endif
1153
1154 # ifdef GLM_FORCE_SINGLE_ONLY
1155 # pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.")
1156 # endif
1157
1158 # if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)
1159 # undef GLM_FORCE_ALIGNED_GENTYPES
1160 # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.")
1161 # elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE)
1162 # undef GLM_FORCE_ALIGNED_GENTYPES
1163 # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.")
1164 # endif
1165
1166 # if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
1167 # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE
1168 # undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
1169 # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.")
1170 # elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
1171 # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.")
1172 # endif
1173 # endif
1174
1175 # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
1176 # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.")
1177 # else
1178 # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.")
1179 # endif
1180
1181 # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
1182 # pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.")
1183 # else
1184 # pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.")
1185 # endif
1186 #endif//GLM_MESSAGES
1187
1188 #endif//GLM_SETUP_INCLUDED
glm::uint64_t
uint64 uint64_t
Default qualifier 64 bit unsigned integer type.
Definition: fwd.hpp:145
glm::uint64
detail::uint64 uint64
64 bit unsigned integer type.
Definition: scalar_uint_sized.hpp:67
glm::int64_t
int64 int64_t
64 bit signed integer type.
Definition: fwd.hpp:85
glm::int64
detail::int64 int64
64 bit signed integer type.
Definition: scalar_int_sized.hpp:67