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 | #include <boost/predef/detail/test.h> |
8 | |
9 | #ifndef BOOST_PREDEF_MAKE_H |
10 | #define BOOST_PREDEF_MAKE_H |
11 | |
12 | /* |
13 | Shorthands for the common version number formats used by vendors... |
14 | */ |
15 | |
16 | /* tag::reference[] |
17 | = `BOOST_PREDEF_MAKE_..` macros |
18 | |
19 | These set of macros decompose common vendor version number |
20 | macros which are composed version, revision, and patch digits. |
21 | The naming convention indicates: |
22 | |
23 | * The base of the specified version number. "`BOOST_PREDEF_MAKE_0X`" for |
24 | hexadecimal digits, and "`BOOST_PREDEF_MAKE_10`" for decimal digits. |
25 | * The format of the vendor version number. Where "`V`" indicates the version digits, |
26 | "`R`" indicates the revision digits, "`P`" indicates the patch digits, and "`0`" |
27 | indicates an ignored digit. |
28 | |
29 | Macros are: |
30 | |
31 | */ // end::reference[] |
32 | /* tag::reference[] |
33 | * `BOOST_PREDEF_MAKE_0X_VRP(V)` |
34 | */ // end::reference[] |
35 | #define BOOST_PREDEF_MAKE_0X_VRP(V) BOOST_VERSION_NUMBER((V&0xF00)>>8,(V&0xF0)>>4,(V&0xF)) |
36 | /* tag::reference[] |
37 | * `BOOST_PREDEF_MAKE_0X_VVRP(V)` |
38 | */ // end::reference[] |
39 | #define BOOST_PREDEF_MAKE_0X_VVRP(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xF0)>>4,(V&0xF)) |
40 | /* tag::reference[] |
41 | * `BOOST_PREDEF_MAKE_0X_VRPP(V)` |
42 | */ // end::reference[] |
43 | #define BOOST_PREDEF_MAKE_0X_VRPP(V) BOOST_VERSION_NUMBER((V&0xF000)>>12,(V&0xF00)>>8,(V&0xFF)) |
44 | /* tag::reference[] |
45 | * `BOOST_PREDEF_MAKE_0X_VVRR(V)` |
46 | */ // end::reference[] |
47 | #define BOOST_PREDEF_MAKE_0X_VVRR(V) BOOST_VERSION_NUMBER((V&0xFF00)>>8,(V&0xFF),0) |
48 | /* tag::reference[] |
49 | * `BOOST_PREDEF_MAKE_0X_VRRPPPP(V)` |
50 | */ // end::reference[] |
51 | #define BOOST_PREDEF_MAKE_0X_VRRPPPP(V) BOOST_VERSION_NUMBER((V&0xF000000)>>24,(V&0xFF0000)>>16,(V&0xFFFF)) |
52 | /* tag::reference[] |
53 | * `BOOST_PREDEF_MAKE_0X_VVRRP(V)` |
54 | */ // end::reference[] |
55 | #define BOOST_PREDEF_MAKE_0X_VVRRP(V) BOOST_VERSION_NUMBER((V&0xFF000)>>12,(V&0xFF0)>>4,(V&0xF)) |
56 | /* tag::reference[] |
57 | * `BOOST_PREDEF_MAKE_0X_VRRPP000(V)` |
58 | */ // end::reference[] |
59 | #define BOOST_PREDEF_MAKE_0X_VRRPP000(V) BOOST_VERSION_NUMBER((V&0xF0000000)>>28,(V&0xFF00000)>>20,(V&0xFF000)>>12) |
60 | /* tag::reference[] |
61 | * `BOOST_PREDEF_MAKE_0X_VVRRPP(V)` |
62 | */ // end::reference[] |
63 | #define BOOST_PREDEF_MAKE_0X_VVRRPP(V) BOOST_VERSION_NUMBER((V&0xFF0000)>>16,(V&0xFF00)>>8,(V&0xFF)) |
64 | /* tag::reference[] |
65 | * `BOOST_PREDEF_MAKE_10_VPPP(V)` |
66 | */ // end::reference[] |
67 | #define BOOST_PREDEF_MAKE_10_VPPP(V) BOOST_VERSION_NUMBER(((V)/1000)%10,0,(V)%1000) |
68 | /* tag::reference[] |
69 | * `BOOST_PREDEF_MAKE_10_VR0(V)` |
70 | */ // end::reference[] |
71 | #define BOOST_PREDEF_MAKE_10_VR0(V) BOOST_VERSION_NUMBER(((V)/100)%10,((V)/10)%10,0) |
72 | /* tag::reference[] |
73 | * `BOOST_PREDEF_MAKE_10_VRP(V)` |
74 | */ // end::reference[] |
75 | #define BOOST_PREDEF_MAKE_10_VRP(V) BOOST_VERSION_NUMBER(((V)/100)%10,((V)/10)%10,(V)%10) |
76 | /* tag::reference[] |
77 | * `BOOST_PREDEF_MAKE_10_VRP000(V)` |
78 | */ // end::reference[] |
79 | #define BOOST_PREDEF_MAKE_10_VRP000(V) BOOST_VERSION_NUMBER(((V)/100000)%10,((V)/10000)%10,((V)/1000)%10) |
80 | /* tag::reference[] |
81 | * `BOOST_PREDEF_MAKE_10_VRPPPP(V)` |
82 | */ // end::reference[] |
83 | #define BOOST_PREDEF_MAKE_10_VRPPPP(V) BOOST_VERSION_NUMBER(((V)/100000)%10,((V)/10000)%10,(V)%10000) |
84 | /* tag::reference[] |
85 | * `BOOST_PREDEF_MAKE_10_VRPP(V)` |
86 | */ // end::reference[] |
87 | #define BOOST_PREDEF_MAKE_10_VRPP(V) BOOST_VERSION_NUMBER(((V)/1000)%10,((V)/100)%10,(V)%100) |
88 | /* tag::reference[] |
89 | * `BOOST_PREDEF_MAKE_10_VRR(V)` |
90 | */ // end::reference[] |
91 | #define BOOST_PREDEF_MAKE_10_VRR(V) BOOST_VERSION_NUMBER(((V)/100)%10,(V)%100,0) |
92 | /* tag::reference[] |
93 | * `BOOST_PREDEF_MAKE_10_VRRPP(V)` |
94 | */ // end::reference[] |
95 | #define BOOST_PREDEF_MAKE_10_VRRPP(V) BOOST_VERSION_NUMBER(((V)/10000)%10,((V)/100)%100,(V)%100) |
96 | /* tag::reference[] |
97 | * `BOOST_PREDEF_MAKE_10_VRR000(V)` |
98 | */ // end::reference[] |
99 | #define BOOST_PREDEF_MAKE_10_VRR000(V) BOOST_VERSION_NUMBER(((V)/100000)%10,((V)/1000)%100,0) |
100 | /* tag::reference[] |
101 | * `BOOST_PREDEF_MAKE_10_VV00(V)` |
102 | */ // end::reference[] |
103 | #define BOOST_PREDEF_MAKE_10_VV00(V) BOOST_VERSION_NUMBER(((V)/100)%100,0,0) |
104 | /* tag::reference[] |
105 | * `BOOST_PREDEF_MAKE_10_VVRR(V)` |
106 | */ // end::reference[] |
107 | #define BOOST_PREDEF_MAKE_10_VVRR(V) BOOST_VERSION_NUMBER(((V)/100)%100,(V)%100,0) |
108 | /* tag::reference[] |
109 | * `BOOST_PREDEF_MAKE_10_VVRRP(V)` |
110 | */ // end::reference[] |
111 | #define BOOST_PREDEF_MAKE_10_VVRRP(V) BOOST_VERSION_NUMBER(((V)/1000)%100,((V)/10)%100,(V)%10) |
112 | /* tag::reference[] |
113 | * `BOOST_PREDEF_MAKE_10_VVRRPP(V)` |
114 | */ // end::reference[] |
115 | #define BOOST_PREDEF_MAKE_10_VVRRPP(V) BOOST_VERSION_NUMBER(((V)/10000)%100,((V)/100)%100,(V)%100) |
116 | /* tag::reference[] |
117 | * `BOOST_PREDEF_MAKE_10_VVRRPPP(V)` |
118 | */ // end::reference[] |
119 | #define BOOST_PREDEF_MAKE_10_VVRRPPP(V) BOOST_VERSION_NUMBER(((V)/100000)%100,((V)/1000)%100,(V)%1000) |
120 | /* tag::reference[] |
121 | * `BOOST_PREDEF_MAKE_10_VVRR0PP00(V)` |
122 | */ // end::reference[] |
123 | #define BOOST_PREDEF_MAKE_10_VVRR0PP00(V) BOOST_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,((V)/100)%100) |
124 | /* tag::reference[] |
125 | * `BOOST_PREDEF_MAKE_10_VVRR0PPPP(V)` |
126 | */ // end::reference[] |
127 | #define BOOST_PREDEF_MAKE_10_VVRR0PPPP(V) BOOST_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,(V)%10000) |
128 | /* tag::reference[] |
129 | * `BOOST_PREDEF_MAKE_10_VVRR00PP00(V)` |
130 | */ // end::reference[] |
131 | #define BOOST_PREDEF_MAKE_10_VVRR00PP00(V) BOOST_VERSION_NUMBER(((V)/100000000)%100,((V)/1000000)%100,((V)/100)%100) |
132 | |
133 | /* tag::reference[] |
134 | |
135 | = `BOOST_PREDEF_MAKE_*..` date macros |
136 | |
137 | Date decomposition macros return a date in the relative to the 1970 |
138 | Epoch date. If the month is not available, January 1st is used as the month and day. |
139 | If the day is not available, but the month is, the 1st of the month is used as the day. |
140 | |
141 | */ // end::reference[] |
142 | /* tag::reference[] |
143 | * `BOOST_PREDEF_MAKE_DATE(Y,M,D)` |
144 | */ // end::reference[] |
145 | #define BOOST_PREDEF_MAKE_DATE(Y,M,D) BOOST_VERSION_NUMBER((Y)%10000-1970,(M)%100,(D)%100) |
146 | /* tag::reference[] |
147 | * `BOOST_PREDEF_MAKE_YYYYMMDD(V)` |
148 | */ // end::reference[] |
149 | #define BOOST_PREDEF_MAKE_YYYYMMDD(V) BOOST_PREDEF_MAKE_DATE(((V)/10000)%10000,((V)/100)%100,(V)%100) |
150 | /* tag::reference[] |
151 | * `BOOST_PREDEF_MAKE_YYYY(V)` |
152 | */ // end::reference[] |
153 | #define BOOST_PREDEF_MAKE_YYYY(V) BOOST_PREDEF_MAKE_DATE(V,1,1) |
154 | /* tag::reference[] |
155 | * `BOOST_PREDEF_MAKE_YYYYMM(V)` |
156 | */ // end::reference[] |
157 | #define BOOST_PREDEF_MAKE_YYYYMM(V) BOOST_PREDEF_MAKE_DATE((V)/100,(V)%100,1) |
158 | |
159 | #endif |
160 | |