Chris@16: Chris@16: // Copyright (C) 2009-2012 Lorenzo Caminiti Chris@16: // Distributed under the Boost Software License, Version 1.0 Chris@16: // (see accompanying file LICENSE_1_0.txt or a copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Home at http://www.boost.org/libs/local_function Chris@16: Chris@16: #ifndef BOOST_LOCAL_FUNCTION_AUX_SYMBOL_HPP_ Chris@16: #define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_HPP_ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: // PRIVATE // Chris@16: Chris@16: // NOTE: INFIX is used to separate symbols concatenated together. Some of these Chris@16: // symbols are user-defined so they can be anything. Because they can contain Chris@16: // underscore `_` and/or start with capital letters, it is NOT safe for the Chris@16: // INFIX to be the underscore `_` character because that could lead to library Chris@16: // defined symbols containing double underscores `__` or a leading underscore Chris@16: // (followed or not by a capital letter) in the global namespace. All these Chris@16: // symbols are reserved by the C++ standard: (1) "each name that contains a Chris@16: // double underscore (_ _) or begins with an underscore followed by an Chris@16: // uppercase letter is reserved to the implementation" and (2) "each name that Chris@16: // begins with an underscore is reserved to the implementation for use as a Chris@16: // name in the global namespace". Chris@16: #define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_INFIX_ X // `X` used as separator. Chris@16: Chris@16: #define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_PREFIX_ boost_local_function_aux Chris@16: Chris@16: #define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_POSTFIX_(s, unused, tokens) \ Chris@16: BOOST_PP_CAT(tokens, BOOST_LOCAL_FUNCTION_AUX_SYMBOL_INFIX_) Chris@16: Chris@16: // PUBLIC // Chris@16: Chris@16: // Prefixes this library reserved symbol. Chris@16: #define BOOST_LOCAL_FUNCTION_AUX_SYMBOL(seq) \ Chris@16: BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_TRANSFORM( \ Chris@16: BOOST_LOCAL_FUNCTION_AUX_SYMBOL_POSTFIX_, \ Chris@16: ~, (BOOST_LOCAL_FUNCTION_AUX_SYMBOL_PREFIX_) seq )) Chris@16: Chris@16: // Postfixes this library reserved symbol. Chris@16: #define BOOST_LOCAL_FUNCTION_AUX_SYMBOL_POSTFIX(seq) \ Chris@16: BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_TRANSFORM( \ Chris@16: BOOST_LOCAL_FUNCTION_AUX_SYMBOL_POSTFIX_, \ Chris@16: ~, seq (BOOST_LOCAL_FUNCTION_AUX_SYMBOL_PREFIX_) )) Chris@16: Chris@16: #endif // #include guard Chris@16: