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