Ticket #2754: asio_no_exceptions.diff

File asio_no_exceptions.diff, 49.3 KB (added by arvid@…, 14 years ago)

patch to disable exception throwing code when building without exception support

  • boost/asio/basic_datagram_socket.hpp

    diff -ur boost_1_36_0/boost/asio/basic_datagram_socket.hpp boost_1_36_0_exceptions/boost/asio/basic_datagram_socket.hpp
    old new  
    152152   * buffers in one go, and how to use it with arrays, boost::array or
    153153   * std::vector.
    154154   */
     155#ifndef BOOST_NO_EXCEPTIONS
    155156  template <typename ConstBufferSequence>
    156157  std::size_t send(const ConstBufferSequence& buffers)
    157158  {
     
    160161    boost::asio::detail::throw_error(ec);
    161162    return s;
    162163  }
     164#endif
    163165
    164166  /// Send some data on a connected socket.
    165167  /**
     
    178180   * @note The send operation can only be used with a connected socket. Use
    179181   * the send_to function to send data on an unconnected datagram socket.
    180182   */
     183#ifndef BOOST_NO_EXCEPTIONS
    181184  template <typename ConstBufferSequence>
    182185  std::size_t send(const ConstBufferSequence& buffers,
    183186      socket_base::message_flags flags)
     
    188191    boost::asio::detail::throw_error(ec);
    189192    return s;
    190193  }
     194#endif
    191195
    192196  /// Send some data on a connected socket.
    193197  /**
     
    316320   * buffers in one go, and how to use it with arrays, boost::array or
    317321   * std::vector.
    318322   */
     323#ifndef BOOST_NO_EXCEPTIONS
    319324  template <typename ConstBufferSequence>
    320325  std::size_t send_to(const ConstBufferSequence& buffers,
    321326      const endpoint_type& destination)
     
    326331    boost::asio::detail::throw_error(ec);
    327332    return s;
    328333  }
     334#endif
    329335
    330336  /// Send a datagram to the specified endpoint.
    331337  /**
     
    343349   *
    344350   * @throws boost::system::system_error Thrown on failure.
    345351   */
     352#ifndef BOOST_NO_EXCEPTIONS
    346353  template <typename ConstBufferSequence>
    347354  std::size_t send_to(const ConstBufferSequence& buffers,
    348355      const endpoint_type& destination, socket_base::message_flags flags)
     
    353360    boost::asio::detail::throw_error(ec);
    354361    return s;
    355362  }
     363#endif
    356364
    357365  /// Send a datagram to the specified endpoint.
    358366  /**
     
    484492   * multiple buffers in one go, and how to use it with arrays, boost::array or
    485493   * std::vector.
    486494   */
     495#ifndef BOOST_NO_EXCEPTIONS
    487496  template <typename MutableBufferSequence>
    488497  std::size_t receive(const MutableBufferSequence& buffers)
    489498  {
     
    493502    boost::asio::detail::throw_error(ec);
    494503    return s;
    495504  }
     505#endif
    496506
    497507  /// Receive some data on a connected socket.
    498508  /**
     
    512522   * the receive_from function to receive data on an unconnected datagram
    513523   * socket.
    514524   */
     525#ifndef BOOST_NO_EXCEPTIONS
    515526  template <typename MutableBufferSequence>
    516527  std::size_t receive(const MutableBufferSequence& buffers,
    517528      socket_base::message_flags flags)
     
    522533    boost::asio::detail::throw_error(ec);
    523534    return s;
    524535  }
     536#endif
    525537
    526538  /// Receive some data on a connected socket.
    527539  /**
     
    651663   * multiple buffers in one go, and how to use it with arrays, boost::array or
    652664   * std::vector.
    653665   */
     666#ifndef BOOST_NO_EXCEPTIONS
    654667  template <typename MutableBufferSequence>
    655668  std::size_t receive_from(const MutableBufferSequence& buffers,
    656669      endpoint_type& sender_endpoint)
     
    661674    boost::asio::detail::throw_error(ec);
    662675    return s;
    663676  }
     677#endif
    664678 
    665679  /// Receive a datagram with the endpoint of the sender.
    666680  /**
     
    678692   *
    679693   * @throws boost::system::system_error Thrown on failure.
    680694   */
     695#ifndef BOOST_NO_EXCEPTIONS
    681696  template <typename MutableBufferSequence>
    682697  std::size_t receive_from(const MutableBufferSequence& buffers,
    683698      endpoint_type& sender_endpoint, socket_base::message_flags flags)
     
    688703    boost::asio::detail::throw_error(ec);
    689704    return s;
    690705  }
     706#endif
    691707 
    692708  /// Receive a datagram with the endpoint of the sender.
    693709  /**
  • boost/asio/basic_deadline_timer.hpp

    diff -ur boost_1_36_0/boost/asio/basic_deadline_timer.hpp boost_1_36_0_exceptions/boost/asio/basic_deadline_timer.hpp
    old new  
    154154   * @param expiry_time The expiry time to be used for the timer, expressed
    155155   * as an absolute time.
    156156   */
     157#ifndef BOOST_NO_EXCEPTIONS
    157158  basic_deadline_timer(boost::asio::io_service& io_service,
    158159      const time_type& expiry_time)
    159160    : basic_io_object<TimerService>(io_service)
     
    162163    this->service.expires_at(this->implementation, expiry_time, ec);
    163164    boost::asio::detail::throw_error(ec);
    164165  }
     166#endif
    165167
    166168  /// Constructor to set a particular expiry time relative to now.
    167169  /**
     
    173175   * @param expiry_time The expiry time to be used for the timer, relative to
    174176   * now.
    175177   */
     178#ifndef BOOST_NO_EXCEPTIONS
    176179  basic_deadline_timer(boost::asio::io_service& io_service,
    177180      const duration_type& expiry_time)
    178181    : basic_io_object<TimerService>(io_service)
     
    181184    this->service.expires_from_now(this->implementation, expiry_time, ec);
    182185    boost::asio::detail::throw_error(ec);
    183186  }
     187#endif
    184188
    185189  /// Cancel any asynchronous operations that are waiting on the timer.
    186190  /**
     
    194198   *
    195199   * @throws boost::system::system_error Thrown on failure.
    196200   */
     201#ifndef BOOST_NO_EXCEPTIONS
    197202  std::size_t cancel()
    198203  {
    199204    boost::system::error_code ec;
     
    201206    boost::asio::detail::throw_error(ec);
    202207    return s;
    203208  }
     209#endif
    204210
    205211  /// Cancel any asynchronous operations that are waiting on the timer.
    206212  /**
     
    241247   *
    242248   * @throws boost::system::system_error Thrown on failure.
    243249   */
     250#ifndef BOOST_NO_EXCEPTIONS
    244251  std::size_t expires_at(const time_type& expiry_time)
    245252  {
    246253    boost::system::error_code ec;
     
    249256    boost::asio::detail::throw_error(ec);
    250257    return s;
    251258  }
     259#endif
    252260
    253261  /// Set the timer's expiry time as an absolute time.
    254262  /**
     
    290298   *
    291299   * @throws boost::system::system_error Thrown on failure.
    292300   */
     301#ifndef BOOST_NO_EXCEPTIONS
    293302  std::size_t expires_from_now(const duration_type& expiry_time)
    294303  {
    295304    boost::system::error_code ec;
     
    298307    boost::asio::detail::throw_error(ec);
    299308    return s;
    300309  }
     310#endif
    301311
    302312  /// Set the timer's expiry time relative to now.
    303313  /**
     
    325335   *
    326336   * @throws boost::system::system_error Thrown on failure.
    327337   */
     338#ifndef BOOST_NO_EXCEPTIONS
    328339  void wait()
    329340  {
    330341    boost::system::error_code ec;
    331342    this->service.wait(this->implementation, ec);
    332343    boost::asio::detail::throw_error(ec);
    333344  }
     345#endif
    334346
    335347  /// Perform a blocking wait on the timer.
    336348  /**
  • boost/asio/basic_socket.hpp

    diff -ur boost_1_36_0/boost/asio/basic_socket.hpp boost_1_36_0_exceptions/boost/asio/basic_socket.hpp
    old new  
    7979   *
    8080   * @throws boost::system::system_error Thrown on failure.
    8181   */
     82#ifndef BOOST_NO_EXCEPTIONS
    8283  basic_socket(boost::asio::io_service& io_service,
    8384      const protocol_type& protocol)
    8485    : basic_io_object<SocketService>(io_service)
     
    8788    this->service.open(this->implementation, protocol, ec);
    8889    boost::asio::detail::throw_error(ec);
    8990  }
     91#endif
    9092
    9193  /// Construct a basic_socket, opening it and binding it to the given local
    9294  /// endpoint.
     
    103105   *
    104106   * @throws boost::system::system_error Thrown on failure.
    105107   */
     108#ifndef BOOST_NO_EXCEPTIONS
    106109  basic_socket(boost::asio::io_service& io_service,
    107110      const endpoint_type& endpoint)
    108111    : basic_io_object<SocketService>(io_service)
     
    113116    this->service.bind(this->implementation, endpoint, ec);
    114117    boost::asio::detail::throw_error(ec);
    115118  }
     119#endif
    116120
    117121  /// Construct a basic_socket on an existing native socket.
    118122  /**
     
    127131   *
    128132   * @throws boost::system::system_error Thrown on failure.
    129133   */
     134#ifndef BOOST_NO_EXCEPTIONS
    130135  basic_socket(boost::asio::io_service& io_service,
    131136      const protocol_type& protocol, const native_type& native_socket)
    132137    : basic_io_object<SocketService>(io_service)
     
    135140    this->service.assign(this->implementation, protocol, native_socket, ec);
    136141    boost::asio::detail::throw_error(ec);
    137142  }
     143#endif
    138144
    139145  /// Get a reference to the lowest layer.
    140146  /**
     
    164170   * socket.open(boost::asio::ip::tcp::v4());
    165171   * @endcode
    166172   */
     173#ifndef BOOST_NO_EXCEPTIONS
    167174  void open(const protocol_type& protocol = protocol_type())
    168175  {
    169176    boost::system::error_code ec;
    170177    this->service.open(this->implementation, protocol, ec);
    171178    boost::asio::detail::throw_error(ec);
    172179  }
     180#endif
    173181
    174182  /// Open the socket using the specified protocol.
    175183  /**
     
    206214   *
    207215   * @throws boost::system::system_error Thrown on failure.
    208216   */
     217#ifndef BOOST_NO_EXCEPTIONS
    209218  void assign(const protocol_type& protocol, const native_type& native_socket)
    210219  {
    211220    boost::system::error_code ec;
    212221    this->service.assign(this->implementation, protocol, native_socket, ec);
    213222    boost::asio::detail::throw_error(ec);
    214223  }
     224#endif
    215225
    216226  /// Assign an existing native socket to the socket.
    217227  /*
     
    247257   * @note For portable behaviour with respect to graceful closure of a
    248258   * connected socket, call shutdown() before closing the socket.
    249259   */
     260#ifndef BOOST_NO_EXCEPTIONS
    250261  void close()
    251262  {
    252263    boost::system::error_code ec;
    253264    this->service.close(this->implementation, ec);
    254265    boost::asio::detail::throw_error(ec);
    255266  }
     267#endif
    256268
    257269  /// Close the socket.
    258270  /**
     
    334346        "operation_not_supported when used on Windows XP, Windows Server 2003, "
    335347        "or earlier. Consult documentation for details."))
    336348#endif
     349#ifndef BOOST_NO_EXCEPTIONS
    337350  void cancel()
    338351  {
    339352    boost::system::error_code ec;
    340353    this->service.cancel(this->implementation, ec);
    341354    boost::asio::detail::throw_error(ec);
    342355  }
     356#endif
    343357
    344358  /// Cancel all asynchronous operations associated with the socket.
    345359  /**
     
    397411   *
    398412   * @throws boost::system::system_error Thrown on failure.
    399413   */
     414#ifndef BOOST_NO_EXCEPTIONS
    400415  bool at_mark() const
    401416  {
    402417    boost::system::error_code ec;
     
    404419    boost::asio::detail::throw_error(ec);
    405420    return b;
    406421  }
     422#endif
    407423
    408424  /// Determine whether the socket is at the out-of-band data mark.
    409425  /**
     
    430446   *
    431447   * @throws boost::system::system_error Thrown on failure.
    432448   */
     449#ifndef BOOST_NO_EXCEPTIONS
    433450  std::size_t available() const
    434451  {
    435452    boost::system::error_code ec;
     
    437454    boost::asio::detail::throw_error(ec);
    438455    return s;
    439456  }
     457#endif
    440458
    441459  /// Determine the number of bytes available for reading.
    442460  /**
     
    471489   *       boost::asio::ip::tcp::v4(), 12345));
    472490   * @endcode
    473491   */
     492#ifndef BOOST_NO_EXCEPTIONS
    474493  void bind(const endpoint_type& endpoint)
    475494  {
    476495    boost::system::error_code ec;
    477496    this->service.bind(this->implementation, endpoint, ec);
    478497    boost::asio::detail::throw_error(ec);
    479498  }
     499#endif
    480500
    481501  /// Bind the socket to the given local endpoint.
    482502  /**
     
    530550   * socket.connect(endpoint);
    531551   * @endcode
    532552   */
     553#ifndef BOOST_NO_EXCEPTIONS
    533554  void connect(const endpoint_type& peer_endpoint)
    534555  {
    535556    boost::system::error_code ec;
     
    541562    this->service.connect(this->implementation, peer_endpoint, ec);
    542563    boost::asio::detail::throw_error(ec);
    543564  }
     565#endif
    544566
    545567  /// Connect the socket to the specified endpoint.
    546568  /**
     
    678700   * socket.set_option(option);
    679701   * @endcode
    680702   */
     703#ifndef BOOST_NO_EXCEPTIONS
    681704  template <typename SettableSocketOption>
    682705  void set_option(const SettableSocketOption& option)
    683706  {
     
    685708    this->service.set_option(this->implementation, option, ec);
    686709    boost::asio::detail::throw_error(ec);
    687710  }
     711#endif
    688712
    689713  /// Set an option on the socket.
    690714  /**
     
    767791   * bool is_set = option.get();
    768792   * @endcode
    769793   */
     794#ifndef BOOST_NO_EXCEPTIONS
    770795  template <typename GettableSocketOption>
    771796  void get_option(GettableSocketOption& option) const
    772797  {
     
    774799    this->service.get_option(this->implementation, option, ec);
    775800    boost::asio::detail::throw_error(ec);
    776801  }
     802#endif
    777803
    778804  /// Get an option from the socket.
    779805  /**
     
    844870   * std::size_t bytes_readable = command.get();
    845871   * @endcode
    846872   */
     873#ifndef BOOST_NO_EXCEPTIONS
    847874  template <typename IoControlCommand>
    848875  void io_control(IoControlCommand& command)
    849876  {
     
    851878    this->service.io_control(this->implementation, command, ec);
    852879    boost::asio::detail::throw_error(ec);
    853880  }
     881#endif
    854882
    855883  /// Perform an IO control command on the socket.
    856884  /**
     
    901929   * boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
    902930   * @endcode
    903931   */
     932#ifndef BOOST_NO_EXCEPTIONS
    904933  endpoint_type local_endpoint() const
    905934  {
    906935    boost::system::error_code ec;
     
    908937    boost::asio::detail::throw_error(ec);
    909938    return ep;
    910939  }
     940#endif
    911941
    912942  /// Get the local endpoint of the socket.
    913943  /**
     
    950980   * boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
    951981   * @endcode
    952982   */
     983#ifndef BOOST_NO_EXCEPTIONS
    953984  endpoint_type remote_endpoint() const
    954985  {
    955986    boost::system::error_code ec;
     
    957988    boost::asio::detail::throw_error(ec);
    958989    return ep;
    959990  }
     991#endif
    960992
    961993  /// Get the remote endpoint of the socket.
    962994  /**
     
    10011033   * socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
    10021034   * @endcode
    10031035   */
     1036#ifndef BOOST_NO_EXCEPTIONS
    10041037  void shutdown(shutdown_type what)
    10051038  {
    10061039    boost::system::error_code ec;
    10071040    this->service.shutdown(this->implementation, what, ec);
    10081041    boost::asio::detail::throw_error(ec);
    10091042  }
     1043#endif
    10101044
    10111045  /// Disable sends or receives on the socket.
    10121046  /**
  • boost/asio/basic_socket_acceptor.hpp

    diff -ur boost_1_36_0/boost/asio/basic_socket_acceptor.hpp boost_1_36_0_exceptions/boost/asio/basic_socket_acceptor.hpp
    old new  
    9090   *
    9191   * @throws boost::system::system_error Thrown on failure.
    9292   */
     93#ifndef BOOST_NO_EXCEPTIONS
    9394  basic_socket_acceptor(boost::asio::io_service& io_service,
    9495      const protocol_type& protocol)
    9596    : basic_io_object<SocketAcceptorService>(io_service)
     
    9899    this->service.open(this->implementation, protocol, ec);
    99100    boost::asio::detail::throw_error(ec);
    100101  }
     102#endif
    101103
    102104  /// Construct an acceptor opened on the given endpoint.
    103105  /**
     
    126128   * acceptor.listen(listen_backlog);
    127129   * @endcode
    128130   */
     131#ifndef BOOST_NO_EXCEPTIONS
    129132  basic_socket_acceptor(boost::asio::io_service& io_service,
    130133      const endpoint_type& endpoint, bool reuse_addr = true)
    131134    : basic_io_object<SocketAcceptorService>(io_service)
     
    145148        socket_base::max_connections, ec);
    146149    boost::asio::detail::throw_error(ec);
    147150  }
     151#endif
    148152
    149153  /// Construct a basic_socket_acceptor on an existing native acceptor.
    150154  /**
     
    161165   *
    162166   * @throws boost::system::system_error Thrown on failure.
    163167   */
     168#ifndef BOOST_NO_EXCEPTIONS
    164169  basic_socket_acceptor(boost::asio::io_service& io_service,
    165170      const protocol_type& protocol, const native_type& native_acceptor)
    166171    : basic_io_object<SocketAcceptorService>(io_service)
     
    169174    this->service.assign(this->implementation, protocol, native_acceptor, ec);
    170175    boost::asio::detail::throw_error(ec);
    171176  }
     177#endif
    172178
    173179  /// Open the acceptor using the specified protocol.
    174180  /**
     
    185191   * acceptor.open(boost::asio::ip::tcp::v4());
    186192   * @endcode
    187193   */
     194#ifndef BOOST_NO_EXCEPTIONS
    188195  void open(const protocol_type& protocol = protocol_type())
    189196  {
    190197    boost::system::error_code ec;
    191198    this->service.open(this->implementation, protocol, ec);
    192199    boost::asio::detail::throw_error(ec);
    193200  }
     201#endif
    194202
    195203  /// Open the acceptor using the specified protocol.
    196204  /**
     
    228236   *
    229237   * @throws boost::system::system_error Thrown on failure.
    230238   */
     239#ifndef BOOST_NO_EXCEPTIONS
    231240  void assign(const protocol_type& protocol, const native_type& native_acceptor)
    232241  {
    233242    boost::system::error_code ec;
    234243    this->service.assign(this->implementation, protocol, native_acceptor, ec);
    235244    boost::asio::detail::throw_error(ec);
    236245  }
     246#endif
    237247
    238248  /// Assigns an existing native acceptor to the acceptor.
    239249  /*
     
    275285   * acceptor.bind(boost::asio::ip::tcp::endpoint(12345));
    276286   * @endcode
    277287   */
     288#ifndef BOOST_NO_EXCEPTIONS
    278289  void bind(const endpoint_type& endpoint)
    279290  {
    280291    boost::system::error_code ec;
    281292    this->service.bind(this->implementation, endpoint, ec);
    282293    boost::asio::detail::throw_error(ec);
    283294  }
     295#endif
    284296
    285297  /// Bind the acceptor to the given local endpoint.
    286298  /**
     
    320332   *
    321333   * @throws boost::system::system_error Thrown on failure.
    322334   */
     335#ifndef BOOST_NO_EXCEPTIONS
    323336  void listen(int backlog = socket_base::max_connections)
    324337  {
    325338    boost::system::error_code ec;
    326339    this->service.listen(this->implementation, backlog, ec);
    327340    boost::asio::detail::throw_error(ec);
    328341  }
     342#endif
    329343
    330344  /// Place the acceptor into the state where it will listen for new
    331345  /// connections.
     
    364378   *
    365379   * @throws boost::system::system_error Thrown on failure.
    366380   */
     381#ifndef BOOST_NO_EXCEPTIONS
    367382  void close()
    368383  {
    369384    boost::system::error_code ec;
    370385    this->service.close(this->implementation, ec);
    371386    boost::asio::detail::throw_error(ec);
    372387  }
     388#endif
    373389
    374390  /// Close the acceptor.
    375391  /**
     
    417433   *
    418434   * @throws boost::system::system_error Thrown on failure.
    419435   */
     436#ifndef BOOST_NO_EXCEPTIONS
    420437  void cancel()
    421438  {
    422439    boost::system::error_code ec;
    423440    this->service.cancel(this->implementation, ec);
    424441    boost::asio::detail::throw_error(ec);
    425442  }
     443#endif
    426444
    427445  /// Cancel all asynchronous operations associated with the acceptor.
    428446  /**
     
    458476   * acceptor.set_option(option);
    459477   * @endcode
    460478   */
     479#ifndef BOOST_NO_EXCEPTIONS
    461480  template <typename SettableSocketOption>
    462481  void set_option(const SettableSocketOption& option)
    463482  {
     
    465484    this->service.set_option(this->implementation, option, ec);
    466485    boost::asio::detail::throw_error(ec);
    467486  }
     487#endif
    468488
    469489  /// Set an option on the acceptor.
    470490  /**
     
    521541   * bool is_set = option.get();
    522542   * @endcode
    523543   */
     544#ifndef BOOST_NO_EXCEPTIONS
    524545  template <typename GettableSocketOption>
    525546  void get_option(GettableSocketOption& option)
    526547  {
     
    528549    this->service.get_option(this->implementation, option, ec);
    529550    boost::asio::detail::throw_error(ec);
    530551  }
     552#endif
    531553
    532554  /// Get an option from the acceptor.
    533555  /**
     
    578600   * boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint();
    579601   * @endcode
    580602   */
     603#ifndef BOOST_NO_EXCEPTIONS
    581604  endpoint_type local_endpoint() const
    582605  {
    583606    boost::system::error_code ec;
     
    585608    boost::asio::detail::throw_error(ec);
    586609    return ep;
    587610  }
     611#endif
    588612
    589613  /// Get the local endpoint of the acceptor.
    590614  /**
     
    631655   * acceptor.accept(socket);
    632656   * @endcode
    633657   */
     658#ifndef BOOST_NO_EXCEPTIONS
    634659  template <typename SocketService>
    635660  void accept(basic_socket<protocol_type, SocketService>& peer)
    636661  {
     
    638663    this->service.accept(this->implementation, peer, 0, ec);
    639664    boost::asio::detail::throw_error(ec);
    640665  }
     666#endif
    641667
    642668  /// Accept a new connection.
    643669  /**
     
    738764   * acceptor.accept(socket, endpoint);
    739765   * @endcode
    740766   */
     767#ifndef BOOST_NO_EXCEPTIONS
    741768  template <typename SocketService>
    742769  void accept(basic_socket<protocol_type, SocketService>& peer,
    743770      endpoint_type& peer_endpoint)
     
    746773    this->service.accept(this->implementation, peer, &peer_endpoint, ec);
    747774    boost::asio::detail::throw_error(ec);
    748775  }
     776#endif
    749777
    750778  /// Accept a new connection and obtain the endpoint of the peer
    751779  /**
  • boost/asio/basic_stream_socket.hpp

    diff -ur boost_1_36_0/boost/asio/basic_stream_socket.hpp boost_1_36_0_exceptions/boost/asio/basic_stream_socket.hpp
    old new  
    156156   * buffers in one go, and how to use it with arrays, boost::array or
    157157   * std::vector.
    158158   */
     159#ifndef BOOST_NO_EXCEPTIONS
    159160  template <typename ConstBufferSequence>
    160161  std::size_t send(const ConstBufferSequence& buffers)
    161162  {
     
    165166    boost::asio::detail::throw_error(ec);
    166167    return s;
    167168  }
     169#endif
    168170
    169171  /// Send some data on the socket.
    170172  /**
     
    193195   * buffers in one go, and how to use it with arrays, boost::array or
    194196   * std::vector.
    195197   */
     198#ifndef BOOST_NO_EXCEPTIONS
    196199  template <typename ConstBufferSequence>
    197200  std::size_t send(const ConstBufferSequence& buffers,
    198201      socket_base::message_flags flags)
     
    203206    boost::asio::detail::throw_error(ec);
    204207    return s;
    205208  }
     209#endif
    206210
    207211  /// Send some data on the socket.
    208212  /**
     
    342346   * multiple buffers in one go, and how to use it with arrays, boost::array or
    343347   * std::vector.
    344348   */
     349#ifndef BOOST_NO_EXCEPTIONS
    345350  template <typename MutableBufferSequence>
    346351  std::size_t receive(const MutableBufferSequence& buffers)
    347352  {
     
    350355    boost::asio::detail::throw_error(ec);
    351356    return s;
    352357  }
     358#endif
    353359
    354360  /// Receive some data on the socket.
    355361  /**
     
    381387   * multiple buffers in one go, and how to use it with arrays, boost::array or
    382388   * std::vector.
    383389   */
     390#ifndef BOOST_NO_EXCEPTIONS
    384391  template <typename MutableBufferSequence>
    385392  std::size_t receive(const MutableBufferSequence& buffers,
    386393      socket_base::message_flags flags)
     
    391398    boost::asio::detail::throw_error(ec);
    392399    return s;
    393400  }
     401#endif
    394402
    395403  /// Receive some data on a connected socket.
    396404  /**
     
    533541   * buffers in one go, and how to use it with arrays, boost::array or
    534542   * std::vector.
    535543   */
     544#ifndef BOOST_NO_EXCEPTIONS
    536545  template <typename ConstBufferSequence>
    537546  std::size_t write_some(const ConstBufferSequence& buffers)
    538547  {
     
    541550    boost::asio::detail::throw_error(ec);
    542551    return s;
    543552  }
     553#endif
    544554
    545555  /// Write some data to the socket.
    546556  /**
     
    635645   * buffers in one go, and how to use it with arrays, boost::array or
    636646   * std::vector.
    637647   */
     648#ifndef BOOST_NO_EXCEPTIONS
    638649  template <typename MutableBufferSequence>
    639650  std::size_t read_some(const MutableBufferSequence& buffers)
    640651  {
     
    643654    boost::asio::detail::throw_error(ec);
    644655    return s;
    645656  }
     657#endif
    646658
    647659  /// Read some data from the socket.
    648660  /**
  • boost/asio/detail/resolver_service.hpp

    diff -ur boost_1_36_0/boost/asio/detail/resolver_service.hpp boost_1_36_0_exceptions/boost/asio/detail/resolver_service.hpp
    old new  
    321321  public:
    322322    work_io_service_runner(boost::asio::io_service& io_service)
    323323      : io_service_(io_service) {}
    324     void operator()() { io_service_.run(); }
     324    void operator()()
     325    {
     326                 boost::system::error_code ec;
     327       io_service_.run(ec);
     328#ifndef BOOST_NO_EXCEPTIONS
     329       throw_error(ec);
     330#endif
     331    }
    325332  private:
    326333    boost::asio::io_service& io_service_;
    327334  };
  • boost/asio/detail/throw_error.hpp

    diff -ur boost_1_36_0/boost/asio/detail/throw_error.hpp boost_1_36_0_exceptions/boost/asio/detail/throw_error.hpp
    old new  
    2828namespace asio {
    2929namespace detail {
    3030
     31#ifndef BOOST_NO_EXCEPTIONS
    3132inline void throw_error(const boost::system::error_code& err)
    3233{
    3334  if (err)
     
    3637    boost::throw_exception(e);
    3738  }
    3839}
     40#endif
    3941
    4042} // namespace detail
    4143} // namespace asio
  • boost/asio/impl/io_service.ipp

    diff -ur boost_1_36_0/boost/asio/impl/io_service.ipp boost_1_36_0_exceptions/boost/asio/impl/io_service.ipp
    old new  
    5252  delete service_registry_;
    5353}
    5454
     55#ifndef BOOST_NO_EXCEPTIONS
    5556inline std::size_t io_service::run()
    5657{
    5758  boost::system::error_code ec;
     
    5960  boost::asio::detail::throw_error(ec);
    6061  return s;
    6162}
     63#endif
    6264
    6365inline std::size_t io_service::run(boost::system::error_code& ec)
    6466{
    6567  return impl_.run(ec);
    6668}
    6769
     70#ifndef BOOST_NO_EXCEPTIONS
    6871inline std::size_t io_service::run_one()
    6972{
    7073  boost::system::error_code ec;
     
    7275  boost::asio::detail::throw_error(ec);
    7376  return s;
    7477}
     78#endif
    7579
    7680inline std::size_t io_service::run_one(boost::system::error_code& ec)
    7781{
    7882  return impl_.run_one(ec);
    7983}
    8084
     85#ifndef BOOST_NO_EXCEPTIONS
    8186inline std::size_t io_service::poll()
    8287{
    8388  boost::system::error_code ec;
     
    8590  boost::asio::detail::throw_error(ec);
    8691  return s;
    8792}
     93#endif
    8894
    8995inline std::size_t io_service::poll(boost::system::error_code& ec)
    9096{
    9197  return impl_.poll(ec);
    9298}
    9399
     100#ifndef BOOST_NO_EXCEPTIONS
    94101inline std::size_t io_service::poll_one()
    95102{
    96103  boost::system::error_code ec;
     
    98105  boost::asio::detail::throw_error(ec);
    99106  return s;
    100107}
     108#endif
    101109
    102110inline std::size_t io_service::poll_one(boost::system::error_code& ec)
    103111{
  • boost/asio/impl/read.ipp

    diff -ur boost_1_36_0/boost/asio/impl/read.ipp boost_1_36_0_exceptions/boost/asio/impl/read.ipp
    old new  
    5353  return total_transferred;
    5454}
    5555
     56#ifndef BOOST_NO_EXCEPTIONS
    5657template <typename SyncReadStream, typename MutableBufferSequence>
    5758inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers)
    5859{
     
    7273  boost::asio::detail::throw_error(ec);
    7374  return bytes_transferred;
    7475}
     76#endif
    7577
    7678template <typename SyncReadStream, typename Allocator,
    7779    typename CompletionCondition>
     
    9395  }
    9496}
    9597
     98#ifndef BOOST_NO_EXCEPTIONS
    9699template <typename SyncReadStream, typename Allocator>
    97100inline std::size_t read(SyncReadStream& s,
    98101    boost::asio::basic_streambuf<Allocator>& b)
     
    114117  boost::asio::detail::throw_error(ec);
    115118  return bytes_transferred;
    116119}
     120#endif
    117121
    118122namespace detail
    119123{
  • boost/asio/impl/write.ipp

    diff -ur boost_1_36_0/boost/asio/impl/write.ipp boost_1_36_0_exceptions/boost/asio/impl/write.ipp
    old new  
    4848  return total_transferred;
    4949}
    5050
     51#ifndef BOOST_NO_EXCEPTIONS
    5152template <typename SyncWriteStream, typename ConstBufferSequence>
    5253inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers)
    5354{
     
    6768  boost::asio::detail::throw_error(ec);
    6869  return bytes_transferred;
    6970}
     71#endif
    7072
    7173template <typename SyncWriteStream, typename Allocator,
    7274    typename CompletionCondition>
     
    7981  return bytes_transferred;
    8082}
    8183
     84#ifndef BOOST_NO_EXCEPTIONS
    8285template <typename SyncWriteStream, typename Allocator>
    8386inline std::size_t write(SyncWriteStream& s,
    8487    boost::asio::basic_streambuf<Allocator>& b)
     
    100103  boost::asio::detail::throw_error(ec);
    101104  return bytes_transferred;
    102105}
     106#endif
    103107
    104108namespace detail
    105109{
  • boost/asio/io_service.hpp

    diff -ur boost_1_36_0/boost/asio/io_service.hpp boost_1_36_0_exceptions/boost/asio/io_service.hpp
    old new  
    190190   * @note The poll() function may also be used to dispatch ready handlers,
    191191   * but without blocking.
    192192   */
     193#ifndef BOOST_NO_EXCEPTIONS
    193194  std::size_t run();
     195#endif
    194196
    195197  /// Run the io_service's event processing loop.
    196198  /**
     
    223225   *
    224226   * @throws boost::system::system_error Thrown on failure.
    225227   */
     228#ifndef BOOST_NO_EXCEPTIONS
    226229  std::size_t run_one();
     230#endif
    227231
    228232  /// Run the io_service's event processing loop to execute at most one handler.
    229233  /**
     
    245249   *
    246250   * @throws boost::system::system_error Thrown on failure.
    247251   */
     252#ifndef BOOST_NO_EXCEPTIONS
    248253  std::size_t poll();
     254#endif
    249255
    250256  /// Run the io_service's event processing loop to execute ready handlers.
    251257  /**
     
    267273   *
    268274   * @throws boost::system::system_error Thrown on failure.
    269275   */
     276#ifndef BOOST_NO_EXCEPTIONS
    270277  std::size_t poll_one();
     278#endif
    271279
    272280  /// Run the io_service's event processing loop to execute one ready handler.
    273281  /**
  • boost/asio/ip/address.hpp

    diff -ur boost_1_36_0/boost/asio/ip/address.hpp boost_1_36_0_exceptions/boost/asio/ip/address.hpp
    old new  
    120120  {
    121121    if (type_ != ipv4)
    122122    {
     123#ifdef BOOST_NO_EXCEPTIONS
     124      return boost::asio::ip::address_v4();
     125#else
    123126      boost::system::system_error e(
    124127          boost::asio::error::address_family_not_supported);
    125128      boost::throw_exception(e);
     129#endif
    126130    }
    127131    return ipv4_address_;
    128132  }
     
    132136  {
    133137    if (type_ != ipv6)
    134138    {
     139#ifdef BOOST_NO_EXCEPTIONS
     140      return boost::asio::ip::address_v6();
     141#else
    135142      boost::system::system_error e(
    136143          boost::asio::error::address_family_not_supported);
    137144      boost::throw_exception(e);
     145#endif
    138146    }
    139147    return ipv6_address_;
    140148  }
    141149
    142150  /// Get the address as a string in dotted decimal format.
     151#ifndef BOOST_NO_EXCEPTIONS
    143152  std::string to_string() const
    144153  {
    145154    if (type_ == ipv6)
    146155      return ipv6_address_.to_string();
    147156    return ipv4_address_.to_string();
    148157  }
     158#endif
    149159
    150160  /// Get the address as a string in dotted decimal format.
    151161  std::string to_string(boost::system::error_code& ec) const
     
    157167
    158168  /// Create an address from an IPv4 address string in dotted decimal form,
    159169  /// or from an IPv6 address in hexadecimal notation.
     170#ifndef BOOST_NO_EXCEPTIONS
    160171  static address from_string(const char* str)
    161172  {
    162173    boost::system::error_code ec;
     
    164175    boost::asio::detail::throw_error(ec);
    165176    return addr;
    166177  }
     178#endif
    167179
    168180  /// Create an address from an IPv4 address string in dotted decimal form,
    169181  /// or from an IPv6 address in hexadecimal notation.
     
    192204    return address();
    193205  }
    194206
     207#ifndef BOOST_NO_EXCEPTIONS
    195208  /// Create an address from an IPv4 address string in dotted decimal form,
    196209  /// or from an IPv6 address in hexadecimal notation.
    197210  static address from_string(const std::string& str)
    198211  {
    199212    return from_string(str.c_str());
    200213  }
     214#endif
    201215
    202216  /// Create an address from an IPv4 address string in dotted decimal form,
    203217  /// or from an IPv6 address in hexadecimal notation.
     
    266280std::basic_ostream<Elem, Traits>& operator<<(
    267281    std::basic_ostream<Elem, Traits>& os, const address& addr)
    268282{
    269   os << addr.to_string();
     283  if (addr.is_v4()) os << addr.to_v4();
     284  else os << addr.to_v6();
    270285  return os;
    271286}
    272287
  • boost/asio/ip/address_v4.hpp

    diff -ur boost_1_36_0/boost/asio/ip/address_v4.hpp boost_1_36_0_exceptions/boost/asio/ip/address_v4.hpp
    old new  
    9494    return boost::asio::detail::socket_ops::network_to_host_long(addr_.s_addr);
    9595  }
    9696
     97#ifndef BOOST_NO_EXCEPTIONS
    9798  /// Get the address as a string in dotted decimal format.
    9899  std::string to_string() const
    99100  {
     
    102103    boost::asio::detail::throw_error(ec);
    103104    return addr;
    104105  }
     106#endif
    105107
    106108  /// Get the address as a string in dotted decimal format.
    107109  std::string to_string(boost::system::error_code& ec) const
     
    115117    return addr;
    116118  }
    117119
     120#ifndef BOOST_NO_EXCEPTIONS
    118121  /// Create an address from an IP address string in dotted decimal form.
    119122  static address_v4 from_string(const char* str)
    120123  {
     
    123126    boost::asio::detail::throw_error(ec);
    124127    return addr;
    125128  }
     129#endif
    126130
    127131  /// Create an address from an IP address string in dotted decimal form.
    128132  static address_v4 from_string(const char* str, boost::system::error_code& ec)
     
    134138    return tmp;
    135139  }
    136140
     141#ifndef BOOST_NO_EXCEPTIONS
    137142  /// Create an address from an IP address string in dotted decimal form.
    138143  static address_v4 from_string(const std::string& str)
    139144  {
    140145    return from_string(str.c_str());
    141146  }
     147#endif
    142148
    143149  /// Create an address from an IP address string in dotted decimal form.
    144150  static address_v4 from_string(const std::string& str,
     
    270276  std::string s = addr.to_string(ec);
    271277  if (ec)
    272278  {
     279#ifndef BOOST_NO_EXCEPTIONS
    273280    if (os.exceptions() & std::ios::failbit)
    274281      boost::asio::detail::throw_error(ec);
    275282    else
     283#endif
    276284      os.setstate(std::ios_base::failbit);
    277285  }
    278286  else
  • boost/asio/ip/address_v6.hpp

    diff -ur boost_1_36_0/boost/asio/ip/address_v6.hpp boost_1_36_0_exceptions/boost/asio/ip/address_v6.hpp
    old new  
    109109    return bytes;
    110110  }
    111111
     112#ifndef BOOST_NO_EXCEPTIONS
    112113  /// Get the address as a string.
    113114  std::string to_string() const
    114115  {
     
    117118    boost::asio::detail::throw_error(ec);
    118119    return addr;
    119120  }
     121#endif
    120122
    121123  /// Get the address as a string.
    122124  std::string to_string(boost::system::error_code& ec) const
     
    130132    return addr;
    131133  }
    132134
     135#ifndef BOOST_NO_EXCEPTIONS
    133136  /// Create an address from an IP address string.
    134137  static address_v6 from_string(const char* str)
    135138  {
     
    138141    boost::asio::detail::throw_error(ec);
    139142    return addr;
    140143  }
     144#endif
    141145
    142146  /// Create an address from an IP address string.
    143147  static address_v6 from_string(const char* str, boost::system::error_code& ec)
     
    149153    return tmp;
    150154  }
    151155
     156#ifndef BOOST_NO_EXCEPTIONS
    152157  /// Create an address from an IP address string.
    153158  static address_v6 from_string(const std::string& str)
    154159  {
    155160    return from_string(str.c_str());
    156161  }
     162#endif
    157163
    158164  /// Create an address from an IP address string.
    159165  static address_v6 from_string(const std::string& str,
     
    166172  address_v4 to_v4() const
    167173  {
    168174    if (!is_v4_mapped() && !is_v4_compatible())
     175#ifdef BOOST_NO_EXCEPTIONS
     176      return address_v4();
     177#else
    169178      throw std::bad_cast();
     179#endif
    170180    address_v4::bytes_type v4_bytes = { { addr_.s6_addr[12],
    171181      addr_.s6_addr[13], addr_.s6_addr[14], addr_.s6_addr[15] } };
    172182    return address_v4(v4_bytes);
     
    388398  std::string s = addr.to_string(ec);
    389399  if (ec)
    390400  {
     401#ifndef BOOST_NO_EXCEPTIONS
    391402    if (os.exceptions() & std::ios::failbit)
    392403      boost::asio::detail::throw_error(ec);
    393404    else
     405#endif
    394406      os.setstate(std::ios_base::failbit);
    395407  }
    396408  else
  • boost/asio/ip/basic_endpoint.hpp

    diff -ur boost_1_36_0/boost/asio/ip/basic_endpoint.hpp boost_1_36_0_exceptions/boost/asio/ip/basic_endpoint.hpp
    old new  
    318318  std::string a = addr.to_string(ec);
    319319  if (ec)
    320320  {
     321#ifndef BOOST_NO_EXCEPTIONS
    321322    if (os.exceptions() & std::ios::failbit)
    322323      boost::asio::detail::throw_error(ec);
    323324    else
     325#endif
    324326      os.setstate(std::ios_base::failbit);
    325327  }
    326328  else
     
    344346  std::string a = addr.to_string(ec);
    345347  if (ec)
    346348  {
     349#ifndef BOOST_NO_EXCEPTIONS
    347350    if (os.exceptions() & std::ios::failbit)
    348351      boost::asio::detail::throw_error(ec);
    349352    else
     353#endif
    350354      os.setstate(std::ios_base::failbit);
    351355  }
    352356  else
  • boost/asio/ip/basic_resolver.hpp

    diff -ur boost_1_36_0/boost/asio/ip/basic_resolver.hpp boost_1_36_0_exceptions/boost/asio/ip/basic_resolver.hpp
    old new  
    9292   * A successful call to this function is guaranteed to return at least one
    9393   * entry.
    9494   */
     95#ifndef BOOST_NO_EXCEPTIONS
    9596  iterator resolve(const query& q)
    9697  {
    9798    boost::system::error_code ec;
     
    99100    boost::asio::detail::throw_error(ec);
    100101    return i;
    101102  }
     103#endif
    102104
    103105  /// Resolve a query to a list of entries.
    104106  /**
     
    172174   * A successful call to this function is guaranteed to return at least one
    173175   * entry.
    174176   */
     177#ifndef BOOST_NO_EXCEPTIONS
    175178  iterator resolve(const endpoint_type& e)
    176179  {
    177180    boost::system::error_code ec;
     
    179182    boost::asio::detail::throw_error(ec);
    180183    return i;
    181184  }
     185#endif
    182186
    183187  /// Resolve an endpoint to a list of entries.
    184188  /**
  • boost/asio/ip/detail/socket_option.hpp

    diff -ur boost_1_36_0/boost/asio/ip/detail/socket_option.hpp boost_1_36_0_exceptions/boost/asio/ip/detail/socket_option.hpp
    old new  
    140140  {
    141141    if (protocol.family() == PF_INET6)
    142142    {
     143#ifndef BOOST_NO_EXCEPTIONS
    143144      if (s != sizeof(ipv6_value_))
    144145      {
    145146        throw std::length_error(
    146147            "multicast_enable_loopback socket option resize");
    147148      }
     149#else
     150      BOOST_ASSERT(s == sizeof(ipv6_value_));
     151#endif
    148152      ipv4_value_ = ipv6_value_ ? 1 : 0;
    149153    }
    150154    else
    151155    {
     156#ifndef BOOST_NO_EXCEPTIONS
    152157      if (s != sizeof(ipv4_value_))
    153158      {
    154159        throw std::length_error(
    155160            "multicast_enable_loopback socket option resize");
    156161      }
     162#else
     163      BOOST_ASSERT(s == sizeof(ipv4_value_));
     164#endif
    157165      ipv6_value_ = ipv4_value_ ? 1 : 0;
    158166    }
    159167  }
     
    236244  template <typename Protocol>
    237245  void resize(const Protocol&, std::size_t s)
    238246  {
     247#ifndef BOOST_NO_EXCEPTIONS
    239248    if (s != sizeof(value_))
    240249      throw std::length_error("unicast hops socket option resize");
     250#else
     251      BOOST_ASSERT(s == sizeof(value_));
     252#endif
    241253#if defined(__hpux)
    242254    if (value_ < 0)
    243255      value_ = value_ & 0xFF;
     
    270282  // Construct with a specific option value.
    271283  explicit multicast_hops(int v)
    272284  {
     285#ifndef BOOST_NO_EXCEPTIONS
    273286    if (v < 0 || v > 255)
    274287      throw std::out_of_range("multicast hops value out of range");
     288#else
     289    BOOST_ASSERT(v >= 0 && v <= 255);
     290#endif
    275291    ipv4_value_ = (ipv4_value_type)v;
    276292    ipv6_value_ = v;
    277293  }
     
    279295  // Set the value of the option.
    280296  multicast_hops& operator=(int v)
    281297  {
     298#ifndef BOOST_NO_EXCEPTIONS
    282299    if (v < 0 || v > 255)
    283300      throw std::out_of_range("multicast hops value out of range");
     301#else
     302    BOOST_ASSERT(v >= 0 && v <= 255);
     303#endif
    284304    ipv4_value_ = (ipv4_value_type)v;
    285305    ipv6_value_ = v;
    286306    return *this;
     
    343363  {
    344364    if (protocol.family() == PF_INET6)
    345365    {
     366#ifndef BOOST_NO_EXCEPTIONS
    346367      if (s != sizeof(ipv6_value_))
    347368        throw std::length_error("multicast hops socket option resize");
     369#else
     370      BOOST_ASSERT(s == sizeof(ipv6_value_));
     371#endif
    348372      if (ipv6_value_ < 0)
    349373        ipv4_value_ = 0;
    350374      else if (ipv6_value_ > 255)
     
    354378    }
    355379    else
    356380    {
     381#ifndef BOOST_NO_EXCEPTIONS
    357382      if (s != sizeof(ipv4_value_))
    358383        throw std::length_error("multicast hops socket option resize");
     384#else
     385      BOOST_ASSERT(s == sizeof(ipv4_value_));
     386#endif
    359387      ipv6_value_ = ipv4_value_;
    360388    }
    361389  }
  • boost/asio/ip/host_name.hpp

    diff -ur boost_1_36_0/boost/asio/ip/host_name.hpp boost_1_36_0_exceptions/boost/asio/ip/host_name.hpp
    old new  
    3535/// Get the current host name.
    3636std::string host_name(boost::system::error_code& ec);
    3737
     38#ifndef BOOST_NO_EXCEPTIONS
    3839inline std::string host_name()
    3940{
    4041  char name[1024];
     
    4647  }
    4748  return std::string(name);
    4849}
     50#endif
    4951
    5052inline std::string host_name(boost::system::error_code& ec)
    5153{
  • boost/asio/ssl/basic_context.hpp

    diff -ur boost_1_36_0/boost/asio/ssl/basic_context.hpp boost_1_36_0_exceptions/boost/asio/ssl/basic_context.hpp
    old new  
    8080   *
    8181   * @throws boost::system::system_error Thrown on failure.
    8282   */
     83#ifndef BOOST_NO_EXCEPTIONS
    8384  void set_options(options o)
    8485  {
    8586    boost::system::error_code ec;
    8687    service_.set_options(impl_, o, ec);
    8788    boost::asio::detail::throw_error(ec);
    8889  }
     90#endif
    8991
    9092  /// Set options on the context.
    9193  /**
     
    113115   *
    114116   * @throws boost::system::system_error Thrown on failure.
    115117   */
     118#ifndef BOOST_NO_EXCEPTIONS
    116119  void set_verify_mode(verify_mode v)
    117120  {
    118121    boost::system::error_code ec;
    119122    service_.set_verify_mode(impl_, v, ec);
    120123    boost::asio::detail::throw_error(ec);
    121124  }
     125#endif
    122126
    123127  /// Set the peer verification mode.
    124128  /**
     
    146150   *
    147151   * @throws boost::system::system_error Thrown on failure.
    148152   */
     153#ifndef BOOST_NO_EXCEPTIONS
    149154  void load_verify_file(const std::string& filename)
    150155  {
    151156    boost::system::error_code ec;
    152157    service_.load_verify_file(impl_, filename, ec);
    153158    boost::asio::detail::throw_error(ec);
    154159  }
     160#endif
    155161
    156162  /// Load a certification authority file for performing verification.
    157163  /**
     
    181187   *
    182188   * @throws boost::system::system_error Thrown on failure.
    183189   */
     190#ifndef BOOST_NO_EXCEPTIONS
    184191  void add_verify_path(const std::string& path)
    185192  {
    186193    boost::system::error_code ec;
    187194    service_.add_verify_path(impl_, path, ec);
    188195    boost::asio::detail::throw_error(ec);
    189196  }
     197#endif
    190198
    191199  /// Add a directory containing certificate authority files to be used for
    192200  /// performing verification.
     
    216224   *
    217225   * @throws boost::system::system_error Thrown on failure.
    218226   */
     227#ifndef BOOST_NO_EXCEPTIONS
    219228  void use_certificate_file(const std::string& filename, file_format format)
    220229  {
    221230    boost::system::error_code ec;
    222231    service_.use_certificate_file(impl_, filename, format, ec);
    223232    boost::asio::detail::throw_error(ec);
    224233  }
     234#endif
    225235
    226236  /// Use a certificate from a file.
    227237  /**
     
    249259   *
    250260   * @throws boost::system::system_error Thrown on failure.
    251261   */
     262#ifndef BOOST_NO_EXCEPTIONS
    252263  void use_certificate_chain_file(const std::string& filename)
    253264  {
    254265    boost::system::error_code ec;
    255266    service_.use_certificate_chain_file(impl_, filename, ec);
    256267    boost::asio::detail::throw_error(ec);
    257268  }
     269#endif
    258270
    259271  /// Use a certificate chain from a file.
    260272  /**
     
    282294   *
    283295   * @throws boost::system::system_error Thrown on failure.
    284296   */
     297#ifndef BOOST_NO_EXCEPTIONS
    285298  void use_private_key_file(const std::string& filename, file_format format)
    286299  {
    287300    boost::system::error_code ec;
    288301    service_.use_private_key_file(impl_, filename, format, ec);
    289302    boost::asio::detail::throw_error(ec);
    290303  }
     304#endif
    291305
    292306  /// Use a private key from a file.
    293307  /**
     
    316330   *
    317331   * @throws boost::system::system_error Thrown on failure.
    318332   */
     333#ifndef BOOST_NO_EXCEPTIONS
    319334  void use_rsa_private_key_file(const std::string& filename, file_format format)
    320335  {
    321336    boost::system::error_code ec;
    322337    service_.use_rsa_private_key_file(impl_, filename, format, ec);
    323338    boost::asio::detail::throw_error(ec);
    324339  }
     340#endif
    325341
    326342  /// Use an RSA private key from a file.
    327343  /**
     
    351367   *
    352368   * @throws boost::system::system_error Thrown on failure.
    353369   */
     370#ifndef BOOST_NO_EXCEPTIONS
    354371  void use_tmp_dh_file(const std::string& filename)
    355372  {
    356373    boost::system::error_code ec;
    357374    service_.use_tmp_dh_file(impl_, filename, ec);
    358375    boost::asio::detail::throw_error(ec);
    359376  }
     377#endif
    360378
    361379  /// Use the specified file to obtain the temporary Diffie-Hellman parameters.
    362380  /**
     
    389407   *
    390408   * @throws boost::system::system_error Thrown on failure.
    391409   */
     410#ifndef BOOST_NO_EXCEPTIONS
    392411  template <typename PasswordCallback>
    393412  void set_password_callback(PasswordCallback callback)
    394413  {
     
    396415    service_.set_password_callback(impl_, callback, ec);
    397416    boost::asio::detail::throw_error(ec);
    398417  }
     418#endif
    399419
    400420  /// Set the password callback.
    401421  /**
  • boost/asio/ssl/detail/openssl_stream_service.hpp

    diff -ur boost_1_36_0/boost/asio/ssl/detail/openssl_stream_service.hpp boost_1_36_0_exceptions/boost/asio/ssl/detail/openssl_stream_service.hpp
    old new  
    214214  boost::system::error_code handshake(impl_type& impl, Stream& next_layer,
    215215      stream_base::handshake_type type, boost::system::error_code& ec)
    216216  {
     217#ifndef BOOST_NO_EXCEPTIONS
    217218    try
    218219    {
     220#endif
    219221      openssl_operation<Stream> op(
    220222        type == stream_base::client ?
    221223          &ssl_wrap<mutex_type>::SSL_connect:
     
    225227        impl->ssl,
    226228        impl->ext_bio);
    227229      op.start();
     230#ifndef BOOST_NO_EXCEPTIONS
    228231    }
    229232    catch (boost::system::system_error& e)
    230233    {
    231234      ec = e.code();
    232235      return ec;
    233236    }
     237#endif
    234238
    235239    ec = boost::system::error_code();
    236240    return ec;
     
    274278  boost::system::error_code shutdown(impl_type& impl, Stream& next_layer,
    275279      boost::system::error_code& ec)
    276280  {
     281#ifndef BOOST_NO_EXCEPTIONS
    277282    try
    278283    {
     284#endif
    279285      openssl_operation<Stream> op(
    280286        &ssl_wrap<mutex_type>::SSL_shutdown,
    281287        next_layer,
     
    283289        impl->ssl,
    284290        impl->ext_bio);
    285291      op.start();
     292#ifndef BOOST_NO_EXCEPTIONS
    286293    }
    287294    catch (boost::system::system_error& e)
    288295    {
    289296      ec = e.code();
    290297      return ec;
    291298    }
     299#endif
    292300
    293301    ec = boost::system::error_code();
    294302    return ec;
     
    330338      const Const_Buffers& buffers, boost::system::error_code& ec)
    331339  {
    332340    size_t bytes_transferred = 0;
     341#ifndef BOOST_NO_EXCEPTIONS
    333342    try
    334343    {
     344#endif
    335345      std::size_t buffer_size = boost::asio::buffer_size(*buffers.begin());
    336346      if (buffer_size > max_buffer_size)
    337347        buffer_size = max_buffer_size;
     
    348358        impl->ext_bio
    349359      );
    350360      bytes_transferred = static_cast<size_t>(op.start());
     361#ifndef BOOST_NO_EXCEPTIONS
    351362    }
    352363    catch (boost::system::system_error& e)
    353364    {
    354365      ec = e.code();
    355366      return 0;
    356367    }
     368#endif
    357369
    358370    ec = boost::system::error_code();
    359371    return bytes_transferred;
     
    404416      const Mutable_Buffers& buffers, boost::system::error_code& ec)
    405417  {
    406418    size_t bytes_transferred = 0;
     419#ifndef BOOST_NO_EXCEPTIONS
    407420    try
    408421    {
     422#endif
    409423      std::size_t buffer_size = boost::asio::buffer_size(*buffers.begin());
    410424      if (buffer_size > max_buffer_size)
    411425        buffer_size = max_buffer_size;
     
    422436      );
    423437
    424438      bytes_transferred = static_cast<size_t>(op.start());
     439#ifndef BOOST_NO_EXCEPTIONS
    425440    }
    426441    catch (boost::system::system_error& e)
    427442    {
    428443      ec = e.code();
    429444      return 0;
    430445    }
     446#endif
    431447
    432448    ec = boost::system::error_code();
    433449    return bytes_transferred;
  • boost/asio/ssl/stream.hpp

    diff -ur boost_1_36_0/boost/asio/ssl/stream.hpp boost_1_36_0_exceptions/boost/asio/ssl/stream.hpp
    old new  
    171171   *
    172172   * @throws boost::system::system_error Thrown on failure.
    173173   */
     174#ifndef BOOST_NO_EXCEPTIONS
    174175  void handshake(handshake_type type)
    175176  {
    176177    boost::system::error_code ec;
    177178    service_.handshake(impl_, next_layer_, type, ec);
    178179    boost::asio::detail::throw_error(ec);
    179180  }
     181#endif
    180182
    181183  /// Perform SSL handshaking.
    182184  /**
     
    222224   *
    223225   * @throws boost::system::system_error Thrown on failure.
    224226   */
     227#ifndef BOOST_NO_EXCEPTIONS
    225228  void shutdown()
    226229  {
    227230    boost::system::error_code ec;
    228231    service_.shutdown(impl_, next_layer_, ec);
    229232    boost::asio::detail::throw_error(ec);
    230233  }
     234#endif
    231235
    232236  /// Shut down SSL on the stream.
    233237  /**
     
    275279   * peer. Consider using the @ref write function if you need to ensure that all
    276280   * data is written before the blocking operation completes.
    277281   */
     282#ifndef BOOST_NO_EXCEPTIONS
    278283  template <typename ConstBufferSequence>
    279284  std::size_t write_some(const ConstBufferSequence& buffers)
    280285  {
     
    283288    boost::asio::detail::throw_error(ec);
    284289    return s;
    285290  }
     291#endif
    286292
    287293  /// Write some data to the stream.
    288294  /**
     
    352358   * bytes. Consider using the @ref read function if you need to ensure that the
    353359   * requested amount of data is read before the blocking operation completes.
    354360   */
     361#ifndef BOOST_NO_EXCEPTIONS
    355362  template <typename MutableBufferSequence>
    356363  std::size_t read_some(const MutableBufferSequence& buffers)
    357364  {
     
    360367    boost::asio::detail::throw_error(ec);
    361368    return s;
    362369  }
     370#endif
    363371
    364372  /// Read some data from the stream.
    365373  /**
     
    426434   *
    427435   * @throws boost::system::system_error Thrown on failure.
    428436   */
     437#ifndef BOOST_NO_EXCEPTIONS
    429438  template <typename MutableBufferSequence>
    430439  std::size_t peek(const MutableBufferSequence& buffers)
    431440  {
     
    434443    boost::asio::detail::throw_error(ec);
    435444    return s;
    436445  }
     446#endif
    437447
    438448  /// Peek at the incoming data on the stream.
    439449  /**
     
    463473   *
    464474   * @throws boost::system::system_error Thrown on failure.
    465475   */
     476#ifndef BOOST_NO_EXCEPTIONS
    466477  std::size_t in_avail()
    467478  {
    468479    boost::system::error_code ec;
     
    470481    boost::asio::detail::throw_error(ec);
    471482    return s;
    472483  }
     484#endif
    473485
    474486  /// Determine the amount of data that may be read without blocking.
    475487  /**