Chris@16: # /* Copyright (C) 2001 Chris@16: # * Housemarque Oy Chris@16: # * http://www.housemarque.com Chris@16: # * Chris@16: # * Distributed under the Boost Software License, Version 1.0. (See Chris@16: # * accompanying file LICENSE_1_0.txt or copy at Chris@16: # * http://www.boost.org/LICENSE_1_0.txt) Chris@16: # */ Chris@16: # Chris@16: # /* Revised by Paul Mensonides (2002) */ Chris@16: # Chris@16: # /* See http://www.boost.org for most recent version. */ Chris@16: # Chris@16: # ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_DIV_BASE_HPP Chris@16: # define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_DIV_BASE_HPP Chris@16: # Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # Chris@16: # /* BOOST_PP_DIV_BASE */ Chris@16: # Chris@16: # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG() Chris@16: # 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: # else Chris@16: # define BOOST_PP_DIV_BASE(x, y) BOOST_PP_DIV_BASE_I(x, y) Chris@16: # 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: # endif Chris@16: # Chris@16: # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT() Chris@16: # define BOOST_PP_DIV_BASE_P(d, rxy) BOOST_PP_DIV_BASE_P_IM(d, BOOST_PP_TUPLE_REM_3 rxy) Chris@16: # define BOOST_PP_DIV_BASE_P_IM(d, im) BOOST_PP_DIV_BASE_P_I(d, im) Chris@16: # else Chris@16: # 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: # endif Chris@16: # Chris@16: # define BOOST_PP_DIV_BASE_P_I(d, r, x, y) BOOST_PP_LESS_EQUAL_D(d, y, x) Chris@16: # Chris@16: # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT() Chris@16: # define BOOST_PP_DIV_BASE_O(d, rxy) BOOST_PP_DIV_BASE_O_IM(d, BOOST_PP_TUPLE_REM_3 rxy) Chris@16: # define BOOST_PP_DIV_BASE_O_IM(d, im) BOOST_PP_DIV_BASE_O_I(d, im) Chris@16: # else Chris@16: # 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: # endif Chris@16: # Chris@16: # 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: # Chris@16: # /* BOOST_PP_DIV_BASE_D */ Chris@16: # Chris@16: # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG() Chris@16: # 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: # else Chris@16: # define BOOST_PP_DIV_BASE_D(d, x, y) BOOST_PP_DIV_BASE_D_I(d, x, y) Chris@16: # 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: # endif Chris@16: # Chris@16: # endif