Chris@16
|
1 # /* Copyright (C) 2001
|
Chris@16
|
2 # * Housemarque Oy
|
Chris@16
|
3 # * http://www.housemarque.com
|
Chris@16
|
4 # *
|
Chris@16
|
5 # * Distributed under the Boost Software License, Version 1.0. (See
|
Chris@16
|
6 # * accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 # * http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8 # */
|
Chris@16
|
9 #
|
Chris@16
|
10 # /* Revised by Paul Mensonides (2002) */
|
Chris@16
|
11 #
|
Chris@16
|
12 # /* See http://www.boost.org for most recent version. */
|
Chris@16
|
13 #
|
Chris@16
|
14 # ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_DIV_BASE_HPP
|
Chris@16
|
15 # define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_DIV_BASE_HPP
|
Chris@16
|
16 #
|
Chris@16
|
17 # include <boost/preprocessor/arithmetic/inc.hpp>
|
Chris@16
|
18 # include <boost/preprocessor/arithmetic/sub.hpp>
|
Chris@16
|
19 # include <boost/preprocessor/comparison/less_equal.hpp>
|
Chris@16
|
20 # include <boost/preprocessor/config/config.hpp>
|
Chris@16
|
21 # include <boost/preprocessor/control/while.hpp>
|
Chris@16
|
22 # include <boost/preprocessor/tuple/elem.hpp>
|
Chris@16
|
23 # include <boost/preprocessor/tuple/rem.hpp>
|
Chris@16
|
24 #
|
Chris@16
|
25 # /* BOOST_PP_DIV_BASE */
|
Chris@16
|
26 #
|
Chris@16
|
27 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
Chris@16
|
28 # define BOOST_PP_DIV_BASE(x, y) BOOST_PP_WHILE(BOOST_PP_DIV_BASE_P, BOOST_PP_DIV_BASE_O, (0, x, y))
|
Chris@16
|
29 # else
|
Chris@16
|
30 # define BOOST_PP_DIV_BASE(x, y) BOOST_PP_DIV_BASE_I(x, y)
|
Chris@16
|
31 # define BOOST_PP_DIV_BASE_I(x, y) BOOST_PP_WHILE(BOOST_PP_DIV_BASE_P, BOOST_PP_DIV_BASE_O, (0, x, y))
|
Chris@16
|
32 # endif
|
Chris@16
|
33 #
|
Chris@16
|
34 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
|
Chris@16
|
35 # define BOOST_PP_DIV_BASE_P(d, rxy) BOOST_PP_DIV_BASE_P_IM(d, BOOST_PP_TUPLE_REM_3 rxy)
|
Chris@16
|
36 # define BOOST_PP_DIV_BASE_P_IM(d, im) BOOST_PP_DIV_BASE_P_I(d, im)
|
Chris@16
|
37 # else
|
Chris@16
|
38 # define BOOST_PP_DIV_BASE_P(d, rxy) BOOST_PP_DIV_BASE_P_I(d, BOOST_PP_TUPLE_ELEM(3, 0, rxy), BOOST_PP_TUPLE_ELEM(3, 1, rxy), BOOST_PP_TUPLE_ELEM(3, 2, rxy))
|
Chris@16
|
39 # endif
|
Chris@16
|
40 #
|
Chris@16
|
41 # define BOOST_PP_DIV_BASE_P_I(d, r, x, y) BOOST_PP_LESS_EQUAL_D(d, y, x)
|
Chris@16
|
42 #
|
Chris@16
|
43 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
|
Chris@16
|
44 # define BOOST_PP_DIV_BASE_O(d, rxy) BOOST_PP_DIV_BASE_O_IM(d, BOOST_PP_TUPLE_REM_3 rxy)
|
Chris@16
|
45 # define BOOST_PP_DIV_BASE_O_IM(d, im) BOOST_PP_DIV_BASE_O_I(d, im)
|
Chris@16
|
46 # else
|
Chris@16
|
47 # define BOOST_PP_DIV_BASE_O(d, rxy) BOOST_PP_DIV_BASE_O_I(d, BOOST_PP_TUPLE_ELEM(3, 0, rxy), BOOST_PP_TUPLE_ELEM(3, 1, rxy), BOOST_PP_TUPLE_ELEM(3, 2, rxy))
|
Chris@16
|
48 # endif
|
Chris@16
|
49 #
|
Chris@16
|
50 # define BOOST_PP_DIV_BASE_O_I(d, r, x, y) (BOOST_PP_INC(r), BOOST_PP_SUB_D(d, x, y), y)
|
Chris@16
|
51 #
|
Chris@16
|
52 # /* BOOST_PP_DIV_BASE_D */
|
Chris@16
|
53 #
|
Chris@16
|
54 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
Chris@16
|
55 # define BOOST_PP_DIV_BASE_D(d, x, y) BOOST_PP_WHILE_ ## d(BOOST_PP_DIV_BASE_P, BOOST_PP_DIV_BASE_O, (0, x, y))
|
Chris@16
|
56 # else
|
Chris@16
|
57 # define BOOST_PP_DIV_BASE_D(d, x, y) BOOST_PP_DIV_BASE_D_I(d, x, y)
|
Chris@16
|
58 # define BOOST_PP_DIV_BASE_D_I(d, x, y) BOOST_PP_WHILE_ ## d(BOOST_PP_DIV_BASE_P, BOOST_PP_DIV_BASE_O, (0, x, y))
|
Chris@16
|
59 # endif
|
Chris@16
|
60 #
|
Chris@16
|
61 # endif
|