clang_version.hpp 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Copyright 2021 Peter Dimov
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // https://www.boost.org/LICENSE_1_0.txt)
  4. #if !defined(__apple_build_version__)
  5. # define BOOST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__ % 100)
  6. #else
  7. # define BOOST_CLANG_REPORTED_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__ % 100)
  8. // https://en.wikipedia.org/wiki/Xcode#Toolchain_versions
  9. # if BOOST_CLANG_REPORTED_VERSION >= 150000
  10. # define BOOST_CLANG_VERSION 160000
  11. # elif BOOST_CLANG_REPORTED_VERSION >= 140003
  12. # define BOOST_CLANG_VERSION 150000
  13. # elif BOOST_CLANG_REPORTED_VERSION >= 140000
  14. # define BOOST_CLANG_VERSION 140000
  15. # elif BOOST_CLANG_REPORTED_VERSION >= 130100
  16. # define BOOST_CLANG_VERSION 130000
  17. # elif BOOST_CLANG_REPORTED_VERSION >= 130000
  18. # define BOOST_CLANG_VERSION 120000
  19. # elif BOOST_CLANG_REPORTED_VERSION >= 120005
  20. # define BOOST_CLANG_VERSION 110100
  21. # elif BOOST_CLANG_REPORTED_VERSION >= 120000
  22. # define BOOST_CLANG_VERSION 100000
  23. # elif BOOST_CLANG_REPORTED_VERSION >= 110003
  24. # define BOOST_CLANG_VERSION 90000
  25. # elif BOOST_CLANG_REPORTED_VERSION >= 110000
  26. # define BOOST_CLANG_VERSION 80000
  27. # elif BOOST_CLANG_REPORTED_VERSION >= 100001
  28. # define BOOST_CLANG_VERSION 70000
  29. # elif BOOST_CLANG_REPORTED_VERSION >= 100000
  30. # define BOOST_CLANG_VERSION 60001
  31. # elif BOOST_CLANG_REPORTED_VERSION >= 90100
  32. # define BOOST_CLANG_VERSION 50002
  33. # elif BOOST_CLANG_REPORTED_VERSION >= 90000
  34. # define BOOST_CLANG_VERSION 40000
  35. # elif BOOST_CLANG_REPORTED_VERSION >= 80000
  36. # define BOOST_CLANG_VERSION 30900
  37. # elif BOOST_CLANG_REPORTED_VERSION >= 70300
  38. # define BOOST_CLANG_VERSION 30800
  39. # elif BOOST_CLANG_REPORTED_VERSION >= 70000
  40. # define BOOST_CLANG_VERSION 30700
  41. # elif BOOST_CLANG_REPORTED_VERSION >= 60100
  42. # define BOOST_CLANG_VERSION 30600
  43. # elif BOOST_CLANG_REPORTED_VERSION >= 60000
  44. # define BOOST_CLANG_VERSION 30500
  45. # elif BOOST_CLANG_REPORTED_VERSION >= 50100
  46. # define BOOST_CLANG_VERSION 30400
  47. # elif BOOST_CLANG_REPORTED_VERSION >= 50000
  48. # define BOOST_CLANG_VERSION 30300
  49. # elif BOOST_CLANG_REPORTED_VERSION >= 40200
  50. # define BOOST_CLANG_VERSION 30200
  51. # elif BOOST_CLANG_REPORTED_VERSION >= 30100
  52. # define BOOST_CLANG_VERSION 30100
  53. # elif BOOST_CLANG_REPORTED_VERSION >= 20100
  54. # define BOOST_CLANG_VERSION 30000
  55. # else
  56. # define BOOST_CLANG_VERSION 20900
  57. # endif
  58. # undef BOOST_CLANG_REPORTED_VERSION
  59. #endif