noreturn attribute is standard in C++11
This commit is contained in:
parent
9bd5f424d3
commit
57017e3ace
|
@ -41,11 +41,11 @@ namespace libtorrent { namespace aux {
|
||||||
|
|
||||||
template <typename T, typename... Args>
|
template <typename T, typename... Args>
|
||||||
#ifdef BOOST_NO_EXCEPTIONS
|
#ifdef BOOST_NO_EXCEPTIONS
|
||||||
void TORRENT_NO_RETURN throw_ex(Args&&...) {
|
[[noreturn]] void throw_ex(Args&&...) {
|
||||||
std::terminate();
|
std::terminate();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void TORRENT_NO_RETURN throw_ex(Args&&... args) {
|
[[noreturn]] void throw_ex(Args&&... args) {
|
||||||
throw T(std::forward<Args>(args)...);
|
throw T(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -346,16 +346,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#define TORRENT_UNUSED(x) (void)(x)
|
#define TORRENT_UNUSED(x) (void)(x)
|
||||||
|
|
||||||
// at the highest warning level, clang actually warns about functions
|
|
||||||
// that could be marked noreturn.
|
|
||||||
#if defined __clang__ || defined __GNUC__
|
|
||||||
#define TORRENT_NO_RETURN __attribute((noreturn))
|
|
||||||
#elif _MSC_VER
|
|
||||||
#define TORRENT_NO_RETURN __declspec(noreturn)
|
|
||||||
#else
|
|
||||||
#define TORRENT_NO_RETURN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined __GNUC__ || defined __clang__
|
#if defined __GNUC__ || defined __clang__
|
||||||
#define TORRENT_FORMAT(fmt, ellipsis) __attribute__((__format__(__printf__, fmt, ellipsis)))
|
#define TORRENT_FORMAT(fmt, ellipsis) __attribute__((__format__(__printf__, fmt, ellipsis)))
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace aux {
|
||||||
class torrent;
|
class torrent;
|
||||||
|
|
||||||
#ifndef BOOST_NO_EXCEPTIONS
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
void TORRENT_NO_RETURN throw_invalid_handle();
|
[[noreturn]] void throw_invalid_handle();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using status_flags_t = flags::bitfield_flag<std::uint32_t, struct status_flags_tag>;
|
using status_flags_t = flags::bitfield_flag<std::uint32_t, struct status_flags_tag>;
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace detail {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
inline void TORRENT_NO_RETURN throw_error()
|
[[noreturn]] inline void throw_error()
|
||||||
{ aux::throw_ex<system_error>(errors::invalid_entry_type); }
|
{ aux::throw_ex<system_error>(errors::invalid_entry_type); }
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace libtorrent {
|
||||||
constexpr status_flags_t torrent_handle::query_save_path;
|
constexpr status_flags_t torrent_handle::query_save_path;
|
||||||
|
|
||||||
#ifndef BOOST_NO_EXCEPTIONS
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
void TORRENT_NO_RETURN throw_invalid_handle()
|
[[noreturn]] void throw_invalid_handle()
|
||||||
{
|
{
|
||||||
throw system_error(errors::invalid_torrent_handle);
|
throw system_error(errors::invalid_torrent_handle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ LONG WINAPI seh_exception_handler(LPEXCEPTION_POINTERS p)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
void TORRENT_NO_RETURN sig_handler(int sig)
|
[[noreturn]] void sig_handler(int sig)
|
||||||
{
|
{
|
||||||
char stack_text[10000];
|
char stack_text[10000];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue