]> git.lyx.org Git - lyx.git/blob - boost/boost/preprocessor/slot.hpp
update boost
[lyx.git] / boost / boost / preprocessor / slot.hpp
1 # /* **************************************************************************
2 #  *                                                                          *
3 #  *     (C) Copyright Paul Mensonides 2002.  Permission to copy, use,        *
4 #  *     modify, sell, and distribute this software is granted provided       *
5 #  *     this copyright notice appears in all copies.  This software is       *
6 #  *     provided "as is" without express or implied warranty, and with       *
7 #  *     no claim at to its suitability for any purpose.                      *
8 #  *                                                                          *
9 #  ************************************************************************** */
10 #
11 # ifndef BOOST_PREPROCESSOR_SLOT_HPP
12 # define BOOST_PREPROCESSOR_SLOT_HPP
13 #
14 # include <boost/preprocessor/detail/cat.hpp>
15 # include <boost/preprocessor/detail/line.hpp>
16 #
17 # define BOOST_PP_SLOT_LIMIT 5
18 # define BOOST_PP_SLOT_MAX 4294967295 /* 2^32 - 1 */
19 #
20 # define BOOST_PP_ASSIGN_SLOT(i) BOOST_PP_DETAIL_CAT2(BOOST_PP_ASSIGN_SLOT_, i)
21 # define BOOST_PP_ASSIGN_SLOT_1 <boost/preprocessor/detail/slot/slot1.hpp>
22 # define BOOST_PP_ASSIGN_SLOT_2 <boost/preprocessor/detail/slot/slot2.hpp>
23 # define BOOST_PP_ASSIGN_SLOT_3 <boost/preprocessor/detail/slot/slot3.hpp>
24 # define BOOST_PP_ASSIGN_SLOT_4 <boost/preprocessor/detail/slot/slot4.hpp>
25 # define BOOST_PP_ASSIGN_SLOT_5 <boost/preprocessor/detail/slot/slot5.hpp>
26 #
27 # define BOOST_PP_SLOT(i) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_, i)()
28 #
29 # ifndef BOOST_PP_SLOT_SIG
30 #   define BOOST_PP_SLOT_SIG 10
31 # endif
32 #
33 # if BOOST_PP_SLOT_SIG >= 10
34 #    define BOOST_PP_SLOT_10TH(x) (x) % 1000000000UL
35 # else
36 #    define BOOST_PP_SLOT_10TH(x) (x)
37 # endif
38 #
39 # if BOOST_PP_SLOT_SIG >= 9
40 #    define BOOST_PP_SLOT_9TH(x) BOOST_PP_SLOT_10TH(x) % 100000000UL
41 # else
42 #    define BOOST_PP_SLOT_9TH(x) (x)
43 # endif
44 #
45 # if BOOST_PP_SLOT_SIG >= 8
46 #    define BOOST_PP_SLOT_8TH(x) BOOST_PP_SLOT_9TH(x) % 10000000UL
47 # else
48 #    define BOOST_PP_SLOT_8TH(x) (x)
49 # endif
50 #
51 # if BOOST_PP_SLOT_SIG >= 7
52 #    define BOOST_PP_SLOT_7TH(x) BOOST_PP_SLOT_8TH(x) % 1000000UL
53 # else
54 #    define BOOST_PP_SLOT_7TH(x) (x)
55 # endif
56 #
57 # if BOOST_PP_SLOT_SIG >= 6
58 #    define BOOST_PP_SLOT_6TH(x) BOOST_PP_SLOT_7TH(x) % 100000UL
59 # else
60 #    define BOOST_PP_SLOT_6TH(x) (x)
61 # endif
62 #
63 # if BOOST_PP_SLOT_SIG >= 5
64 #    define BOOST_PP_SLOT_5TH(x) BOOST_PP_SLOT_6TH(x) % 10000UL
65 # else
66 #    define BOOST_PP_SLOT_5TH(x) (x)
67 # endif
68 #
69 # if BOOST_PP_SLOT_SIG >= 4
70 #    define BOOST_PP_SLOT_4TH(x) BOOST_PP_SLOT_5TH(x) % 1000UL
71 # else
72 #    define BOOST_PP_SLOT_4TH(x) (x)
73 # endif
74 #
75 # if BOOST_PP_SLOT_SIG >= 3
76 #    define BOOST_PP_SLOT_3RD(x) BOOST_PP_SLOT_4TH(x) % 100UL
77 # else
78 #    define BOOST_PP_SLOT_3RD(x) (x)
79 # endif
80 #
81 # if BOOST_PP_SLOT_SIG >= 2
82 #    define BOOST_PP_SLOT_2ND(x) BOOST_PP_SLOT_3RD(x) % 10UL
83 # else
84 #    define BOOST_PP_SLOT_2ND(x) (x)
85 # endif
86 #
87 # define BOOST_PP_SLOT_CC_2(a, b) BOOST_PP_DETAIL_CAT2(a, b)
88 # define BOOST_PP_SLOT_CC_3(a, b, c) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_CC_2(a, b), c)
89 # define BOOST_PP_SLOT_CC_4(a, b, c, d) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_CC_3(a, b, c), d)
90 # define BOOST_PP_SLOT_CC_5(a, b, c, d, e) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_CC_4(a, b, c, d), e)
91 # define BOOST_PP_SLOT_CC_6(a, b, c, d, e, f) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_CC_5(a, b, c, d, e), f)
92 # define BOOST_PP_SLOT_CC_7(a, b, c, d, e, f, g) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_CC_6(a, b, c, d, e, f), g)
93 # define BOOST_PP_SLOT_CC_8(a, b, c, d, e, f, g, h) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_CC_7(a, b, c, d, e, f, g), h)
94 # define BOOST_PP_SLOT_CC_9(a, b, c, d, e, f, g, h, i) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_CC_8(a, b, c, d, e, f, g, h), i)
95 # define BOOST_PP_SLOT_CC_10(a, b, c, d, e, f, g, h, i, j) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_CC_9(a, b, c, d, e, f, g, h, i), j)
96 #
97 # endif