gcc.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. Copyright Rene Rivera 2008-2015
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. #ifndef BOOST_PREDEF_COMPILER_GCC_H
  8. #define BOOST_PREDEF_COMPILER_GCC_H
  9. /* Other compilers that emulate this one need to be detected first. */
  10. #include <boost/predef/compiler/clang.h>
  11. #include <boost/predef/version_number.h>
  12. #include <boost/predef/make.h>
  13. /*`
  14. [heading `BOOST_COMP_GNUC`]
  15. [@http://en.wikipedia.org/wiki/GNU_Compiler_Collection Gnu GCC C/C++] compiler.
  16. Version number available as major, minor, and patch (if available).
  17. [table
  18. [[__predef_symbol__] [__predef_version__]]
  19. [[`__GNUC__`] [__predef_detection__]]
  20. [[`__GNUC__`, `__GNUC_MINOR__`, `__GNUC_PATCHLEVEL__`] [V.R.P]]
  21. [[`__GNUC__`, `__GNUC_MINOR__`] [V.R.0]]
  22. ]
  23. */
  24. #define BOOST_COMP_GNUC BOOST_VERSION_NUMBER_NOT_AVAILABLE
  25. #if defined(__GNUC__)
  26. # if !defined(BOOST_COMP_GNUC_DETECTION) && defined(__GNUC_PATCHLEVEL__)
  27. # define BOOST_COMP_GNUC_DETECTION \
  28. BOOST_VERSION_NUMBER(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__)
  29. # endif
  30. # if !defined(BOOST_COMP_GNUC_DETECTION)
  31. # define BOOST_COMP_GNUC_DETECTION \
  32. BOOST_VERSION_NUMBER(__GNUC__,__GNUC_MINOR__,0)
  33. # endif
  34. #endif
  35. #ifdef BOOST_COMP_GNUC_DETECTION
  36. # if defined(BOOST_PREDEF_DETAIL_COMP_DETECTED)
  37. # define BOOST_COMP_GNUC_EMULATED BOOST_COMP_GNUC_DETECTION
  38. # else
  39. # undef BOOST_COMP_GNUC
  40. # define BOOST_COMP_GNUC BOOST_COMP_GNUC_DETECTION
  41. # endif
  42. # define BOOST_COMP_GNUC_AVAILABLE
  43. # include <boost/predef/detail/comp_detected.h>
  44. #endif
  45. #define BOOST_COMP_GNUC_NAME "Gnu GCC C/C++"
  46. #endif
  47. #include <boost/predef/detail/test.h>
  48. BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GNUC,BOOST_COMP_GNUC_NAME)
  49. #ifdef BOOST_COMP_GNUC_EMULATED
  50. #include <boost/predef/detail/test.h>
  51. BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_GNUC_EMULATED,BOOST_COMP_GNUC_NAME)
  52. #endif