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   unused_variable.hpp
0009  * \author Andrey Semashev
0010  * \date   10.05.2008
0011  *
0012  * The header contains definition of a macro to suppress compiler warnings about unused variables.
0013  */
0014 
0015 #ifndef BOOST_LOG_UTILITY_UNUSED_VARIABLE_HPP_INCLUDED_
0016 #define BOOST_LOG_UTILITY_UNUSED_VARIABLE_HPP_INCLUDED_
0017 
0018 #include <boost/log/detail/config.hpp>
0019 
0020 #ifdef BOOST_HAS_PRAGMA_ONCE
0021 #pragma once
0022 #endif
0023 
0024 #if defined(__GNUC__)
0025 
0026 //! The macro suppresses compiler warnings for \c var being unused
0027 #define BOOST_LOG_UNUSED_VARIABLE(type, var, initializer) __attribute__((unused)) type var initializer
0028 
0029 #else
0030 
0031 namespace boost {
0032 
0033 BOOST_LOG_OPEN_NAMESPACE
0034 
0035 namespace aux {
0036 
0037 template< typename T >
0038 BOOST_FORCEINLINE void no_unused_warnings(T const&) BOOST_NOEXCEPT {}
0039 
0040 } // namespace aux
0041 
0042 BOOST_LOG_CLOSE_NAMESPACE // namespace log
0043 
0044 } // namespace boost
0045 
0046 //! The macro suppresses compiler warnings for \c var being unused
0047 #define BOOST_LOG_UNUSED_VARIABLE(type, var, initializer) type var initializer; ::boost::log::aux::no_unused_warnings(var)
0048 
0049 #endif
0050 
0051 #endif // BOOST_LOG_UTILITY_UNUSED_VARIABLE_HPP_INCLUDED_