Chris@16
|
1 /*
|
Chris@101
|
2 * Copyright Andrey Semashev 2007 - 2015.
|
Chris@16
|
3 * Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
4 * (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
5 * http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 */
|
Chris@16
|
7 /*!
|
Chris@16
|
8 * \file unique_identifier_name.hpp
|
Chris@16
|
9 * \author Andrey Semashev
|
Chris@16
|
10 * \date 30.04.2008
|
Chris@16
|
11 *
|
Chris@16
|
12 * The header contains \c BOOST_LOG_UNIQUE_IDENTIFIER_NAME macro definition.
|
Chris@16
|
13 */
|
Chris@16
|
14
|
Chris@16
|
15 #ifndef BOOST_LOG_UTILITY_UNIQUE_IDENTIFIER_NAME_HPP_INCLUDED_
|
Chris@16
|
16 #define BOOST_LOG_UTILITY_UNIQUE_IDENTIFIER_NAME_HPP_INCLUDED_
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/preprocessor/cat.hpp>
|
Chris@16
|
19 #include <boost/log/detail/config.hpp>
|
Chris@16
|
20
|
Chris@16
|
21 #ifdef BOOST_HAS_PRAGMA_ONCE
|
Chris@16
|
22 #pragma once
|
Chris@16
|
23 #endif
|
Chris@16
|
24
|
Chris@16
|
25 #ifndef BOOST_LOG_DOXYGEN_PASS
|
Chris@16
|
26
|
Chris@16
|
27 #define BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL_(prefix, postfix)\
|
Chris@16
|
28 BOOST_PP_CAT(prefix, postfix)
|
Chris@16
|
29 #define BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(prefix, postfix)\
|
Chris@16
|
30 BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL_(prefix, postfix)
|
Chris@16
|
31
|
Chris@16
|
32 #endif // BOOST_LOG_DOXYGEN_PASS
|
Chris@16
|
33
|
Chris@16
|
34 /*!
|
Chris@16
|
35 * \def BOOST_LOG_UNIQUE_IDENTIFIER_NAME(prefix)
|
Chris@16
|
36 *
|
Chris@16
|
37 * Constructs a unique (in the current file scope) token that can be used as a variable name.
|
Chris@16
|
38 * The name will contain a prefix passed in the \a prefix argument. This allows to use the
|
Chris@16
|
39 * macro multiple times on a single line.
|
Chris@16
|
40 */
|
Chris@16
|
41
|
Chris@16
|
42 // In VC 7.0 and later when compiling with /ZI option __LINE__ macro is corrupted
|
Chris@16
|
43 #ifdef BOOST_MSVC
|
Chris@16
|
44 # define BOOST_LOG_UNIQUE_IDENTIFIER_NAME(prefix)\
|
Chris@16
|
45 BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(prefix, __COUNTER__)
|
Chris@16
|
46 #else
|
Chris@16
|
47 # define BOOST_LOG_UNIQUE_IDENTIFIER_NAME(prefix)\
|
Chris@16
|
48 BOOST_LOG_UNIQUE_IDENTIFIER_NAME_INTERNAL(prefix, __LINE__)
|
Chris@16
|
49 #endif // BOOST_MSVC
|
Chris@16
|
50
|
Chris@16
|
51 #endif // BOOST_LOG_UTILITY_UNIQUE_IDENTIFIER_NAME_HPP_INCLUDED_
|