Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:29

0001 /*
0002  *          Copyright Andrey Semashev 2007 - 2015.
0003  * Distributed under the Boost Software License, Version 1.0.
0004  *    (See accompanying file LICENSE_1_0.txt or copy at
0005  *          http://www.boost.org/LICENSE_1_0.txt)
0006  */
0007 /*!
0008  * \file   unique_identifier_name.hpp
0009  * \author Andrey Semashev
0010  * \date   30.04.2008
0011  *
0012  * The header contains \c BOOST_LOG_UNIQUE_IDENTIFIER_NAME macro definition.
0013  */
0014 
0015 #ifndef BOOST_LOG_UTILITY_UNIQUE_IDENTIFIER_NAME_HPP_INCLUDED_
0016 #define BOOST_LOG_UTILITY_UNIQUE_IDENTIFIER_NAME_HPP_INCLUDED_
0017 
0018 #include <boost/preprocessor/cat.hpp>
0019 #include <boost/log/detail/config.hpp>
0020 
0021 #ifdef BOOST_HAS_PRAGMA_ONCE
0022 #pragma once
0023 #endif
0024 
0025 #ifndef BOOST_LOG_DOXYGEN_PASS
0026 
0027 #define BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL_(prefix, postfix)\
0028     BOOST_PP_CAT(prefix, postfix)
0029 #define BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(prefix, postfix)\
0030     BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL_(prefix, postfix)
0031 
0032 #endif // BOOST_LOG_DOXYGEN_PASS
0033 
0034 /*!
0035  * \def BOOST_LOG_UNIQUE_IDENTIFIER_NAME(prefix)
0036  *
0037  * Constructs a unique (in the current file scope) token that can be used as a variable name.
0038  * The name will contain a prefix passed in the \a prefix argument. This allows to use the
0039  * macro multiple times on a single line.
0040  */
0041 
0042 // In VC 7.0 and later when compiling with /ZI option __LINE__ macro is corrupted
0043 #ifdef BOOST_MSVC
0044 #  define BOOST_LOG_UNIQUE_IDENTIFIER_NAME(prefix)\
0045     BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(prefix, __COUNTER__)
0046 #else
0047 #  define BOOST_LOG_UNIQUE_IDENTIFIER_NAME(prefix)\
0048     BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(prefix, __LINE__)
0049 #endif // BOOST_MSVC
0050 
0051 #endif // BOOST_LOG_UTILITY_UNIQUE_IDENTIFIER_NAME_HPP_INCLUDED_