head 1.2; access; symbols pkgsrc-2014Q3:1.1.0.2 pkgsrc-2014Q3-base:1.1; locks; strict; comment @// @; 1.2 date 2014.12.28.16.57.36; author fhajny; state dead; branches; next 1.1; commitid Mh56hvXRLkKurP3y; 1.1 date 2014.08.18.10.35.13; author fhajny; state Exp; branches; next ; commitid 9n3uAptGnUUWyPMx; desc @@ 1.2 log @Remove patches that are unnecessary in 1.57.0. Fixes build on SunOS. @ text @$NetBSD: patch-boost_asio_detail_win__fd__set__adapter.hpp,v 1.1 2014/08/18 10:35:13 fhajny Exp $ Revert a upstream Windows optimization commit that breaks /dev/poll platforms like SunOS. See https://svn.boost.org/trac/boost/ticket/10350 --- boost/asio/detail/win_fd_set_adapter.hpp.orig 2014-08-13 12:13:05.251499093 +0000 +++ boost/asio/detail/win_fd_set_adapter.hpp @@@@ -20,7 +20,6 @@@@ #if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) #include -#include #include #include @@@@ -62,20 +61,24 @@@@ public: if (fd_set_->fd_array[i] == descriptor) return true; - reserve(fd_set_->fd_count + 1); - fd_set_->fd_array[fd_set_->fd_count++] = descriptor; - return true; - } - - void set(reactor_op_queue& operations, op_queue&) - { - reactor_op_queue::iterator i = operations.begin(); - while (i != operations.end()) + if (fd_set_->fd_count == capacity_) { - reactor_op_queue::iterator op_iter = i++; - reserve(fd_set_->fd_count + 1); - fd_set_->fd_array[fd_set_->fd_count++] = op_iter->first; + u_int new_capacity = capacity_ + capacity_ / 2; + win_fd_set* new_fd_set = static_cast(::operator new( + sizeof(win_fd_set) - sizeof(SOCKET) + + sizeof(SOCKET) * (new_capacity))); + + new_fd_set->fd_count = fd_set_->fd_count; + for (u_int i = 0; i < fd_set_->fd_count; ++i) + new_fd_set->fd_array[i] = fd_set_->fd_array[i]; + + ::operator delete(fd_set_); + fd_set_ = new_fd_set; + capacity_ = new_capacity; } + + fd_set_->fd_array[fd_set_->fd_count++] = descriptor; + return true; } bool is_set(socket_type descriptor) const @@@@ -94,14 +97,8 @@@@ public: return max_descriptor_; } - void perform(reactor_op_queue& operations, - op_queue& ops) const - { - for (u_int i = 0; i < fd_set_->fd_count; ++i) - operations.perform_operations(fd_set_->fd_array[i], ops); - } - private: + // This structure is defined to be compatible with the Windows API fd_set // structure, but without being dependent on the value of FD_SETSIZE. We use // the "struct hack" to allow the number of descriptors to be varied at @@@@ -112,29 +109,6 @@@@ private: SOCKET fd_array[1]; }; - // Increase the fd_set_ capacity to at least the specified number of elements. - void reserve(u_int n) - { - if (n <= capacity_) - return; - - u_int new_capacity = capacity_ + capacity_ / 2; - if (new_capacity < n) - new_capacity = n; - - win_fd_set* new_fd_set = static_cast(::operator new( - sizeof(win_fd_set) - sizeof(SOCKET) - + sizeof(SOCKET) * (new_capacity))); - - new_fd_set->fd_count = fd_set_->fd_count; - for (u_int i = 0; i < fd_set_->fd_count; ++i) - new_fd_set->fd_array[i] = fd_set_->fd_array[i]; - - ::operator delete(fd_set_); - fd_set_ = new_fd_set; - capacity_ = new_capacity; - } - win_fd_set* fd_set_; u_int capacity_; socket_type max_descriptor_; @ 1.1 log @Fix build on SunOS: transform _XOPEN_SOURCE=500 args where needed, and revert an upstream commit (https://svn.boost.org/trac/boost/ticket/10350). The latter part deserves a better fix (finish what upstream neglected). @ text @d1 1 a1 1 $NetBSD$ @