Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85747 - trunk/boost/asio/detail
From: chris_at_[hidden]
Date: 2013-09-17 17:45:43


Author: chris_kohlhoff
Date: 2013-09-17 17:45:43 EDT (Tue, 17 Sep 2013)
New Revision: 85747
URL: http://svn.boost.org/trac/boost/changeset/85747

Log:
Suppress g++ 4.8+ warning about unused typedefs.

Text files modified:
   trunk/boost/asio/detail/handler_type_requirements.hpp | 58 +++++++++++++++++++++++----------------
   1 files changed, 34 insertions(+), 24 deletions(-)

Modified: trunk/boost/asio/detail/handler_type_requirements.hpp
==============================================================================
--- trunk/boost/asio/detail/handler_type_requirements.hpp Tue Sep 17 17:43:29 2013 (r85746)
+++ trunk/boost/asio/detail/handler_type_requirements.hpp 2013-09-17 17:45:43 EDT (Tue, 17 Sep 2013) (r85747)
@@ -53,6 +53,16 @@
 # include <boost/asio/handler_type.hpp>
 #endif // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
 
+// Newer gcc needs special treatment to suppress unused typedef warnings.
+#if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
+# define BOOST_ASIO_UNUSED_TYPEDEF __attribute__((__unused__))
+# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) || (__GNUC__ > 4)
+#endif // defined(__GNUC__)
+#if !defined(BOOST_ASIO_UNUSED_TYPEDEF)
+# define BOOST_ASIO_UNUSED_TYPEDEF
+#endif // !defined(BOOST_ASIO_UNUSED_TYPEDEF)
+
 namespace boost {
 namespace asio {
 namespace detail {
@@ -131,7 +141,7 @@
       sizeof( \
         boost::asio::detail::lvref< \
           asio_true_handler_type>()(), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_READ_HANDLER_CHECK( \
     handler_type, handler) \
@@ -158,7 +168,7 @@
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>(), \
             boost::asio::detail::lvref<const std::size_t>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 
 #define BOOST_ASIO_WRITE_HANDLER_CHECK( \
@@ -186,7 +196,7 @@
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>(), \
             boost::asio::detail::lvref<const std::size_t>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \
     handler_type, handler) \
@@ -211,7 +221,7 @@
         boost::asio::detail::lvref< \
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_CONNECT_HANDLER_CHECK( \
     handler_type, handler) \
@@ -236,7 +246,7 @@
         boost::asio::detail::lvref< \
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK( \
     handler_type, handler, iter_type) \
@@ -263,7 +273,7 @@
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>(), \
             boost::asio::detail::lvref<const iter_type>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \
     handler_type, handler, iter_type) \
@@ -290,7 +300,7 @@
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>(), \
             boost::asio::detail::lvref<const iter_type>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_WAIT_HANDLER_CHECK( \
     handler_type, handler) \
@@ -315,7 +325,7 @@
         boost::asio::detail::lvref< \
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_SIGNAL_HANDLER_CHECK( \
     handler_type, handler) \
@@ -342,7 +352,7 @@
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>(), \
             boost::asio::detail::lvref<const int>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_HANDSHAKE_HANDLER_CHECK( \
     handler_type, handler) \
@@ -367,7 +377,7 @@
         boost::asio::detail::lvref< \
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \
     handler_type, handler) \
@@ -394,7 +404,7 @@
           asio_true_handler_type>()( \
           boost::asio::detail::lvref<const boost::system::error_code>(), \
           boost::asio::detail::lvref<const std::size_t>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \
     handler_type, handler) \
@@ -419,57 +429,57 @@
         boost::asio::detail::lvref< \
           asio_true_handler_type>()( \
             boost::asio::detail::lvref<const boost::system::error_code>()), \
- char(0))>
+ char(0))> BOOST_ASIO_UNUSED_TYPEDEF
 
 #else // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
 
 #define BOOST_ASIO_COMPLETION_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_READ_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_WRITE_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_CONNECT_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_COMPOSED_CONNECT_HANDLER_CHECK( \
     handler_type, handler, iter_type) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \
     handler_type, handler, iter_type) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_WAIT_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_SIGNAL_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_HANDSHAKE_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \
     handler_type, handler) \
- typedef int
+ typedef int BOOST_ASIO_UNUSED_TYPEDEF
 
 #endif // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk