forked from boostorg/system
Add get_posix_category, get_system_category, to solve order-of-initialization issues
[SVN r39394]
This commit is contained in:
@@ -162,12 +162,15 @@ namespace boost
|
|||||||
|
|
||||||
// predefined error categories -----------------------------------------//
|
// predefined error categories -----------------------------------------//
|
||||||
|
|
||||||
BOOST_SYSTEM_DECL extern const error_category & posix_category;
|
BOOST_SYSTEM_DECL const error_category & get_system_category();
|
||||||
BOOST_SYSTEM_DECL extern const error_category & 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
|
// deprecated synonyms
|
||||||
BOOST_SYSTEM_DECL extern const error_category & errno_ecat; // posix_category
|
static const error_category & errno_ecat = get_posix_category();
|
||||||
BOOST_SYSTEM_DECL extern const error_category & native_ecat; // system_category
|
static const error_category & native_ecat = get_system_category();
|
||||||
|
|
||||||
// class error_condition -----------------------------------------------//
|
// class error_condition -----------------------------------------------//
|
||||||
|
|
||||||
|
@@ -214,8 +214,8 @@ namespace
|
|||||||
error_condition default_error_condition( int ev ) const;
|
error_condition default_error_condition( int ev ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
const posix_error_category posix_category_const;
|
const posix_error_category posix_category_const;
|
||||||
const system_error_category system_category_const;
|
const system_error_category system_category_const;
|
||||||
|
|
||||||
// posix_error_category implementation ---------------------------------//
|
// posix_error_category implementation ---------------------------------//
|
||||||
|
|
||||||
@@ -376,18 +376,15 @@ namespace boost
|
|||||||
namespace system
|
namespace system
|
||||||
{
|
{
|
||||||
|
|
||||||
BOOST_SYSTEM_DECL const error_category & posix_category
|
BOOST_SYSTEM_DECL const error_category & get_system_category()
|
||||||
= posix_category_const;
|
{
|
||||||
|
return system_category_const;
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_SYSTEM_DECL const error_category & system_category
|
BOOST_SYSTEM_DECL const error_category & get_posix_category()
|
||||||
= system_category_const;
|
{
|
||||||
|
return posix_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;
|
|
||||||
|
|
||||||
} // namespace system
|
} // namespace system
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
Reference in New Issue
Block a user