1.0.0 API documentation: setup.hpp Source File

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