Add BOOST_SYSTEM_DEPRECATED; mark deprecated categories

This commit is contained in:
Peter Dimov
2020-10-06 03:42:00 +03:00
parent 8f32183b63
commit 6758690d2f
3 changed files with 20 additions and 6 deletions

View File

@ -48,4 +48,18 @@
# define BOOST_SYSTEM_CONSTEXPR
#endif
// BOOST_SYSTEM_DEPRECATED
#if defined(__clang__)
# define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg)))
#elif defined(__GNUC__)
# if __GNUC__ * 100 + __GNUC_MINOR__ >= 405
# define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated(msg)))
# else
# define BOOST_SYSTEM_DEPRECATED(msg) __attribute__((deprecated))
# endif
#elif defined(_MSC_VER)
# define BOOST_SYSTEM_DEPRECATED(msg) __declspec(deprecated(msg))
#endif
#endif // BOOST_SYSTEM_DETAIL_CONFIG_HPP_INCLUDED

View File

@ -109,10 +109,10 @@ inline error_category const & generic_category() BOOST_NOEXCEPT
#ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
inline const error_category & get_generic_category() { return generic_category(); }
inline const error_category & get_posix_category() { return generic_category(); }
static const error_category & posix_category BOOST_ATTRIBUTE_UNUSED = generic_category();
static const error_category & errno_ecat BOOST_ATTRIBUTE_UNUSED = generic_category();
BOOST_SYSTEM_DEPRECATED("please use generic_category()") inline const error_category & get_generic_category() { return generic_category(); }
BOOST_SYSTEM_DEPRECATED("please use generic_category()") inline const error_category & get_posix_category() { return generic_category(); }
BOOST_SYSTEM_DEPRECATED("please use generic_category()") static const error_category & posix_category BOOST_ATTRIBUTE_UNUSED = generic_category();
BOOST_SYSTEM_DEPRECATED("please use generic_category()") static const error_category & errno_ecat BOOST_ATTRIBUTE_UNUSED = generic_category();
#endif

View File

@ -98,8 +98,8 @@ inline error_category const & system_category() BOOST_NOEXCEPT
#ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
inline const error_category & get_system_category() { return system_category(); }
static const error_category & native_ecat BOOST_ATTRIBUTE_UNUSED = system_category();
BOOST_SYSTEM_DEPRECATED("please use system_category()") inline const error_category & get_system_category() { return system_category(); }
BOOST_SYSTEM_DEPRECATED("please use system_category()") static const error_category & native_ecat BOOST_ATTRIBUTE_UNUSED = system_category();
#endif