clang.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_CLANG_H
  8. #define BOOST_PREDEF_COMPILER_CLANG_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. /* tag::reference[]
  12. = `BOOST_COMP_CLANG`
  13. http://en.wikipedia.org/wiki/Clang[Clang] compiler.
  14. Version number available as major, minor, and patch.
  15. [options="header"]
  16. |===
  17. | {predef_symbol} | {predef_version}
  18. | `+__clang__+` | {predef_detection}
  19. | `+__clang_major__+`, `+__clang_minor__+`, `+__clang_patchlevel__+` | V.R.P
  20. |===
  21. */ // end::reference[]
  22. #define BOOST_COMP_CLANG BOOST_VERSION_NUMBER_NOT_AVAILABLE
  23. #if defined(__clang__)
  24. # define BOOST_COMP_CLANG_DETECTION BOOST_VERSION_NUMBER(__clang_major__,__clang_minor__,__clang_patchlevel__)
  25. #endif
  26. #ifdef BOOST_COMP_CLANG_DETECTION
  27. # if defined(BOOST_PREDEF_DETAIL_COMP_DETECTED)
  28. # define BOOST_COMP_CLANG_EMULATED BOOST_COMP_CLANG_DETECTION
  29. # else
  30. # undef BOOST_COMP_CLANG
  31. # define BOOST_COMP_CLANG BOOST_COMP_CLANG_DETECTION
  32. # endif
  33. # define BOOST_COMP_CLANG_AVAILABLE
  34. # include <boost/predef/detail/comp_detected.h>
  35. #endif
  36. #define BOOST_COMP_CLANG_NAME "Clang"
  37. #endif
  38. #include <boost/predef/detail/test.h>
  39. BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_CLANG,BOOST_COMP_CLANG_NAME)
  40. #ifdef BOOST_COMP_CLANG_EMULATED
  41. #include <boost/predef/detail/test.h>
  42. BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_CLANG_EMULATED,BOOST_COMP_CLANG_NAME)
  43. #endif