setup.hpp
Go to the documentation of this file.
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
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 0
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 // -std=c++0x or -std=gnu++0x
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
443 # else
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
450 # else
451 # define GLM_LANG GLM_LANG_CXX
452 # endif
453 #endif
454 
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")
469 # else
470 # pragma message("GLM: C++ language undetected")
471 # endif//GLM_MODEL
472 #endif//GLM_MESSAGE
473 
475 // Platform
476 
477 // User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_AVX
478 
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
485 
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
501 /* TODO: Explore auto detection of instruction set support
502 # elif(defined(_M_IX86_FP))
503 # if(_M_IX86_FP >= 3)
504 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
505 # elif(_M_IX86_FP >= 2)
506 # define GLM_ARCH (GLM_ARCH_SSE2)
507 # else
508 # define GLM_ARCH GLM_ARCH_PURE
509 # endif
510 */
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)
516 # else
517 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
518 # endif
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
523 # else
524 # define GLM_ARCH GLM_ARCH_PURE
525 # endif
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))
535 #else
536 # define GLM_ARCH GLM_ARCH_PURE
537 #endif
538 
539 // With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is
540 // that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems.
541 // To fix, we just explicitly include intrin.h here.
542 #if defined(__MINGW32__) && (GLM_ARCH != GLM_ARCH_PURE)
543 # include <intrin.h>
544 #endif
545 
546 //#if(GLM_ARCH != GLM_ARCH_PURE)
547 #if(GLM_ARCH & GLM_ARCH_AVX2)
548 # include <immintrin.h>
549 #endif//GLM_ARCH
550 #if(GLM_ARCH & GLM_ARCH_AVX)
551 # include <immintrin.h>
552 #endif//GLM_ARCH
553 #if(GLM_ARCH & GLM_ARCH_SSE4)
554 # include <smmintrin.h>
555 #endif//GLM_ARCH
556 #if(GLM_ARCH & GLM_ARCH_SSE3)
557 # include <pmmintrin.h>
558 #endif//GLM_ARCH
559 #if(GLM_ARCH & GLM_ARCH_SSE2)
560 # include <emmintrin.h>
561 #endif//GLM_ARCH
562 //#endif//(GLM_ARCH != GLM_ARCH_PURE)
563 
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")
578 # endif//GLM_ARCH
579 #endif//GLM_MESSAGE
580 
582 // Support check macros
583 
584 #define GLM_SUPPORT_ANONYMOUS_UNION() \
585  ((GLM_LANG & GLM_LANG_CXX98) == GLM_LANG_CXX98)
586 
587 //#define GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() <backslash>
588 // (((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)))
589 
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))
592 
593 #define GLM_SUPPORT_SWIZZLE_OPERATOR() \
594  (/*defined(GLM_SWIZZLE) && */GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
595 
596 #define GLM_SUPPORT_SWIZZLE_FUNCTION() defined(GLM_SWIZZLE)
597 
599 // Components
600 
601 //#define GLM_FORCE_ONLY_XYZW
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.
605 
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
610 #else
611 # define GLM_COMPONENT GLM_COMPONENT_ONLY_XYZW
612 #endif
613 
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")
622 # else
623 # error "GLM: GLM_COMPONENT value unknown"
624 # endif//GLM_MESSAGE_COMPONENT_DISPLAYED
625 #endif//GLM_MESSAGE
626 
628 // Radians
629 
630 //#define GLM_FORCE_RADIANS
631 
633 // Static assert
634 
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]
641 #else
642 # define GLM_STATIC_ASSERT(x, message)
643 # define GLM_STATIC_ASSERT_NULL
644 #endif//GLM_LANG
645 
647 // Qualifiers
648 
649 // User defines: GLM_FORCE_INLINE GLM_FORCE_CUDA
650 
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__
654 #else
655 # define GLM_CUDA_FUNC_DEF
656 # define GLM_CUDA_FUNC_DECL
657 #endif
658 
659 #if GLM_COMPILER & GLM_COMPILER_GCC
660 #define GLM_VAR_USED __attribute__ ((unused))
661 #else
662 #define GLM_VAR_USED
663 #endif
664 
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))
670 # else
671 # define GLM_INLINE inline
672 # endif//GLM_COMPILER
673 #else
674 # define GLM_INLINE inline
675 #endif//defined(GLM_FORCE_INLINE)
676 
677 #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL
678 #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE
679 
681 // Swizzle operators
682 
683 // User defines: GLM_SWIZZLE
684 
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")
691 # else
692 # pragma message("GLM: Swizzling operators disabled")
693 # endif
694 #endif//GLM_MESSAGE
695 
696 #endif//glm_setup