gnu.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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_LIBRARY_C_GNU_H
  8. #define BOOST_PREDEF_LIBRARY_C_GNU_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. #include <boost/predef/library/c/_prefix.h>
  12. #if defined(__STDC__)
  13. #include <stddef.h>
  14. #elif defined(__cplusplus)
  15. #include <cstddef>
  16. #endif
  17. /* tag::reference[]
  18. = `BOOST_LIB_C_GNU`
  19. http://en.wikipedia.org/wiki/Glibc[GNU glibc] Standard C library.
  20. Version number available as major, and minor.
  21. [options="header"]
  22. |===
  23. | {predef_symbol} | {predef_version}
  24. | `+__GLIBC__+` | {predef_detection}
  25. | `+__GNU_LIBRARY__+` | {predef_detection}
  26. | `+__GLIBC__+`, `+__GLIBC_MINOR__+` | V.R.0
  27. | `+__GNU_LIBRARY__+`, `+__GNU_LIBRARY_MINOR__+` | V.R.0
  28. |===
  29. */ // end::reference[]
  30. #define BOOST_LIB_C_GNU BOOST_VERSION_NUMBER_NOT_AVAILABLE
  31. #if defined(__GLIBC__) || defined(__GNU_LIBRARY__)
  32. # undef BOOST_LIB_C_GNU
  33. # if defined(__GLIBC__)
  34. # define BOOST_LIB_C_GNU \
  35. BOOST_VERSION_NUMBER(__GLIBC__,__GLIBC_MINOR__,0)
  36. # else
  37. # define BOOST_LIB_C_GNU \
  38. BOOST_VERSION_NUMBER(__GNU_LIBRARY__,__GNU_LIBRARY_MINOR__,0)
  39. # endif
  40. #endif
  41. #if BOOST_LIB_C_GNU
  42. # define BOOST_LIB_C_GNU_AVAILABLE
  43. #endif
  44. #define BOOST_LIB_C_GNU_NAME "GNU"
  45. #endif
  46. #include <boost/predef/detail/test.h>
  47. BOOST_PREDEF_DECLARE_TEST(BOOST_LIB_C_GNU,BOOST_LIB_C_GNU_NAME)