Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52478 - in trunk/boost/asio: . detail
From: chris_at_[hidden]
Date: 2009-04-19 00:15:18


Author: chris_kohlhoff
Date: 2009-04-19 00:15:17 EDT (Sun, 19 Apr 2009)
New Revision: 52478
URL: http://svn.boost.org/trac/boost/changeset/52478

Log:
Don't include termios.h unless BOOST_ASIO_HAS_SERIAL_PORT is defined.
Fixes #2917.

Text files modified:
   trunk/boost/asio/detail/reactive_serial_port_service.hpp | 10 +++++-----
   trunk/boost/asio/serial_port_base.hpp | 22 +++++++++++++++++++---
   trunk/boost/asio/serial_port_service.hpp | 8 +-------
   3 files changed, 25 insertions(+), 15 deletions(-)

Modified: trunk/boost/asio/detail/reactive_serial_port_service.hpp
==============================================================================
--- trunk/boost/asio/detail/reactive_serial_port_service.hpp (original)
+++ trunk/boost/asio/detail/reactive_serial_port_service.hpp 2009-04-19 00:15:17 EDT (Sun, 19 Apr 2009)
@@ -23,11 +23,10 @@
 #include <string>
 #include <boost/asio/detail/pop_options.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#include <boost/asio/serial_port_base.hpp>
 
-#include <boost/asio/detail/push_options.hpp>
-#include <termios.h>
-#include <boost/asio/detail/pop_options.hpp>
+#if defined(BOOST_ASIO_HAS_SERIAL_PORT) \
+ && !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
 
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
@@ -263,7 +262,8 @@
 } // namespace asio
 } // namespace boost
 
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // defined(BOOST_ASIO_HAS_SERIAL_PORT)
+ // && !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
 
 #include <boost/asio/detail/pop_options.hpp>
 

Modified: trunk/boost/asio/serial_port_base.hpp
==============================================================================
--- trunk/boost/asio/serial_port_base.hpp (original)
+++ trunk/boost/asio/serial_port_base.hpp 2009-04-19 00:15:17 EDT (Sun, 19 Apr 2009)
@@ -22,12 +22,25 @@
 #include <stdexcept>
 #include <boost/config.hpp>
 #include <boost/detail/workaround.hpp>
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# include <termios.h>
-#endif
 #include <boost/system/error_code.hpp>
 #include <boost/asio/detail/pop_options.hpp>
 
+#if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
+# if defined(BOOST_ASIO_HAS_IOCP) \
+ || !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+# define BOOST_ASIO_HAS_SERIAL_PORT 1
+# endif // defined(BOOST_ASIO_HAS_IOCP)
+#endif // !defined(BOOST_ASIO_DISABLE_STREAM_HANDLE)
+
+#if defined(BOOST_ASIO_HAS_SERIAL_PORT) \
+ || defined(GENERATING_DOCUMENTATION)
+
+#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+# include <boost/asio/detail/push_options.hpp>
+# include <termios.h>
+# include <boost/asio/detail/pop_options.hpp>
+#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+
 #include <boost/asio/detail/socket_types.hpp>
 
 #if defined(GENERATING_DOCUMENTATION)
@@ -154,6 +167,9 @@
 
 #undef BOOST_ASIO_OPTION_STORAGE
 
+#endif // defined(BOOST_ASIO_HAS_SERIAL_PORT)
+ // || defined(GENERATING_DOCUMENTATION)
+
 #include <boost/asio/detail/pop_options.hpp>
 
 #endif // BOOST_ASIO_SERIAL_PORT_BASE_HPP

Modified: trunk/boost/asio/serial_port_service.hpp
==============================================================================
--- trunk/boost/asio/serial_port_service.hpp (original)
+++ trunk/boost/asio/serial_port_service.hpp 2009-04-19 00:15:17 EDT (Sun, 19 Apr 2009)
@@ -25,17 +25,11 @@
 
 #include <boost/asio/error.hpp>
 #include <boost/asio/io_service.hpp>
+#include <boost/asio/serial_port_base.hpp>
 #include <boost/asio/detail/service_base.hpp>
 #include <boost/asio/detail/reactive_serial_port_service.hpp>
 #include <boost/asio/detail/win_iocp_serial_port_service.hpp>
 
-#if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
-# if defined(BOOST_ASIO_HAS_IOCP) \
- || !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# define BOOST_ASIO_HAS_SERIAL_PORT 1
-# endif // defined(BOOST_ASIO_HAS_IOCP)
-#endif // !defined(BOOST_ASIO_DISABLE_STREAM_HANDLE)
-
 #if defined(BOOST_ASIO_HAS_SERIAL_PORT) \
   || defined(GENERATING_DOCUMENTATION)
 


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