unix.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_OS_UNIX_H
  8. #define BOOST_PREDEF_OS_UNIX_H
  9. #include <boost/predef/version_number.h>
  10. #include <boost/predef/make.h>
  11. /* tag::reference[]
  12. = `BOOST_OS_UNIX`
  13. http://en.wikipedia.org/wiki/Unix[Unix Environment] operating system.
  14. [options="header"]
  15. |===
  16. | {predef_symbol} | {predef_version}
  17. | `unix` | {predef_detection}
  18. | `+__unix+` | {predef_detection}
  19. | `+_XOPEN_SOURCE+` | {predef_detection}
  20. | `+_POSIX_SOURCE+` | {predef_detection}
  21. |===
  22. */ // end::reference[]
  23. #define BOOST_OS_UNIX BOOST_VERSION_NUMBER_NOT_AVAILABLE
  24. #if defined(unix) || defined(__unix) || \
  25. defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
  26. # undef BOOST_OS_UNIX
  27. # define BOOST_OS_UNIX BOOST_VERSION_NUMBER_AVAILABLE
  28. #endif
  29. #if BOOST_OS_UNIX
  30. # define BOOST_OS_UNIX_AVAILABLE
  31. #endif
  32. #define BOOST_OS_UNIX_NAME "Unix Environment"
  33. /* tag::reference[]
  34. = `BOOST_OS_SVR4`
  35. http://en.wikipedia.org/wiki/UNIX_System_V[SVR4 Environment] operating system.
  36. [options="header"]
  37. |===
  38. | {predef_symbol} | {predef_version}
  39. | `+__sysv__+` | {predef_detection}
  40. | `+__SVR4+` | {predef_detection}
  41. | `+__svr4__+` | {predef_detection}
  42. | `+_SYSTYPE_SVR4+` | {predef_detection}
  43. |===
  44. */ // end::reference[]
  45. #define BOOST_OS_SVR4 BOOST_VERSION_NUMBER_NOT_AVAILABLE
  46. #if defined(__sysv__) || defined(__SVR4) || \
  47. defined(__svr4__) || defined(_SYSTYPE_SVR4)
  48. # undef BOOST_OS_SVR4
  49. # define BOOST_OS_SVR4 BOOST_VERSION_NUMBER_AVAILABLE
  50. #endif
  51. #if BOOST_OS_SVR4
  52. # define BOOST_OS_SVR4_AVAILABLE
  53. #endif
  54. #define BOOST_OS_SVR4_NAME "SVR4 Environment"
  55. #endif
  56. #include <boost/predef/detail/test.h>
  57. BOOST_PREDEF_DECLARE_TEST(BOOST_OS_UNIX,BOOST_OS_UNIX_NAME)
  58. BOOST_PREDEF_DECLARE_TEST(BOOST_OS_SVR4,BOOST_OS_SVR4_NAME)