1 /* 2 * Copyright Andrey Semashev 2007 - 2015. 3 * Distributed under the Boost Software License, Version 1.0. 4 * (See accompanying file LICENSE_1_0.txt or copy at 5 * http://www.boost.org/LICENSE_1_0.txt) 6 */ 7 /*! 8 * \file util_unique_identifier.cpp 9 * \author Andrey Semashev 10 * \date 24.01.2009 11 * 12 * \brief This header contains tests for the unique identifier name generator. 13 */ 14 15 #include <boost/log/utility/unique_identifier_name.hpp> 16 17 // Some hints to avoid warnings about unused variables in this test 18 #if defined(__GNUC__) 19 #define BOOST_LOG_AUX_UNUSED_ATTR __attribute__((unused)) 20 #else 21 #define BOOST_LOG_AUX_UNUSED_ATTR 22 #endif 23 main(int,char * [])24int main(int, char*[]) 25 { 26 // Names with the same prefixes may coexist in different lines 27 BOOST_LOG_AUX_UNUSED_ATTR int BOOST_LOG_UNIQUE_IDENTIFIER_NAME(var) = 0; 28 BOOST_LOG_AUX_UNUSED_ATTR int BOOST_LOG_UNIQUE_IDENTIFIER_NAME(var) = 0; 29 30 // Names with different prefixes may coexist on the same line 31 BOOST_LOG_AUX_UNUSED_ATTR int BOOST_LOG_UNIQUE_IDENTIFIER_NAME(var1) = 0; BOOST_LOG_AUX_UNUSED_ATTR int BOOST_LOG_UNIQUE_IDENTIFIER_NAME(var2) = 0; 32 33 return 0; 34 } 35