Go to the documentation of this file.
35 #define GLM_VERSION 94
36 #define GLM_VERSION_MAJOR 0
37 #define GLM_VERSION_MINOR 9
38 #define GLM_VERSION_PATCH 4
39 #define GLM_VERSION_REVISION 0
44 #define GLM_PLATFORM_UNKNOWN 0x00000000
45 #define GLM_PLATFORM_WINDOWS 0x00010000
46 #define GLM_PLATFORM_LINUX 0x00020000
47 #define GLM_PLATFORM_APPLE 0x00040000
49 #define GLM_PLATFORM_ANDROID 0x00100000
50 #define GLM_PLATFORM_CHROME_NACL 0x00200000
51 #define GLM_PLATFORM_UNIX 0x00400000
52 #define GLM_PLATFORM_QNXNTO 0x00800000
54 #ifdef GLM_FORCE_PLATFORM_UNKNOWN
55 # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
56 #elif defined(__QNXNTO__)
57 # define GLM_PLATFORM GLM_PLATFORM_QNXNTO
58 #elif defined(__APPLE__)
59 # define GLM_PLATFORM GLM_PLATFORM_APPLE
61 # define GLM_PLATFORM GLM_PLATFORM_WINDOWS
62 #elif defined(__native_client__)
63 # define GLM_PLATFORM GLM_PLATFORM_CHROME_NACL
64 #elif defined(__ANDROID__)
65 # define GLM_PLATFORM GLM_PLATFORM_ANDROID
66 #elif defined(__linux)
67 # define GLM_PLATFORM GLM_PLATFORM_LINUX
69 # define GLM_PLATFORM GLM_PLATFORM_UNIX
71 # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
75 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_PLATFORM_DISPLAYED))
76 # define GLM_MESSAGE_PLATFORM_DISPLAYED
77 # if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
78 # pragma message("GLM: Windows platform detected")
81 # elif(GLM_PLATFORM & GLM_PLATFORM_APPLE)
82 # pragma message("GLM: Apple platform detected")
83 # elif(GLM_PLATFORM & GLM_PLATFORM_LINUX)
84 # pragma message("GLM: Linux platform detected")
85 # elif(GLM_PLATFORM & GLM_PLATFORM_UNIX)
86 # pragma message("GLM: UNIX platform detected")
87 # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
88 # pragma message("GLM: Android platform detected")
89 # elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL)
90 # pragma message("GLM: Chrone Native Client detected")
91 # elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN)
92 # pragma message("GLM: platform unknown")
94 # pragma message("GLM: platform not detected")
104 #define GLM_COMPILER_UNKNOWN 0x00000000
107 #define GLM_COMPILER_VC 0x01000000
108 #define GLM_COMPILER_VC2 0x01000010
109 #define GLM_COMPILER_VC4 0x01000020
110 #define GLM_COMPILER_VC5 0x01000030
111 #define GLM_COMPILER_VC6 0x01000040
112 #define GLM_COMPILER_VC2002 0x01000050
113 #define GLM_COMPILER_VC2003 0x01000060
114 #define GLM_COMPILER_VC2005 0x01000070
115 #define GLM_COMPILER_VC2008 0x01000080
116 #define GLM_COMPILER_VC2010 0x01000090
117 #define GLM_COMPILER_VC2012 0x010000A0
120 #define GLM_COMPILER_GCC 0x02000000
121 #define GLM_COMPILER_GCC_LLVM 0x02000001
122 #define GLM_COMPILER_GCC_CLANG 0x02000002
123 #define GLM_COMPILER_GCC30 0x02000010
124 #define GLM_COMPILER_GCC31 0x02000020
125 #define GLM_COMPILER_GCC32 0x02000030
126 #define GLM_COMPILER_GCC33 0x02000040
127 #define GLM_COMPILER_GCC34 0x02000050
128 #define GLM_COMPILER_GCC35 0x02000060
129 #define GLM_COMPILER_GCC40 0x02000070
130 #define GLM_COMPILER_GCC41 0x02000080
131 #define GLM_COMPILER_GCC42 0x02000090
132 #define GLM_COMPILER_GCC43 0x020000A0
133 #define GLM_COMPILER_GCC44 0x020000B0
134 #define GLM_COMPILER_GCC45 0x020000C0
135 #define GLM_COMPILER_GCC46 0x020000D0
136 #define GLM_COMPILER_GCC47 0x020000E0
137 #define GLM_COMPILER_GCC48 0x020000F0
138 #define GLM_COMPILER_GCC49 0x02000100
139 #define GLM_COMPILER_GCC50 0x02000200
145 #define GLM_COMPILER_BC 0x04000000
146 #define GLM_COMPILER_BCB4 0x04000100
147 #define GLM_COMPILER_BCB5 0x04000200
148 #define GLM_COMPILER_BCB6 0x04000300
150 #define GLM_COMPILER_BCB2009 0x04000500
153 #define GLM_COMPILER_CODEWARRIOR 0x08000000
156 #define GLM_COMPILER_CUDA 0x10000000
157 #define GLM_COMPILER_CUDA30 0x10000010
158 #define GLM_COMPILER_CUDA31 0x10000020
159 #define GLM_COMPILER_CUDA32 0x10000030
160 #define GLM_COMPILER_CUDA40 0x10000040
161 #define GLM_COMPILER_CUDA41 0x10000050
162 #define GLM_COMPILER_CUDA42 0x10000060
165 #define GLM_COMPILER_CLANG 0x20000000
166 #define GLM_COMPILER_CLANG26 0x20000010
167 #define GLM_COMPILER_CLANG27 0x20000020
168 #define GLM_COMPILER_CLANG28 0x20000030
169 #define GLM_COMPILER_CLANG29 0x20000040
170 #define GLM_COMPILER_CLANG30 0x20000050
171 #define GLM_COMPILER_CLANG31 0x20000060
172 #define GLM_COMPILER_CLANG32 0x20000070
173 #define GLM_COMPILER_CLANG33 0x20000080
174 #define GLM_COMPILER_CLANG40 0x20000090
175 #define GLM_COMPILER_CLANG41 0x200000A0
176 #define GLM_COMPILER_CLANG42 0x200000B0
177 #define GLM_COMPILER_CLANG43 0x200000C0
180 #define GLM_COMPILER_LLVM_GCC 0x40000000
183 #define GLM_COMPILER_INTEL 0x80000000
184 #define GLM_COMPILER_INTEL9 0x80000010
185 #define GLM_COMPILER_INTEL10_0 0x80000020
186 #define GLM_COMPILER_INTEL10_1 0x80000030
187 #define GLM_COMPILER_INTEL11_0 0x80000040
188 #define GLM_COMPILER_INTEL11_1 0x80000050
189 #define GLM_COMPILER_INTEL12_0 0x80000060
190 #define GLM_COMPILER_INTEL12_1 0x80000070
191 #define GLM_COMPILER_INTEL13_0 0x80000080
194 #define GLM_MODEL_32 0x00000010
195 #define GLM_MODEL_64 0x00000020
198 #ifdef GLM_FORCE_COMPILER_UNKNOWN
199 # define GLM_COMPILER GLM_COMPILER_UNKNOWN
201 #elif defined(__INTEL_COMPILER)
202 # if __INTEL_COMPILER == 900
203 # define GLM_COMPILER GLM_COMPILER_INTEL9
204 # elif __INTEL_COMPILER == 1000
205 # define GLM_COMPILER GLM_COMPILER_INTEL10_0
206 # elif __INTEL_COMPILER == 1010
207 # define GLM_COMPILER GLM_COMPILER_INTEL10_1
208 # elif __INTEL_COMPILER == 1100
209 # define GLM_COMPILER GLM_COMPILER_INTEL11_0
210 # elif __INTEL_COMPILER == 1110
211 # define GLM_COMPILER GLM_COMPILER_INTEL11_1
212 # elif __INTEL_COMPILER == 1200
213 # define GLM_COMPILER GLM_COMPILER_INTEL12_0
214 # elif __INTEL_COMPILER == 1210
215 # define GLM_COMPILER GLM_COMPILER_INTEL12_1
216 # elif __INTEL_COMPILER == 1300
217 # define GLM_COMPILER GLM_COMPILER_INTEL13_0
219 # define GLM_COMPILER GLM_COMPILER_INTEL
223 #elif defined(__CUDACC__)
224 # define GLM_COMPILER GLM_COMPILER_CUDA
246 #elif defined(_MSC_VER)
248 # define GLM_COMPILER GLM_COMPILER_VC2
249 # elif _MSC_VER == 1000
250 # define GLM_COMPILER GLM_COMPILER_VC4
251 # elif _MSC_VER == 1100
252 # define GLM_COMPILER GLM_COMPILER_VC5
253 # elif _MSC_VER == 1200
254 # define GLM_COMPILER GLM_COMPILER_VC6
255 # elif _MSC_VER == 1300
256 # define GLM_COMPILER GLM_COMPILER_VC2002
257 # elif _MSC_VER == 1310
258 # define GLM_COMPILER GLM_COMPILER_VC2003
259 # elif _MSC_VER == 1400
260 # define GLM_COMPILER GLM_COMPILER_VC2005
261 # elif _MSC_VER == 1500
262 # define GLM_COMPILER GLM_COMPILER_VC2008
263 # elif _MSC_VER == 1600
264 # define GLM_COMPILER GLM_COMPILER_VC2010
265 # elif _MSC_VER == 1700
266 # define GLM_COMPILER GLM_COMPILER_VC2012
268 # define GLM_COMPILER GLM_COMPILER_VC
272 #elif defined(__clang__)
273 # if(__clang_major__ == 2) && (__clang_minor__ == 6)
274 # define GLM_COMPILER GLM_COMPILER_CLANG26
275 # elif(__clang_major__ == 2) && (__clang_minor__ == 7)
276 # define GLM_COMPILER GLM_COMPILER_CLANG27
277 # elif(__clang_major__ == 2) && (__clang_minor__ == 8)
278 # define GLM_COMPILER GLM_COMPILER_CLANG28
279 # elif(__clang_major__ == 2) && (__clang_minor__ == 9)
280 # define GLM_COMPILER GLM_COMPILER_CLANG29
281 # elif(__clang_major__ == 3) && (__clang_minor__ == 0)
282 # define GLM_COMPILER GLM_COMPILER_CLANG30
283 # elif(__clang_major__ == 3) && (__clang_minor__ == 1)
284 # define GLM_COMPILER GLM_COMPILER_CLANG31
285 # elif(__clang_major__ == 3) && (__clang_minor__ == 2)
286 # define GLM_COMPILER GLM_COMPILER_CLANG32
287 # elif(__clang_major__ == 3) && (__clang_minor__ == 3)
288 # define GLM_COMPILER GLM_COMPILER_CLANG33
289 # elif(__clang_major__ == 4) && (__clang_minor__ == 0)
290 # define GLM_COMPILER GLM_COMPILER_CLANG40
291 # elif(__clang_major__ == 4) && (__clang_minor__ == 1)
292 # define GLM_COMPILER GLM_COMPILER_CLANG41
293 # elif(__clang_major__ == 4) && (__clang_minor__ == 2)
294 # define GLM_COMPILER GLM_COMPILER_CLANG42
295 # elif(__clang_major__ == 4) && (__clang_minor__ == 3)
296 # define GLM_COMPILER GLM_COMPILER_CLANG43
298 # define GLM_COMPILER GLM_COMPILER_CLANG
302 #elif(defined(__GNUC__) || defined(__MINGW32__))// || defined(__llvm__) || defined(__clang__)
303 # if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2)
304 # define GLM_COMPILER GLM_COMPILER_GCC32
305 # elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 3)
306 # define GLM_COMPILER GLM_COMPILER_GCC33
307 # elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 4)
308 # define GLM_COMPILER GLM_COMPILER_GCC34
309 # elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 5)
310 # define GLM_COMPILER GLM_COMPILER_GCC35
311 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 0)
312 # define GLM_COMPILER (GLM_COMPILER_GCC40)
313 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 1)
314 # define GLM_COMPILER (GLM_COMPILER_GCC41)
315 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
316 # define GLM_COMPILER (GLM_COMPILER_GCC42)
317 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
318 # define GLM_COMPILER (GLM_COMPILER_GCC43)
319 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)
320 # define GLM_COMPILER (GLM_COMPILER_GCC44)
321 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 5)
322 # define GLM_COMPILER (GLM_COMPILER_GCC45)
323 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
324 # define GLM_COMPILER (GLM_COMPILER_GCC46)
325 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 7)
326 # define GLM_COMPILER (GLM_COMPILER_GCC47)
327 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
328 # define GLM_COMPILER (GLM_COMPILER_GCC48)
329 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 9)
330 # define GLM_COMPILER (GLM_COMPILER_GCC49)
331 # elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0)
332 # define GLM_COMPILER (GLM_COMPILER_GCC50)
334 # define GLM_COMPILER (GLM_COMPILER_GCC)
338 #elif defined(_BORLANDC_)
340 # define GLM_COMPILER GLM_COMPILER_BCB4
341 # elif defined(VER130)
342 # define GLM_COMPILER GLM_COMPILER_BCB5
343 # elif defined(VER140)
344 # define GLM_COMPILER GLM_COMPILER_BCB6
345 # elif defined(VER200)
346 # define GLM_COMPILER GLM_COMPILER_BCB2009
348 # define GLM_COMPILER GLM_COMPILER_BC
352 #elif defined(__MWERKS__)
353 # define GLM_COMPILER GLM_COMPILER_CODEWARRIOR
356 # define GLM_COMPILER GLM_COMPILER_UNKNOWN
360 #error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message."
364 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPILER_DISPLAYED))
365 # define GLM_MESSAGE_COMPILER_DISPLAYED
366 # if(GLM_COMPILER & GLM_COMPILER_CUDA)
367 # pragma message("GLM: CUDA compiler detected")
368 # elif(GLM_COMPILER & GLM_COMPILER_VC)
369 # pragma message("GLM: Visual C++ compiler detected")
370 # elif(GLM_COMPILER & GLM_COMPILER_CLANG)
371 # pragma message("GLM: Clang compiler detected")
372 # elif(GLM_COMPILER & GLM_COMPILER_LLVM_GCC)
373 # pragma message("GLM: LLVM GCC compiler detected")
374 # elif(GLM_COMPILER & GLM_COMPILER_GCC)
375 # if(GLM_COMPILER == GLM_COMPILER_GCC_LLVM)
376 # pragma message("GLM: LLVM GCC compiler detected")
377 # elif(GLM_COMPILER == GLM_COMPILER_GCC_CLANG)
378 # pragma message("GLM: CLANG compiler detected")
380 # pragma message("GLM: GCC compiler detected")
382 # elif(GLM_COMPILER & GLM_COMPILER_BC)
383 # pragma message("GLM: Borland compiler detected but not supported")
384 # elif(GLM_COMPILER & GLM_COMPILER_CODEWARRIOR)
385 # pragma message("GLM: Codewarrior compiler detected but not supported")
387 # pragma message("GLM: Compiler not detected")
394 #if(defined(__arch64__) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__))
395 # define GLM_MODEL GLM_MODEL_64
396 #elif(defined(__i386__) || defined(__ppc__))
397 # define GLM_MODEL GLM_MODEL_32
399 # define GLM_MODEL GLM_MODEL_32
402 #if(!defined(GLM_MODEL) && GLM_COMPILER != 0)
403 # error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
406 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_MODEL_DISPLAYED))
407 # define GLM_MESSAGE_MODEL_DISPLAYED
408 # if(GLM_MODEL == GLM_MODEL_64)
409 # pragma message("GLM: 64 bits model")
410 # elif(GLM_MODEL == GLM_MODEL_32)
411 # pragma message("GLM: 32 bits model")
420 #define GLM_LANG_CXX (0 << 0)
421 #define GLM_LANG_CXX98 ((1 << 1) | GLM_LANG_CXX)
422 #define GLM_LANG_CXX03 ((1 << 2) | GLM_LANG_CXX98)
423 #define GLM_LANG_CXX0X ((1 << 3) | GLM_LANG_CXX03)
424 #define GLM_LANG_CXX11 ((1 << 4) | GLM_LANG_CXX0X)
425 #define GLM_LANG_CXXMS (1 << 5)
426 #define GLM_LANG_CXXGNU (1 << 6)
428 #if(defined(GLM_FORCE_CXX11))
429 # define GLM_LANG GLM_LANG_CXX11
430 #elif(defined(GLM_FORCE_CXX03))
431 # define GLM_LANG GLM_LANG_CXX03
432 #elif(defined(GLM_FORCE_CXX98))
433 # define GLM_LANG GLM_LANG_CXX98
436 # if(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__GXX_EXPERIMENTAL_CXX0X__))
437 # define GLM_LANG GLM_LANG_CXX0X
438 # elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && defined(_MSC_EXTENSIONS))
439 # define GLM_LANG GLM_LANG_CXXMS
440 # elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && !defined(_MSC_EXTENSIONS))
441 # if(GLM_COMPILER >= GLM_COMPILER_VC2010)
442 # define GLM_LANG GLM_LANG_CXX0X
444 # define GLM_LANG GLM_LANG_CXX98
445 # endif//(GLM_COMPILER == GLM_COMPILER_VC2010)
446 # elif((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) //&& defined(__STRICT_ANSI__))
447 # define GLM_LANG GLM_LANG_CXX98
448 # elif((GLM_COMPILER & GLM_COMPILER_CLANG) == GLM_COMPILER_CLANG)
449 # define GLM_LANG GLM_LANG_CXX98
451 # define GLM_LANG GLM_LANG_CXX
455 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_LANG_DISPLAYED))
456 # define GLM_MESSAGE_LANG_DISPLAYED
457 # if(GLM_LANG == GLM_LANG_CXX98)
458 # pragma message("GLM: C++98")
459 # elif(GLM_LANG == GLM_LANG_CXX03)
460 # pragma message("GLM: C++03")
461 # elif(GLM_LANG == GLM_LANG_CXX0X)
462 # pragma message("GLM: C++0x")
463 # elif(GLM_LANG == GLM_LANG_CXX11)
464 # pragma message("GLM: C++11")
465 # elif(GLM_LANG == GLM_LANG_CXXGNU)
466 # pragma message("GLM: C++ with GNU language extensions")
467 # elif(GLM_LANG == GLM_LANG_CXXMS)
468 # pragma message("GLM: C++ with VC language extensions")
470 # pragma message("GLM: C++ language undetected")
479 #define GLM_ARCH_PURE 0x0000
480 #define GLM_ARCH_SSE2 0x0001
481 #define GLM_ARCH_SSE3 0x0002// | GLM_ARCH_SSE2
482 #define GLM_ARCH_SSE4 0x0004// | GLM_ARCH_SSE3 | GLM_ARCH_SSE2
483 #define GLM_ARCH_AVX 0x0008// | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2
484 #define GLM_ARCH_AVX2 0x0010// | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2
486 #if(defined(GLM_FORCE_PURE))
487 # define GLM_ARCH GLM_ARCH_PURE
488 #elif(defined(GLM_FORCE_AVX2))
489 # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
490 #elif(defined(GLM_FORCE_AVX))
491 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
492 #elif(defined(GLM_FORCE_SSE4))
493 # define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
494 #elif(defined(GLM_FORCE_SSE3))
495 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
496 #elif(defined(GLM_FORCE_SSE2))
497 # define GLM_ARCH (GLM_ARCH_SSE2)
498 #elif((GLM_COMPILER & GLM_COMPILER_VC) && (defined(_M_IX86) || defined(_M_X64)))
499 # if(defined(_M_CEE_PURE))
500 # define GLM_ARCH GLM_ARCH_PURE
511 # elif(GLM_COMPILER >= GLM_COMPILER_VC2012)
512 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
513 # elif(GLM_COMPILER >= GLM_COMPILER_VC2010)
514 # if(_MSC_FULL_VER >= 160031118) //160031118: VC2010 SP1 beta full version
515 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)//GLM_ARCH_AVX (Require SP1)
517 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
519 # elif(GLM_COMPILER >= GLM_COMPILER_VC2008)
520 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
521 # elif(GLM_COMPILER >= GLM_COMPILER_VC2005)
522 # define GLM_ARCH GLM_ARCH_SSE2
524 # define GLM_ARCH GLM_ARCH_PURE
526 #elif((GLM_PLATFORM & GLM_PLATFORM_APPLE) && (GLM_COMPILER & GLM_COMPILER_GCC))
527 # define GLM_ARCH GLM_ARCH_PURE
528 #elif(((GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__))) || (GLM_COMPILER & GLM_COMPILER_LLVM_GCC))
529 # define GLM_ARCH (GLM_ARCH_PURE \
530 | (defined(__AVX2__) ? GLM_ARCH_AVX2 : 0) \
531 | (defined(__AVX__) ? GLM_ARCH_AVX : 0) \
532 | (defined(__SSE4__) ? GLM_ARCH_SSE4 : 0) \
533 | (defined(__SSE3__) ? GLM_ARCH_SSE3 : 0) \
534 | (defined(__SSE2__) ? GLM_ARCH_SSE2 : 0))
536 # define GLM_ARCH GLM_ARCH_PURE
542 #if defined(__MINGW32__) && (GLM_ARCH != GLM_ARCH_PURE)
547 #if(GLM_ARCH & GLM_ARCH_AVX2)
548 # include <immintrin.h>
550 #if(GLM_ARCH & GLM_ARCH_AVX)
551 # include <immintrin.h>
553 #if(GLM_ARCH & GLM_ARCH_SSE4)
554 # include <smmintrin.h>
556 #if(GLM_ARCH & GLM_ARCH_SSE3)
557 # include <pmmintrin.h>
559 #if(GLM_ARCH & GLM_ARCH_SSE2)
560 # include <emmintrin.h>
564 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED))
565 # define GLM_MESSAGE_ARCH_DISPLAYED
566 # if(GLM_ARCH == GLM_ARCH_PURE)
567 # pragma message("GLM: Platform independent")
568 # elif(GLM_ARCH & GLM_ARCH_SSE2)
569 # pragma message("GLM: SSE2 instruction set")
570 # elif(GLM_ARCH & GLM_ARCH_SSE3)
571 # pragma message("GLM: SSE3 instruction set")
572 # elif(GLM_ARCH & GLM_ARCH_SSE4)
573 # pragma message("GLM: SSE4 instruction set")
574 # elif(GLM_ARCH & GLM_ARCH_AVX)
575 # pragma message("GLM: AVX instruction set")
576 # elif(GLM_ARCH & GLM_ARCH_AVX2)
577 # pragma message("GLM: AVX2 instruction set")
584 #define GLM_SUPPORT_ANONYMOUS_UNION() \
585 ((GLM_LANG & GLM_LANG_CXX98) == GLM_LANG_CXX98)
590 #define GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() \
591 (((GLM_LANG & GLM_LANG_CXX11) == GLM_LANG_CXX11) || ((GLM_COMPILER & GLM_COMPILER_VC) && ((GLM_LANG & GLM_LANG_CXXMS) == GLM_LANG_CXXMS)) || ((GLM_LANG == GLM_LANG_CXX0X) == GLM_LANG_CXX0X))
593 #define GLM_SUPPORT_SWIZZLE_OPERATOR() \
594 (GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
596 #define GLM_SUPPORT_SWIZZLE_FUNCTION() defined(GLM_SWIZZLE)
602 #define GLM_COMPONENT_ONLY_XYZW 0 // To disable multiple vector component names access.
603 #define GLM_COMPONENT_CXX98 1 //
604 #define GLM_COMPONENT_CXX11 2 // To use anonymous union to provide multiple component names access for class valType. Visual C++ only.
606 #if(GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() && !defined(GLM_FORCE_ONLY_XYZW))
607 # define GLM_COMPONENT GLM_COMPONENT_CXX11
608 #elif(GLM_SUPPORT_ANONYMOUS_UNION() && !defined(GLM_FORCE_ONLY_XYZW))
609 # define GLM_COMPONENT GLM_COMPONENT_CXX98
611 # define GLM_COMPONENT GLM_COMPONENT_ONLY_XYZW
614 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPONENT_DISPLAYED))
615 # define GLM_MESSAGE_COMPONENT_DISPLAYED
616 # if(GLM_COMPONENT == GLM_COMPONENT_CXX98)
617 # pragma message("GLM: x,y,z,w; r,g,b,a; s,t,p,q component names except of half based vector types")
618 # elif(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW)
619 # pragma message("GLM: x,y,z,w component names for all vector types")
620 # elif(GLM_COMPONENT == GLM_COMPONENT_CXX11)
621 # pragma message("GLM: x,y,z,w; r,g,b,a; s,t,p,q component names for all vector types")
623 # error "GLM: GLM_COMPONENT value unknown"
624 # endif//GLM_MESSAGE_COMPONENT_DISPLAYED
635 #if(GLM_LANG == GLM_LANG_CXX0X)
636 # define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
637 #elif(defined(BOOST_STATIC_ASSERT))
638 # define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x)
639 #elif(GLM_COMPILER & GLM_COMPILER_VC)
640 # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
642 # define GLM_STATIC_ASSERT(x, message)
643 # define GLM_STATIC_ASSERT_NULL
651 #if(defined(GLM_FORCE_CUDA) || (GLM_COMPILER & GLM_COMPILER_CUDA))
652 # define GLM_CUDA_FUNC_DEF __device__ __host__
653 # define GLM_CUDA_FUNC_DECL __device__ __host__
655 # define GLM_CUDA_FUNC_DEF
656 # define GLM_CUDA_FUNC_DECL
659 #if GLM_COMPILER & GLM_COMPILER_GCC
660 #define GLM_VAR_USED __attribute__ ((unused))
665 #if(defined(GLM_FORCE_INLINE))
666 # if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005))
667 # define GLM_INLINE __forceinline
668 # elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC34))
669 # define GLM_INLINE __attribute__((always_inline))
671 # define GLM_INLINE inline
672 # endif//GLM_COMPILER
674 # define GLM_INLINE inline
675 #endif//defined(GLM_FORCE_INLINE)
677 #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL
678 #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE
685 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_SWIZZLE_DISPLAYED))
686 # define GLM_MESSAGE_SWIZZLE_DISPLAYED
687 # if(GLM_SUPPORT_SWIZZLE_OPERATOR())
688 # pragma message("GLM: Swizzling operators enabled")
689 # elif(GLM_SUPPORT_SWIZZLE_FUNCTION())
690 # pragma message("GLM: Swizzling operators supported through swizzling functions")
692 # pragma message("GLM: Swizzling operators disabled")