util_unique_identifier.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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. #include <boost/log/utility/unique_identifier_name.hpp>
  15. // Some hints to avoid warnings about unused variables in this test
  16. #if defined(__GNUC__)
  17. #define BOOST_LOG_AUX_UNUSED_ATTR __attribute__((unused))
  18. #else
  19. #define BOOST_LOG_AUX_UNUSED_ATTR
  20. #endif
  21. int main(int, char*[])
  22. {
  23. // Names with the same prefixes may coexist in different lines
  24. BOOST_LOG_AUX_UNUSED_ATTR int BOOST_LOG_UNIQUE_IDENTIFIER_NAME(var) = 0;
  25. BOOST_LOG_AUX_UNUSED_ATTR int BOOST_LOG_UNIQUE_IDENTIFIER_NAME(var) = 0;
  26. // Names with different prefixes may coexist on the same line
  27. 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;
  28. return 0;
  29. }