setup.hpp

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 #ifndef glm_setup
00030 #define glm_setup
00031 
00033 // Version
00034 
00035 #define GLM_VERSION                                     93
00036 #define GLM_VERSION_MAJOR                       0
00037 #define GLM_VERSION_MINOR                       9
00038 #define GLM_VERSION_PATCH                       3
00039 #define GLM_VERSION_REVISION            0
00040 
00042 // Platform
00043 
00044 #define GLM_PLATFORM_UNKNOWN            0x00000000
00045 #define GLM_PLATFORM_WINDOWS            0x00010000
00046 #define GLM_PLATFORM_LINUX                      0x00020000
00047 #define GLM_PLATFORM_MACOSX                     0x00040000
00048 #define GLM_PLATFORM_IOS                        0x00080000
00049 #define GLM_PLATFORM_ANDROID            0x00100000
00050 
00051 #ifdef GLM_FORCE_PLATFORM_UNKNOWN
00052 #       define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
00053 #elif defined(_WIN32)
00054 #       define GLM_PLATFORM GLM_PLATFORM_WINDOWS
00055 #elif defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR)
00056 #       define GLM_PLATFORM GLM_PLATFORM_IOS
00057 #elif defined(__APPLE__)
00058 #       define GLM_PLATFORM GLM_PLATFORM_MACOSX
00059 #elif defined(ANDROID)
00060 #       define GLM_PLATFORM GLM_PLATFORM_ANDROID
00061 #else
00062 #       define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
00063 #endif//
00064 
00066 // Compiler
00067 
00068 // User defines: GLM_FORCE_COMPILER_UNKNOWN
00069 // TODO ? __llvm__ 
00070 
00071 #define GLM_COMPILER_UNKNOWN            0x00000000
00072 
00073 // Visual C++ defines
00074 #define GLM_COMPILER_VC                         0x01000000
00075 #define GLM_COMPILER_VC2                        0x01000010
00076 #define GLM_COMPILER_VC4                        0x01000020
00077 #define GLM_COMPILER_VC5                        0x01000030
00078 #define GLM_COMPILER_VC6                        0x01000040
00079 #define GLM_COMPILER_VC2002                     0x01000050
00080 #define GLM_COMPILER_VC2003                     0x01000060
00081 #define GLM_COMPILER_VC2005                     0x01000070
00082 #define GLM_COMPILER_VC2008                     0x01000080
00083 #define GLM_COMPILER_VC2010                     0x01000090
00084 #define GLM_COMPILER_VC2011                     0x010000A0
00085 
00086 // GCC defines
00087 #define GLM_COMPILER_GCC            0x02000000
00088 #define GLM_COMPILER_GCC_LLVM       0x02000001
00089 #define GLM_COMPILER_GCC_CLANG      0x02000002
00090 #define GLM_COMPILER_GCC30                      0x02000010
00091 #define GLM_COMPILER_GCC31                      0x02000020
00092 #define GLM_COMPILER_GCC32                      0x02000030
00093 #define GLM_COMPILER_GCC33                      0x02000040
00094 #define GLM_COMPILER_GCC34                      0x02000050
00095 #define GLM_COMPILER_GCC35                      0x02000060
00096 #define GLM_COMPILER_GCC40                      0x02000070
00097 #define GLM_COMPILER_GCC41                      0x02000080
00098 #define GLM_COMPILER_GCC42                      0x02000090
00099 #define GLM_COMPILER_GCC43                      0x020000A0
00100 #define GLM_COMPILER_GCC44                      0x020000B0
00101 #define GLM_COMPILER_GCC45                      0x020000C0
00102 #define GLM_COMPILER_GCC46                      0x020000D0
00103 #define GLM_COMPILER_GCC47                      0x020000E0
00104 #define GLM_COMPILER_GCC48                      0x020000F0
00105 #define GLM_COMPILER_GCC49                      0x02000100
00106 #define GLM_COMPILER_GCC50                      0x02000200
00107 
00108 // G++ command line to display defined
00109 // echo "" | g++ -E -dM -x c++ - | sort
00110 
00111 // Borland C++ defines. How to identify BC?
00112 #define GLM_COMPILER_BC                         0x04000000
00113 #define GLM_COMPILER_BCB4                       0x04000100
00114 #define GLM_COMPILER_BCB5                       0x04000200
00115 #define GLM_COMPILER_BCB6                       0x04000300
00116 //#define GLM_COMPILER_BCBX                     0x04000400 // What's the version value?
00117 #define GLM_COMPILER_BCB2009            0x04000500
00118 
00119 // CodeWarrior
00120 #define GLM_COMPILER_CODEWARRIOR        0x08000000
00121 
00122 // CUDA
00123 #define GLM_COMPILER_CUDA           0x10000000
00124 #define GLM_COMPILER_CUDA30                     0x10000010
00125 #define GLM_COMPILER_CUDA31                     0x10000020
00126 #define GLM_COMPILER_CUDA32                     0x10000030
00127 #define GLM_COMPILER_CUDA40                     0x10000040
00128 
00129 // Clang
00130 #define GLM_COMPILER_CLANG          0x20000000
00131 #define GLM_COMPILER_CLANG26            0x20000010
00132 #define GLM_COMPILER_CLANG27            0x20000020
00133 #define GLM_COMPILER_CLANG28            0x20000030
00134 #define GLM_COMPILER_CLANG29            0x20000040
00135 
00136 // LLVM GCC
00137 #define GLM_COMPILER_LLVM_GCC           0x40000000
00138 
00139 // Build model
00140 #define GLM_MODEL_32                            0x00000010
00141 #define GLM_MODEL_64                            0x00000020
00142 
00143 // Force generic C++ compiler
00144 #ifdef GLM_FORCE_COMPILER_UNKNOWN
00145 #               define GLM_COMPILER GLM_COMPILER_UNKNOWN
00146 
00147 // CUDA
00148 #elif defined(__CUDACC__)
00149 #       define GLM_COMPILER GLM_COMPILER_CUDA
00150 /*
00151 #       if CUDA_VERSION < 3000
00152 #               error "GLM requires CUDA 3.0 or higher"
00153 #       elif CUDA_VERSION == 3000
00154 #               define GLM_COMPILER GLM_COMPILER_CUDA30 
00155 #       elif CUDA_VERSION == 3010
00156 #               define GLM_COMPILER GLM_COMPILER_CUDA31 
00157 #       elif CUDA_VERSION == 3020
00158 #               define GLM_COMPILER GLM_COMPILER_CUDA32 
00159 #       elif CUDA_VERSION == 4000
00160 #               define GLM_COMPILER GLM_COMPILER_CUDA40 
00161 #       else
00162 #               define GLM_COMPILER GLM_COMPILER_CUDA
00163 #       endif
00164 */
00165 
00166 // Visual C++
00167 #elif defined(_MSC_VER)
00168 #       if _MSC_VER == 900
00169 #               define GLM_COMPILER GLM_COMPILER_VC2
00170 #       elif _MSC_VER == 1000
00171 #               define GLM_COMPILER GLM_COMPILER_VC4
00172 #       elif _MSC_VER == 1100
00173 #               define GLM_COMPILER GLM_COMPILER_VC5
00174 #       elif _MSC_VER == 1200
00175 #               define GLM_COMPILER GLM_COMPILER_VC6
00176 #       elif _MSC_VER == 1300
00177 #               define GLM_COMPILER GLM_COMPILER_VC2002
00178 #       elif _MSC_VER == 1310
00179 #               define GLM_COMPILER GLM_COMPILER_VC2003
00180 #       elif _MSC_VER == 1400
00181 #               define GLM_COMPILER GLM_COMPILER_VC2005
00182 #       elif _MSC_VER == 1500
00183 #               define GLM_COMPILER GLM_COMPILER_VC2008
00184 #       elif _MSC_VER == 1600
00185 #               define GLM_COMPILER GLM_COMPILER_VC2010
00186 #       elif _MSC_VER == 1700
00187 #               define GLM_COMPILER GLM_COMPILER_VC2011
00188 #       else//_MSC_VER
00189 #               define GLM_COMPILER GLM_COMPILER_VC
00190 #       endif//_MSC_VER
00191 
00192 // G++
00193 #elif defined(__GNUC__)// || defined(__llvm__) || defined(__clang__)
00194 #   if defined (__llvm__)
00195 #       define GLM_COMPILER_GCC_EXTRA GLM_COMPILER_GCC_LLVM
00196 #   elif defined (__clang__)
00197 #       define GLM_COMPILER_GCC_EXTRA GLM_COMPILER_GCC_CLANG
00198 #   else
00199 #       define GLM_COMPILER_GCC_EXTRA 0
00200 #   endif
00201 #
00202 #       if   (__GNUC__ == 3) && (__GNUC_MINOR__ == 2)
00203 #               define GLM_COMPILER GLM_COMPILER_GCC32
00204 #       elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 3)
00205 #               define GLM_COMPILER GLM_COMPILER_GCC33
00206 #       elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 4)
00207 #               define GLM_COMPILER GLM_COMPILER_GCC34
00208 #       elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 5)
00209 #               define GLM_COMPILER GLM_COMPILER_GCC35
00210 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 0)
00211 #               define GLM_COMPILER (GLM_COMPILER_GCC40 | GLM_COMPILER_GCC_EXTRA)
00212 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 1)
00213 #               define GLM_COMPILER (GLM_COMPILER_GCC41 | GLM_COMPILER_GCC_EXTRA)
00214 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
00215 #               define GLM_COMPILER (GLM_COMPILER_GCC42 | GLM_COMPILER_GCC_EXTRA)
00216 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
00217 #               define GLM_COMPILER (GLM_COMPILER_GCC43 | GLM_COMPILER_GCC_EXTRA)
00218 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)
00219 #               define GLM_COMPILER (GLM_COMPILER_GCC44 | GLM_COMPILER_GCC_EXTRA)
00220 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 5)
00221 #               define GLM_COMPILER (GLM_COMPILER_GCC45 | GLM_COMPILER_GCC_EXTRA)
00222 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
00223 #               define GLM_COMPILER (GLM_COMPILER_GCC46 | GLM_COMPILER_GCC_EXTRA)
00224 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 7)
00225 #               define GLM_COMPILER (GLM_COMPILER_GCC47 | GLM_COMPILER_GCC_EXTRA)
00226 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
00227 #               define GLM_COMPILER (GLM_COMPILER_GCC48 | GLM_COMPILER_GCC_EXTRA)
00228 #       elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 9)
00229 #               define GLM_COMPILER (GLM_COMPILER_GCC49 | GLM_COMPILER_GCC_EXTRA)
00230 #       elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0)
00231 #               define GLM_COMPILER (GLM_COMPILER_GCC50 | GLM_COMPILER_GCC_EXTRA)
00232 #       else
00233 #               define GLM_COMPILER (GLM_COMPILER_GCC | GLM_COMPILER_GCC_EXTRA)
00234 #       endif
00235 
00236 // Borland C++
00237 #elif defined(_BORLANDC_)
00238 #       if defined(VER125)
00239 #               define GLM_COMPILER GLM_COMPILER_BCB4
00240 #       elif defined(VER130)
00241 #               define GLM_COMPILER GLM_COMPILER_BCB5
00242 #       elif defined(VER140)
00243 #               define GLM_COMPILER GLM_COMPILER_BCB6
00244 #       elif defined(VER200)
00245 #               define GLM_COMPILER GLM_COMPILER_BCB2009
00246 #       else
00247 #               define GLM_COMPILER GLM_COMPILER_BC
00248 #       endif
00249 
00250 // Codewarrior
00251 #elif defined(__MWERKS__)
00252 #       define GLM_COMPILER GLM_COMPILER_CODEWARRIOR
00253 
00254 #else
00255 #       define GLM_COMPILER GLM_COMPILER_UNKNOWN
00256 #endif
00257 
00258 #ifndef GLM_COMPILER
00259 #error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message."
00260 #endif//GLM_COMPILER
00261 
00262 // Report compiler detection
00263 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPILER_DISPLAYED))
00264 #       define GLM_MESSAGE_COMPILER_DISPLAYED
00265 #       if(GLM_COMPILER & GLM_COMPILER_CUDA)
00266 #               pragma message("GLM: CUDA compiler detected")
00267 #       elif(GLM_COMPILER & GLM_COMPILER_VC)
00268 #               pragma message("GLM: Visual C++ compiler detected")
00269 #       elif(GLM_COMPILER & GLM_COMPILER_CLANG)
00270 #               pragma message("GLM: Clang compiler detected")
00271 #       elif(GLM_COMPILER & GLM_COMPILER_LLVM_GCC)
00272 #               pragma message("GLM: LLVM GCC compiler detected")
00273 #       elif(GLM_COMPILER & GLM_COMPILER_GCC)
00274 #       if(GLM_COMPILER == GLM_COMPILER_GCC_LLVM)
00275 #           pragma message("GLM: LLVM GCC compiler detected")
00276 #       elif(GLM_COMPILER == GLM_COMPILER_GCC_CLANG)
00277 #           pragma message("GLM: CLANG compiler detected")
00278 #       else
00279 #           pragma message("GLM: GCC compiler detected")
00280 #       endif
00281 #       elif(GLM_COMPILER & GLM_COMPILER_BC)
00282 #               pragma message("GLM: Borland compiler detected but not supported")
00283 #       elif(GLM_COMPILER & GLM_COMPILER_CODEWARRIOR)
00284 #               pragma message("GLM: Codewarrior compiler detected but not supported")
00285 #       else
00286 #               pragma message("GLM: Compiler not detected")
00287 #       endif
00288 #endif//GLM_MESSAGE
00289 
00291 // Build model //
00292 
00293 #if(GLM_COMPILER & GLM_COMPILER_VC)
00294 #       if defined(_M_X64)
00295 #               define GLM_MODEL        GLM_MODEL_64
00296 #       else
00297 #               define GLM_MODEL        GLM_MODEL_32
00298 #       endif//_M_X64
00299 #elif(GLM_COMPILER & GLM_COMPILER_GCC)
00300 #       if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__) || defined(__LP64__) || defined(__x86_64__)
00301 #               define GLM_MODEL        GLM_MODEL_64
00302 #       else
00303 #               define GLM_MODEL        GLM_MODEL_32
00304 #       endif//
00305 #else
00306 #       define GLM_MODEL        GLM_MODEL_32
00307 #endif//
00308 
00309 #if(!defined(GLM_MODEL) && GLM_COMPILER != 0)
00310 #error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
00311 #endif//GLM_MODEL
00312 
00313 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_MODEL_DISPLAYED))
00314 #       define GLM_MESSAGE_MODEL_DISPLAYED
00315 #       if(GLM_MODEL == GLM_MODEL_64)
00316 #               pragma message("GLM: 64 bits model")
00317 #       elif(GLM_MODEL == GLM_MODEL_32)
00318 #               pragma message("GLM: 32 bits model")
00319 #       endif//GLM_MODEL
00320 #endif//GLM_MESSAGE
00321 
00323 // C++ Version //
00324 
00325 // User defines: GLM_FORCE_CXX98
00326 
00327 #define GLM_LANG_CXX                    (0 << 0)
00328 #define GLM_LANG_CXX98                  ((1 << 1) | GLM_LANG_CXX)
00329 #define GLM_LANG_CXX03                  ((1 << 2) | GLM_LANG_CXX98)
00330 #define GLM_LANG_CXX0X                  ((1 << 3) | GLM_LANG_CXX03)
00331 #define GLM_LANG_CXX11                  ((1 << 4) | GLM_LANG_CXX11)
00332 #define GLM_LANG_CXXMS                  (1 << 5)
00333 #define GLM_LANG_CXXGNU                 (1 << 6)
00334 
00335 #if(defined(GLM_FORCE_CXX11))
00336 #       define GLM_LANG GLM_LANG_CXX11
00337 #elif(defined(GLM_FORCE_CXX03))
00338 #       define GLM_LANG GLM_LANG_CXX03
00339 #elif(defined(GLM_FORCE_CXX98))
00340 #       define GLM_LANG GLM_LANG_CXX98
00341 #else
00342 #       if(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__STRICT_ANSI__))
00343 #               define GLM_LANG GLM_LANG_CXX98
00344 #       elif(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__GXX_EXPERIMENTAL_CXX0X__)) // -std=c++0x or -std=gnu++0x
00345 #               define GLM_LANG GLM_LANG_CXX0X
00346 #       elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && defined(_MSC_EXTENSIONS))
00347 #               define GLM_LANG GLM_LANG_CXXMS
00348 #       elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && !defined(_MSC_EXTENSIONS))
00349 #               if(GLM_COMPILER >= GLM_COMPILER_VC2010)
00350 #                       define GLM_LANG GLM_LANG_CXX0X
00351 #               else
00352 #                       define GLM_LANG GLM_LANG_CXX98
00353 #               endif//(GLM_COMPILER == GLM_COMPILER_VC2010)
00354 #       else
00355 #               define GLM_LANG GLM_LANG_CXX
00356 #       endif
00357 #endif
00358 
00359 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_LANG_DISPLAYED))
00360 #       define GLM_MESSAGE_LANG_DISPLAYED
00361 #       if(GLM_LANG == GLM_LANG_CXX98)
00362 #               pragma message("GLM: C++98")
00363 #       elif(GLM_LANG == GLM_LANG_CXX03)
00364 #               pragma message("GLM: C++03")
00365 #       elif(GLM_LANG == GLM_LANG_CXX0X)
00366 #               pragma message("GLM: C++0x")
00367 #       elif(GLM_LANG == GLM_LANG_CXX11)
00368 #               pragma message("GLM: C++11")
00369 #       elif(GLM_LANG == GLM_LANG_CXXGNU)
00370 #               pragma message("GLM: C++ with GNU language extensions")
00371 #       elif(GLM_LANG == GLM_LANG_CXXMS)
00372 #               pragma message("GLM: C++ with VC language extensions")
00373 #       endif//GLM_MODEL
00374 #endif//GLM_MESSAGE
00375 
00377 // Platform 
00378 
00379 // User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_AVX
00380 
00381 #define GLM_ARCH_PURE           0x0000 //(0x0000)
00382 #define GLM_ARCH_SSE2           0x0001 //(0x0001)
00383 #define GLM_ARCH_SSE3           0x0003 //(0x0002 | GLM_ARCH_SSE2)
00384 #define GLM_ARCH_AVX            0x0007 //(0x0004 | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
00385 
00386 #if(defined(GLM_FORCE_PURE))
00387 #       define GLM_ARCH GLM_ARCH_PURE
00388 #elif(defined(GLM_FORCE_AVX))
00389 #       define GLM_ARCH GLM_ARCH_AVX
00390 #elif(defined(GLM_FORCE_SSE3))
00391 #       define GLM_ARCH GLM_ARCH_SSE3
00392 #elif(defined(GLM_FORCE_SSE2))
00393 #       define GLM_ARCH GLM_ARCH_SSE2
00394 #elif((GLM_COMPILER & GLM_COMPILER_VC) && (defined(_M_IX86) || defined(_M_X64)))
00395 #       if(defined(_M_CEE_PURE))
00396 #               define GLM_ARCH GLM_ARCH_PURE
00397 #       elif(GLM_COMPILER >= GLM_COMPILER_VC2010)
00398 #               if(_MSC_FULL_VER >= 160031118) //160031118: VC2010 SP1 beta full version
00399 #                       define GLM_ARCH GLM_ARCH_AVX //GLM_ARCH_AVX (Require SP1)
00400 #               else
00401 #                       define GLM_ARCH GLM_ARCH_SSE3
00402 #               endif
00403 #       elif(GLM_COMPILER >= GLM_COMPILER_VC2008) 
00404 #               define GLM_ARCH GLM_ARCH_SSE3
00405 #       elif(GLM_COMPILER >= GLM_COMPILER_VC2005)
00406 #               define GLM_ARCH GLM_ARCH_SSE2
00407 #       else
00408 #               define GLM_ARCH GLM_ARCH_PURE
00409 #       endif
00410 #elif(GLM_COMPILER & GLM_COMPILER_LLVM_GCC)
00411 #       if(defined(__AVX__))
00412 #               define GLM_ARCH GLM_ARCH_AVX
00413 #       elif(defined(__SSE3__))
00414 #               define GLM_ARCH GLM_ARCH_SSE3
00415 #       elif(defined(__SSE2__))
00416 #               define GLM_ARCH GLM_ARCH_SSE2
00417 #       else
00418 #               define GLM_ARCH GLM_ARCH_PURE
00419 #       endif
00420 #elif((GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__)))
00421 #       if(defined(__AVX__))
00422 #               define GLM_ARCH GLM_ARCH_AVX
00423 #       elif(defined(__SSE3__))
00424 #               define GLM_ARCH GLM_ARCH_SSE3
00425 #       elif(defined(__SSE2__))
00426 #               define GLM_ARCH GLM_ARCH_SSE2
00427 #       else
00428 #               define GLM_ARCH GLM_ARCH_PURE
00429 #       endif
00430 #else
00431 #       define GLM_ARCH GLM_ARCH_PURE
00432 #endif
00433 
00434 #if(GLM_ARCH != GLM_ARCH_PURE)
00435 #if((GLM_ARCH & GLM_ARCH_AVX) == GLM_ARCH_AVX)
00436 #       include <immintrin.h>
00437 #endif//GLM_ARCH
00438 #if((GLM_ARCH & GLM_ARCH_SSE3) == GLM_ARCH_SSE3)
00439 #       include <pmmintrin.h>
00440 #endif//GLM_ARCH
00441 #if((GLM_ARCH & GLM_ARCH_SSE2) == GLM_ARCH_SSE2)
00442 #       include <emmintrin.h>
00443 #endif//GLM_ARCH
00444 #endif//(GLM_ARCH != GLM_ARCH_PURE)
00445 
00446 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED))
00447 #       define GLM_MESSAGE_ARCH_DISPLAYED
00448 #       if(GLM_ARCH == GLM_ARCH_PURE)
00449 #               pragma message("GLM: Platform independent")
00450 #       elif(GLM_ARCH == GLM_ARCH_SSE2)
00451 #               pragma message("GLM: SSE2 build platform")
00452 #       elif(GLM_ARCH == GLM_ARCH_SSE3)
00453 #               pragma message("GLM: SSE3 build platform")
00454 #       elif(GLM_ARCH == GLM_ARCH_AVX)
00455 #               pragma message("GLM: AVX build platform")
00456 #       endif//GLM_ARCH
00457 #endif//GLM_MESSAGE
00458 
00460 // Support check macros
00461 
00462 #define GLM_SUPPORT_ANONYMOUS_UNION() \
00463         ((GLM_LANG & GLM_LANG_CXX98) == GLM_LANG_CXX98)
00464 
00465 #define GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() \
00466         (((GLM_LANG & GLM_LANG_CXX11) == GLM_LANG_CXX11) || ((GLM_LANG & GLM_LANG_CXXMS) == GLM_LANG_CXXMS) || ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_LANG == GLM_LANG_CXX0X)))
00467 
00468 #define GLM_SUPPORT_SWIZZLE_OPERATOR() \
00469         (/*defined(GLM_SWIZZLE) && */GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
00470 
00471 #define GLM_SUPPORT_SWIZZLE_FUNCTION() defined(GLM_SWIZZLE)
00472 
00474 // Components
00475 
00476 //#define GLM_FORCE_ONLY_XYZW
00477 #define GLM_COMPONENT_ONLY_XYZW                         0 // To disable multiple vector component names access.
00478 #define GLM_COMPONENT_CXX98                                     1 //  
00479 #define GLM_COMPONENT_CXX11                                     2 // To use anonymous union to provide multiple component names access for class valType. Visual C++ only.
00480 
00481 #if(GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() && !defined(GLM_FORCE_ONLY_XYZW))
00482 #       define GLM_COMPONENT GLM_COMPONENT_CXX11
00483 #elif(GLM_SUPPORT_ANONYMOUS_UNION() && !defined(GLM_FORCE_ONLY_XYZW))
00484 #       define GLM_COMPONENT GLM_COMPONENT_CXX98
00485 #else
00486 #       define GLM_COMPONENT GLM_COMPONENT_ONLY_XYZW
00487 #endif
00488 
00489 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPONENT_DISPLAYED))
00490 #       define GLM_MESSAGE_COMPONENT_DISPLAYED
00491 #       if(GLM_COMPONENT == GLM_COMPONENT_CXX98)
00492 #               pragma message("GLM: x,y,z,w; r,g,b,a; s,t,p,q component names except of half based vector types")
00493 #       elif(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW)
00494 #               pragma message("GLM: x,y,z,w component names for all vector types")
00495 #       elif(GLM_COMPONENT == GLM_COMPONENT_CXX11)
00496 #               pragma message("GLM: x,y,z,w; r,g,b,a; s,t,p,q component names for all vector types")
00497 #       else
00498 #               error "GLM: GLM_COMPONENT value unknown"
00499 #       endif//GLM_MESSAGE_COMPONENT_DISPLAYED
00500 #endif//GLM_MESSAGE
00501 
00503 // Static assert
00504 
00505 #if(GLM_LANG == GLM_LANG_CXX0X)
00506 #       define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
00507 #elif(defined(BOOST_STATIC_ASSERT))
00508 #       define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x)
00509 #elif(GLM_COMPILER & GLM_COMPILER_VC)
00510 #       define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
00511 #else
00512 #       define GLM_STATIC_ASSERT(x, message)
00513 #       define GLM_STATIC_ASSERT_NULL
00514 #endif//GLM_LANG
00515 
00517 // Qualifiers 
00518 
00519 // User defines: GLM_FORCE_INLINE GLM_FORCE_CUDA
00520 
00521 #if(defined(GLM_FORCE_CUDA) || (GLM_COMPILER & GLM_COMPILER_CUDA))
00522 #   define GLM_CUDA_FUNC_DEF __device__ __host__ 
00523 #       define GLM_CUDA_FUNC_DECL __device__ __host__ 
00524 #else
00525 #   define GLM_CUDA_FUNC_DEF
00526 #       define GLM_CUDA_FUNC_DECL
00527 #endif
00528 
00529 #if GLM_COMPILER & GLM_COMPILER_GCC
00530 #define GLM_VAR_USED __attribute__ ((unused))
00531 #else
00532 #define GLM_VAR_USED
00533 #endif
00534 
00535 #if(defined(GLM_FORCE_INLINE))
00536 #   if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005))
00537 #       define GLM_INLINE __forceinline
00538 #   elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC34))
00539 #       define GLM_INLINE __attribute__((always_inline))
00540 #   else
00541 #       define GLM_INLINE inline
00542 #   endif//GLM_COMPILER
00543 #else
00544 #   define GLM_INLINE inline
00545 #endif//defined(GLM_FORCE_INLINE)
00546 
00547 #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL
00548 #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE
00549 
00551 // Swizzle operators
00552 
00553 // User defines: GLM_SWIZZLE
00554 
00555 #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_SWIZZLE_DISPLAYED))
00556 #       define GLM_MESSAGE_SWIZZLE_DISPLAYED
00557 #       if(GLM_SUPPORT_SWIZZLE_OPERATOR())
00558 #               pragma message("GLM: Swizzling operators enabled")
00559 #       elif(GLM_SUPPORT_SWIZZLE_FUNCTION())
00560 #               pragma message("GLM: Swizzling operators supported through swizzling functions")
00561 #       else
00562 #               pragma message("GLM: Swizzling operators disabled")
00563 #       endif
00564 #endif//GLM_MESSAGE
00565 
00566 #endif//glm_setup