Flow Visualisation
setup.hpp
Go to the documentation of this file.
1 
29 #ifndef glm_setup
30 #define glm_setup
31 
33 // Version
34 
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 3
40 
42 // Platform
43 
44 #define GLM_PLATFORM_UNKNOWN 0x00000000
45 #define GLM_PLATFORM_WINDOWS 0x00010000
46 #define GLM_PLATFORM_LINUX 0x00020000
47 #define GLM_PLATFORM_APPLE 0x00040000
48 //#define GLM_PLATFORM_IOS 0x00080000
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
53 
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
60 #elif defined(_WIN32)
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
68 #elif defined(__unix)
69 # define GLM_PLATFORM GLM_PLATFORM_UNIX
70 #else
71 # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
72 #endif//
73 
74 // Report platform detection
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")
79 //# elif(GLM_PLATFORM & GLM_PLATFORM_IOS)
80 //# pragma message("GLM: iOS 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")
93 # else
94 # pragma message("GLM: platform not detected")
95 # endif
96 #endif//GLM_MESSAGE
97 
99 // Compiler
100 
101 // User defines: GLM_FORCE_COMPILER_UNKNOWN
102 // TODO ? __llvm__
103 
104 #define GLM_COMPILER_UNKNOWN 0x00000000
105 
106 // Visual C++ defines
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
118 
119 // GCC defines
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
140 
141 // G++ command line to display defined
142 // echo "" | g++ -E -dM -x c++ - | sort
143 
144 // Borland C++ defines. How to identify BC?
145 #define GLM_COMPILER_BC 0x04000000
146 #define GLM_COMPILER_BCB4 0x04000100
147 #define GLM_COMPILER_BCB5 0x04000200
148 #define GLM_COMPILER_BCB6 0x04000300
149 //#define GLM_COMPILER_BCBX 0x04000400 // What's the version value?
150 #define GLM_COMPILER_BCB2009 0x04000500
151 
152 // CodeWarrior
153 #define GLM_COMPILER_CODEWARRIOR 0x08000000
154 
155 // CUDA
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
163 
164 // Clang
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
178 
179 // LLVM GCC
180 #define GLM_COMPILER_LLVM_GCC 0x40000000
181 
182 // Intel
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
192 
193 // Build model
194 #define GLM_MODEL_32 0x00000010
195 #define GLM_MODEL_64 0x00000020
196 
197 // Force generic C++ compiler
198 #ifdef GLM_FORCE_COMPILER_UNKNOWN
199 # define GLM_COMPILER GLM_COMPILER_UNKNOWN
200 
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
218 # else
219 # define GLM_COMPILER GLM_COMPILER_INTEL
220 # endif
221 
222 // CUDA
223 #elif defined(__CUDACC__)
224 # define GLM_COMPILER GLM_COMPILER_CUDA
225 /*
226 # if CUDA_VERSION < 3000
227 # error "GLM requires CUDA 3.0 or higher"
228 # elif CUDA_VERSION == 3000
229 # define GLM_COMPILER GLM_COMPILER_CUDA30
230 # elif CUDA_VERSION == 3010
231 # define GLM_COMPILER GLM_COMPILER_CUDA31
232 # elif CUDA_VERSION == 3020
233 # define GLM_COMPILER GLM_COMPILER_CUDA32
234 # elif CUDA_VERSION == 4000
235 # define GLM_COMPILER GLM_COMPILER_CUDA40
236 # elif CUDA_VERSION == 4010
237 # define GLM_COMPILER GLM_COMPILER_CUDA41
238 # elif CUDA_VERSION == 4020
239 # define GLM_COMPILER GLM_COMPILER_CUDA42
240 # else
241 # define GLM_COMPILER GLM_COMPILER_CUDA
242 # endif
243 */
244 
245 // Visual C++
246 #elif defined(_MSC_VER)
247 # if _MSC_VER == 900
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
267 # else//_MSC_VER
268 # define GLM_COMPILER GLM_COMPILER_VC
269 # endif//_MSC_VER
270 
271 // Clang
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
297 # else
298 # define GLM_COMPILER GLM_COMPILER_CLANG
299 # endif
300 
301 // G++
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)
333 # else
334 # define GLM_COMPILER (GLM_COMPILER_GCC)
335 # endif
336 
337 // Borland C++
338 #elif defined(_BORLANDC_)
339 # if defined(VER125)
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
347 # else
348 # define GLM_COMPILER GLM_COMPILER_BC
349 # endif
350 
351 // Codewarrior
352 #elif defined(__MWERKS__)
353 # define GLM_COMPILER GLM_COMPILER_CODEWARRIOR
354 
355 #else
356 # define GLM_COMPILER GLM_COMPILER_UNKNOWN
357 #endif
358 
359 #ifndef GLM_COMPILER
360 #error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message."
361 #endif//GLM_COMPILER
362 
363 // Report compiler detection
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")
379 # else
380 # pragma message("GLM: GCC compiler detected")
381 # endif
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")
386 # else
387 # pragma message("GLM: Compiler not detected")
388 # endif
389 #endif//GLM_MESSAGE
390 
392 // Build model //
393 
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
398 #else
399 # define GLM_MODEL GLM_MODEL_32
400 #endif//
401 
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."
404 #endif//GLM_MODEL
405 
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")
412 # endif//GLM_MODEL
413 #endif//GLM_MESSAGE
414 
416 // C++ Version //
417 
418 // User defines: GLM_FORCE_CXX98
419 
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)
427 
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
434 #else
435 # if(__cplusplus >= 201103L)
436 # define GLM_LANG GLM_LANG_CXX11
437 # elif(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__GXX_EXPERIMENTAL_CXX0X__))
438 # define GLM_LANG GLM_LANG_CXX0X
439 # elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && defined(_MSC_EXTENSIONS))
440 # define GLM_LANG GLM_LANG_CXXMS
441 # elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && !defined(_MSC_EXTENSIONS))
442 # if(GLM_COMPILER == GLM_COMPILER_VC2010)
443 # define GLM_LANG GLM_LANG_CXX0X
444 # else
445 # define GLM_LANG GLM_LANG_CXX98
446 # endif//(GLM_COMPILER == GLM_COMPILER_VC2010)
447 # elif(__cplusplus >= 199711L)
448 # define GLM_LANG GLM_LANG_CXX98
449 # else
450 # define GLM_LANG GLM_LANG_CXX
451 # endif
452 #endif
453 
454 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_LANG_DISPLAYED))
455 # define GLM_MESSAGE_LANG_DISPLAYED
456 # if(GLM_LANG == GLM_LANG_CXX98)
457 # pragma message("GLM: C++98")
458 # elif(GLM_LANG == GLM_LANG_CXX03)
459 # pragma message("GLM: C++03")
460 # elif(GLM_LANG == GLM_LANG_CXX0X)
461 # pragma message("GLM: C++0x")
462 # elif(GLM_LANG == GLM_LANG_CXX11)
463 # pragma message("GLM: C++11")
464 # elif(GLM_LANG == GLM_LANG_CXXGNU)
465 # pragma message("GLM: C++ with GNU language extensions")
466 # elif(GLM_LANG == GLM_LANG_CXXMS)
467 # pragma message("GLM: C++ with VC language extensions")
468 # else
469 # pragma message("GLM: C++ language undetected")
470 # endif//GLM_MODEL
471 #endif//GLM_MESSAGE
472 
474 // Platform
475 
476 // User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_AVX
477 
478 #define GLM_ARCH_PURE 0x0000
479 #define GLM_ARCH_SSE2 0x0001
480 #define GLM_ARCH_SSE3 0x0002// | GLM_ARCH_SSE2
481 #define GLM_ARCH_SSE4 0x0004// | GLM_ARCH_SSE3 | GLM_ARCH_SSE2
482 #define GLM_ARCH_AVX 0x0008// | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2
483 #define GLM_ARCH_AVX2 0x0010// | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2
484 
485 #if(defined(GLM_FORCE_PURE))
486 # define GLM_ARCH GLM_ARCH_PURE
487 #elif(defined(GLM_FORCE_AVX2))
488 # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
489 #elif(defined(GLM_FORCE_AVX))
490 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
491 #elif(defined(GLM_FORCE_SSE4))
492 # define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
493 #elif(defined(GLM_FORCE_SSE3))
494 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
495 #elif(defined(GLM_FORCE_SSE2))
496 # define GLM_ARCH (GLM_ARCH_SSE2)
497 #elif((GLM_COMPILER & GLM_COMPILER_VC) && (defined(_M_IX86) || defined(_M_X64)))
498 # if(defined(_M_CEE_PURE))
499 # define GLM_ARCH GLM_ARCH_PURE
500 /* TODO: Explore auto detection of instruction set support
501 # elif(defined(_M_IX86_FP))
502 # if(_M_IX86_FP >= 3)
503 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
504 # elif(_M_IX86_FP >= 2)
505 # define GLM_ARCH (GLM_ARCH_SSE2)
506 # else
507 # define GLM_ARCH GLM_ARCH_PURE
508 # endif
509 */
510 # elif(GLM_COMPILER >= GLM_COMPILER_VC2012)
511 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
512 # elif(GLM_COMPILER >= GLM_COMPILER_VC2010)
513 # if(_MSC_FULL_VER >= 160031118) //160031118: VC2010 SP1 beta full version
514 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)//GLM_ARCH_AVX (Require SP1)
515 # else
516 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
517 # endif
518 # elif(GLM_COMPILER >= GLM_COMPILER_VC2008)
519 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
520 # elif(GLM_COMPILER >= GLM_COMPILER_VC2005)
521 # define GLM_ARCH GLM_ARCH_SSE2
522 # else
523 # define GLM_ARCH GLM_ARCH_PURE
524 # endif
525 #elif((GLM_PLATFORM & GLM_PLATFORM_APPLE) && (GLM_COMPILER & GLM_COMPILER_GCC))
526 # define GLM_ARCH GLM_ARCH_PURE
527 #elif(((GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__))) || (GLM_COMPILER & GLM_COMPILER_LLVM_GCC))
528 # define GLM_ARCH (GLM_ARCH_PURE \
529 | (defined(__AVX2__) ? GLM_ARCH_AVX2 : 0) \
530 | (defined(__AVX__) ? GLM_ARCH_AVX : 0) \
531 | (defined(__SSE4__) ? GLM_ARCH_SSE4 : 0) \
532 | (defined(__SSE3__) ? GLM_ARCH_SSE3 : 0) \
533 | (defined(__SSE2__) ? GLM_ARCH_SSE2 : 0))
534 #else
535 # define GLM_ARCH GLM_ARCH_PURE
536 #endif
537 
538 // With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is
539 // that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems.
540 // To fix, we just explicitly include intrin.h here.
541 #if defined(__MINGW32__) && (GLM_ARCH != GLM_ARCH_PURE)
542 # include <intrin.h>
543 #endif
544 
545 //#if(GLM_ARCH != GLM_ARCH_PURE)
546 #if(GLM_ARCH & GLM_ARCH_AVX2)
547 # include <immintrin.h>
548 #endif//GLM_ARCH
549 #if(GLM_ARCH & GLM_ARCH_AVX)
550 # include <immintrin.h>
551 #endif//GLM_ARCH
552 #if(GLM_ARCH & GLM_ARCH_SSE4)
553 # include <smmintrin.h>
554 #endif//GLM_ARCH
555 #if(GLM_ARCH & GLM_ARCH_SSE3)
556 # include <pmmintrin.h>
557 #endif//GLM_ARCH
558 #if(GLM_ARCH & GLM_ARCH_SSE2)
559 # include <emmintrin.h>
560 #endif//GLM_ARCH
561 //#endif//(GLM_ARCH != GLM_ARCH_PURE)
562 
563 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED))
564 # define GLM_MESSAGE_ARCH_DISPLAYED
565 # if(GLM_ARCH == GLM_ARCH_PURE)
566 # pragma message("GLM: Platform independent")
567 # elif(GLM_ARCH & GLM_ARCH_SSE2)
568 # pragma message("GLM: SSE2 instruction set")
569 # elif(GLM_ARCH & GLM_ARCH_SSE3)
570 # pragma message("GLM: SSE3 instruction set")
571 # elif(GLM_ARCH & GLM_ARCH_SSE4)
572 # pragma message("GLM: SSE4 instruction set")
573 # elif(GLM_ARCH & GLM_ARCH_AVX)
574 # pragma message("GLM: AVX instruction set")
575 # elif(GLM_ARCH & GLM_ARCH_AVX2)
576 # pragma message("GLM: AVX2 instruction set")
577 # endif//GLM_ARCH
578 #endif//GLM_MESSAGE
579 
581 // Support check macros
582 
583 #define GLM_SUPPORT_ANONYMOUS_UNION() \
584  ((GLM_LANG & GLM_LANG_CXX98) == GLM_LANG_CXX98)
585 
586 //#define GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() <backslash>
587 // (((GLM_LANG & GLM_LANG_CXX11) == GLM_LANG_CXX11) || ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_LANG & GLM_LANG_CXXMS) == GLM_LANG_CXXMS) || ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_LANG == GLM_LANG_CXX0X)))
588 
589 #define GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() \
590  (((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))
591 
592 #define GLM_SUPPORT_SWIZZLE_OPERATOR() \
593  (/*defined(GLM_SWIZZLE) && */GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
594 
595 #define GLM_SUPPORT_SWIZZLE_FUNCTION() defined(GLM_SWIZZLE)
596 
598 // Components
599 
600 //#define GLM_FORCE_ONLY_XYZW
601 #define GLM_COMPONENT_ONLY_XYZW 0 // To disable multiple vector component names access.
602 #define GLM_COMPONENT_CXX98 1 //
603 #define GLM_COMPONENT_CXX11 2 // To use anonymous union to provide multiple component names access for class valType. Visual C++ only.
604 
605 #if(GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() && !defined(GLM_FORCE_ONLY_XYZW))
606 # define GLM_COMPONENT GLM_COMPONENT_CXX11
607 #elif(GLM_SUPPORT_ANONYMOUS_UNION() && !defined(GLM_FORCE_ONLY_XYZW))
608 # define GLM_COMPONENT GLM_COMPONENT_CXX98
609 #else
610 # define GLM_COMPONENT GLM_COMPONENT_ONLY_XYZW
611 #endif
612 
613 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPONENT_DISPLAYED))
614 # define GLM_MESSAGE_COMPONENT_DISPLAYED
615 # if(GLM_COMPONENT == GLM_COMPONENT_CXX98)
616 # pragma message("GLM: x,y,z,w; r,g,b,a; s,t,p,q component names except of half based vector types")
617 # elif(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW)
618 # pragma message("GLM: x,y,z,w component names for all vector types")
619 # elif(GLM_COMPONENT == GLM_COMPONENT_CXX11)
620 # pragma message("GLM: x,y,z,w; r,g,b,a; s,t,p,q component names for all vector types")
621 # else
622 # error "GLM: GLM_COMPONENT value unknown"
623 # endif//GLM_MESSAGE_COMPONENT_DISPLAYED
624 #endif//GLM_MESSAGE
625 
627 // Radians
628 
629 //#define GLM_FORCE_RADIANS
630 
632 // Static assert
633 
634 #if(GLM_LANG == GLM_LANG_CXX0X)
635 # define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
636 #elif(defined(BOOST_STATIC_ASSERT))
637 # define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x)
638 #elif(GLM_COMPILER & GLM_COMPILER_VC)
639 # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
640 #else
641 # define GLM_STATIC_ASSERT(x, message)
642 # define GLM_STATIC_ASSERT_NULL
643 #endif//GLM_LANG
644 
646 // Qualifiers
647 
648 // User defines: GLM_FORCE_INLINE GLM_FORCE_CUDA
649 
650 #if(defined(GLM_FORCE_CUDA) || (GLM_COMPILER & GLM_COMPILER_CUDA))
651 # define GLM_CUDA_FUNC_DEF __device__ __host__
652 # define GLM_CUDA_FUNC_DECL __device__ __host__
653 #else
654 # define GLM_CUDA_FUNC_DEF
655 # define GLM_CUDA_FUNC_DECL
656 #endif
657 
658 #if GLM_COMPILER & GLM_COMPILER_GCC
659 # define GLM_VAR_USED __attribute__ ((unused))
660 #else
661 # define GLM_VAR_USED
662 #endif
663 
664 #if(defined(GLM_FORCE_INLINE))
665 # if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005))
666 # define GLM_INLINE __forceinline
667 # elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC34))
668 # define GLM_INLINE __attribute__((always_inline))
669 # elif(GLM_COMPILER & GLM_COMPILER_CLANG)
670 # define GLM_INLINE __attribute__((always_inline))
671 # else
672 # define GLM_INLINE inline
673 # endif//GLM_COMPILER
674 #else
675 # define GLM_INLINE inline
676 #endif//defined(GLM_FORCE_INLINE)
677 
678 #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL
679 #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE
680 
682 // Swizzle operators
683 
684 // User defines: GLM_SWIZZLE
685 
686 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_SWIZZLE_DISPLAYED))
687 # define GLM_MESSAGE_SWIZZLE_DISPLAYED
688 # if(GLM_SUPPORT_SWIZZLE_OPERATOR())
689 # pragma message("GLM: Swizzling operators enabled")
690 # elif(GLM_SUPPORT_SWIZZLE_FUNCTION())
691 # pragma message("GLM: Swizzling operators supported through swizzling functions")
692 # else
693 # pragma message("GLM: Swizzling operators disabled")
694 # endif
695 #endif//GLM_MESSAGE
696 
697 #endif//glm_setup