config.hpp 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*=============================================================================
  2. Copyright (c) 2001-2003 Joel de Guzman
  3. http://spirit.sourceforge.net/
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. =============================================================================*/
  7. #if !defined(BOOST_SPIRIT_CONFIG_HPP)
  8. #define BOOST_SPIRIT_CONFIG_HPP
  9. #include <boost/config.hpp>
  10. ///////////////////////////////////////////////////////////////////////////////
  11. //
  12. // Compiler check:
  13. //
  14. // Historically, Spirit supported a lot of compilers, including (to some
  15. // extent) poorly conforming compilers such as VC6. Spirit v1.6.x will be
  16. // the last release that will support older poorly conforming compilers.
  17. // Starting from Spirit v1.8.0, ill conforming compilers will not be
  18. // supported. If you are still using one of these older compilers, you can
  19. // still use Spirit v1.6.x.
  20. //
  21. // The reason why Spirit v1.6.x worked on old non-conforming compilers is
  22. // that the authors laboriously took the trouble of searching for
  23. // workarounds to make these compilers happy. The process takes a lot of
  24. // time and energy, especially when one encounters the dreaded ICE or
  25. // "Internal Compiler Error". Sometimes searching for a single workaround
  26. // takes days or even weeks. Sometimes, there are no known workarounds. This
  27. // stifles progress a lot. And, as the library gets more progressive and
  28. // takes on more advanced C++ techniques, the difficulty is escalated to
  29. // even new heights.
  30. //
  31. // Spirit v1.6.x will still be supported. Maintenance and bug fixes will
  32. // still be applied. There will still be active development for the back-
  33. // porting of new features introduced in Spirit v1.8.0 (and Spirit 1.9.0)
  34. // to lesser able compilers; hopefully, fueled by contributions from the
  35. // community. For instance, there is already a working AST tree back-port
  36. // for VC6 and VC7 by Peder Holt.
  37. //
  38. // If you got here somehow, your compiler is known to be poorly conforming
  39. // WRT ANSI/ISO C++ standard. Library implementers get a bad reputation when
  40. // someone attempts to compile the code on a non-conforming compiler. She'll
  41. // be confronted with tons of compiler errors when she tries to compile the
  42. // library. Such errors will somehow make less informed users conclude that
  43. // the code is poorly written. It's better for the user to see a message
  44. // "sorry, this code has not been ported to your compiler yet", than to see
  45. // pages and pages of compiler error messages.
  46. //
  47. /////////////////////////////////////////////////////////////////////////////////
  48. #if (defined(BOOST_MSVC) && (BOOST_MSVC < 1310)) \
  49. || (defined(__BORLANDC__) && (__BORLANDC__ <= 0x570)) \
  50. || (defined(__GNUC__) && (__GNUC__ < 3)) \
  51. || (defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ < 1))
  52. # error "Compiler not supported. See note in <boost/spirit/core/config.hpp>"
  53. #else
  54. // Pass... Compiler supported.
  55. #endif
  56. #endif