Upgrade system and filesystem to conform system_category and generic_category interface to N3090, the current C++0x working paper, section 19.5, System error support.

Refactor API macros into a new header, boost/system/api_config.hpp.

Prohibit user definition of API macros. Rationale: ensure all translation units use same definitions, cut number of environments that need to be tested.

[SVN r62313]
This commit is contained in:
Beman Dawes
2010-05-30 15:38:32 +00:00
parent 2565e5307b
commit baae3a392a
15 changed files with 248 additions and 196 deletions

View File

@@ -159,7 +159,7 @@ namespace
switch ( ev )
{
case 0: return make_error_condition( success );
# if defined(BOOST_POSIX_API)
# if defined(BOOST_POSIX_API)
// POSIX-like O/S -> posix_errno decode table ---------------------------//
case E2BIG: return make_error_condition( argument_list_too_long );
case EACCES: return make_error_condition( permission_denied );
@@ -329,7 +329,7 @@ namespace
case WSAETIMEDOUT: return make_error_condition( timed_out );
case WSAEWOULDBLOCK: return make_error_condition( operation_would_block );
#endif
default: return error_condition( ev, system_category );
default: return error_condition( ev, system_category() );
}
}
@@ -337,7 +337,7 @@ namespace
std::string system_error_category::message( int ev ) const
{
return generic_category.message( ev );
return generic_category().message( ev );
}
# else
// TODO:
@@ -423,13 +423,13 @@ namespace boost
// address for comparison purposes
# endif
BOOST_SYSTEM_DECL const error_category & get_system_category()
BOOST_SYSTEM_DECL const error_category & system_category()
{
static const system_error_category system_category_const;
return system_category_const;
}
BOOST_SYSTEM_DECL const error_category & get_generic_category()
BOOST_SYSTEM_DECL const error_category & generic_category()
{
static const generic_error_category generic_category_const;
return generic_category_const;