MessagePack for C++
Loading...
Searching...
No Matches
div_base.hpp
Go to the documentation of this file.
1# /* Copyright (C) 2001
2# * Housemarque Oy
3# * http://www.housemarque.com
4# *
5# * Distributed under the Boost Software License, Version 1.0. (See
6# * accompanying file LICENSE_1_0.txt or copy at
7# * http://www.boost.org/LICENSE_1_0.txt)
8# */
9#
10# /* Revised by Paul Mensonides (2002) */
11#
12# /* See http://www.boost.org for most recent version. */
13#
14# ifndef MSGPACK_PREPROCESSOR_ARITHMETIC_DETAIL_DIV_BASE_HPP
15# define MSGPACK_PREPROCESSOR_ARITHMETIC_DETAIL_DIV_BASE_HPP
16#
24#
25# /* MSGPACK_PP_DIV_BASE */
26#
27# if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
28# define MSGPACK_PP_DIV_BASE(x, y) MSGPACK_PP_WHILE(MSGPACK_PP_DIV_BASE_P, MSGPACK_PP_DIV_BASE_O, (0, x, y))
29# else
30# define MSGPACK_PP_DIV_BASE(x, y) MSGPACK_PP_DIV_BASE_I(x, y)
31# define MSGPACK_PP_DIV_BASE_I(x, y) MSGPACK_PP_WHILE(MSGPACK_PP_DIV_BASE_P, MSGPACK_PP_DIV_BASE_O, (0, x, y))
32# endif
33#
34# if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_STRICT()
35# define MSGPACK_PP_DIV_BASE_P(d, rxy) MSGPACK_PP_DIV_BASE_P_IM(d, MSGPACK_PP_TUPLE_REM_3 rxy)
36# define MSGPACK_PP_DIV_BASE_P_IM(d, im) MSGPACK_PP_DIV_BASE_P_I(d, im)
37# else
38# define MSGPACK_PP_DIV_BASE_P(d, rxy) MSGPACK_PP_DIV_BASE_P_I(d, MSGPACK_PP_TUPLE_ELEM(3, 0, rxy), MSGPACK_PP_TUPLE_ELEM(3, 1, rxy), MSGPACK_PP_TUPLE_ELEM(3, 2, rxy))
39# endif
40#
41# define MSGPACK_PP_DIV_BASE_P_I(d, r, x, y) MSGPACK_PP_LESS_EQUAL_D(d, y, x)
42#
43# if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_STRICT()
44# define MSGPACK_PP_DIV_BASE_O(d, rxy) MSGPACK_PP_DIV_BASE_O_IM(d, MSGPACK_PP_TUPLE_REM_3 rxy)
45# define MSGPACK_PP_DIV_BASE_O_IM(d, im) MSGPACK_PP_DIV_BASE_O_I(d, im)
46# else
47# define MSGPACK_PP_DIV_BASE_O(d, rxy) MSGPACK_PP_DIV_BASE_O_I(d, MSGPACK_PP_TUPLE_ELEM(3, 0, rxy), MSGPACK_PP_TUPLE_ELEM(3, 1, rxy), MSGPACK_PP_TUPLE_ELEM(3, 2, rxy))
48# endif
49#
50# define MSGPACK_PP_DIV_BASE_O_I(d, r, x, y) (MSGPACK_PP_INC(r), MSGPACK_PP_SUB_D(d, x, y), y)
51#
52# /* MSGPACK_PP_DIV_BASE_D */
53#
54# if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
55# define MSGPACK_PP_DIV_BASE_D(d, x, y) MSGPACK_PP_WHILE_ ## d(MSGPACK_PP_DIV_BASE_P, MSGPACK_PP_DIV_BASE_O, (0, x, y))
56# else
57# define MSGPACK_PP_DIV_BASE_D(d, x, y) MSGPACK_PP_DIV_BASE_D_I(d, x, y)
58# define MSGPACK_PP_DIV_BASE_D_I(d, x, y) MSGPACK_PP_WHILE_ ## d(MSGPACK_PP_DIV_BASE_P, MSGPACK_PP_DIV_BASE_O, (0, x, y))
59# endif
60#
61# endif