Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 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 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 14 | # ifndef NDNBOOST_PREPROCESSOR_LIST_REVERSE_HPP |
| 15 | # define NDNBOOST_PREPROCESSOR_LIST_REVERSE_HPP |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 16 | # |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 17 | # include <ndnboost/preprocessor/config/config.hpp> |
| 18 | # include <ndnboost/preprocessor/list/fold_left.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 19 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 20 | # /* NDNBOOST_PP_LIST_REVERSE */ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 21 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 22 | # if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG() |
| 23 | # define NDNBOOST_PP_LIST_REVERSE(list) NDNBOOST_PP_LIST_FOLD_LEFT(NDNBOOST_PP_LIST_REVERSE_O, NDNBOOST_PP_NIL, list) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 24 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 25 | # define NDNBOOST_PP_LIST_REVERSE(list) NDNBOOST_PP_LIST_REVERSE_I(list) |
| 26 | # define NDNBOOST_PP_LIST_REVERSE_I(list) NDNBOOST_PP_LIST_FOLD_LEFT(NDNBOOST_PP_LIST_REVERSE_O, NDNBOOST_PP_NIL, list) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 27 | # endif |
| 28 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 29 | # define NDNBOOST_PP_LIST_REVERSE_O(d, s, x) (x, s) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 30 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 31 | # /* NDNBOOST_PP_LIST_REVERSE_D */ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 32 | # |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 33 | # if ~NDNBOOST_PP_CONFIG_FLAGS() & NDNBOOST_PP_CONFIG_EDG() |
| 34 | # define NDNBOOST_PP_LIST_REVERSE_D(d, list) NDNBOOST_PP_LIST_FOLD_LEFT_ ## d(NDNBOOST_PP_LIST_REVERSE_O, NDNBOOST_PP_NIL, list) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 35 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 36 | # define NDNBOOST_PP_LIST_REVERSE_D(d, list) NDNBOOST_PP_LIST_REVERSE_D_I(d, list) |
| 37 | # define NDNBOOST_PP_LIST_REVERSE_D_I(d, list) NDNBOOST_PP_LIST_FOLD_LEFT_ ## d(NDNBOOST_PP_LIST_REVERSE_O, NDNBOOST_PP_NIL, list) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 38 | # endif |
| 39 | # |
| 40 | # endif |