visualc.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. Copyright Redshift Software, Inc. 2008-2013
  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_VISUALC_H
  8. #define BOOST_PREDEF_COMPILER_VISUALC_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. /*`
  12. [heading `BOOST_COMP_MSVC`]
  13. [@http://en.wikipedia.org/wiki/Visual_studio Microsoft Visual C/C++] compiler.
  14. Version number available as major, minor, and patch.
  15. [table
  16. [[__predef_symbol__] [__predef_version__]]
  17. [[`_MSC_VER`] [__predef_detection__]]
  18. [[`_MSC_FULL_VER`] [V.R.P]]
  19. [[`_MSC_VER`] [V.R.0]]
  20. ]
  21. */
  22. #define BOOST_COMP_MSVC BOOST_VERSION_NUMBER_NOT_AVAILABLE
  23. #if defined(_MSC_VER)
  24. # undef BOOST_COMP_MSVC
  25. # if !defined (_MSC_FULL_VER)
  26. # define BOOST_COMP_MSVC_BUILD 0
  27. # else
  28. /* how many digits does the build number have? */
  29. # if _MSC_FULL_VER / 10000 == _MSC_VER
  30. /* four digits */
  31. # define BOOST_COMP_MSVC_BUILD (_MSC_FULL_VER % 10000)
  32. # elif _MSC_FULL_VER / 100000 == _MSC_VER
  33. /* five digits */
  34. # define BOOST_COMP_MSVC_BUILD (_MSC_FULL_VER % 100000)
  35. # else
  36. # error "Cannot determine build number from _MSC_FULL_VER"
  37. # endif
  38. # endif
  39. # define BOOST_COMP_MSVC BOOST_VERSION_NUMBER(\
  40. _MSC_VER/100-6,\
  41. _MSC_VER%100,\
  42. BOOST_COMP_MSVC_BUILD)
  43. #endif
  44. #if BOOST_COMP_MSVC
  45. # define BOOST_COMP_MSVC_AVAILABLE
  46. #endif
  47. #define BOOST_COMP_MSVC_NAME "Microsoft Visual C/C++"
  48. #include <boost/predef/detail/test.h>
  49. BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MSVC,BOOST_COMP_MSVC_NAME)
  50. #endif