gcc.hpp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. // (C) Copyright John Maddock 2001 - 2003.
  2. // (C) Copyright Darin Adler 2001 - 2002.
  3. // (C) Copyright Jens Maurer 2001 - 2002.
  4. // (C) Copyright Beman Dawes 2001 - 2003.
  5. // (C) Copyright Douglas Gregor 2002.
  6. // (C) Copyright David Abrahams 2002 - 2003.
  7. // (C) Copyright Synge Todo 2003.
  8. // Use, modification and distribution are subject to the
  9. // Boost Software License, Version 1.0. (See accompanying file
  10. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  11. // See http://www.boost.org for most recent version.
  12. // GNU C++ compiler setup:
  13. #if __GNUC__ < 3
  14. # if __GNUC_MINOR__ == 91
  15. // egcs 1.1 won't parse shared_ptr.hpp without this:
  16. # define BOOST_NO_AUTO_PTR
  17. # endif
  18. # if __GNUC_MINOR__ < 95
  19. //
  20. // Prior to gcc 2.95 member templates only partly
  21. // work - define BOOST_MSVC6_MEMBER_TEMPLATES
  22. // instead since inline member templates mostly work.
  23. //
  24. # define BOOST_NO_MEMBER_TEMPLATES
  25. # if __GNUC_MINOR__ >= 9
  26. # define BOOST_MSVC6_MEMBER_TEMPLATES
  27. # endif
  28. # endif
  29. # if __GNUC_MINOR__ < 96
  30. # define BOOST_NO_SFINAE
  31. # endif
  32. # if __GNUC_MINOR__ <= 97
  33. # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
  34. # define BOOST_NO_OPERATORS_IN_NAMESPACE
  35. # endif
  36. # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
  37. # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
  38. # define BOOST_NO_IS_ABSTRACT
  39. #elif __GNUC__ == 3
  40. # if defined (__PATHSCALE__)
  41. # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  42. # define BOOST_NO_IS_ABSTRACT
  43. # endif
  44. //
  45. // gcc-3.x problems:
  46. //
  47. // Bug specific to gcc 3.1 and 3.2:
  48. //
  49. # if ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2))
  50. # define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
  51. # endif
  52. # if __GNUC_MINOR__ < 4
  53. # define BOOST_NO_IS_ABSTRACT
  54. # endif
  55. #endif
  56. #if __GNUC__ < 4
  57. //
  58. // All problems to gcc-3.x and earlier here:
  59. //
  60. #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
  61. #endif
  62. #ifndef __EXCEPTIONS
  63. # define BOOST_NO_EXCEPTIONS
  64. #endif
  65. //
  66. // Threading support: Turn this on unconditionally here (except for
  67. // those platforms where we can know for sure). It will get turned off again
  68. // later if no threading API is detected.
  69. //
  70. #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
  71. # define BOOST_HAS_THREADS
  72. #endif
  73. //
  74. // gcc has "long long"
  75. //
  76. #define BOOST_HAS_LONG_LONG
  77. //
  78. // gcc implements the named return value optimization since version 3.1
  79. //
  80. #if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 )
  81. #define BOOST_HAS_NRVO
  82. #endif
  83. //
  84. // RTTI and typeinfo detection is possible post gcc-4.3:
  85. //
  86. #if __GNUC__ * 100 + __GNUC_MINOR__ >= 403
  87. # ifndef __GXX_RTTI
  88. # define BOOST_NO_TYPEID
  89. # define BOOST_NO_RTTI
  90. # endif
  91. #endif
  92. // C++0x features not implemented in any GCC version
  93. //
  94. #define BOOST_NO_CONSTEXPR
  95. #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
  96. #define BOOST_NO_EXTERN_TEMPLATE
  97. #define BOOST_NO_LAMBDAS
  98. #define BOOST_NO_NULLPTR
  99. #define BOOST_NO_RAW_LITERALS
  100. // scoped enums have a serious bug in 4.4.0, so define BOOST_NO_SCOPED_ENUMS until it
  101. // gets fixed. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
  102. #define BOOST_NO_SCOPED_ENUMS
  103. #define BOOST_NO_TEMPLATE_ALIASES
  104. // C++0x features in 4.3.n and later
  105. //
  106. #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
  107. // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
  108. // passed on the command line, which in turn defines
  109. // __GXX_EXPERIMENTAL_CXX0X__.
  110. # define BOOST_HAS_DECLTYPE
  111. # define BOOST_HAS_RVALUE_REFS
  112. # define BOOST_HAS_STATIC_ASSERT
  113. # define BOOST_HAS_VARIADIC_TMPL
  114. #else
  115. # define BOOST_NO_DECLTYPE
  116. # define BOOST_NO_RVALUE_REFERENCES
  117. # define BOOST_NO_STATIC_ASSERT
  118. // Variadic templates compiler:
  119. // http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
  120. # ifdef __VARIADIC_TEMPLATES
  121. # define BOOST_HAS_VARIADIC_TMPL
  122. # else
  123. # define BOOST_NO_VARIADIC_TEMPLATES
  124. # endif
  125. #endif
  126. // C++0x features in 4.4.n and later
  127. //
  128. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
  129. # define BOOST_NO_AUTO_DECLARATIONS
  130. # define BOOST_NO_AUTO_MULTIDECLARATIONS
  131. # define BOOST_NO_CHAR16_T
  132. # define BOOST_NO_CHAR32_T
  133. # define BOOST_NO_DEFAULTED_FUNCTIONS
  134. # define BOOST_NO_DELETED_FUNCTIONS
  135. # define BOOST_NO_INITIALIZER_LISTS
  136. # define BOOST_NO_SCOPED_ENUMS
  137. # define BOOST_NO_UNICODE_LITERALS
  138. #endif
  139. // ConceptGCC compiler:
  140. // http://www.generic-programming.org/software/ConceptGCC/
  141. #ifdef __GXX_CONCEPTS__
  142. # define BOOST_HAS_CONCEPTS
  143. # define BOOST_COMPILER "ConceptGCC version " __VERSION__
  144. #else
  145. # define BOOST_NO_CONCEPTS
  146. #endif
  147. #ifndef BOOST_COMPILER
  148. # define BOOST_COMPILER "GNU C++ version " __VERSION__
  149. #endif
  150. //
  151. // versions check:
  152. // we don't know gcc prior to version 2.90:
  153. #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90)
  154. # error "Compiler not configured - please reconfigure"
  155. #endif
  156. //
  157. // last known and checked version is 4.3 (Pre-release):
  158. #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 3))
  159. # if defined(BOOST_ASSERT_CONFIG)
  160. # error "Unknown compiler version - please run the configure tests and report the results"
  161. # else
  162. // we don't emit warnings here anymore since there are no defect macros defined for
  163. // gcc post 3.4, so any failures are gcc regressions...
  164. //# warning "Unknown compiler version - please run the configure tests and report the results"
  165. # endif
  166. #endif