Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62531 - in trunk/boost/asio/detail: . impl
From: chris_at_[hidden]
Date: 2010-06-07 19:29:07


Author: chris_kohlhoff
Date: 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
New Revision: 62531
URL: http://svn.boost.org/trac/boost/changeset/62531

Log:
Some changes for Symbian support.

Removed:
   trunk/boost/asio/detail/win_signal_blocker.hpp
Text files modified:
   trunk/boost/asio/detail/config.hpp | 8 +++-
   trunk/boost/asio/detail/impl/descriptor_ops.ipp | 15 +++++++++
   trunk/boost/asio/detail/impl/pipe_select_interrupter.ipp | 8 +++-
   trunk/boost/asio/detail/impl/socket_ops.ipp | 64 ++++++++++++++++++++++++++++++----------
   trunk/boost/asio/detail/impl/socket_select_interrupter.ipp | 8 +++-
   trunk/boost/asio/detail/null_signal_blocker.hpp | 12 ++++++-
   trunk/boost/asio/detail/pipe_select_interrupter.hpp | 8 +++-
   trunk/boost/asio/detail/select_interrupter.hpp | 4 +-
   trunk/boost/asio/detail/signal_blocker.hpp | 10 ++---
   trunk/boost/asio/detail/socket_select_interrupter.hpp | 8 +++-
   trunk/boost/asio/detail/socket_types.hpp | 8 +++-
   11 files changed, 114 insertions(+), 39 deletions(-)

Modified: trunk/boost/asio/detail/config.hpp
==============================================================================
--- trunk/boost/asio/detail/config.hpp (original)
+++ trunk/boost/asio/detail/config.hpp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -159,9 +159,11 @@
 // Serial ports.
 #if defined(BOOST_ASIO_HAS_IOCP) \
    || !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
-# if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
-# define BOOST_ASIO_HAS_SERIAL_PORT 1
-# endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
+# if !defined(__SYMBIAN32__)
+# if !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
+# define BOOST_ASIO_HAS_SERIAL_PORT 1
+# endif // !defined(BOOST_ASIO_DISABLE_SERIAL_PORT)
+# endif // !defined(__SYMBIAN32__)
 #endif // defined(BOOST_ASIO_HAS_IOCP)
        // || !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
 

Modified: trunk/boost/asio/detail/impl/descriptor_ops.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/descriptor_ops.ipp (original)
+++ trunk/boost/asio/detail/impl/descriptor_ops.ipp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -45,8 +45,14 @@
   {
     if (state & internal_non_blocking)
     {
+#if defined(__SYMBIAN32__)
+ int flags = ::fcntl(d, F_GETFL, 0);
+ if (flags >= 0)
+ ::fcntl(d, F_SETFL, flags & ~O_NONBLOCK);
+#else // defined(__SYMBIAN32__)
       ioctl_arg_type arg = 0;
       ::ioctl(d, FIONBIO, &arg);
+#endif // defined(__SYMBIAN32__)
       state &= ~internal_non_blocking;
     }
 
@@ -69,8 +75,17 @@
   }
 
   errno = 0;
+#if defined(__SYMBIAN32__)
+ int result = error_wrapper(::fcntl(d, F_GETFL, 0), ec);
+ if (result >= 0)
+ {
+ errno = 0;
+ result = error_wrapper(::fcntl(d, F_SETFL, result | O_NONBLOCK), ec);
+ }
+#else // defined(__SYMBIAN32__)
   ioctl_arg_type arg = 1;
   int result = error_wrapper(::ioctl(d, FIONBIO, &arg), ec);
+#endif // defined(__SYMBIAN32__)
 
   if (result >= 0)
   {

Modified: trunk/boost/asio/detail/impl/pipe_select_interrupter.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/pipe_select_interrupter.ipp (original)
+++ trunk/boost/asio/detail/impl/pipe_select_interrupter.ipp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -17,7 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_WINDOWS)
+#if !defined(__CYGWIN__)
+#if !defined(__SYMBIAN32__)
 #if !defined(BOOST_ASIO_HAS_EVENTFD)
 
 #include <fcntl.h>
