Add get_posix_category, get_system_category, to solve order-of-initialization issues

[SVN r39394]
This commit is contained in:
Beman Dawes
2007-09-19 19:28:56 +00:00
parent 64b936097f
commit 4ff64eea34
2 changed files with 17 additions and 17 deletions

View File

@@ -162,12 +162,15 @@ namespace boost
// predefined error categories -----------------------------------------//
BOOST_SYSTEM_DECL extern const error_category & posix_category;
BOOST_SYSTEM_DECL extern const error_category & system_category;
BOOST_SYSTEM_DECL const error_category & get_system_category();
BOOST_SYSTEM_DECL const error_category & get_posix_category();
static const error_category & system_category = get_system_category();
static const error_category & posix_category = get_posix_category();
// deprecated synonyms
BOOST_SYSTEM_DECL extern const error_category & errno_ecat; // posix_category
BOOST_SYSTEM_DECL extern const error_category & native_ecat; // system_category
static const error_category & errno_ecat = get_posix_category();
static const error_category & native_ecat = get_system_category();
// class error_condition -----------------------------------------------//

View File

@@ -214,8 +214,8 @@ namespace
error_condition default_error_condition( int ev ) const;
};
const posix_error_category posix_category_const;
const system_error_category system_category_const;
const posix_error_category posix_category_const;
const system_error_category system_category_const;
// posix_error_category implementation ---------------------------------//
@@ -376,18 +376,15 @@ namespace boost
namespace system
{
BOOST_SYSTEM_DECL const error_category & posix_category
= posix_category_const;
BOOST_SYSTEM_DECL const error_category & get_system_category()
{
return system_category_const;
}
BOOST_SYSTEM_DECL const error_category & system_category
= system_category_const;
// deprecated synonyms
BOOST_SYSTEM_DECL const error_category & errno_ecat
= posix_category_const;
BOOST_SYSTEM_DECL const error_category & native_ecat
= system_category_const;
BOOST_SYSTEM_DECL const error_category & get_posix_category()
{
return posix_category_const;
}
} // namespace system
} // namespace boost