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