stdcpp.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. Copyright Rene Rivera 2011-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_LANGUAGE_STDCPP_H
  8. #define BOOST_PREDEF_LANGUAGE_STDCPP_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. /*`
  12. [heading `BOOST_LANG_STDCPP`]
  13. [@http://en.wikipedia.org/wiki/C%2B%2B Standard C++] language.
  14. If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date.
  15. Because of the way the C++ standardization process works the
  16. defined version year will not be the commonly known year of the standard.
  17. Specifically the defined versions are:
  18. [table Detected Version Number vs. C++ Standard Year
  19. [[Detected Version Number] [Standard Year] [C++ Standard]]
  20. [[27.11.1] [1998] [ISO/IEC 14882:1998]]
  21. [[41.12.1] [2011] [ISO/IEC 14882:2011]]
  22. ]
  23. [table
  24. [[__predef_symbol__] [__predef_version__]]
  25. [[`__cplusplus`] [__predef_detection__]]
  26. [[`__cplusplus`] [YYYY.MM.1]]
  27. ]
  28. */
  29. #define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER_NOT_AVAILABLE
  30. #if defined(__cplusplus)
  31. # undef BOOST_LANG_STDCPP
  32. # if (__cplusplus > 100)
  33. # define BOOST_LANG_STDCPP BOOST_PREDEF_MAKE_YYYYMM(__cplusplus)
  34. # else
  35. # define BOOST_LANG_STDCPP BOOST_VERSION_NUMBER_AVAILABLE
  36. # endif
  37. #endif
  38. #if BOOST_LANG_STDCPP
  39. # define BOOST_LANG_STDCPP_AVAILABLE
  40. #endif
  41. #define BOOST_LANG_STDCPP_NAME "Standard C++"
  42. /*`
  43. [heading `BOOST_LANG_STDCPPCLI`]
  44. [@http://en.wikipedia.org/wiki/C%2B%2B/CLI Standard C++/CLI] language.
  45. If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date.
  46. [table
  47. [[__predef_symbol__] [__predef_version__]]
  48. [[`__cplusplus_cli`] [__predef_detection__]]
  49. [[`__cplusplus_cli`] [YYYY.MM.1]]
  50. ]
  51. */
  52. #define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER_NOT_AVAILABLE
  53. #if defined(__cplusplus_cli)
  54. # undef BOOST_LANG_STDCPPCLI
  55. # if (__cplusplus_cli > 100)
  56. # define BOOST_LANG_STDCPPCLI BOOST_PREDEF_MAKE_YYYYMM(__cplusplus_cli)
  57. # else
  58. # define BOOST_LANG_STDCPPCLI BOOST_VERSION_NUMBER_AVAILABLE
  59. # endif
  60. #endif
  61. #if BOOST_LANG_STDCPPCLI
  62. # define BOOST_LANG_STDCPPCLI_AVAILABLE
  63. #endif
  64. #define BOOST_LANG_STDCPPCLI_NAME "Standard C++/CLI"
  65. /*`
  66. [heading `BOOST_LANG_STDECPP`]
  67. [@http://en.wikipedia.org/wiki/Embedded_C%2B%2B Standard Embedded C++] language.
  68. [table
  69. [[__predef_symbol__] [__predef_version__]]
  70. [[`__embedded_cplusplus`] [__predef_detection__]]
  71. ]
  72. */
  73. #define BOOST_LANG_STDECPP BOOST_VERSION_NUMBER_NOT_AVAILABLE
  74. #if defined(__embedded_cplusplus)
  75. # undef BOOST_LANG_STDECPP
  76. # define BOOST_LANG_STDECPP BOOST_VERSION_NUMBER_AVAILABLE
  77. #endif
  78. #if BOOST_LANG_STDECPP
  79. # define BOOST_LANG_STDECPP_AVAILABLE
  80. #endif
  81. #define BOOST_LANG_STDECPP_NAME "Standard Embedded C++"
  82. #endif
  83. #include <boost/predef/detail/test.h>
  84. BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPP,BOOST_LANG_STDCPP_NAME)
  85. #include <boost/predef/detail/test.h>
  86. BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDCPPCLI,BOOST_LANG_STDCPPCLI_NAME)
  87. #include <boost/predef/detail/test.h>
  88. BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDECPP,BOOST_LANG_STDECPP_NAME)