Ticket #7347: 7347_2.patch

File 7347_2.patch, 1.9 KB (added by viboes, 10 years ago)

Needed to run the Boost.Thread test if BOOST_ERROR_CODE_HEADER_ONLY is defined

  • src/error_code.cpp

     
    2222#include <cstdlib>
    2323#include <cassert>
    2424
    25 using namespace boost::system;
    26 using namespace boost::system::errc;
    27 
    2825#include <cstring> // for strerror/strerror_r
    2926
    3027# if defined( BOOST_WINDOWS_API )
     
    3633# endif
    3734
    3835//----------------------------------------------------------------------------//
     36namespace boost
     37{
     38    namespace system
     39    {
    3940
    4041namespace
    4142{
    42 #if defined(__PGI)
    43   using boost::system::errc::invalid_argument;
    44 #endif
     43   
    4544  //  standard error categories  ---------------------------------------------//
    4645
    4746  class generic_error_category : public error_category
     
    7069
    7170  std::string generic_error_category::message( int ev ) const
    7271  {
     72    using namespace boost::system::errc;
     73#if defined(__PGI)
     74      using boost::system::errc::invalid_argument;
     75#endif
     76     
    7377    static std::string unknown_err( "Unknown error" );
    7478  // strerror_r is preferred because it is always thread safe,
    7579  // however, we fallback to strerror in certain cases because:
     
    133137        }
    134138      }
    135139      std::string msg;
     140#   ifndef BOOST_NO_EXCEPTIONS
    136141      try
     142#   endif
    137143      {
    138144        msg = ( ( result == invalid_argument ) ? "Unknown error" : bp );
    139145      }
     
    161167
    162168  error_condition system_error_category::default_error_condition( int ev ) const
    163169  {
     170    using namespace boost::system::errc;
     171#if defined(__PGI)
     172      using boost::system::errc::invalid_argument;
     173#endif
     174
    164175    switch ( ev )
    165176    {
    166177    case 0: return make_error_condition( success );
     
    401412
    402413} // unnamed namespace
    403414
    404 namespace boost
    405 {
    406   namespace system
    407   {
    408415
    409416# ifndef BOOST_SYSTEM_NO_DEPRECATED
    410417    BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code;