@@ -89,6 +91,8 @@
 #include <boost/asio/detail/pop_options.hpp>
 
 #endif // !defined(BOOST_ASIO_HAS_EVENTFD)
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(__SYMBIAN32__)
+#endif // !defined(__CYGWIN__)
+#endif // !defined(BOOST_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_PIPE_SELECT_INTERRUPTER_IPP

Modified: trunk/boost/asio/detail/impl/socket_ops.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/socket_ops.ipp (original)
+++ trunk/boost/asio/detail/impl/socket_ops.ipp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -288,8 +288,14 @@
 #else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
     if (state & non_blocking)
     {
+#if defined(__SYMBIAN32__)
+ int flags = ::fcntl(s, F_GETFL, 0);
+ if (flags >= 0)
+ ::fcntl(s, F_SETFL, flags & ~O_NONBLOCK);
+#else // defined(__SYMBIAN32__)
       ioctl_arg_type arg = 0;
       ::ioctl(s, FIONBIO, &arg);
+#endif // defined(__SYMBIAN32__)
       state &= ~non_blocking;
     }
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
@@ -327,12 +333,20 @@
   }
 
   clear_last_error();
- ioctl_arg_type arg = 1;
 #if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+ ioctl_arg_type arg = 1;
   int result = error_wrapper(::ioctlsocket(s, FIONBIO, &arg), ec);
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#elif defined(__SYMBIAN32__)
+ int result = error_wrapper(::fcntl(s, F_GETFL, 0), ec);
+ if (result >= 0)
+ {
+ clear_last_error();
+ result = error_wrapper(::fcntl(s, F_SETFL, result | O_NONBLOCK), ec);
+ }
+#else
+ ioctl_arg_type arg = 1;
   int result = error_wrapper(::ioctl(s, FIONBIO, &arg), ec);
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif
 
   if (result >= 0)
   {
@@ -1492,8 +1506,10 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
- FD_SET fds;
+#if defined(BOOST_WINDOWS) \
+ || defined(__CYGWIN__) \
+ || defined(__SYMBIAN32__)
+ fd_set fds;
   FD_ZERO(&fds);
   FD_SET(s, &fds);
   clear_last_error();
@@ -1501,7 +1517,9 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_WINDOWS)
+ // || defined(__CYGWIN__)
+ // || defined(__SYMBIAN32__)
   pollfd fds;
   fds.fd = s;
   fds.events = POLLIN;
@@ -1511,7 +1529,9 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_WINDOWS)
+ // || defined(__CYGWIN__)
+ // || defined(__SYMBIAN32__)
 }
 
 int poll_write(socket_type s, boost::system::error_code& ec)
@@ -1522,8 +1542,10 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
- FD_SET fds;
+#if defined(BOOST_WINDOWS) \
+ || defined(__CYGWIN__) \
+ || defined(__SYMBIAN32__)
+ fd_set fds;
   FD_ZERO(&fds);
   FD_SET(s, &fds);
   clear_last_error();
@@ -1531,7 +1553,9 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_WINDOWS)
+ // || defined(__CYGWIN__)
+ // || defined(__SYMBIAN32__)
   pollfd fds;
   fds.fd = s;
   fds.events = POLLOUT;
@@ -1541,7 +1565,9 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_WINDOWS)
+ // || defined(__CYGWIN__)
+ // || defined(__SYMBIAN32__)
 }
 
 int poll_connect(socket_type s, boost::system::error_code& ec)
@@ -1552,11 +1578,13 @@
     return socket_error_retval;
   }
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
- FD_SET write_fds;
+#if defined(BOOST_WINDOWS) \
+ || defined(__CYGWIN__) \
+ || defined(__SYMBIAN32__)
+ fd_set write_fds;
   FD_ZERO(&write_fds);
   FD_SET(s, &write_fds);
- FD_SET except_fds;
+ fd_set except_fds;
   FD_ZERO(&except_fds);
   FD_SET(s, &except_fds);
   clear_last_error();
@@ -1564,7 +1592,9 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#else // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#else // defined(BOOST_WINDOWS)
+ // || defined(__CYGWIN__)
+ // || defined(__SYMBIAN32__)
   pollfd fds;
   fds.fd = s;
   fds.events = POLLOUT;
