bsd.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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_BSD_H
  8. #define BOOST_PREDEF_OS_BSD_H
  9. /* Special case: OSX will define BSD predefs if the sys/param.h
  10. * header is included. We can guard against that, but only if we
  11. * detect OSX first. Hence we will force include OSX detection
  12. * before doing any BSD detection.
  13. */
  14. #include <boost/predef/os/macos.h>
  15. #include <boost/predef/version_number.h>
  16. #include <boost/predef/make.h>
  17. /* tag::reference[]
  18. = `BOOST_OS_BSD`
  19. http://en.wikipedia.org/wiki/Berkeley_Software_Distribution[BSD] operating system.
  20. BSD has various branch operating systems possible and each detected
  21. individually. This detects the following variations and sets a specific
  22. version number macro to match:
  23. * `BOOST_OS_BSD_DRAGONFLY` http://en.wikipedia.org/wiki/DragonFly_BSD[DragonFly BSD]
  24. * `BOOST_OS_BSD_FREE` http://en.wikipedia.org/wiki/Freebsd[FreeBSD]
  25. * `BOOST_OS_BSD_BSDI` http://en.wikipedia.org/wiki/BSD/OS[BSDi BSD/OS]
  26. * `BOOST_OS_BSD_NET` http://en.wikipedia.org/wiki/Netbsd[NetBSD]
  27. * `BOOST_OS_BSD_OPEN` http://en.wikipedia.org/wiki/Openbsd[OpenBSD]
  28. NOTE: The general `BOOST_OS_BSD` is set in all cases to indicate some form
  29. of BSD. If the above variants is detected the corresponding macro is also set.
  30. [options="header"]
  31. |===
  32. | {predef_symbol} | {predef_version}
  33. | `BSD` | {predef_detection}
  34. | `+_SYSTYPE_BSD+` | {predef_detection}
  35. | `BSD4_2` | 4.2.0
  36. | `BSD4_3` | 4.3.0
  37. | `BSD4_4` | 4.4.0
  38. | `BSD` | V.R.0
  39. |===
  40. */ // end::reference[]
  41. #include <boost/predef/os/bsd/bsdi.h>
  42. #include <boost/predef/os/bsd/dragonfly.h>
  43. #include <boost/predef/os/bsd/free.h>
  44. #include <boost/predef/os/bsd/open.h>
  45. #include <boost/predef/os/bsd/net.h>
  46. #ifndef BOOST_OS_BSD
  47. #define BOOST_OS_BSD BOOST_VERSION_NUMBER_NOT_AVAILABLE
  48. #endif
  49. #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
  50. defined(BSD) || \
  51. defined(_SYSTYPE_BSD) \
  52. )
  53. # undef BOOST_OS_BSD
  54. # include <sys/param.h>
  55. # if !defined(BOOST_OS_BSD) && defined(BSD4_4)
  56. # define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,4,0)
  57. # endif
  58. # if !defined(BOOST_OS_BSD) && defined(BSD4_3)
  59. # define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,3,0)
  60. # endif
  61. # if !defined(BOOST_OS_BSD) && defined(BSD4_2)
  62. # define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,2,0)
  63. # endif
  64. # if !defined(BOOST_OS_BSD) && defined(BSD)
  65. # define BOOST_OS_BSD BOOST_PREDEF_MAKE_10_VVRR(BSD)
  66. # endif
  67. # if !defined(BOOST_OS_BSD)
  68. # define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
  69. # endif
  70. #endif
  71. #if BOOST_OS_BSD
  72. # define BOOST_OS_BSD_AVAILABLE
  73. # include <boost/predef/detail/os_detected.h>
  74. #endif
  75. #define BOOST_OS_BSD_NAME "BSD"
  76. #endif
  77. #include <boost/predef/os/bsd/bsdi.h>
  78. #include <boost/predef/os/bsd/dragonfly.h>
  79. #include <boost/predef/os/bsd/free.h>
  80. #include <boost/predef/os/bsd/open.h>
  81. #include <boost/predef/os/bsd/net.h>
  82. #include <boost/predef/detail/test.h>
  83. BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD,BOOST_OS_BSD_NAME)