setup.hpp 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. #ifndef GLM_SETUP_INCLUDED
  2. #include <cassert>
  3. #include <cstddef>
  4. #define GLM_VERSION_MAJOR 0
  5. #define GLM_VERSION_MINOR 9
  6. #define GLM_VERSION_PATCH 9
  7. #define GLM_VERSION_REVISION 3
  8. #define GLM_VERSION 993
  9. #define GLM_VERSION_MESSAGE "GLM: version 0.9.9.3"
  10. #define GLM_SETUP_INCLUDED GLM_VERSION
  11. ///////////////////////////////////////////////////////////////////////////////////
  12. // Active states
  13. #define GLM_DISABLE 0
  14. #define GLM_ENABLE 1
  15. ///////////////////////////////////////////////////////////////////////////////////
  16. // Messages
  17. #if defined(GLM_FORCE_MESSAGES)
  18. # define GLM_MESSAGES GLM_ENABLE
  19. #else
  20. # define GLM_MESSAGES GLM_DISABLE
  21. #endif
  22. ///////////////////////////////////////////////////////////////////////////////////
  23. // Detect the platform
  24. #include "../simd/platform.h"
  25. ///////////////////////////////////////////////////////////////////////////////////
  26. // Build model
  27. #if defined(__arch64__) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__)
  28. # define GLM_MODEL GLM_MODEL_64
  29. #elif defined(__i386__) || defined(__ppc__)
  30. # define GLM_MODEL GLM_MODEL_32
  31. #else
  32. # define GLM_MODEL GLM_MODEL_32
  33. #endif//
  34. #if !defined(GLM_MODEL) && GLM_COMPILER != 0
  35. # error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
  36. #endif//GLM_MODEL
  37. ///////////////////////////////////////////////////////////////////////////////////
  38. // C++ Version
  39. // User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14, GLM_FORCE_CXX17, GLM_FORCE_CXX2A
  40. #define GLM_LANG_CXX98_FLAG (1 << 1)
  41. #define GLM_LANG_CXX03_FLAG (1 << 2)
  42. #define GLM_LANG_CXX0X_FLAG (1 << 3)
  43. #define GLM_LANG_CXX11_FLAG (1 << 4)
  44. #define GLM_LANG_CXX14_FLAG (1 << 5)
  45. #define GLM_LANG_CXX17_FLAG (1 << 6)
  46. #define GLM_LANG_CXX2A_FLAG (1 << 7)
  47. #define GLM_LANG_CXXMS_FLAG (1 << 8)
  48. #define GLM_LANG_CXXGNU_FLAG (1 << 9)
  49. #define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG
  50. #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG)
  51. #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG)
  52. #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG)
  53. #define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG)
  54. #define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG)
  55. #define GLM_LANG_CXX2A (GLM_LANG_CXX17 | GLM_LANG_CXX2A_FLAG)
  56. #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG
  57. #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG
  58. #if (defined(_MSC_EXTENSIONS))
  59. # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG
  60. #elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT))
  61. # define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG
  62. #else
  63. # define GLM_LANG_EXT 0
  64. #endif
  65. #if (defined(GLM_FORCE_CXX_UNKNOWN))
  66. # define GLM_LANG 0
  67. #elif defined(GLM_FORCE_CXX2A)
  68. # define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT)
  69. # define GLM_LANG_STL11_FORCED
  70. #elif defined(GLM_FORCE_CXX17)
  71. # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT)
  72. # define GLM_LANG_STL11_FORCED
  73. #elif defined(GLM_FORCE_CXX14)
  74. # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT)
  75. # define GLM_LANG_STL11_FORCED
  76. #elif defined(GLM_FORCE_CXX11)
  77. # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT)
  78. # define GLM_LANG_STL11_FORCED
  79. #elif defined(GLM_FORCE_CXX03)
  80. # define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT)
  81. #elif defined(GLM_FORCE_CXX98)
  82. # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT)
  83. #else
  84. # if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG)
  85. # if GLM_COMPILER >= GLM_COMPILER_VC15_7
  86. # define GLM_LANG_PLATFORM _MSVC_LANG
  87. # elif GLM_COMPILER >= GLM_COMPILER_VC15
  88. # if _MSVC_LANG > 201402L
  89. # define GLM_LANG_PLATFORM 201402L
  90. # else
  91. # define GLM_LANG_PLATFORM _MSVC_LANG
  92. # endif
  93. # else
  94. # define GLM_LANG_PLATFORM 0
  95. # endif
  96. # else
  97. # define GLM_LANG_PLATFORM 0
  98. # endif
  99. # if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L
  100. # define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT)
  101. # elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L
  102. # define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT)
  103. # elif __cplusplus == 201402L || GLM_LANG_PLATFORM == 201402L
  104. # define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT)
  105. # elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L
  106. # define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT)
  107. # elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__)
  108. # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT)
  109. # elif __cplusplus == 199711L
  110. # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT)
  111. # else
  112. # define GLM_LANG (0 | GLM_LANG_EXT)
  113. # endif
  114. #endif
  115. ///////////////////////////////////////////////////////////////////////////////////
  116. // Has of C++ features
  117. // http://clang.llvm.org/cxx_status.html
  118. // http://gcc.gnu.org/projects/cxx0x.html
  119. // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
  120. // Android has multiple STLs but C++11 STL detection doesn't always work #284 #564
  121. #if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED)
  122. # define GLM_HAS_CXX11_STL 0
  123. #elif GLM_COMPILER & GLM_COMPILER_CLANG
  124. # if (defined(_LIBCPP_VERSION) && GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED)
  125. # define GLM_HAS_CXX11_STL 1
  126. # else
  127. # define GLM_HAS_CXX11_STL 0
  128. # endif
  129. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  130. # define GLM_HAS_CXX11_STL 1
  131. #else
  132. # define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  133. ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \
  134. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
  135. ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15))))
  136. #endif
  137. // N1720
  138. #if GLM_COMPILER & GLM_COMPILER_CLANG
  139. # define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert)
  140. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  141. # define GLM_HAS_STATIC_ASSERT 1
  142. #else
  143. # define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  144. ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
  145. ((GLM_COMPILER & GLM_COMPILER_VC))))
  146. #endif
  147. // N1988
  148. #if GLM_LANG & GLM_LANG_CXX11_FLAG
  149. # define GLM_HAS_EXTENDED_INTEGER_TYPE 1
  150. #else
  151. # define GLM_HAS_EXTENDED_INTEGER_TYPE (\
  152. ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \
  153. ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
  154. ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)))
  155. #endif
  156. // N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
  157. #if GLM_COMPILER & GLM_COMPILER_CLANG
  158. # define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers)
  159. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  160. # define GLM_HAS_INITIALIZER_LISTS 1
  161. #else
  162. # define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  163. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \
  164. ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
  165. ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75))))
  166. #endif
  167. // N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
  168. #if GLM_COMPILER & GLM_COMPILER_CLANG
  169. # define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions)
  170. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  171. # define GLM_HAS_UNRESTRICTED_UNIONS 1
  172. #else
  173. # define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  174. (GLM_COMPILER & GLM_COMPILER_VC) || \
  175. ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA75)))
  176. #endif
  177. // N2346
  178. #if GLM_COMPILER & GLM_COMPILER_CLANG
  179. # define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions)
  180. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  181. # define GLM_HAS_DEFAULTED_FUNCTIONS 1
  182. #else
  183. # define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  184. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
  185. ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
  186. (GLM_COMPILER & GLM_COMPILER_CUDA)))
  187. #endif
  188. // N2118
  189. #if GLM_COMPILER & GLM_COMPILER_CLANG
  190. # define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references)
  191. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  192. # define GLM_HAS_RVALUE_REFERENCES 1
  193. #else
  194. # define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  195. ((GLM_COMPILER & GLM_COMPILER_VC)) || \
  196. ((GLM_COMPILER & GLM_COMPILER_CUDA))))
  197. #endif
  198. // N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
  199. #if GLM_COMPILER & GLM_COMPILER_CLANG
  200. # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions)
  201. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  202. # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1
  203. #else
  204. # define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  205. ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
  206. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
  207. ((GLM_COMPILER & GLM_COMPILER_CUDA))))
  208. #endif
  209. // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
  210. #if GLM_COMPILER & GLM_COMPILER_CLANG
  211. # define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates)
  212. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  213. # define GLM_HAS_TEMPLATE_ALIASES 1
  214. #else
  215. # define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  216. ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
  217. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
  218. ((GLM_COMPILER & GLM_COMPILER_CUDA))))
  219. #endif
  220. // N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
  221. #if GLM_COMPILER & GLM_COMPILER_CLANG
  222. # define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for)
  223. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  224. # define GLM_HAS_RANGE_FOR 1
  225. #else
  226. # define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  227. ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
  228. ((GLM_COMPILER & GLM_COMPILER_VC)) || \
  229. ((GLM_COMPILER & GLM_COMPILER_CUDA))))
  230. #endif
  231. // N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
  232. #if GLM_COMPILER & GLM_COMPILER_CLANG
  233. # define GLM_HAS_ALIGNOF __has_feature(cxx_alignas)
  234. #elif GLM_LANG & GLM_LANG_CXX11_FLAG
  235. # define GLM_HAS_ALIGNOF 1
  236. #else
  237. # define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  238. ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \
  239. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \
  240. ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA70))))
  241. #endif
  242. // N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
  243. // N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
  244. #if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr...
  245. # define GLM_HAS_CONSTEXPR 0
  246. #elif (GLM_COMPILER & GLM_COMPILER_CLANG)
  247. # define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr)
  248. #elif (GLM_LANG & GLM_LANG_CXX14_FLAG)
  249. # define GLM_HAS_CONSTEXPR 1
  250. #else
  251. # define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\
  252. ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \
  253. ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC6)) || \
  254. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15))))
  255. #endif
  256. #if GLM_HAS_CONSTEXPR
  257. # define GLM_CONSTEXPR constexpr
  258. #else
  259. # define GLM_CONSTEXPR
  260. #endif
  261. //
  262. #if GLM_LANG & GLM_LANG_CXX11_FLAG
  263. # define GLM_HAS_ASSIGNABLE 1
  264. #else
  265. # define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  266. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \
  267. ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))))
  268. #endif
  269. //
  270. #define GLM_HAS_TRIVIAL_QUERIES 0
  271. //
  272. #if GLM_LANG & GLM_LANG_CXX11_FLAG
  273. # define GLM_HAS_MAKE_SIGNED 1
  274. #else
  275. # define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
  276. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
  277. ((GLM_COMPILER & GLM_COMPILER_CUDA))))
  278. #endif
  279. //
  280. #if defined(GLM_FORCE_PURE)
  281. # define GLM_HAS_BITSCAN_WINDOWS 0
  282. #else
  283. # define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\
  284. ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
  285. ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT))))
  286. #endif
  287. ///////////////////////////////////////////////////////////////////////////////////
  288. // OpenMP
  289. #ifdef _OPENMP
  290. # if GLM_COMPILER & GLM_COMPILER_GCC
  291. # if GLM_COMPILER >= GLM_COMPILER_GCC61
  292. # define GLM_HAS_OPENMP 45
  293. # elif GLM_COMPILER >= GLM_COMPILER_GCC49
  294. # define GLM_HAS_OPENMP 40
  295. # elif GLM_COMPILER >= GLM_COMPILER_GCC47
  296. # define GLM_HAS_OPENMP 31
  297. # else
  298. # define GLM_HAS_OPENMP 0
  299. # endif
  300. # elif GLM_COMPILER & GLM_COMPILER_CLANG
  301. # if GLM_COMPILER >= GLM_COMPILER_CLANG38
  302. # define GLM_HAS_OPENMP 31
  303. # else
  304. # define GLM_HAS_OPENMP 0
  305. # endif
  306. # elif GLM_COMPILER & GLM_COMPILER_VC
  307. # define GLM_HAS_OPENMP 20
  308. # elif GLM_COMPILER & GLM_COMPILER_INTEL
  309. # if GLM_COMPILER >= GLM_COMPILER_INTEL16
  310. # define GLM_HAS_OPENMP 40
  311. # else
  312. # define GLM_HAS_OPENMP 0
  313. # endif
  314. # else
  315. # define GLM_HAS_OPENMP 0
  316. # endif
  317. #else
  318. # define GLM_HAS_OPENMP 0
  319. #endif
  320. ///////////////////////////////////////////////////////////////////////////////////
  321. // nullptr
  322. #if GLM_LANG & GLM_LANG_CXX0X_FLAG
  323. # define GLM_CONFIG_NULLPTR GLM_ENABLE
  324. #else
  325. # define GLM_CONFIG_NULLPTR GLM_DISABLE
  326. #endif
  327. #if GLM_CONFIG_NULLPTR == GLM_ENABLE
  328. # define GLM_NULLPTR nullptr
  329. #else
  330. # define GLM_NULLPTR 0
  331. #endif
  332. ///////////////////////////////////////////////////////////////////////////////////
  333. // Static assert
  334. #if GLM_HAS_STATIC_ASSERT
  335. # define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
  336. #elif GLM_COMPILER & GLM_COMPILER_VC
  337. # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
  338. #else
  339. # define GLM_STATIC_ASSERT(x, message) assert(x)
  340. #endif//GLM_LANG
  341. ///////////////////////////////////////////////////////////////////////////////////
  342. // Qualifiers
  343. #if GLM_COMPILER & GLM_COMPILER_CUDA
  344. # define GLM_CUDA_FUNC_DEF __device__ __host__
  345. # define GLM_CUDA_FUNC_DECL __device__ __host__
  346. #else
  347. # define GLM_CUDA_FUNC_DEF
  348. # define GLM_CUDA_FUNC_DECL
  349. #endif
  350. #if defined(GLM_FORCE_INLINE)
  351. # if GLM_COMPILER & GLM_COMPILER_VC
  352. # define GLM_INLINE __forceinline
  353. # define GLM_NEVER_INLINE __declspec((noinline))
  354. # elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)
  355. # define GLM_INLINE inline __attribute__((__always_inline__))
  356. # define GLM_NEVER_INLINE __attribute__((__noinline__))
  357. # elif GLM_COMPILER & GLM_COMPILER_CUDA
  358. # define GLM_INLINE __forceinline__
  359. # define GLM_NEVER_INLINE __noinline__
  360. # else
  361. # define GLM_INLINE inline
  362. # define GLM_NEVER_INLINE
  363. # endif//GLM_COMPILER
  364. #else
  365. # define GLM_INLINE inline
  366. # define GLM_NEVER_INLINE
  367. #endif//defined(GLM_FORCE_INLINE)
  368. #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL
  369. #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE
  370. ///////////////////////////////////////////////////////////////////////////////////
  371. // Swizzle operators
  372. // User defines: GLM_FORCE_SWIZZLE
  373. #define GLM_SWIZZLE_DISABLED 0
  374. #define GLM_SWIZZLE_OPERATOR 1
  375. #define GLM_SWIZZLE_FUNCTION 2
  376. #if defined(GLM_FORCE_XYZW_ONLY)
  377. # undef GLM_FORCE_SWIZZLE
  378. #endif
  379. #if defined(GLM_SWIZZLE)
  380. # pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.")
  381. # define GLM_FORCE_SWIZZLE
  382. #endif
  383. #if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG)
  384. # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR
  385. #elif defined(GLM_FORCE_SWIZZLE)
  386. # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION
  387. #else
  388. # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED
  389. #endif
  390. ///////////////////////////////////////////////////////////////////////////////////
  391. // Allows using not basic types as genType
  392. // #define GLM_FORCE_UNRESTRICTED_GENTYPE
  393. #ifdef GLM_FORCE_UNRESTRICTED_GENTYPE
  394. # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE
  395. #else
  396. # define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE
  397. #endif
  398. ///////////////////////////////////////////////////////////////////////////////////
  399. // Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM
  400. // to use a clip space between 0 to 1.
  401. // Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM
  402. // to use left handed coordinate system by default.
  403. #define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE
  404. #define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE
  405. #define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan
  406. #define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM
  407. #define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT)
  408. #define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT)
  409. #define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT)
  410. #define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT)
  411. #ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE
  412. # ifdef GLM_FORCE_LEFT_HANDED
  413. # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO
  414. # else
  415. # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO
  416. # endif
  417. #else
  418. # ifdef GLM_FORCE_LEFT_HANDED
  419. # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO
  420. # else
  421. # define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO
  422. # endif
  423. #endif
  424. ///////////////////////////////////////////////////////////////////////////////////
  425. // Qualifiers
  426. #if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))
  427. # define GLM_DEPRECATED __declspec(deprecated)
  428. # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name
  429. #elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL)
  430. # define GLM_DEPRECATED __attribute__((__deprecated__))
  431. # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment)))
  432. #elif GLM_COMPILER & GLM_COMPILER_CUDA
  433. # define GLM_DEPRECATED
  434. # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x)
  435. #else
  436. # define GLM_DEPRECATED
  437. # define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name
  438. #endif
  439. ///////////////////////////////////////////////////////////////////////////////////
  440. #ifdef GLM_FORCE_EXPLICIT_CTOR
  441. # define GLM_EXPLICIT explicit
  442. #else
  443. # define GLM_EXPLICIT
  444. #endif
  445. ///////////////////////////////////////////////////////////////////////////////////
  446. // Length type: all length functions returns a length_t type.
  447. // When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise
  448. // length_t is a typedef of int like GLSL defines it.
  449. #define GLM_LENGTH_INT 1
  450. #define GLM_LENGTH_SIZE_T 2
  451. #ifdef GLM_FORCE_SIZE_T_LENGTH
  452. # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T
  453. #else
  454. # define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT
  455. #endif
  456. namespace glm
  457. {
  458. using std::size_t;
  459. # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T
  460. typedef size_t length_t;
  461. # else
  462. typedef int length_t;
  463. # endif
  464. }//namespace glm
  465. ///////////////////////////////////////////////////////////////////////////////////
  466. // constexpr
  467. #if GLM_HAS_CONSTEXPR
  468. # define GLM_CONFIG_CONSTEXP GLM_ENABLE
  469. namespace glm
  470. {
  471. template<typename T, std::size_t N>
  472. constexpr std::size_t countof(T const (&)[N])
  473. {
  474. return N;
  475. }
  476. }//namespace glm
  477. # define GLM_COUNTOF(arr) glm::countof(arr)
  478. #elif defined(_MSC_VER)
  479. # define GLM_CONFIG_CONSTEXP GLM_DISABLE
  480. # define GLM_COUNTOF(arr) _countof(arr)
  481. #else
  482. # define GLM_CONFIG_CONSTEXP GLM_DISABLE
  483. # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0])
  484. #endif
  485. ///////////////////////////////////////////////////////////////////////////////////
  486. // uint
  487. namespace glm{
  488. namespace detail
  489. {
  490. template<typename T>
  491. struct is_int
  492. {
  493. enum test {value = 0};
  494. };
  495. template<>
  496. struct is_int<unsigned int>
  497. {
  498. enum test {value = ~0};
  499. };
  500. template<>
  501. struct is_int<signed int>
  502. {
  503. enum test {value = ~0};
  504. };
  505. }//namespace detail
  506. typedef unsigned int uint;
  507. }//namespace glm
  508. ///////////////////////////////////////////////////////////////////////////////////
  509. // 64-bit int
  510. #if GLM_HAS_EXTENDED_INTEGER_TYPE
  511. # include <cstdint>
  512. #endif
  513. namespace glm{
  514. namespace detail
  515. {
  516. # if GLM_HAS_EXTENDED_INTEGER_TYPE
  517. typedef std::uint64_t uint64;
  518. typedef std::int64_t int64;
  519. # elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
  520. typedef uint64_t uint64;
  521. typedef int64_t int64;
  522. # elif GLM_COMPILER & GLM_COMPILER_VC
  523. typedef unsigned __int64 uint64;
  524. typedef signed __int64 int64;
  525. # elif GLM_COMPILER & GLM_COMPILER_GCC
  526. # pragma GCC diagnostic ignored "-Wlong-long"
  527. __extension__ typedef unsigned long long uint64;
  528. __extension__ typedef signed long long int64;
  529. # elif (GLM_COMPILER & GLM_COMPILER_CLANG)
  530. # pragma clang diagnostic ignored "-Wc++11-long-long"
  531. typedef unsigned long long uint64;
  532. typedef signed long long int64;
  533. # else//unknown compiler
  534. typedef unsigned long long uint64;
  535. typedef signed long long int64;
  536. # endif
  537. }//namespace detail
  538. }//namespace glm
  539. ///////////////////////////////////////////////////////////////////////////////////
  540. // make_unsigned
  541. #if GLM_HAS_MAKE_SIGNED
  542. # include <type_traits>
  543. namespace glm{
  544. namespace detail
  545. {
  546. using std::make_unsigned;
  547. }//namespace detail
  548. }//namespace glm
  549. #else
  550. namespace glm{
  551. namespace detail
  552. {
  553. template<typename genType>
  554. struct make_unsigned
  555. {};
  556. template<>
  557. struct make_unsigned<char>
  558. {
  559. typedef unsigned char type;
  560. };
  561. template<>
  562. struct make_unsigned<short>
  563. {
  564. typedef unsigned short type;
  565. };
  566. template<>
  567. struct make_unsigned<int>
  568. {
  569. typedef unsigned int type;
  570. };
  571. template<>
  572. struct make_unsigned<long>
  573. {
  574. typedef unsigned long type;
  575. };
  576. template<>
  577. struct make_unsigned<int64>
  578. {
  579. typedef uint64 type;
  580. };
  581. template<>
  582. struct make_unsigned<unsigned char>
  583. {
  584. typedef unsigned char type;
  585. };
  586. template<>
  587. struct make_unsigned<unsigned short>
  588. {
  589. typedef unsigned short type;
  590. };
  591. template<>
  592. struct make_unsigned<unsigned int>
  593. {
  594. typedef unsigned int type;
  595. };
  596. template<>
  597. struct make_unsigned<unsigned long>
  598. {
  599. typedef unsigned long type;
  600. };
  601. template<>
  602. struct make_unsigned<uint64>
  603. {
  604. typedef uint64 type;
  605. };
  606. }//namespace detail
  607. }//namespace glm
  608. #endif
  609. ///////////////////////////////////////////////////////////////////////////////////
  610. // Only use x, y, z, w as vector type components
  611. #ifdef GLM_FORCE_XYZW_ONLY
  612. # define GLM_CONFIG_XYZW_ONLY GLM_ENABLE
  613. #else
  614. # define GLM_CONFIG_XYZW_ONLY GLM_DISABLE
  615. #endif
  616. ///////////////////////////////////////////////////////////////////////////////////
  617. // Configure the use of defaulted initialized types
  618. #define GLM_CTOR_INIT_DISABLE 0
  619. #define GLM_CTOR_INITIALIZER_LIST 1
  620. #define GLM_CTOR_INITIALISATION 2
  621. #if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
  622. # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST
  623. #elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
  624. # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION
  625. #else
  626. # define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE
  627. #endif
  628. ///////////////////////////////////////////////////////////////////////////////////
  629. // Use SIMD instruction sets
  630. #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)
  631. # define GLM_CONFIG_SIMD GLM_ENABLE
  632. #else
  633. # define GLM_CONFIG_SIMD GLM_DISABLE
  634. #endif
  635. ///////////////////////////////////////////////////////////////////////////////////
  636. // Configure the use of defaulted function
  637. #if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE
  638. # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE
  639. # define GLM_DEFAULT = default
  640. #else
  641. # define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE
  642. # define GLM_DEFAULT
  643. #endif
  644. ///////////////////////////////////////////////////////////////////////////////////
  645. // Configure the use of aligned gentypes
  646. #ifdef GLM_FORCE_ALIGNED // Legacy define
  647. # define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
  648. #endif
  649. #ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
  650. # define GLM_FORCE_ALIGNED_GENTYPES
  651. #endif
  652. #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE))
  653. # define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE
  654. #else
  655. # define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE
  656. #endif
  657. ///////////////////////////////////////////////////////////////////////////////////
  658. // Configure the use of anonymous structure as implementation detail
  659. #if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE))
  660. # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE
  661. #else
  662. # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE
  663. #endif
  664. ///////////////////////////////////////////////////////////////////////////////////
  665. // Silent warnings
  666. #ifdef GLM_FORCE_SILENT_WARNINGS
  667. # define GLM_SILENT_WARNINGS GLM_ENABLE
  668. #else
  669. # define GLM_SILENT_WARNINGS GLM_DISABLE
  670. #endif
  671. ///////////////////////////////////////////////////////////////////////////////////
  672. // Precision
  673. #define GLM_HIGHP 1
  674. #define GLM_MEDIUMP 2
  675. #define GLM_LOWP 3
  676. #if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL)
  677. # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP
  678. #elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL)
  679. # define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP
  680. #elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL)
  681. # define GLM_CONFIG_PRECISION_BOOL GLM_LOWP
  682. #else
  683. # define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP
  684. #endif
  685. #if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT)
  686. # define GLM_CONFIG_PRECISION_INT GLM_HIGHP
  687. #elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT)
  688. # define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP
  689. #elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT)
  690. # define GLM_CONFIG_PRECISION_INT GLM_LOWP
  691. #else
  692. # define GLM_CONFIG_PRECISION_INT GLM_HIGHP
  693. #endif
  694. #if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT)
  695. # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP
  696. #elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT)
  697. # define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP
  698. #elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT)
  699. # define GLM_CONFIG_PRECISION_UINT GLM_LOWP
  700. #else
  701. # define GLM_CONFIG_PRECISION_UINT GLM_HIGHP
  702. #endif
  703. #if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT)
  704. # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP
  705. #elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT)
  706. # define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP
  707. #elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT)
  708. # define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP
  709. #else
  710. # define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP
  711. #endif
  712. #if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE)
  713. # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP
  714. #elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE)
  715. # define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP
  716. #elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE)
  717. # define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP
  718. #else
  719. # define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP
  720. #endif
  721. ///////////////////////////////////////////////////////////////////////////////////
  722. // Check inclusions of different versions of GLM
  723. #elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION))
  724. # error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error."
  725. #elif GLM_SETUP_INCLUDED == GLM_VERSION
  726. ///////////////////////////////////////////////////////////////////////////////////
  727. // Messages
  728. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED)
  729. # define GLM_MESSAGE_DISPLAYED
  730. # define GLM_STR_HELPER(x) #x
  731. # define GLM_STR(x) GLM_STR_HELPER(x)
  732. // Report GLM version
  733. # pragma message (GLM_STR(GLM_VERSION_MESSAGE))
  734. // Report C++ language
  735. # if (GLM_LANG & GLM_LANG_CXX2A_FLAG) && (GLM_LANG & GLM_LANG_EXT)
  736. # pragma message("GLM: C++ 2A with extensions")
  737. # elif (GLM_LANG & GLM_LANG_CXX2A_FLAG)
  738. # pragma message("GLM: C++ 2A")
  739. # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT)
  740. # pragma message("GLM: C++ 17 with extensions")
  741. # elif (GLM_LANG & GLM_LANG_CXX17_FLAG)
  742. # pragma message("GLM: C++ 17")
  743. # elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT)
  744. # pragma message("GLM: C++ 14 with extensions")
  745. # elif (GLM_LANG & GLM_LANG_CXX14_FLAG)
  746. # pragma message("GLM: C++ 14")
  747. # elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT)
  748. # pragma message("GLM: C++ 11 with extensions")
  749. # elif (GLM_LANG & GLM_LANG_CXX11_FLAG)
  750. # pragma message("GLM: C++ 11")
  751. # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT)
  752. # pragma message("GLM: C++ 0x with extensions")
  753. # elif (GLM_LANG & GLM_LANG_CXX0X_FLAG)
  754. # pragma message("GLM: C++ 0x")
  755. # elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT)
  756. # pragma message("GLM: C++ 03 with extensions")
  757. # elif (GLM_LANG & GLM_LANG_CXX03_FLAG)
  758. # pragma message("GLM: C++ 03")
  759. # elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT)
  760. # pragma message("GLM: C++ 98 with extensions")
  761. # elif (GLM_LANG & GLM_LANG_CXX98_FLAG)
  762. # pragma message("GLM: C++ 98")
  763. # else
  764. # pragma message("GLM: C++ language undetected")
  765. # endif//GLM_LANG
  766. // Report compiler detection
  767. # if GLM_COMPILER & GLM_COMPILER_CUDA
  768. # pragma message("GLM: CUDA compiler detected")
  769. # elif GLM_COMPILER & GLM_COMPILER_VC
  770. # pragma message("GLM: Visual C++ compiler detected")
  771. # elif GLM_COMPILER & GLM_COMPILER_CLANG
  772. # pragma message("GLM: Clang compiler detected")
  773. # elif GLM_COMPILER & GLM_COMPILER_INTEL
  774. # pragma message("GLM: Intel Compiler detected")
  775. # elif GLM_COMPILER & GLM_COMPILER_GCC
  776. # pragma message("GLM: GCC compiler detected")
  777. # else
  778. # pragma message("GLM: Compiler not detected")
  779. # endif
  780. // Report build target
  781. # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64)
  782. # pragma message("GLM: x86 64 bits with AVX2 instruction set build target")
  783. # elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32)
  784. # pragma message("GLM: x86 32 bits with AVX2 instruction set build target")
  785. # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64)
  786. # pragma message("GLM: x86 64 bits with AVX instruction set build target")
  787. # elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32)
  788. # pragma message("GLM: x86 32 bits with AVX instruction set build target")
  789. # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64)
  790. # pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target")
  791. # elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32)
  792. # pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target")
  793. # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64)
  794. # pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target")
  795. # elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32)
  796. # pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target")
  797. # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64)
  798. # pragma message("GLM: x86 64 bits with SSSE3 instruction set build target")
  799. # elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32)
  800. # pragma message("GLM: x86 32 bits with SSSE3 instruction set build target")
  801. # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64)
  802. # pragma message("GLM: x86 64 bits with SSE3 instruction set build target")
  803. # elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32)
  804. # pragma message("GLM: x86 32 bits with SSE3 instruction set build target")
  805. # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64)
  806. # pragma message("GLM: x86 64 bits with SSE2 instruction set build target")
  807. # elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32)
  808. # pragma message("GLM: x86 32 bits with SSE2 instruction set build target")
  809. # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64)
  810. # pragma message("GLM: x86 64 bits build target")
  811. # elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32)
  812. # pragma message("GLM: x86 32 bits build target")
  813. # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64)
  814. # pragma message("GLM: ARM 64 bits with Neon instruction set build target")
  815. # elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32)
  816. # pragma message("GLM: ARM 32 bits with Neon instruction set build target")
  817. # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64)
  818. # pragma message("GLM: ARM 64 bits build target")
  819. # elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32)
  820. # pragma message("GLM: ARM 32 bits build target")
  821. # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64)
  822. # pragma message("GLM: MIPS 64 bits build target")
  823. # elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32)
  824. # pragma message("GLM: MIPS 32 bits build target")
  825. # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64)
  826. # pragma message("GLM: PowerPC 64 bits build target")
  827. # elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32)
  828. # pragma message("GLM: PowerPC 32 bits build target")
  829. # else
  830. # pragma message("GLM: Unknown build target")
  831. # endif//GLM_ARCH
  832. // Report platform name
  833. # if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO)
  834. # pragma message("GLM: QNX platform detected")
  835. //# elif(GLM_PLATFORM & GLM_PLATFORM_IOS)
  836. //# pragma message("GLM: iOS platform detected")
  837. # elif(GLM_PLATFORM & GLM_PLATFORM_APPLE)
  838. # pragma message("GLM: Apple platform detected")
  839. # elif(GLM_PLATFORM & GLM_PLATFORM_WINCE)
  840. # pragma message("GLM: WinCE platform detected")
  841. # elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
  842. # pragma message("GLM: Windows platform detected")
  843. # elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL)
  844. # pragma message("GLM: Native Client detected")
  845. # elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
  846. # pragma message("GLM: Android platform detected")
  847. # elif(GLM_PLATFORM & GLM_PLATFORM_LINUX)
  848. # pragma message("GLM: Linux platform detected")
  849. # elif(GLM_PLATFORM & GLM_PLATFORM_UNIX)
  850. # pragma message("GLM: UNIX platform detected")
  851. # elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN)
  852. # pragma message("GLM: platform unknown")
  853. # else
  854. # pragma message("GLM: platform not detected")
  855. # endif
  856. // Report whether only xyzw component are used
  857. # if defined GLM_FORCE_XYZW_ONLY
  858. # pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.")
  859. # endif
  860. // Report swizzle operator support
  861. # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
  862. # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.")
  863. # elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
  864. # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.")
  865. # else
  866. # pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.")
  867. # endif
  868. // Report .length() type
  869. # if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T
  870. # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.")
  871. # else
  872. # pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.")
  873. # endif
  874. # if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE
  875. # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.")
  876. # else
  877. # pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.")
  878. # endif
  879. # if GLM_SILENT_WARNINGS == GLM_ENABLE
  880. # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is defined. Ignores C++ warnings from using C++ language extensions.")
  881. # else
  882. # pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is undefined. Shows C++ warnings from using C++ language extensions.")
  883. # endif
  884. # ifdef GLM_FORCE_SINGLE_ONLY
  885. # pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.")
  886. # endif
  887. # if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)
  888. # undef GLM_FORCE_ALIGNED_GENTYPES
  889. # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.")
  890. # elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE)
  891. # undef GLM_FORCE_ALIGNED_GENTYPES
  892. # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.")
  893. # endif
  894. # if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
  895. # if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE
  896. # undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
  897. # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.")
  898. # elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
  899. # pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.")
  900. # endif
  901. # endif
  902. # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
  903. # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.")
  904. # else
  905. # pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.")
  906. # endif
  907. # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
  908. # pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.")
  909. # else
  910. # pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.")
  911. # endif
  912. #endif//GLM_MESSAGES
  913. #endif//GLM_SETUP_INCLUDED