@@ -1574,7 +1604,9 @@
   if (result >= 0)
     ec = boost::system::error_code();
   return result;
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_WINDOWS)
+ // || defined(__CYGWIN__)
+ // || defined(__SYMBIAN32__)
 }
 
 const char* inet_ntop(int af, const void* src, char* dest, size_t length,

Modified: trunk/boost/asio/detail/impl/socket_select_interrupter.ipp
==============================================================================
--- trunk/boost/asio/detail/impl/socket_select_interrupter.ipp (original)
+++ trunk/boost/asio/detail/impl/socket_select_interrupter.ipp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -17,7 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_WINDOWS) \
+ || defined(__CYGWIN__) \
+ || defined(__SYMBIAN32__)
 
 #include <cstdlib>
 #include <boost/asio/detail/socket_holder.hpp>
@@ -144,6 +146,8 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_WINDOWS)
+ // || defined(__CYGWIN__)
+ // || defined(__SYMBIAN32__)
 
 #endif // BOOST_ASIO_DETAIL_IMPL_SOCKET_SELECT_INTERRUPTER_IPP

Modified: trunk/boost/asio/detail/null_signal_blocker.hpp
==============================================================================
--- trunk/boost/asio/detail/null_signal_blocker.hpp (original)
+++ trunk/boost/asio/detail/null_signal_blocker.hpp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -17,7 +17,11 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_HAS_THREADS) \
+ || defined(BOOST_ASIO_DISABLE_THREADS) \
+ || defined(BOOST_WINDOWS) \
+ || defined(__CYGWIN__) \
+ || defined(__SYMBIAN32__)
 
 #include <boost/asio/detail/noncopyable.hpp>
 
@@ -58,6 +62,10 @@
 
 #include <boost/asio/detail/pop_options.hpp>
 
-#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#endif // !defined(BOOST_HAS_THREADS)
+ // || defined(BOOST_ASIO_DISABLE_THREADS)
+ // || defined(BOOST_WINDOWS)
+ // || defined(__CYGWIN__)
+ // || defined(__SYMBIAN32__)
 
 #endif // BOOST_ASIO_DETAIL_NULL_SIGNAL_BLOCKER_HPP

Modified: trunk/boost/asio/detail/pipe_select_interrupter.hpp
==============================================================================
--- trunk/boost/asio/detail/pipe_select_interrupter.hpp (original)
+++ trunk/boost/asio/detail/pipe_select_interrupter.hpp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -17,7 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#if !defined(BOOST_WINDOWS)
+#if !defined(__CYGWIN__)
+#if !defined(__SYMBIAN32__)
 #if !defined(BOOST_ASIO_HAS_EVENTFD)
 
 #include <boost/asio/detail/push_options.hpp>
@@ -71,6 +73,8 @@
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
 #endif // !defined(BOOST_ASIO_HAS_EVENTFD)
-#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
+#endif // !defined(__SYMBIAN32__)
+#endif // !defined(__CYGWIN__)
+#endif // !defined(BOOST_WINDOWS)
 
 #endif // BOOST_ASIO_DETAIL_PIPE_SELECT_INTERRUPTER_HPP

Modified: trunk/boost/asio/detail/select_interrupter.hpp
==============================================================================
--- trunk/boost/asio/detail/select_interrupter.hpp (original)
+++ trunk/boost/asio/detail/select_interrupter.hpp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 # include <boost/asio/detail/socket_select_interrupter.hpp>
 #elif defined(BOOST_ASIO_HAS_EVENTFD)
 # include <boost/asio/detail/eventfd_select_interrupter.hpp>
