Index: src/error_code.cpp =================================================================== --- src/error_code.cpp (revision 80450) +++ src/error_code.cpp (working copy) @@ -22,9 +22,6 @@ #include #include -using namespace boost::system; -using namespace boost::system::errc; - #include // for strerror/strerror_r # if defined( BOOST_WINDOWS_API ) @@ -36,12 +33,14 @@ # endif //----------------------------------------------------------------------------// +namespace boost +{ + namespace system + { namespace { -#if defined(__PGI) - using boost::system::errc::invalid_argument; -#endif + // standard error categories ---------------------------------------------// class generic_error_category : public error_category @@ -70,6 +69,11 @@ std::string generic_error_category::message( int ev ) const { + using namespace boost::system::errc; +#if defined(__PGI) + using boost::system::errc::invalid_argument; +#endif + static std::string unknown_err( "Unknown error" ); // strerror_r is preferred because it is always thread safe, // however, we fallback to strerror in certain cases because: @@ -133,7 +137,9 @@ } } std::string msg; +# ifndef BOOST_NO_EXCEPTIONS try +# endif { msg = ( ( result == invalid_argument ) ? "Unknown error" : bp ); } @@ -161,6 +167,11 @@ error_condition system_error_category::default_error_condition( int ev ) const { + using namespace boost::system::errc; +#if defined(__PGI) + using boost::system::errc::invalid_argument; +#endif + switch ( ev ) { case 0: return make_error_condition( success ); @@ -401,10 +412,6 @@ } // unnamed namespace -namespace boost -{ - namespace system - { # ifndef BOOST_SYSTEM_NO_DEPRECATED BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code;