stdc.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_STDC_H
  8. #define BOOST_PREDEF_LANGUAGE_STDC_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. /* tag::reference[]
  12. = `BOOST_LANG_STDC`
  13. http://en.wikipedia.org/wiki/C_(programming_language)[Standard C] language.
  14. If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date.
  15. [options="header"]
  16. |===
  17. | {predef_symbol} | {predef_version}
  18. | `+__STDC__+` | {predef_detection}
  19. | `+__STDC_VERSION__+` | V.R.P
  20. |===
  21. */ // end::reference[]
  22. #define BOOST_LANG_STDC BOOST_VERSION_NUMBER_NOT_AVAILABLE
  23. #if defined(__STDC__)
  24. # undef BOOST_LANG_STDC
  25. # if defined(__STDC_VERSION__)
  26. # if (__STDC_VERSION__ > 100)
  27. # define BOOST_LANG_STDC BOOST_PREDEF_MAKE_YYYYMM(__STDC_VERSION__)
  28. # else
  29. # define BOOST_LANG_STDC BOOST_VERSION_NUMBER_AVAILABLE
  30. # endif
  31. # else
  32. # define BOOST_LANG_STDC BOOST_VERSION_NUMBER_AVAILABLE
  33. # endif
  34. #endif
  35. #if BOOST_LANG_STDC
  36. # define BOOST_LANG_STDC_AVAILABLE
  37. #endif
  38. #define BOOST_LANG_STDC_NAME "Standard C"
  39. #endif
  40. #include <boost/predef/detail/test.h>
  41. BOOST_PREDEF_DECLARE_TEST(BOOST_LANG_STDC,BOOST_LANG_STDC_NAME)