Ticket #7347: 7347_2.patch
File 7347_2.patch, 1.9 KB (added by , 10 years ago) |
---|
-
src/error_code.cpp
22 22 #include <cstdlib> 23 23 #include <cassert> 24 24 25 using namespace boost::system;26 using namespace boost::system::errc;27 28 25 #include <cstring> // for strerror/strerror_r 29 26 30 27 # if defined( BOOST_WINDOWS_API ) … … 36 33 # endif 37 34 38 35 //----------------------------------------------------------------------------// 36 namespace boost 37 { 38 namespace system 39 { 39 40 40 41 namespace 41 42 { 42 #if defined(__PGI) 43 using boost::system::errc::invalid_argument; 44 #endif 43 45 44 // standard error categories ---------------------------------------------// 46 45 47 46 class generic_error_category : public error_category … … 70 69 71 70 std::string generic_error_category::message( int ev ) const 72 71 { 72 using namespace boost::system::errc; 73 #if defined(__PGI) 74 using boost::system::errc::invalid_argument; 75 #endif 76 73 77 static std::string unknown_err( "Unknown error" ); 74 78 // strerror_r is preferred because it is always thread safe, 75 79 // however, we fallback to strerror in certain cases because: … … 133 137 } 134 138 } 135 139 std::string msg; 140 # ifndef BOOST_NO_EXCEPTIONS 136 141 try 142 # endif 137 143 { 138 144 msg = ( ( result == invalid_argument ) ? "Unknown error" : bp ); 139 145 } … … 161 167 162 168 error_condition system_error_category::default_error_condition( int ev ) const 163 169 { 170 using namespace boost::system::errc; 171 #if defined(__PGI) 172 using boost::system::errc::invalid_argument; 173 #endif 174 164 175 switch ( ev ) 165 176 { 166 177 case 0: return make_error_condition( success ); … … 401 412 402 413 } // unnamed namespace 403 414 404 namespace boost405 {406 namespace system407 {408 415 409 416 # ifndef BOOST_SYSTEM_NO_DEPRECATED 410 417 BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code;