bsd.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. /*`
  18. [heading `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. [table
  31. [[__predef_symbol__] [__predef_version__]]
  32. [[`BSD`] [__predef_detection__]]
  33. [[`_SYSTYPE_BSD`] [__predef_detection__]]
  34. [[`BSD4_2`] [4.2.0]]
  35. [[`BSD4_3`] [4.3.0]]
  36. [[`BSD4_4`] [4.4.0]]
  37. [[`BSD`] [V.R.0]]
  38. ]
  39. */
  40. #include <boost/predef/os/bsd/bsdi.h>
  41. #include <boost/predef/os/bsd/dragonfly.h>
  42. #include <boost/predef/os/bsd/free.h>
  43. #include <boost/predef/os/bsd/open.h>
  44. #include <boost/predef/os/bsd/net.h>
  45. #ifndef BOOST_OS_BSD
  46. #define BOOST_OS_BSD BOOST_VERSION_NUMBER_NOT_AVAILABLE
  47. #endif
  48. #if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
  49. defined(BSD) || \
  50. defined(_SYSTYPE_BSD) \
  51. )
  52. # undef BOOST_OS_BSD
  53. # include <sys/param.h>
  54. # if !defined(BOOST_OS_BSD) && defined(BSD4_4)
  55. # define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,4,0)
  56. # endif
  57. # if !defined(BOOST_OS_BSD) && defined(BSD4_3)
  58. # define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,3,0)
  59. # endif
  60. # if !defined(BOOST_OS_BSD) && defined(BSD4_2)
  61. # define BOOST_OS_BSD BOOST_VERSION_NUMBER(4,2,0)
  62. # endif
  63. # if !defined(BOOST_OS_BSD) && defined(BSD)
  64. # define BOOST_OS_BSD BOOST_PREDEF_MAKE_10_VVRR(BSD)
  65. # endif
  66. # if !defined(BOOST_OS_BSD)
  67. # define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
  68. # endif
  69. #endif
  70. #if BOOST_OS_BSD
  71. # define BOOST_OS_BSD_AVAILABLE
  72. # include <boost/predef/detail/os_detected.h>
  73. #endif
  74. #define BOOST_OS_BSD_NAME "BSD"
  75. #endif
  76. #include <boost/predef/os/bsd/bsdi.h>
  77. #include <boost/predef/os/bsd/dragonfly.h>
  78. #include <boost/predef/os/bsd/free.h>
  79. #include <boost/predef/os/bsd/open.h>
  80. #include <boost/predef/os/bsd/net.h>
  81. #include <boost/predef/detail/test.h>
  82. BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD,BOOST_OS_BSD_NAME)