1 # /* **************************************************************************
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. *
9 # ************************************************************************** */
11 # ifndef BOOST_PREPROCESSOR_SLOT_HPP
12 # define BOOST_PREPROCESSOR_SLOT_HPP
14 # include <boost/preprocessor/detail/cat.hpp>
15 # include <boost/preprocessor/detail/line.hpp>
17 # define BOOST_PP_SLOT_LIMIT 5
18 # define BOOST_PP_SLOT_MAX 4294967295 /* 2^32 - 1 */
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>
27 # define BOOST_PP_SLOT(i) BOOST_PP_DETAIL_CAT2(BOOST_PP_SLOT_, i)()
29 # ifndef BOOST_PP_SLOT_SIG
30 # define BOOST_PP_SLOT_SIG 10
33 # if BOOST_PP_SLOT_SIG >= 10
34 # define BOOST_PP_SLOT_10TH(x) (x) % 1000000000UL
36 # define BOOST_PP_SLOT_10TH(x) (x)
39 # if BOOST_PP_SLOT_SIG >= 9
40 # define BOOST_PP_SLOT_9TH(x) BOOST_PP_SLOT_10TH(x) % 100000000UL
42 # define BOOST_PP_SLOT_9TH(x) (x)
45 # if BOOST_PP_SLOT_SIG >= 8
46 # define BOOST_PP_SLOT_8TH(x) BOOST_PP_SLOT_9TH(x) % 10000000UL
48 # define BOOST_PP_SLOT_8TH(x) (x)
51 # if BOOST_PP_SLOT_SIG >= 7
52 # define BOOST_PP_SLOT_7TH(x) BOOST_PP_SLOT_8TH(x) % 1000000UL
54 # define BOOST_PP_SLOT_7TH(x) (x)
57 # if BOOST_PP_SLOT_SIG >= 6
58 # define BOOST_PP_SLOT_6TH(x) BOOST_PP_SLOT_7TH(x) % 100000UL
60 # define BOOST_PP_SLOT_6TH(x) (x)
63 # if BOOST_PP_SLOT_SIG >= 5
64 # define BOOST_PP_SLOT_5TH(x) BOOST_PP_SLOT_6TH(x) % 10000UL
66 # define BOOST_PP_SLOT_5TH(x) (x)
69 # if BOOST_PP_SLOT_SIG >= 4
70 # define BOOST_PP_SLOT_4TH(x) BOOST_PP_SLOT_5TH(x) % 1000UL
72 # define BOOST_PP_SLOT_4TH(x) (x)
75 # if BOOST_PP_SLOT_SIG >= 3
76 # define BOOST_PP_SLOT_3RD(x) BOOST_PP_SLOT_4TH(x) % 100UL
78 # define BOOST_PP_SLOT_3RD(x) (x)
81 # if BOOST_PP_SLOT_SIG >= 2
82 # define BOOST_PP_SLOT_2ND(x) BOOST_PP_SLOT_3RD(x) % 10UL
84 # define BOOST_PP_SLOT_2ND(x) (x)
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)