_features.hpp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. #pragma once
  2. // #define GLM_CXX98_EXCEPTIONS
  3. // #define GLM_CXX98_RTTI
  4. // #define GLM_CXX11_RVALUE_REFERENCES
  5. // Rvalue references - GCC 4.3
  6. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
  7. // GLM_CXX11_TRAILING_RETURN
  8. // Rvalue references for *this - GCC not supported
  9. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm
  10. // GLM_CXX11_NONSTATIC_MEMBER_INIT
  11. // Initialization of class objects by rvalues - GCC any
  12. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html
  13. // GLM_CXX11_NONSTATIC_MEMBER_INIT
  14. // Non-static data member initializers - GCC 4.7
  15. // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm
  16. // #define GLM_CXX11_VARIADIC_TEMPLATE
  17. // Variadic templates - GCC 4.3
  18. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf
  19. //
  20. // Extending variadic template template parameters - GCC 4.4
  21. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf
  22. // #define GLM_CXX11_GENERALIZED_INITIALIZERS
  23. // Initializer lists - GCC 4.4
  24. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
  25. // #define GLM_CXX11_STATIC_ASSERT
  26. // Static assertions - GCC 4.3
  27. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html
  28. // #define GLM_CXX11_AUTO_TYPE
  29. // auto-typed variables - GCC 4.4
  30. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
  31. // #define GLM_CXX11_AUTO_TYPE
  32. // Multi-declarator auto - GCC 4.4
  33. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf
  34. // #define GLM_CXX11_AUTO_TYPE
  35. // Removal of auto as a storage-class specifier - GCC 4.4
  36. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm
  37. // #define GLM_CXX11_AUTO_TYPE
  38. // New function declarator syntax - GCC 4.4
  39. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
  40. // #define GLM_CXX11_LAMBDAS
  41. // New wording for C++0x lambdas - GCC 4.5
  42. // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf
  43. // #define GLM_CXX11_DECLTYPE
  44. // Declared type of an expression - GCC 4.3
  45. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf
  46. //
  47. // Right angle brackets - GCC 4.3
  48. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html
  49. //
  50. // Default template arguments for function templates DR226 GCC 4.3
  51. // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226
  52. //
  53. // Solving the SFINAE problem for expressions DR339 GCC 4.4
  54. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html
  55. // #define GLM_CXX11_ALIAS_TEMPLATE
  56. // Template aliases N2258 GCC 4.7
  57. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
  58. //
  59. // Extern templates N1987 Yes
  60. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
  61. // #define GLM_CXX11_NULLPTR
  62. // Null pointer constant N2431 GCC 4.6
  63. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
  64. // #define GLM_CXX11_STRONG_ENUMS
  65. // Strongly-typed enums N2347 GCC 4.4
  66. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf
  67. //
  68. // Forward declarations for enums N2764 GCC 4.6
  69. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf
  70. //
  71. // Generalized attributes N2761 GCC 4.8
  72. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf
  73. //
  74. // Generalized constant expressions N2235 GCC 4.6
  75. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
  76. //
  77. // Alignment support N2341 GCC 4.8
  78. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
  79. // #define GLM_CXX11_DELEGATING_CONSTRUCTORS
  80. // Delegating constructors N1986 GCC 4.7
  81. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf
  82. //
  83. // Inheriting constructors N2540 GCC 4.8
  84. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
  85. // #define GLM_CXX11_EXPLICIT_CONVERSIONS
  86. // Explicit conversion operators N2437 GCC 4.5
  87. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
  88. //
  89. // New character types N2249 GCC 4.4
  90. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html
  91. //
  92. // Unicode string literals N2442 GCC 4.5
  93. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
  94. //
  95. // Raw string literals N2442 GCC 4.5
  96. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm
  97. //
  98. // Universal character name literals N2170 GCC 4.5
  99. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
  100. // #define GLM_CXX11_USER_LITERALS
  101. // User-defined literals N2765 GCC 4.7
  102. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
  103. //
  104. // Standard Layout Types N2342 GCC 4.5
  105. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm
  106. // #define GLM_CXX11_DEFAULTED_FUNCTIONS
  107. // #define GLM_CXX11_DELETED_FUNCTIONS
  108. // Defaulted and deleted functions N2346 GCC 4.4
  109. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
  110. //
  111. // Extended friend declarations N1791 GCC 4.7
  112. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
  113. //
  114. // Extending sizeof N2253 GCC 4.4
  115. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
  116. // #define GLM_CXX11_INLINE_NAMESPACES
  117. // Inline namespaces N2535 GCC 4.4
  118. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
  119. // #define GLM_CXX11_UNRESTRICTED_UNIONS
  120. // Unrestricted unions N2544 GCC 4.6
  121. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
  122. // #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS
  123. // Local and unnamed types as template arguments N2657 GCC 4.5
  124. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm
  125. // #define GLM_CXX11_RANGE_FOR
  126. // Range-based for N2930 GCC 4.6
  127. // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html
  128. // #define GLM_CXX11_OVERRIDE_CONTROL
  129. // Explicit virtual overrides N2928 N3206 N3272 GCC 4.7
  130. // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
  131. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
  132. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
  133. //
  134. // Minimal support for garbage collection and reachability-based leak detection N2670 No
  135. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm
  136. // #define GLM_CXX11_NOEXCEPT
  137. // Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only)
  138. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html
  139. //
  140. // Defining move special member functions N3053 GCC 4.6
  141. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html
  142. //
  143. // Sequence points N2239 Yes
  144. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
  145. //
  146. // Atomic operations N2427 GCC 4.4
  147. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html
  148. //
  149. // Strong Compare and Exchange N2748 GCC 4.5
  150. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
  151. //
  152. // Bidirectional Fences N2752 GCC 4.8
  153. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm
  154. //
  155. // Memory model N2429 GCC 4.8
  156. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm
  157. //
  158. // Data-dependency ordering: atomics and memory model N2664 GCC 4.4
  159. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm
  160. //
  161. // Propagating exceptions N2179 GCC 4.4
  162. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html
  163. //
  164. // Abandoning a process and at_quick_exit N2440 GCC 4.8
  165. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm
  166. //
  167. // Allow atomics use in signal handlers N2547 Yes
  168. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm
  169. //
  170. // Thread-local storage N2659 GCC 4.8
  171. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
  172. //
  173. // Dynamic initialization and destruction with concurrency N2660 GCC 4.3
  174. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm
  175. //
  176. // __func__ predefined identifier N2340 GCC 4.3
  177. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm
  178. //
  179. // C99 preprocessor N1653 GCC 4.3
  180. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm
  181. //
  182. // long long N1811 GCC 4.3
  183. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf
  184. //
  185. // Extended integral types N1988 Yes
  186. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf
  187. #if(GLM_COMPILER & GLM_COMPILER_GCC)
  188. # define GLM_CXX11_STATIC_ASSERT
  189. #elif(GLM_COMPILER & GLM_COMPILER_CLANG)
  190. # if(__has_feature(cxx_exceptions))
  191. # define GLM_CXX98_EXCEPTIONS
  192. # endif
  193. # if(__has_feature(cxx_rtti))
  194. # define GLM_CXX98_RTTI
  195. # endif
  196. # if(__has_feature(cxx_access_control_sfinae))
  197. # define GLM_CXX11_ACCESS_CONTROL_SFINAE
  198. # endif
  199. # if(__has_feature(cxx_alias_templates))
  200. # define GLM_CXX11_ALIAS_TEMPLATE
  201. # endif
  202. # if(__has_feature(cxx_alignas))
  203. # define GLM_CXX11_ALIGNAS
  204. # endif
  205. # if(__has_feature(cxx_attributes))
  206. # define GLM_CXX11_ATTRIBUTES
  207. # endif
  208. # if(__has_feature(cxx_constexpr))
  209. # define GLM_CXX11_CONSTEXPR
  210. # endif
  211. # if(__has_feature(cxx_decltype))
  212. # define GLM_CXX11_DECLTYPE
  213. # endif
  214. # if(__has_feature(cxx_default_function_template_args))
  215. # define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS
  216. # endif
  217. # if(__has_feature(cxx_defaulted_functions))
  218. # define GLM_CXX11_DEFAULTED_FUNCTIONS
  219. # endif
  220. # if(__has_feature(cxx_delegating_constructors))
  221. # define GLM_CXX11_DELEGATING_CONSTRUCTORS
  222. # endif
  223. # if(__has_feature(cxx_deleted_functions))
  224. # define GLM_CXX11_DELETED_FUNCTIONS
  225. # endif
  226. # if(__has_feature(cxx_explicit_conversions))
  227. # define GLM_CXX11_EXPLICIT_CONVERSIONS
  228. # endif
  229. # if(__has_feature(cxx_generalized_initializers))
  230. # define GLM_CXX11_GENERALIZED_INITIALIZERS
  231. # endif
  232. # if(__has_feature(cxx_implicit_moves))
  233. # define GLM_CXX11_IMPLICIT_MOVES
  234. # endif
  235. # if(__has_feature(cxx_inheriting_constructors))
  236. # define GLM_CXX11_INHERITING_CONSTRUCTORS
  237. # endif
  238. # if(__has_feature(cxx_inline_namespaces))
  239. # define GLM_CXX11_INLINE_NAMESPACES
  240. # endif
  241. # if(__has_feature(cxx_lambdas))
  242. # define GLM_CXX11_LAMBDAS
  243. # endif
  244. # if(__has_feature(cxx_local_type_template_args))
  245. # define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS
  246. # endif
  247. # if(__has_feature(cxx_noexcept))
  248. # define GLM_CXX11_NOEXCEPT
  249. # endif
  250. # if(__has_feature(cxx_nonstatic_member_init))
  251. # define GLM_CXX11_NONSTATIC_MEMBER_INIT
  252. # endif
  253. # if(__has_feature(cxx_nullptr))
  254. # define GLM_CXX11_NULLPTR
  255. # endif
  256. # if(__has_feature(cxx_override_control))
  257. # define GLM_CXX11_OVERRIDE_CONTROL
  258. # endif
  259. # if(__has_feature(cxx_reference_qualified_functions))
  260. # define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS
  261. # endif
  262. # if(__has_feature(cxx_range_for))
  263. # define GLM_CXX11_RANGE_FOR
  264. # endif
  265. # if(__has_feature(cxx_raw_string_literals))
  266. # define GLM_CXX11_RAW_STRING_LITERALS
  267. # endif
  268. # if(__has_feature(cxx_rvalue_references))
  269. # define GLM_CXX11_RVALUE_REFERENCES
  270. # endif
  271. # if(__has_feature(cxx_static_assert))
  272. # define GLM_CXX11_STATIC_ASSERT
  273. # endif
  274. # if(__has_feature(cxx_auto_type))
  275. # define GLM_CXX11_AUTO_TYPE
  276. # endif
  277. # if(__has_feature(cxx_strong_enums))
  278. # define GLM_CXX11_STRONG_ENUMS
  279. # endif
  280. # if(__has_feature(cxx_trailing_return))
  281. # define GLM_CXX11_TRAILING_RETURN
  282. # endif
  283. # if(__has_feature(cxx_unicode_literals))
  284. # define GLM_CXX11_UNICODE_LITERALS
  285. # endif
  286. # if(__has_feature(cxx_unrestricted_unions))
  287. # define GLM_CXX11_UNRESTRICTED_UNIONS
  288. # endif
  289. # if(__has_feature(cxx_user_literals))
  290. # define GLM_CXX11_USER_LITERALS
  291. # endif
  292. # if(__has_feature(cxx_variadic_templates))
  293. # define GLM_CXX11_VARIADIC_TEMPLATES
  294. # endif
  295. #endif//(GLM_COMPILER & GLM_COMPILER_CLANG)