Chris@16: /* Chris@101: * Copyright Andrey Semashev 2007 - 2015. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: /*! Chris@16: * \file unique_identifier_name.hpp Chris@16: * \author Andrey Semashev Chris@16: * \date 30.04.2008 Chris@16: * Chris@16: * The header contains \c BOOST_LOG_UNIQUE_IDENTIFIER_NAME macro definition. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_LOG_UTILITY_UNIQUE_IDENTIFIER_NAME_HPP_INCLUDED_ Chris@16: #define BOOST_LOG_UTILITY_UNIQUE_IDENTIFIER_NAME_HPP_INCLUDED_ Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #ifdef BOOST_HAS_PRAGMA_ONCE Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #ifndef BOOST_LOG_DOXYGEN_PASS Chris@16: Chris@16: #define BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL_(prefix, postfix)\ Chris@16: BOOST_PP_CAT(prefix, postfix) Chris@16: #define BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(prefix, postfix)\ Chris@16: BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL_(prefix, postfix) Chris@16: Chris@16: #endif // BOOST_LOG_DOXYGEN_PASS Chris@16: Chris@16: /*! Chris@16: * \def BOOST_LOG_UNIQUE_IDENTIFIER_NAME(prefix) Chris@16: * Chris@16: * Constructs a unique (in the current file scope) token that can be used as a variable name. Chris@16: * The name will contain a prefix passed in the \a prefix argument. This allows to use the Chris@16: * macro multiple times on a single line. Chris@16: */ Chris@16: Chris@16: // In VC 7.0 and later when compiling with /ZI option __LINE__ macro is corrupted Chris@16: #ifdef BOOST_MSVC Chris@16: # define BOOST_LOG_UNIQUE_IDENTIFIER_NAME(prefix)\ Chris@16: BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(prefix, __COUNTER__) Chris@16: #else Chris@16: # define BOOST_LOG_UNIQUE_IDENTIFIER_NAME(prefix)\ Chris@16: BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(prefix, __LINE__) Chris@16: #endif // BOOST_MSVC Chris@16: Chris@16: #endif // BOOST_LOG_UTILITY_UNIQUE_IDENTIFIER_NAME_HPP_INCLUDED_