Merge pull request #18 from boostorg/pr/remove-no-deprecated

Replace BOOST_SYSTEM_NO_DEPRECATED with BOOST_SYSTEM_ENABLE_DEPRECATED
This commit is contained in:
Peter Dimov
2017-10-23 00:12:19 +03:00
committed by GitHub
9 changed files with 14 additions and 23 deletions

View File

@ -80,7 +80,7 @@ noexcept</code> and explicit conversion operators. The actual implementation
uses C++11 features only when they are available, and otherwise falls back on uses C++11 features only when they are available, and otherwise falls back on
C++03 features.</p> C++03 features.</p>
<h2><a name="Macros">Macros</a></h2> <h2><a name="Macros">Macros</a></h2>
<p>Users may defined the following macros if desired. Sensible defaults are <p>Users may define the following macros if desired. Sensible defaults are
provided, so users may ignore these macros if they prefer.</p> provided, so users may ignore these macros if they prefer.</p>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height="368"> <table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height="368">
<tr> <tr>
@ -109,17 +109,16 @@ provided, so users may ignore these macros if they prefer.</p>
facility.</td> facility.</td>
</tr> </tr>
<tr> <tr>
<td valign="top" height="32"><code>BOOST_SYSTEM_NO_DEPRECATED</code></td> <td valign="top" height="32"><code>BOOST_SYSTEM_ENABLE_DEPRECATED</code></td>
<td valign="top" height="32">Not defined.</td> <td valign="top" height="32">Not defined.</td>
<td valign="top" height="32">Deprecated features are excluded.</td> <td valign="top" height="32">Deprecated features are provided for compatibility.</td>
</tr> </tr>
</table> </table>
<h2><a name="Deprecated-names">Deprecated names</a></h2> <h2><a name="Deprecated-names">Deprecated names</a></h2>
<p>In the process of adding Boost.System to C++0x standard library, the C++ <p>In the process of adding Boost.System to the C++11 standard library, the
committee changed some C++ committee changed some names. To ease transition, Boost.System deprecates
names. To ease transition, Boost.System deprecates the old the old names, but will provide them when the macro
names, but continues to provide them unless macro <code>BOOST_SYSTEM_NO_DEPRECATED</code> <code>BOOST_SYSTEM_ENABLE_DEPRECATED</code> is defined.</p>
is defined.</p>
<table border="1" cellpadding="5" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111"> <table border="1" cellpadding="5" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
<tr> <tr>
<td><b><i>Old usage, now deprecated</i></b></td> <td><b><i>Old usage, now deprecated</i></b></td>

View File

@ -452,7 +452,7 @@ namespace
} // unnamed namespace } // unnamed namespace
# ifndef BOOST_SYSTEM_NO_DEPRECATED # ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code; BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code;
// note that it doesn't matter if this // note that it doesn't matter if this
// isn't initialized before use since // isn't initialized before use since

View File

@ -144,7 +144,7 @@ namespace boost
} // namespace errc } // namespace errc
# ifndef BOOST_SYSTEM_NO_DEPRECATED # ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
namespace posix = errc; namespace posix = errc;
namespace posix_error = errc; namespace posix_error = errc;
# endif # endif
@ -198,7 +198,7 @@ namespace boost
#endif #endif
// deprecated synonyms ------------------------------------------------------------// // deprecated synonyms ------------------------------------------------------------//
#ifndef BOOST_SYSTEM_NO_DEPRECATED #ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
inline const error_category & get_system_category() { return system_category(); } inline const error_category & get_system_category() { return system_category(); }
inline const error_category & get_generic_category() { return generic_category(); } inline const error_category & get_generic_category() { return generic_category(); }
inline const error_category & get_posix_category() { return generic_category(); } inline const error_category & get_posix_category() { return generic_category(); }
@ -533,7 +533,7 @@ namespace boost
}; };
// predefined error_code object used as "throw on error" tag // predefined error_code object used as "throw on error" tag
# ifndef BOOST_SYSTEM_NO_DEPRECATED # ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
BOOST_SYSTEM_DECL extern error_code throws; BOOST_SYSTEM_DECL extern error_code throws;
# endif # endif

View File

@ -89,7 +89,7 @@ namespace boost
}; };
} // namespace linux_error } // namespace linux_error
# ifndef BOOST_SYSTEM_NO_DEPRECATED # ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
namespace Linux = linux_error; namespace Linux = linux_error;
# endif # endif

View File

@ -107,7 +107,7 @@ namespace boost
} // namespace windows } // namespace windows
# ifndef BOOST_SYSTEM_NO_DEPRECATED # ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
namespace windows = windows_error; namespace windows = windows_error;
# endif # endif

View File

@ -9,9 +9,6 @@
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
// test without deprecated features
#define BOOST_SYSTEM_NO_DEPRECATED
#include <boost/config/warning_disable.hpp> #include <boost/config/warning_disable.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>

View File

@ -14,8 +14,6 @@
// Motivation was a Boost posting by Christopher Kohlhoff on June 28, 2006. // Motivation was a Boost posting by Christopher Kohlhoff on June 28, 2006.
#define BOOST_SYSTEM_NO_DEPRECATED
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
#include <boost/cerrno.hpp> #include <boost/cerrno.hpp>
#include <string> #include <string>

View File

@ -18,7 +18,7 @@ struct foo
foo() foo()
{ {
boost::system::error_code ec; boost::system::error_code ec;
ec == boost::system::posix::permission_denied; ec == boost::system::errc::permission_denied;
} }
} f; } f;

View File

@ -9,9 +9,6 @@
//----------------------------------------------------------------------------// //----------------------------------------------------------------------------//
// test without deprecated features
#define BOOST_SYSTEM_NO_DEPRECATED
#include <boost/config/warning_disable.hpp> #include <boost/config/warning_disable.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>