Skip to content

Commit

Permalink
Replace BOOST_SYSTEM_NO_DEPRECATED with BOOST_SYSTEM_ENABLE_DEPRECATED
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 21, 2017
1 parent 855fc96 commit 829a132
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 23 deletions.
15 changes: 7 additions & 8 deletions doc/reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h2><a name="C++11">C++11</a></h2>
uses C++11 features only when they are available, and otherwise falls back on
C++03 features.</p>
<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>
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height="368">
<tr>
Expand Down Expand Up @@ -109,17 +109,16 @@ <h2><a name="Macros">Macros</a></h2>
facility.</td>
</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">Deprecated features are excluded.</td>
<td valign="top" height="32">Deprecated features are provided for compatibility.</td>
</tr>
</table>
<h2><a name="Deprecated-names">Deprecated names</a></h2>
<p>In the process of adding Boost.System to C++0x standard library, the C++
committee changed some
names. To ease transition, Boost.System deprecates the old
names, but continues to provide them unless macro <code>BOOST_SYSTEM_NO_DEPRECATED</code>
is defined.</p>
<p>In the process of adding Boost.System to the C++11 standard library, the
C++ committee changed some names. To ease transition, Boost.System deprecates
the old names, but will provide them when the macro
<code>BOOST_SYSTEM_ENABLE_DEPRECATED</code> is defined.</p>
<table border="1" cellpadding="5" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td><b><i>Old usage, now deprecated</i></b></td>
Expand Down
2 changes: 1 addition & 1 deletion include/boost/system/detail/error_code.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ 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;
// note that it doesn't matter if this
// isn't initialized before use since
Expand Down
6 changes: 3 additions & 3 deletions include/boost/system/error_code.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ namespace boost

} // namespace errc

# ifndef BOOST_SYSTEM_NO_DEPRECATED
# ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
namespace posix = errc;
namespace posix_error = errc;
# endif
Expand Down Expand Up @@ -198,7 +198,7 @@ namespace boost
#endif
// 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_generic_category() { return generic_category(); }
inline const error_category & get_posix_category() { return generic_category(); }
Expand Down Expand Up @@ -533,7 +533,7 @@ namespace boost
};

// 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;
# endif

Expand Down
2 changes: 1 addition & 1 deletion include/boost/system/linux_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace boost
};
} // namespace linux_error

# ifndef BOOST_SYSTEM_NO_DEPRECATED
# ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
namespace Linux = linux_error;
# endif

Expand Down
2 changes: 1 addition & 1 deletion include/boost/system/windows_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace boost

} // namespace windows

# ifndef BOOST_SYSTEM_NO_DEPRECATED
# ifdef BOOST_SYSTEM_ENABLE_DEPRECATED
namespace windows = windows_error;
# endif

Expand Down
3 changes: 0 additions & 3 deletions test/error_code_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

//----------------------------------------------------------------------------//

// test without deprecated features
#define BOOST_SYSTEM_NO_DEPRECATED

#include <boost/config/warning_disable.hpp>

#include <boost/detail/lightweight_test.hpp>
Expand Down
2 changes: 0 additions & 2 deletions test/error_code_user_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

// 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/cerrno.hpp>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion test/initialization_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct foo
foo()
{
boost::system::error_code ec;
ec == boost::system::posix::permission_denied;
ec == boost::system::errc::permission_denied;
}
} f;

Expand Down
3 changes: 0 additions & 3 deletions test/system_error_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

//----------------------------------------------------------------------------//

// test without deprecated features
#define BOOST_SYSTEM_NO_DEPRECATED

#include <boost/config/warning_disable.hpp>

#include <boost/detail/lightweight_test.hpp>
Expand Down

0 comments on commit 829a132

Please sign in to comment.