_features.hpp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. ///////////////////////////////////////////////////////////////////////////////////
  2. /// OpenGL Mathematics (glm.g-truc.net)
  3. ///
  4. /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
  5. /// Permission is hereby granted, free of charge, to any person obtaining a copy
  6. /// of this software and associated documentation files (the "Software"), to deal
  7. /// in the Software without restriction, including without limitation the rights
  8. /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. /// copies of the Software, and to permit persons to whom the Software is
  10. /// furnished to do so, subject to the following conditions:
  11. ///
  12. /// The above copyright notice and this permission notice shall be included in
  13. /// all copies or substantial portions of the Software.
  14. ///
  15. /// Restrictions:
  16. /// By making use of the Software for military purposes, you choose to make
  17. /// a Bunny unhappy.
  18. ///
  19. /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. /// THE SOFTWARE.
  26. ///
  27. /// @ref core
  28. /// @file glm/detail/_features.hpp
  29. /// @date 2013-02-20 / 2013-02-20
  30. /// @author Christophe Riccio
  31. ///////////////////////////////////////////////////////////////////////////////////
  32. #pragma once
  33. // #define GLM_CXX98_EXCEPTIONS
  34. // #define GLM_CXX98_RTTI
  35. // #define GLM_CXX11_RVALUE_REFERENCES
  36. // Rvalue references - GCC 4.3
  37. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
  38. // GLM_CXX11_TRAILING_RETURN
  39. // Rvalue references for *this - GCC not supported
  40. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm
  41. // GLM_CXX11_NONSTATIC_MEMBER_INIT
  42. // Initialization of class objects by rvalues - GCC any
  43. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html
  44. // GLM_CXX11_NONSTATIC_MEMBER_INIT
  45. // Non-static data member initializers - GCC 4.7
  46. // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm
  47. // #define GLM_CXX11_VARIADIC_TEMPLATE
  48. // Variadic templates - GCC 4.3
  49. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf
  50. //
  51. // Extending variadic template template parameters - GCC 4.4
  52. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
  53. // #define GLM_CXX11_GENERALIZED_INITIALIZERS
  54. // Initializer lists - GCC 4.4
  55. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
  56. // #define GLM_CXX11_STATIC_ASSERT
  57. // Static assertions - GCC 4.3
  58. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
  59. // #define GLM_CXX11_AUTO_TYPE
  60. // auto-typed variables - GCC 4.4
  61. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
  62. // #define GLM_CXX11_AUTO_TYPE
  63. // Multi-declarator auto - GCC 4.4
  64. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf
  65. // #define GLM_CXX11_AUTO_TYPE
  66. // Removal of auto as a storage-class specifier - GCC 4.4
  67. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm
  68. // #define GLM_CXX11_AUTO_TYPE
  69. // New function declarator syntax - GCC 4.4
  70. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
  71. // #define GLM_CXX11_LAMBDAS
  72. // New wording for C++0x lambdas - GCC 4.5
  73. // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf
  74. // #define GLM_CXX11_DECLTYPE
  75. // Declared type of an expression - GCC 4.3
  76. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
  77. //
  78. // Right angle brackets - GCC 4.3
  79. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
  80. //
  81. // Default template arguments for function templates DR226 GCC 4.3
  82. // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
  83. //
  84. // Solving the SFINAE problem for expressions DR339 GCC 4.4
  85. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html
  86. // #define GLM_CXX11_ALIAS_TEMPLATE
  87. // Template aliases N2258 GCC 4.7
  88. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
  89. //
  90. // Extern templates N1987 Yes
  91. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
  92. // #define GLM_CXX11_NULLPTR
  93. // Null pointer constant N2431 GCC 4.6
  94. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
  95. // #define GLM_CXX11_STRONG_ENUMS
  96. // Strongly-typed enums N2347 GCC 4.4
  97. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
  98. //
  99. // Forward declarations for enums N2764 GCC 4.6
  100. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
  101. //
  102. // Generalized attributes N2761 GCC 4.8
  103. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
  104. //
  105. // Generalized constant expressions N2235 GCC 4.6
  106. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
  107. //
  108. // Alignment support N2341 GCC 4.8
  109. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
  110. // #define GLM_CXX11_DELEGATING_CONSTRUCTORS
  111. // Delegating constructors N1986 GCC 4.7
  112. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
  113. //
  114. // Inheriting constructors N2540 GCC 4.8
  115. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
  116. // #define GLM_CXX11_EXPLICIT_CONVERSIONS
  117. // Explicit conversion operators N2437 GCC 4.5
  118. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
  119. //
  120. // New character types N2249 GCC 4.4
  121. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html
  122. //
  123. // Unicode string literals N2442 GCC 4.5
  124. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
  125. //
  126. // Raw string literals N2442 GCC 4.5
  127. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
  128. //
  129. // Universal character name literals N2170 GCC 4.5
  130. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
  131. // #define GLM_CXX11_USER_LITERALS
  132. // User-defined literals N2765 GCC 4.7
  133. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
  134. //
  135. // Standard Layout Types N2342 GCC 4.5
  136. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm
  137. // #define GLM_CXX11_DEFAULTED_FUNCTIONS
  138. // #define GLM_CXX11_DELETED_FUNCTIONS
  139. // Defaulted and deleted functions N2346 GCC 4.4
  140. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
  141. //
  142. // Extended friend declarations N1791 GCC 4.7
  143. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
  144. //
  145. // Extending sizeof N2253 GCC 4.4
  146. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
  147. // #define GLM_CXX11_INLINE_NAMESPACES
  148. // Inline namespaces N2535 GCC 4.4
  149. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
  150. // #define GLM_CXX11_UNRESTRICTED_UNIONS
  151. // Unrestricted unions N2544 GCC 4.6
  152. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
  153. // #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS
  154. // Local and unnamed types as template arguments N2657 GCC 4.5
  155. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
  156. // #define GLM_CXX11_RANGE_FOR
  157. // Range-based for N2930 GCC 4.6
  158. // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html
  159. // #define GLM_CXX11_OVERRIDE_CONTROL
  160. // Explicit virtual overrides N2928 N3206 N3272 GCC 4.7
  161. // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
  162. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
  163. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
  164. //
  165. // Minimal support for garbage collection and reachability-based leak detection N2670 No
  166. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm
  167. // #define GLM_CXX11_NOEXCEPT
  168. // Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only)
  169. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
  170. //
  171. // Defining move special member functions N3053 GCC 4.6
  172. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html
  173. //
  174. // Sequence points N2239 Yes
  175. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
  176. //
  177. // Atomic operations N2427 GCC 4.4
  178. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
  179. //
  180. // Strong Compare and Exchange N2748 GCC 4.5
  181. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
  182. //
  183. // Bidirectional Fences N2752 GCC 4.8
  184. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm
  185. //
  186. // Memory model N2429 GCC 4.8
  187. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm
  188. //
  189. // Data-dependency ordering: atomics and memory model N2664 GCC 4.4
  190. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm
  191. //
  192. // Propagating exceptions N2179 GCC 4.4
  193. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html
  194. //
  195. // Abandoning a process and at_quick_exit N2440 GCC 4.8
  196. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm
  197. //
  198. // Allow atomics use in signal handlers N2547 Yes
  199. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm
  200. //
  201. // Thread-local storage N2659 GCC 4.8
  202. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
  203. //
  204. // Dynamic initialization and destruction with concurrency N2660 GCC 4.3
  205. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm
  206. //
  207. // __func__ predefined identifier N2340 GCC 4.3
  208. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
  209. //
  210. // C99 preprocessor N1653 GCC 4.3
  211. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
  212. //
  213. // long long N1811 GCC 4.3
  214. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
  215. //
  216. // Extended integral types N1988 Yes
  217. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf
  218. #if(GLM_COMPILER & GLM_COMPILER_GCC)
  219. # if(GLM_COMPILER >= GLM_COMPILER_GCC43)
  220. # define GLM_CXX11_STATIC_ASSERT
  221. # endif
  222. #elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
  223. # if(__has_feature(cxx_exceptions))
  224. # define GLM_CXX98_EXCEPTIONS
  225. # endif
  226. # if(__has_feature(cxx_rtti))
  227. # define GLM_CXX98_RTTI
  228. # endif
  229. # if(__has_feature(cxx_access_control_sfinae))
  230. # define GLM_CXX11_ACCESS_CONTROL_SFINAE
  231. # endif
  232. # if(__has_feature(cxx_alias_templates))
  233. # define GLM_CXX11_ALIAS_TEMPLATE
  234. # endif
  235. # if(__has_feature(cxx_alignas))
  236. # define GLM_CXX11_ALIGNAS
  237. # endif
  238. # if(__has_feature(cxx_attributes))
  239. # define GLM_CXX11_ATTRIBUTES
  240. # endif
  241. # if(__has_feature(cxx_constexpr))
  242. # define GLM_CXX11_CONSTEXPR
  243. # endif
  244. # if(__has_feature(cxx_decltype))
  245. # define GLM_CXX11_DECLTYPE
  246. # endif
  247. # if(__has_feature(cxx_default_function_template_args))
  248. # define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS
  249. # endif
  250. # if(__has_feature(cxx_defaulted_functions))
  251. # define GLM_CXX11_DEFAULTED_FUNCTIONS
  252. # endif
  253. # if(__has_feature(cxx_delegating_constructors))
  254. # define GLM_CXX11_DELEGATING_CONSTRUCTORS
  255. # endif
  256. # if(__has_feature(cxx_deleted_functions))
  257. # define GLM_CXX11_DELETED_FUNCTIONS
  258. # endif
  259. # if(__has_feature(cxx_explicit_conversions))
  260. # define GLM_CXX11_EXPLICIT_CONVERSIONS
  261. # endif
  262. # if(__has_feature(cxx_generalized_initializers))
  263. # define GLM_CXX11_GENERALIZED_INITIALIZERS
  264. # endif
  265. # if(__has_feature(cxx_implicit_moves))
  266. # define GLM_CXX11_IMPLICIT_MOVES
  267. # endif
  268. # if(__has_feature(cxx_inheriting_constructors))
  269. # define GLM_CXX11_INHERITING_CONSTRUCTORS
  270. # endif
  271. # if(__has_feature(cxx_inline_namespaces))
  272. # define GLM_CXX11_INLINE_NAMESPACES
  273. # endif
  274. # if(__has_feature(cxx_lambdas))
  275. # define GLM_CXX11_LAMBDAS
  276. # endif
  277. # if(__has_feature(cxx_local_type_template_args))
  278. # define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS
  279. # endif
  280. # if(__has_feature(cxx_noexcept))
  281. # define GLM_CXX11_NOEXCEPT
  282. # endif
  283. # if(__has_feature(cxx_nonstatic_member_init))
  284. # define GLM_CXX11_NONSTATIC_MEMBER_INIT
  285. # endif
  286. # if(__has_feature(cxx_nullptr))
  287. # define GLM_CXX11_NULLPTR
  288. # endif
  289. # if(__has_feature(cxx_override_control))
  290. # define GLM_CXX11_OVERRIDE_CONTROL
  291. # endif
  292. # if(__has_feature(cxx_reference_qualified_functions))
  293. # define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS
  294. # endif
  295. # if(__has_feature(cxx_range_for))
  296. # define GLM_CXX11_RANGE_FOR
  297. # endif
  298. # if(__has_feature(cxx_raw_string_literals))
  299. # define GLM_CXX11_RAW_STRING_LITERALS
  300. # endif
  301. # if(__has_feature(cxx_rvalue_references))
  302. # define GLM_CXX11_RVALUE_REFERENCES
  303. # endif
  304. # if(__has_feature(cxx_static_assert))
  305. # define GLM_CXX11_STATIC_ASSERT
  306. # endif
  307. # if(__has_feature(cxx_auto_type))
  308. # define GLM_CXX11_AUTO_TYPE
  309. # endif
  310. # if(__has_feature(cxx_strong_enums))
  311. # define GLM_CXX11_STRONG_ENUMS
  312. # endif
  313. # if(__has_feature(cxx_trailing_return))
  314. # define GLM_CXX11_TRAILING_RETURN
  315. # endif
  316. # if(__has_feature(cxx_unicode_literals))
  317. # define GLM_CXX11_UNICODE_LITERALS
  318. # endif
  319. # if(__has_feature(cxx_unrestricted_unions))
  320. # define GLM_CXX11_UNRESTRICTED_UNIONS
  321. # endif
  322. # if(__has_feature(cxx_user_literals))
  323. # define GLM_CXX11_USER_LITERALS
  324. # endif
  325. # if(__has_feature(cxx_variadic_templates))
  326. # define GLM_CXX11_VARIADIC_TEMPLATES
  327. # endif
  328. #endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))