--- boost/asio/detail/io_control.hpp.orig 2011-06-05 19:21:43.000000000 -0400 +++ boost/asio/detail/io_control.hpp 2012-06-25 14:11:51.000000000 -0400 @@ -44,9 +44,9 @@ } // Get the name of the IO control command. - int name() const + ioctl_cmd_type name() const { - return static_cast(FIONBIO); + return static_cast(FIONBIO); } // Set the value of the I/O control command. @@ -94,9 +94,9 @@ } // Get the name of the IO control command. - int name() const + ioctl_cmd_type name() const { - return static_cast(FIONREAD); + return static_cast(FIONREAD); } // Set the value of the I/O control command. --- boost/asio/detail/descriptor_ops.hpp.orig 2011-10-09 17:59:57.000000000 -0400 +++ boost/asio/detail/descriptor_ops.hpp 2012-06-25 14:01:53.000000000 -0400 @@ -85,7 +85,7 @@ const buf* bufs, std::size_t count, boost::system::error_code& ec, std::size_t& bytes_transferred); -BOOST_ASIO_DECL int ioctl(int d, state_type& state, long cmd, +BOOST_ASIO_DECL int ioctl(int d, state_type& state, ioctl_cmd_type cmd, ioctl_arg_type* arg, boost::system::error_code& ec); BOOST_ASIO_DECL int fcntl(int d, long cmd, boost::system::error_code& ec); --- boost/asio/detail/socket_ops.hpp.orig 2011-10-09 17:59:57.000000000 -0400 +++ boost/asio/detail/socket_ops.hpp 2012-06-25 14:01:53.000000000 -0400 @@ -249,7 +249,7 @@ std::size_t* addrlen, boost::system::error_code& ec); BOOST_ASIO_DECL int ioctl(socket_type s, state_type& state, - int cmd, ioctl_arg_type* arg, boost::system::error_code& ec); + ioctl_cmd_type cmd, ioctl_arg_type* arg, boost::system::error_code& ec); BOOST_ASIO_DECL int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, timeval* timeout, boost::system::error_code& ec); --- boost/asio/detail/impl/descriptor_ops.ipp.orig 2011-10-09 17:59:57.000000000 -0400 +++ boost/asio/detail/impl/descriptor_ops.ipp 2012-06-25 14:01:53.000000000 -0400 @@ -316,7 +316,7 @@ } } -int ioctl(int d, state_type& state, long cmd, +int ioctl(int d, state_type& state, ioctl_cmd_type cmd, ioctl_arg_type* arg, boost::system::error_code& ec) { if (d == -1) @@ -338,7 +338,7 @@ // descriptor is put into the state that has been requested by the user. If // the ioctl syscall was successful then we need to update the flags to // match. - if (cmd == static_cast(FIONBIO)) + if (cmd == static_cast(FIONBIO)) { if (*arg) { --- boost/asio/detail/impl/socket_ops.ipp.orig 2011-10-09 17:59:57.000000000 -0400 +++ boost/asio/detail/impl/socket_ops.ipp 2012-06-25 14:18:33.000000000 -0400 @@ -1595,7 +1595,7 @@ return result; } -int ioctl(socket_type s, state_type& state, int cmd, +int ioctl(socket_type s, state_type& state, ioctl_cmd_type cmd, ioctl_arg_type* arg, boost::system::error_code& ec) { if (s == invalid_socket) @@ -1607,12 +1607,9 @@ clear_last_error(); #if defined(BOOST_WINDOWS) || defined(__CYGWIN__) int result = error_wrapper(::ioctlsocket(s, cmd, arg), ec); -#elif defined(__MACH__) && defined(__APPLE__) \ - || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) - int result = error_wrapper(::ioctl(s, - static_cast(cmd), arg), ec); #else - int result = error_wrapper(::ioctl(s, cmd, arg), ec); + int result = error_wrapper(::ioctl(s, + static_cast(cmd), arg), ec); #endif if (result >= 0) { @@ -1623,7 +1620,7 @@ // the correct state. This ensures that the underlying socket is put into // the state that has been requested by the user. If the ioctl syscall was // successful then we need to update the flags to match. - if (cmd == static_cast(FIONBIO)) + if (cmd == static_cast(FIONBIO)) { if (*arg) { --- boost/asio/detail/socket_types.hpp.orig 2011-06-05 19:21:43.000000000 -0400 +++ boost/asio/detail/socket_types.hpp 2012-06-25 14:01:53.000000000 -0400 @@ -148,6 +148,12 @@ typedef sockaddr_storage sockaddr_storage_type; typedef sockaddr_un sockaddr_un_type; typedef addrinfo addrinfo_type; +#if (defined(__MACH__) && defined(__APPLE__)) || defined(__DragonFly__) || \ + defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +typedef unsigned long ioctl_cmd_type; +#else +typedef int ioctl_cmd_type; +#endif typedef int ioctl_arg_type; typedef uint32_t u_long_type; typedef uint16_t u_short_type;