setup.hpp
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include <cassert>
32 
34 // Version
35 
36 #define GLM_VERSION 96
37 #define GLM_VERSION_MAJOR 0
38 #define GLM_VERSION_MINOR 9
39 #define GLM_VERSION_PATCH 6
40 #define GLM_VERSION_REVISION 0
41 
43 // Platform
44 
45 #define GLM_PLATFORM_UNKNOWN 0x00000000
46 #define GLM_PLATFORM_WINDOWS 0x00010000
47 #define GLM_PLATFORM_LINUX 0x00020000
48 #define GLM_PLATFORM_APPLE 0x00040000
49 //#define GLM_PLATFORM_IOS 0x00080000
50 #define GLM_PLATFORM_ANDROID 0x00100000
51 #define GLM_PLATFORM_CHROME_NACL 0x00200000
52 #define GLM_PLATFORM_UNIX 0x00400000
53 #define GLM_PLATFORM_QNXNTO 0x00800000
54 #define GLM_PLATFORM_WINCE 0x01000000
55 
56 #ifdef GLM_FORCE_PLATFORM_UNKNOWN
57 # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
58 #elif defined(__QNXNTO__)
59 # define GLM_PLATFORM GLM_PLATFORM_QNXNTO
60 #elif defined(__APPLE__)
61 # define GLM_PLATFORM GLM_PLATFORM_APPLE
62 #elif defined(WINCE)
63 # define GLM_PLATFORM GLM_PLATFORM_WINCE
64 #elif defined(_WIN32)
65 # define GLM_PLATFORM GLM_PLATFORM_WINDOWS
66 #elif defined(__native_client__)
67 # define GLM_PLATFORM GLM_PLATFORM_CHROME_NACL
68 #elif defined(__ANDROID__)
69 # define GLM_PLATFORM GLM_PLATFORM_ANDROID
70 #elif defined(__linux)
71 # define GLM_PLATFORM GLM_PLATFORM_LINUX
72 #elif defined(__unix)
73 # define GLM_PLATFORM GLM_PLATFORM_UNIX
74 #else
75 # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
76 #endif//
77 
78 // Report platform detection
79 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_PLATFORM_DISPLAYED))
80 # define GLM_MESSAGE_PLATFORM_DISPLAYED
81 # if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO)
82 # pragma message("GLM: QNX platform detected")
83 //# elif(GLM_PLATFORM & GLM_PLATFORM_IOS)
84 //# pragma message("GLM: iOS platform detected")
85 # elif(GLM_PLATFORM & GLM_PLATFORM_APPLE)
86 # pragma message("GLM: Apple platform detected")
87 # elif(GLM_PLATFORM & GLM_PLATFORM_WINCE)
88 # pragma message("GLM: WinCE platform detected")
89 # elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
90 # pragma message("GLM: Windows platform detected")
91 # elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL)
92 # pragma message("GLM: Native Client detected")
93 # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
94 # pragma message("GLM: Android platform detected")
95 # elif(GLM_PLATFORM & GLM_PLATFORM_LINUX)
96 # pragma message("GLM: Linux platform detected")
97 # elif(GLM_PLATFORM & GLM_PLATFORM_UNIX)
98 # pragma message("GLM: UNIX platform detected")
99 # elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN)
100 # pragma message("GLM: platform unknown")
101 # else
102 # pragma message("GLM: platform not detected")
103 # endif
104 #endif//GLM_MESSAGE
105 
107 // Compiler
108 
109 // User defines: GLM_FORCE_COMPILER_UNKNOWN
110 // TODO ? __llvm__
111 
112 #define GLM_COMPILER_UNKNOWN 0x00000000
113 
114 // Intel
115 #define GLM_COMPILER_INTEL 0x00100000
116 #define GLM_COMPILER_INTEL9 0x00100010
117 #define GLM_COMPILER_INTEL10_0 0x00100020
118 #define GLM_COMPILER_INTEL10_1 0x00100030
119 #define GLM_COMPILER_INTEL11_0 0x00100040
120 #define GLM_COMPILER_INTEL11_1 0x00100050
121 #define GLM_COMPILER_INTEL12_0 0x00100060
122 #define GLM_COMPILER_INTEL12_1 0x00100070
123 #define GLM_COMPILER_INTEL13_0 0x00100080
124 
125 // Visual C++ defines
126 #define GLM_COMPILER_VC 0x01000000
127 #define GLM_COMPILER_VC8 0x01000070
128 #define GLM_COMPILER_VC9 0x01000080
129 #define GLM_COMPILER_VC10 0x01000090
130 #define GLM_COMPILER_VC11 0x010000A0
131 #define GLM_COMPILER_VC12 0x010000B0
132 
133 // GCC defines
134 #define GLM_COMPILER_GCC 0x02000000
135 #define GLM_COMPILER_GCC34 0x02000050
136 #define GLM_COMPILER_GCC35 0x02000060
137 #define GLM_COMPILER_GCC40 0x02000070
138 #define GLM_COMPILER_GCC41 0x02000080
139 #define GLM_COMPILER_GCC42 0x02000090
140 #define GLM_COMPILER_GCC43 0x020000A0
141 #define GLM_COMPILER_GCC44 0x020000B0
142 #define GLM_COMPILER_GCC45 0x020000C0
143 #define GLM_COMPILER_GCC46 0x020000D0
144 #define GLM_COMPILER_GCC47 0x020000E0
145 #define GLM_COMPILER_GCC48 0x020000F0
146 #define GLM_COMPILER_GCC49 0x02000100
147 
148 // Borland C++
149 #define GLM_COMPILER_BC 0x04000000
150 
151 // CodeWarrior
152 #define GLM_COMPILER_CODEWARRIOR 0x08000000
153 
154 // CUDA
155 #define GLM_COMPILER_CUDA 0x10000000
156 #define GLM_COMPILER_CUDA30 0x10000010
157 #define GLM_COMPILER_CUDA31 0x10000020
158 #define GLM_COMPILER_CUDA32 0x10000030
159 #define GLM_COMPILER_CUDA40 0x10000040
160 #define GLM_COMPILER_CUDA41 0x10000050
161 #define GLM_COMPILER_CUDA42 0x10000060
162 
163 // Clang
164 #define GLM_COMPILER_CLANG 0x20000000
165 #define GLM_COMPILER_CLANG26 0x20000010
166 #define GLM_COMPILER_CLANG27 0x20000020
167 #define GLM_COMPILER_CLANG28 0x20000030
168 #define GLM_COMPILER_CLANG29 0x20000040
169 #define GLM_COMPILER_CLANG30 0x20000050
170 #define GLM_COMPILER_CLANG31 0x20000060
171 #define GLM_COMPILER_CLANG32 0x20000070
172 #define GLM_COMPILER_CLANG33 0x20000080
173 #define GLM_COMPILER_CLANG40 0x20000090
174 #define GLM_COMPILER_CLANG41 0x200000A0
175 #define GLM_COMPILER_CLANG42 0x200000B0
176 #define GLM_COMPILER_CLANG43 0x200000C0
177 #define GLM_COMPILER_CLANG50 0x200000D0
178 
179 // LLVM GCC
180 #define GLM_COMPILER_LLVM_GCC 0x40000000
181 
182 // Build model
183 #define GLM_MODEL_32 0x00000010
184 #define GLM_MODEL_64 0x00000020
185 
186 // Force generic C++ compiler
187 #ifdef GLM_FORCE_COMPILER_UNKNOWN
188 # define GLM_COMPILER GLM_COMPILER_UNKNOWN
189 
190 #elif defined(__INTEL_COMPILER)
191 # if __INTEL_COMPILER == 900
192 # define GLM_COMPILER GLM_COMPILER_INTEL9
193 # elif __INTEL_COMPILER == 1000
194 # define GLM_COMPILER GLM_COMPILER_INTEL10_0
195 # elif __INTEL_COMPILER == 1010
196 # define GLM_COMPILER GLM_COMPILER_INTEL10_1
197 # elif __INTEL_COMPILER == 1100
198 # define GLM_COMPILER GLM_COMPILER_INTEL11_0
199 # elif __INTEL_COMPILER == 1110
200 # define GLM_COMPILER GLM_COMPILER_INTEL11_1
201 # elif __INTEL_COMPILER == 1200
202 # define GLM_COMPILER GLM_COMPILER_INTEL12_0
203 # elif __INTEL_COMPILER == 1210
204 # define GLM_COMPILER GLM_COMPILER_INTEL12_1
205 # elif __INTEL_COMPILER >= 1300
206 # define GLM_COMPILER GLM_COMPILER_INTEL13_0
207 # else
208 # define GLM_COMPILER GLM_COMPILER_INTEL
209 # endif
210 
211 // CUDA
212 #elif defined(__CUDACC__)
213 # if !defined(CUDA_VERSION) && !defined(GLM_FORCE_CUDA)
214 # include <cuda.h> // make sure version is defined since nvcc does not define it itself!
215 # endif
216 # if CUDA_VERSION < 3000
217 # error "GLM requires CUDA 3.0 or higher"
218 # else
219 # define GLM_COMPILER GLM_COMPILER_CUDA
220 # endif
221 
222 // Visual C++
223 #elif defined(_MSC_VER)
224 # if _MSC_VER < 1400
225 # error "GLM requires Visual C++ 2005 or higher"
226 # elif _MSC_VER == 1400
227 # define GLM_COMPILER GLM_COMPILER_VC8
228 # elif _MSC_VER == 1500
229 # define GLM_COMPILER GLM_COMPILER_VC9
230 # elif _MSC_VER == 1600
231 # define GLM_COMPILER GLM_COMPILER_VC10
232 # elif _MSC_VER == 1700
233 # define GLM_COMPILER GLM_COMPILER_VC11
234 # elif _MSC_VER >= 1800
235 # define GLM_COMPILER GLM_COMPILER_VC12
236 # else//_MSC_VER
237 # define GLM_COMPILER GLM_COMPILER_VC
238 # endif//_MSC_VER
239 
240 // Clang
241 #elif defined(__clang__)
242 # if (__clang_major__ <= 1) || ((__clang_major__ == 2) && (__clang_minor__ < 6))
243 # error "GLM requires Clang 2.6 or higher"
244 # elif(__clang_major__ == 2) && (__clang_minor__ == 6)
245 # define GLM_COMPILER GLM_COMPILER_CLANG26
246 # elif(__clang_major__ == 2) && (__clang_minor__ == 7)
247 # define GLM_COMPILER GLM_COMPILER_CLANG27
248 # elif(__clang_major__ == 2) && (__clang_minor__ == 8)
249 # define GLM_COMPILER GLM_COMPILER_CLANG28
250 # elif(__clang_major__ == 2) && (__clang_minor__ == 9)
251 # define GLM_COMPILER GLM_COMPILER_CLANG29
252 # elif(__clang_major__ == 3) && (__clang_minor__ == 0)
253 # define GLM_COMPILER GLM_COMPILER_CLANG30
254 # elif(__clang_major__ == 3) && (__clang_minor__ == 1)
255 # define GLM_COMPILER GLM_COMPILER_CLANG31
256 # elif(__clang_major__ == 3) && (__clang_minor__ == 2)
257 # define GLM_COMPILER GLM_COMPILER_CLANG32
258 # elif(__clang_major__ == 3) && (__clang_minor__ == 3)
259 # define GLM_COMPILER GLM_COMPILER_CLANG33
260 # elif(__clang_major__ == 4) && (__clang_minor__ == 0)
261 # define GLM_COMPILER GLM_COMPILER_CLANG40
262 # elif(__clang_major__ == 4) && (__clang_minor__ == 1)
263 # define GLM_COMPILER GLM_COMPILER_CLANG41
264 # elif(__clang_major__ == 4) && (__clang_minor__ == 2)
265 # define GLM_COMPILER GLM_COMPILER_CLANG42
266 # elif(__clang_major__ == 4) && (__clang_minor__ >= 3)
267 # define GLM_COMPILER GLM_COMPILER_CLANG43
268 # elif(__clang_major__ > 4)
269 # define GLM_COMPILER GLM_COMPILER_CLANG50
270 # else
271 # define GLM_COMPILER GLM_COMPILER_CLANG
272 # endif
273 
274 // G++
275 #elif(defined(__GNUC__) || defined(__MINGW32__))// || defined(__llvm__) || defined(__clang__)
276 # if (__GNUC__ == 3) && (__GNUC_MINOR__ == 4)
277 # define GLM_COMPILER GLM_COMPILER_GCC34
278 # elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 5)
279 # define GLM_COMPILER GLM_COMPILER_GCC35
280 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 0)
281 # define GLM_COMPILER (GLM_COMPILER_GCC40)
282 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 1)
283 # define GLM_COMPILER (GLM_COMPILER_GCC41)
284 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
285 # define GLM_COMPILER (GLM_COMPILER_GCC42)
286 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
287 # define GLM_COMPILER (GLM_COMPILER_GCC43)
288 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)
289 # define GLM_COMPILER (GLM_COMPILER_GCC44)
290 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 5)
291 # define GLM_COMPILER (GLM_COMPILER_GCC45)
292 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
293 # define GLM_COMPILER (GLM_COMPILER_GCC46)
294 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 7)
295 # define GLM_COMPILER (GLM_COMPILER_GCC47)
296 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
297 # define GLM_COMPILER (GLM_COMPILER_GCC48)
298 # elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)
299 # define GLM_COMPILER (GLM_COMPILER_GCC49)
300 # elif (__GNUC__ > 4 )
301 # define GLM_COMPILER (GLM_COMPILER_GCC49)
302 # else
303 # define GLM_COMPILER (GLM_COMPILER_GCC)
304 # endif
305 
306 // Borland C++
307 #elif defined(_BORLANDC_)
308 # define GLM_COMPILER GLM_COMPILER_BC
309 
310 // Codewarrior
311 #elif defined(__MWERKS__)
312 # define GLM_COMPILER GLM_COMPILER_CODEWARRIOR
313 
314 #else
315 # define GLM_COMPILER GLM_COMPILER_UNKNOWN
316 #endif
317 
318 #ifndef GLM_COMPILER
319 #error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message."
320 #endif//GLM_COMPILER
321 
322 // Report compiler detection
323 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPILER_DISPLAYED))
324 # define GLM_MESSAGE_COMPILER_DISPLAYED
325 # if(GLM_COMPILER & GLM_COMPILER_CUDA)
326 # pragma message("GLM: CUDA compiler detected")
327 # elif(GLM_COMPILER & GLM_COMPILER_VC)
328 # pragma message("GLM: Visual C++ compiler detected")
329 # elif(GLM_COMPILER & GLM_COMPILER_CLANG)
330 # pragma message("GLM: Clang compiler detected")
331 # elif(GLM_COMPILER & GLM_COMPILER_LLVM_GCC)
332 # pragma message("GLM: LLVM GCC compiler detected")
333 # elif(GLM_COMPILER & GLM_COMPILER_INTEL)
334 # pragma message("GLM: Intel Compiler detected")
335 # elif(GLM_COMPILER & GLM_COMPILER_GCC)
336 # if(GLM_COMPILER == GLM_COMPILER_GCC_LLVM)
337 # pragma message("GLM: LLVM GCC compiler detected")
338 # elif(GLM_COMPILER == GLM_COMPILER_GCC_CLANG)
339 # pragma message("GLM: CLANG compiler detected")
340 # else
341 # pragma message("GLM: GCC compiler detected")
342 # endif
343 # elif(GLM_COMPILER & GLM_COMPILER_BC)
344 # pragma message("GLM: Borland compiler detected but not supported")
345 # elif(GLM_COMPILER & GLM_COMPILER_CODEWARRIOR)
346 # pragma message("GLM: Codewarrior compiler detected but not supported")
347 # else
348 # pragma message("GLM: Compiler not detected")
349 # endif
350 #endif//GLM_MESSAGE
351 
353 // Build model //
354 
355 #if(defined(__arch64__) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__))
356 # define GLM_MODEL GLM_MODEL_64
357 #elif(defined(__i386__) || defined(__ppc__))
358 # define GLM_MODEL GLM_MODEL_32
359 #else
360 # define GLM_MODEL GLM_MODEL_32
361 #endif//
362 
363 #if(!defined(GLM_MODEL) && GLM_COMPILER != 0)
364 # error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
365 #endif//GLM_MODEL
366 
367 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_MODEL_DISPLAYED))
368 # define GLM_MESSAGE_MODEL_DISPLAYED
369 # if(GLM_MODEL == GLM_MODEL_64)
370 # pragma message("GLM: 64 bits model")
371 # elif(GLM_MODEL == GLM_MODEL_32)
372 # pragma message("GLM: 32 bits model")
373 # endif//GLM_MODEL
374 #endif//GLM_MESSAGE
375 
377 // C++ Version //
378 
379 // User defines: GLM_FORCE_CXX98
380 
381 #define GLM_LANG_CXX_FLAG (1 << 0)
382 #define GLM_LANG_CXX98_FLAG (1 << 1)
383 #define GLM_LANG_CXX03_FLAG (1 << 2)
384 #define GLM_LANG_CXX0X_FLAG (1 << 3)
385 #define GLM_LANG_CXX11_FLAG (1 << 4)
386 #define GLM_LANG_CXX1Y_FLAG (1 << 5)
387 #define GLM_LANG_CXXMS_FLAG (1 << 6)
388 #define GLM_LANG_CXXGNU_FLAG (1 << 7)
389 
390 #define GLM_LANG_CXX GLM_LANG_CXX_FLAG
391 #define GLM_LANG_CXX98 (GLM_LANG_CXX | GLM_LANG_CXX98_FLAG)
392 #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG)
393 #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG)
394 #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG)
395 #define GLM_LANG_CXX1Y (GLM_LANG_CXX11 | GLM_LANG_CXX1Y_FLAG)
396 #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG
397 #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG
398 
399 #if(defined(GLM_FORCE_CXX1Y))
400 # define GLM_LANG GLM_LANG_CXX1Y
401 #elif(defined(GLM_FORCE_CXX11))
402 # define GLM_LANG GLM_LANG_CXX11
403 #elif(defined(GLM_FORCE_CXX03))
404 # define GLM_LANG GLM_LANG_CXX03
405 #elif(defined(GLM_FORCE_CXX98))
406 # define GLM_LANG GLM_LANG_CXX98
407 #else
408 # if(__cplusplus >= 201103L)
409 # define GLM_LANG GLM_LANG_CXX11
410 # elif((GLM_COMPILER & GLM_COMPILER_CLANG) == GLM_COMPILER_CLANG)
411 # if(GLM_PLATFORM == GLM_PLATFORM_APPLE)
412 # define GLM_DETAIL_MAJOR 1
413 # else
414 # define GLM_DETAIL_MAJOR 0
415 # endif
416 # if(__clang_major__ < (2 + GLM_DETAIL_MAJOR))
417 # define GLM_LANG GLM_LANG_CXX
418 # elif(__has_feature(cxx_auto_type))
419 # define GLM_LANG GLM_LANG_CXX0X
420 # else
421 # define GLM_LANG GLM_LANG_CXX98
422 # endif
423 # elif((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC)
424 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
425 # define GLM_LANG GLM_LANG_CXX0X
426 # else
427 # define GLM_LANG GLM_LANG_CXX98
428 # endif
429 # elif(GLM_COMPILER & GLM_COMPILER_VC)
430 # if(defined(_MSC_EXTENSIONS))
431 # if(GLM_COMPILER >= GLM_COMPILER_VC10)
432 # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG)
433 # else
434 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG)
435 # endif
436 # else
437 # if(GLM_COMPILER >= GLM_COMPILER_VC10)
438 # define GLM_LANG GLM_LANG_CXX0X
439 # else
440 # define GLM_LANG GLM_LANG_CXX98
441 # endif
442 # endif
443 # elif(GLM_COMPILER & GLM_COMPILER_INTEL)
444 # if(defined(_MSC_EXTENSIONS))
445 # if(GLM_COMPILER >= GLM_COMPILER_INTEL13_0)
446 # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG)
447 # else
448 # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG)
449 # endif
450 # else
451 # if(GLM_COMPILER >= GLM_COMPILER_INTEL13_0)
452 # define GLM_LANG (GLM_LANG_CXX0X)
453 # else
454 # define GLM_LANG (GLM_LANG_CXX98)
455 # endif
456 # endif
457 # elif(__cplusplus >= 199711L)
458 # define GLM_LANG GLM_LANG_CXX98
459 # else
460 # define GLM_LANG GLM_LANG_CXX
461 # endif
462 #endif
463 
464 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_LANG_DISPLAYED))
465 # define GLM_MESSAGE_LANG_DISPLAYED
466 # if(GLM_LANG & GLM_LANG_CXXGNU_FLAG)
467 # pragma message("GLM: C++ with language extensions")
468 # elif(GLM_LANG & GLM_LANG_CXXMS_FLAG)
469 # pragma message("GLM: C++ with language extensions")
470 # elif(GLM_LANG & GLM_LANG_CXX11_FLAG)
471 # pragma message("GLM: C++11")
472 # elif(GLM_LANG & GLM_LANG_CXX0X_FLAG)
473 # pragma message("GLM: C++0x")
474 # elif(GLM_LANG & GLM_LANG_CXX03_FLAG)
475 # pragma message("GLM: C++03")
476 # elif(GLM_LANG & GLM_LANG_CXX98_FLAG)
477 # pragma message("GLM: C++98")
478 # else
479 # pragma message("GLM: C++ language undetected")
480 # endif//GLM_MODEL
481 # pragma message("GLM: #define GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_LANG_CXX11 or GLM_FORCE_CXX1Y to force using a specific version of the C++ language")
482 #endif//GLM_MESSAGE
483 
485 // Has of C++ features
486 
487 #ifndef __has_feature
488 # define __has_feature(x) 0 // Compatibility with non-clang compilers.
489 #endif
490 #ifndef __has_extension
491 # define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
492 #endif
493 
494 // http://clang.llvm.org/cxx_status.html
495 // http://gcc.gnu.org/projects/cxx0x.html
496 // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
497 
498 // N1720
499 #define GLM_HAS_STATIC_ASSERT ( \
500  (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
501  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC10)) || \
502  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
503  __has_feature(cxx_static_assert))
504 
505 // N1988
506 #define GLM_HAS_EXTENDED_INTEGER_TYPE ( \
507  (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
508  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11)) || \
509  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
510  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG) && (GLM_COMPILER >= GLM_COMPILER_CLANG29)))
511 
512 // N2235
513 #define GLM_HAS_CONSTEXPR ( \
514  (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
515  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \
516  __has_feature(cxx_constexpr))
517 
518 // N2672
519 #define GLM_HAS_INITIALIZER_LISTS ( \
520  (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
521  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12))) || \
522  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \
523  __has_feature(cxx_generalized_initializers))
524 
525 // N2544 Unrestricted unions
526 #define GLM_HAS_UNRESTRICTED_UNIONS ( \
527  (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
528  (GLM_LANG & GLM_LANG_CXXMS_FLAG) || \
529  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \
530  __has_feature(cxx_unrestricted_unions))
531 
532 // N2346
533 #define GLM_HAS_DEFAULTED_FUNCTIONS ( \
534  (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
535  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12))) || \
536  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \
537  __has_feature(cxx_defaulted_functions))
538 
539 // N2118
540 #define GLM_HAS_RVALUE_REFERENCES ( \
541  (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
542  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11))) || \
543  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
544  __has_feature(cxx_rvalue_references))
545 
546 #define GLM_HAS_STL_ARRAY ( \
547  (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
548  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC10))) || \
549  ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)))
550 
551 // OpenMP
552 #ifdef _OPENMP
553 # if(GLM_COMPILER & GLM_COMPILER_GCC)
554 # if(GLM_COMPILER > GLM_COMPILER_GCC47)
555 # define GLM_HAS_OPENMP 31
556 # elif(GLM_COMPILER > GLM_COMPILER_GCC44)
557 # define GLM_HAS_OPENMP 30
558 # elif(GLM_COMPILER > GLM_COMPILER_GCC42)
559 # define GLM_HAS_OPENMP 25
560 # endif
561 # endif//(GLM_COMPILER & GLM_COMPILER_GCC)
562 
563 # if(GLM_COMPILER & GLM_COMPILER_VC)
564 # if(GLM_COMPILER > GLM_COMPILER_VC8)
565 # define GLM_HAS_OPENMP 20
566 # endif
567 # endif//(GLM_COMPILER & GLM_COMPILER_GCC)
568 #endif
569 
570 // Not standard
571 #define GLM_HAS_ANONYMOUS_UNION (GLM_LANG & GLM_LANG_CXXMS_FLAG)
572 
574 // Platform
575 
576 // User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2
577 
578 #define GLM_ARCH_PURE 0x0000
579 #define GLM_ARCH_SSE2 0x0001
580 #define GLM_ARCH_SSE3 0x0002
581 #define GLM_ARCH_SSE4 0x0004
582 #define GLM_ARCH_AVX 0x0008
583 #define GLM_ARCH_AVX2 0x0010
584 
585 #if(defined(GLM_FORCE_PURE))
586 # define GLM_ARCH GLM_ARCH_PURE
587 #elif(defined(GLM_FORCE_AVX2))
588 # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
589 #elif(defined(GLM_FORCE_AVX))
590 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
591 #elif(defined(GLM_FORCE_SSE4))
592 # define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
593 #elif(defined(GLM_FORCE_SSE3))
594 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
595 #elif(defined(GLM_FORCE_SSE2))
596 # define GLM_ARCH (GLM_ARCH_SSE2)
597 #elif((GLM_COMPILER & GLM_COMPILER_CLANG) || (GLM_COMPILER & GLM_COMPILER_GCC))
598 # if(__AVX2__)
599 # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
600 # elif(__AVX__)
601 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
602 # elif(__SSE3__)
603 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
604 # elif(__SSE2__)
605 # define GLM_ARCH (GLM_ARCH_SSE2)
606 # else
607 # define GLM_ARCH GLM_ARCH_PURE
608 # endif
609 #elif(GLM_COMPILER & GLM_COMPILER_VC)
610 # if _M_IX86_FP == 2 && defined(__AVX__)
611 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
612 # elif _M_IX86_FP == 2
613 # define GLM_ARCH (GLM_ARCH_SSE2)
614 # else
615 # define GLM_ARCH (GLM_ARCH_PURE)
616 # endif
617 #elif(((GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__))) || (GLM_COMPILER & GLM_COMPILER_LLVM_GCC) || (GLM_COMPILER & GLM_COMPILER_CLANG))
618 # if defined(__AVX2__)
619 # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
620 # elif defined(__AVX__)
621 # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
622 # elif defined(__SSE4_1__ )
623 # define GLM_ARCH (GLM_ARCH_SSE4 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
624 # elif defined(__SSE3__)
625 # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
626 # elif defined(__SSE2__)
627 # define GLM_ARCH (GLM_ARCH_SSE2)
628 # else
629 # define GLM_ARCH (GLM_ARCH_PURE)
630 # endif
631 #else
632 # define GLM_ARCH GLM_ARCH_PURE
633 #endif
634 
635 // With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is
636 // that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems.
637 // To fix, we just explicitly include intrin.h here.
638 #if defined(__MINGW32__) && (GLM_ARCH != GLM_ARCH_PURE)
639 # include <intrin.h>
640 #endif
641 
642 #if(GLM_ARCH & GLM_ARCH_AVX2)
643 # include <immintrin.h>
644 #endif//GLM_ARCH
645 #if(GLM_ARCH & GLM_ARCH_AVX)
646 # include <immintrin.h>
647 #endif//GLM_ARCH
648 #if(GLM_ARCH & GLM_ARCH_SSE4)
649 # include <smmintrin.h>
650 #endif//GLM_ARCH
651 #if(GLM_ARCH & GLM_ARCH_SSE3)
652 # include <pmmintrin.h>
653 #endif//GLM_ARCH
654 #if(GLM_ARCH & GLM_ARCH_SSE2)
655 # include <emmintrin.h>
656 # if(GLM_COMPILER == GLM_COMPILER_VC8) // VC8 is missing some intrinsics, workaround
657  inline float _mm_cvtss_f32(__m128 A) { return A.m128_f32[0]; }
658  inline __m128 _mm_castpd_ps(__m128d PD) { union { __m128 ps; __m128d pd; } c; c.pd = PD; return c.ps; }
659  inline __m128d _mm_castps_pd(__m128 PS) { union { __m128 ps; __m128d pd; } c; c.ps = PS; return c.pd; }
660  inline __m128i _mm_castps_si128(__m128 PS) { union { __m128 ps; __m128i pi; } c; c.ps = PS; return c.pi; }
661  inline __m128 _mm_castsi128_ps(__m128i PI) { union { __m128 ps; __m128i pi; } c; c.pi = PI; return c.ps; }
662 # endif
663 #endif//GLM_ARCH
664 
665 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED))
666 # define GLM_MESSAGE_ARCH_DISPLAYED
667 # if(GLM_ARCH == GLM_ARCH_PURE)
668 # pragma message("GLM: Platform independent code")
669 # elif(GLM_ARCH & GLM_ARCH_AVX2)
670 # pragma message("GLM: AVX2 instruction set")
671 # elif(GLM_ARCH & GLM_ARCH_AVX)
672 # pragma message("GLM: AVX instruction set")
673 # elif(GLM_ARCH & GLM_ARCH_SSE3)
674 # pragma message("GLM: SSE3 instruction set")
675 # elif(GLM_ARCH & GLM_ARCH_SSE2)
676 # pragma message("GLM: SSE2 instruction set")
677 # endif//GLM_ARCH
678 # pragma message("GLM: #define GLM_FORCE_PURE to avoid using platform specific instruction sets")
679 #endif//GLM_MESSAGE
680 
682 // Static assert
683 
684 #if GLM_HAS_STATIC_ASSERT
685 # define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
686 #elif(defined(BOOST_STATIC_ASSERT))
687 # define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x)
688 #elif(GLM_COMPILER & GLM_COMPILER_VC)
689 # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
690 #else
691 # define GLM_STATIC_ASSERT(x, message)
692 # define GLM_STATIC_ASSERT_NULL
693 #endif//GLM_LANG
694 
696 // Qualifiers
697 
698 // User defines: GLM_FORCE_INLINE GLM_FORCE_CUDA
699 
700 #if(defined(GLM_FORCE_CUDA) || (GLM_COMPILER & GLM_COMPILER_CUDA))
701 # define GLM_CUDA_FUNC_DEF __device__ __host__
702 # define GLM_CUDA_FUNC_DECL __device__ __host__
703 #else
704 # define GLM_CUDA_FUNC_DEF
705 # define GLM_CUDA_FUNC_DECL
706 #endif
707 
708 #if GLM_COMPILER & GLM_COMPILER_GCC
709 # define GLM_VAR_USED __attribute__ ((unused))
710 #else
711 # define GLM_VAR_USED
712 #endif
713 
714 #if(defined(GLM_FORCE_INLINE))
715 # if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC8))
716 # define GLM_INLINE __forceinline
717 # elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC34))
718 # define GLM_INLINE __attribute__((always_inline)) inline
719 # elif(GLM_COMPILER & GLM_COMPILER_CLANG)
720 # define GLM_INLINE __attribute__((always_inline))
721 # else
722 # define GLM_INLINE inline
723 # endif//GLM_COMPILER
724 #else
725 # define GLM_INLINE inline
726 #endif//defined(GLM_FORCE_INLINE)
727 
728 #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL
729 #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE
730 
732 // Swizzle operators
733 
734 // User defines: GLM_SWIZZLE
735 
736 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_SWIZZLE_DISPLAYED))
737 # define GLM_MESSAGE_SWIZZLE_DISPLAYED
738 # if defined(GLM_SWIZZLE)
739 # pragma message("GLM: Swizzling operators enabled")
740 # else
741 # pragma message("GLM: Swizzling operators disabled, #define GLM_SWIZZLE to enable swizzle operators")
742 # endif
743 #endif//GLM_MESSAGE
744 
746 // Length type
747 
748 // User defines: GLM_FORCE_SIZE_T_LENGTH
749 
750 namespace glm
751 {
752 #if defined(GLM_FORCE_SIZE_T_LENGTH)
753  typedef std::size_t length_t;
754 #else
755  typedef int length_t;
756 #endif
757 }//namespace glm
758 
759 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_FORCE_SIZE_T_LENGTH))
760 # define GLM_MESSAGE_FORCE_SIZE_T_LENGTH
761 # if defined(GLM_FORCE_SIZE_T_LENGTH)
762 # pragma message("GLM: .length() returns glm::length_t, a typedef of std::size_t")
763 # else
764 # pragma message("GLM: .length() returns glm::length_t, a typedef of int following the GLSL specification")
765 # pragma message("GLM: #define GLM_FORCE_SIZE_T_LENGTH for .length() to return a std::size_t")
766 # endif
767 #endif//GLM_MESSAGE
768 
770 // Qualifiers
771 
772 #if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC8))
773 # define GLM_DEPRECATED __declspec(deprecated)
774 # define GLM_ALIGN(x) __declspec(align(x))
775 # define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct
776 # define GLM_RESTRICT __declspec(restrict)
777 # define GLM_RESTRICT_VAR __restrict
778 #elif(GLM_COMPILER & GLM_COMPILER_INTEL)
779 # define GLM_DEPRECATED
780 # define GLM_ALIGN(x) __declspec(align(x))
781 # define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct
782 # define GLM_RESTRICT
783 # define GLM_RESTRICT_VAR __restrict
784 #elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG))
785 # define GLM_DEPRECATED __attribute__((__deprecated__))
786 # define GLM_ALIGN(x) __attribute__((aligned(x)))
787 # define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x)))
788 # define GLM_RESTRICT __restrict__
789 # define GLM_RESTRICT_VAR __restrict__
790 #else
791 # define GLM_DEPRECATED
792 # define GLM_ALIGN
793 # define GLM_ALIGNED_STRUCT(x)
794 # define GLM_RESTRICT
795 # define GLM_RESTRICT_VAR
796 #endif//GLM_COMPILER
797 
798 #if GLM_HAS_CONSTEXPR
799 # define GLM_CONSTEXPR constexpr
800 #else
801 # define GLM_CONSTEXPR
802 #endif
int length_t
Definition: setup.hpp:755
GLM_FUNC_DECL genType pi()


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:35:00