@@ -29,7 +29,7 @@
 namespace asio {
 namespace detail {
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 typedef socket_select_interrupter select_interrupter;
 #elif defined(BOOST_ASIO_HAS_EVENTFD)
 typedef eventfd_select_interrupter select_interrupter;

Modified: trunk/boost/asio/detail/signal_blocker.hpp
==============================================================================
--- trunk/boost/asio/detail/signal_blocker.hpp (original)
+++ trunk/boost/asio/detail/signal_blocker.hpp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -17,10 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS) \
+ || defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 # include <boost/asio/detail/null_signal_blocker.hpp>
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-# include <boost/asio/detail/win_signal_blocker.hpp>
 #elif defined(BOOST_HAS_PTHREADS)
 # include <boost/asio/detail/posix_signal_blocker.hpp>
 #else
@@ -31,10 +30,9 @@
 namespace asio {
 namespace detail {
 
-#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
+#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS) \
+ || defined(BOOST_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__)
 typedef null_signal_blocker signal_blocker;
-#elif defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-typedef win_signal_blocker signal_blocker;
 #elif defined(BOOST_HAS_PTHREADS)
 typedef posix_signal_blocker signal_blocker;
 #endif

Modified: trunk/boost/asio/detail/socket_select_interrupter.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_select_interrupter.hpp (original)
+++ trunk/boost/asio/detail/socket_select_interrupter.hpp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -17,7 +17,9 @@
 
 #include <boost/asio/detail/config.hpp>
 
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#if defined(BOOST_WINDOWS) \
+ || defined(__CYGWIN__) \
+ || defined(__SYMBIAN32__)
 
 #include <boost/asio/detail/socket_types.hpp>
 
@@ -71,6 +73,8 @@
 # include <boost/asio/detail/impl/socket_select_interrupter.ipp>
 #endif // defined(BOOST_ASIO_HEADER_ONLY)
 
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
+#endif // defined(BOOST_WINDOWS)
+ // || defined(__CYGWIN__)
+ // || defined(__SYMBIAN32__)
 
 #endif // BOOST_ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP

Modified: trunk/boost/asio/detail/socket_types.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_types.hpp (original)
+++ trunk/boost/asio/detail/socket_types.hpp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
@@ -46,7 +46,9 @@
 # include <boost/asio/detail/old_win_sdk_compat.hpp>
 #else
 # include <sys/ioctl.h>
-# include <sys/poll.h>
+# if !defined(__SYMBIAN32__)
+# include <sys/poll.h>
+# endif
 # include <sys/types.h>
 # include <sys/stat.h>
 # include <fcntl.h>
@@ -59,7 +61,9 @@
 # include <sys/uio.h>
 # include <sys/un.h>
 # include <netinet/in.h>
-# include <netinet/tcp.h>
+# if !defined(__SYMBIAN32__)
+# include <netinet/tcp.h>
+# endif
 # include <arpa/inet.h>
 # include <netdb.h>
 # include <net/if.h>

Deleted: trunk/boost/asio/detail/win_signal_blocker.hpp
==============================================================================
--- trunk/boost/asio/detail/win_signal_blocker.hpp 2010-06-07 19:29:05 EDT (Mon, 07 Jun 2010)
+++ (empty file)
@@ -1,67 +0,0 @@
-//
-// detail/win_signal_blocker.hpp
-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef BOOST_ASIO_DETAIL_WIN_SIGNAL_BLOCKER_HPP
-#define BOOST_ASIO_DETAIL_WIN_SIGNAL_BLOCKER_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
-
-#include <boost/asio/detail/config.hpp>
-
-#if defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-
-#include <boost/asio/detail/noncopyable.hpp>
-
-#include <boost/asio/detail/push_options.hpp>
-
-namespace boost {
-namespace asio {
-namespace detail {
-
-class win_signal_blocker
- : private noncopyable
-{
-public:
- // Constructor blocks all signals for the calling thread.
- win_signal_blocker()
- {
- // No-op.
- }
-
- // Destructor restores the previous signal mask.
- ~win_signal_blocker()
- {
- // No-op.
- }
-
- // Block all signals for the calling thread.
- void block()
- {
- // No-op.
- }
-
- // Restore the previous signal mask.
- void unblock()
- {
- // No-op.
- }
-};
-
-} // namespace detail
-} // namespace asio
-} // namespace boost
-
-#include <boost/asio/detail/pop_options.hpp>
-
-#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
-
-#endif // BOOST_ASIO_DETAIL_WIN_SIGNAL_BLOCKER_HPP


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