fixing stuff
[dyninst.git] / dynutil / h / dyn_detail / boost / preprocessor / list / transform.hpp
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 DYN_DETAIL_BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
15 # define DYN_DETAIL_BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
16 #
17 # include <dyn_detail/boost/preprocessor/config/config.hpp>
18 # include <dyn_detail/boost/preprocessor/list/fold_right.hpp>
19 # include <dyn_detail/boost/preprocessor/tuple/elem.hpp>
20 # include <dyn_detail/boost/preprocessor/tuple/rem.hpp>
21 #
22 # /* DYN_DETAIL_BOOST_PP_LIST_TRANSFORM */
23 #
24 # if ~DYN_DETAIL_BOOST_PP_CONFIG_FLAGS() & DYN_DETAIL_BOOST_PP_CONFIG_EDG()
25 #    define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM(op, data, list) DYN_DETAIL_BOOST_PP_TUPLE_ELEM(3, 2, DYN_DETAIL_BOOST_PP_LIST_FOLD_RIGHT(DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O, (op, data, DYN_DETAIL_BOOST_PP_NIL), list))
26 # else
27 #    define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM(op, data, list) DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_I(op, data, list)
28 #    define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_I(op, data, list) DYN_DETAIL_BOOST_PP_TUPLE_ELEM(3, 2, DYN_DETAIL_BOOST_PP_LIST_FOLD_RIGHT(DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O, (op, data, DYN_DETAIL_BOOST_PP_NIL), list))
29 # endif
30 #
31 # if ~DYN_DETAIL_BOOST_PP_CONFIG_FLAGS() & DYN_DETAIL_BOOST_PP_CONFIG_EDG()
32 #    define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O(d, odr, elem) DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O_D(d, DYN_DETAIL_BOOST_PP_TUPLE_ELEM(3, 0, odr), DYN_DETAIL_BOOST_PP_TUPLE_ELEM(3, 1, odr), DYN_DETAIL_BOOST_PP_TUPLE_ELEM(3, 2, odr), elem)
33 # else
34 #    define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O(d, odr, elem) DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O_I(d, DYN_DETAIL_BOOST_PP_TUPLE_REM_3 odr, elem)
35 #    define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O_I(d, im, elem) DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O_D(d, im, elem)
36 # endif
37 #
38 # define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O_D(d, op, data, res, elem) (op, data, (op(d, data, elem), res))
39 #
40 # /* DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_D */
41 #
42 # if ~DYN_DETAIL_BOOST_PP_CONFIG_FLAGS() & DYN_DETAIL_BOOST_PP_CONFIG_EDG()
43 #    define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_D(d, op, data, list) DYN_DETAIL_BOOST_PP_TUPLE_ELEM(3, 2, DYN_DETAIL_BOOST_PP_LIST_FOLD_RIGHT_ ## d(DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O, (op, data, DYN_DETAIL_BOOST_PP_NIL), list))
44 # else
45 #    define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_D(d, op, data, list) DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_D_I(d, op, data, list)
46 #    define DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_D_I(d, op, data, list) DYN_DETAIL_BOOST_PP_TUPLE_ELEM(3, 2, DYN_DETAIL_BOOST_PP_LIST_FOLD_RIGHT_ ## d(DYN_DETAIL_BOOST_PP_LIST_TRANSFORM_O, (op, data, DYN_DETAIL_BOOST_PP_NIL), list))
47 # endif
48 #
49 # endif