replace noreturn attribute with standard C++ version

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-03-15 21:03:09 -07:00
parent b5d1a09010
commit 591f51f3d3
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
9 changed files with 15 additions and 14 deletions

View File

@ -106,7 +106,7 @@ static constexpr OptionDef option_defs[] = {
static constexpr Domain cmdline_domain("cmdline");
gcc_noreturn
[[noreturn]]
static void version()
{
printf("Music Player Daemon " VERSION " (%s)"
@ -272,7 +272,7 @@ static void PrintOption(const OptionDef &opt)
opt.GetDescription());
}
gcc_noreturn
[[noreturn]]
static void help()
{
printf("Usage:\n"

View File

@ -277,6 +277,7 @@ Convert(TagType tag_type) noexcept
return MPD_TAG_COUNT;
}
[[noreturn]]
static void
ThrowError(struct mpd_connection *connection)
{

View File

@ -71,7 +71,7 @@ public:
return error.message;
}
gcc_noreturn
[[noreturn]]
void Throw(const char *prefix) const;
void CheckThrow(const char *prefix) const;
};

View File

@ -36,7 +36,7 @@
static constexpr Domain fatal_error_domain("fatal_error");
gcc_noreturn
[[noreturn]]
static void
Abort()
{

View File

@ -29,11 +29,11 @@
/**
* Log the specified message and abort the process.
*/
gcc_noreturn
[[noreturn]]
void
FatalError(const char *msg);
gcc_noreturn
[[noreturn]]
void
FormatFatalError(const char *fmt, ...);
@ -42,19 +42,19 @@ FormatFatalError(const char *fmt, ...);
* fail. Prints the given message, the system error message (from
* errno or GetLastError()) and abort the process.
*/
gcc_noreturn
[[noreturn]]
void
FatalSystemError(const char *msg);
#ifdef _WIN32
gcc_noreturn
[[noreturn]]
void
FatalSystemError(const char *msg, DWORD code);
#endif
gcc_noreturn
[[noreturn]]
void
FormatFatalSystemError(const char *fmt, ...);

View File

@ -45,10 +45,12 @@ daemonize_finish()
* pid file.
*/
#ifndef _WIN32
[[noreturn]]
void
daemonize_kill();
#else
#include <stdexcept>
[[noreturn]]
static inline void
daemonize_kill()
{

View File

@ -25,7 +25,7 @@
#include <string.h>
#include <unistd.h>
gcc_noreturn
[[noreturn]]
static void
oom()
{

View File

@ -71,7 +71,6 @@
#define gcc_deprecated __attribute__((deprecated))
#define gcc_may_alias __attribute__((may_alias))
#define gcc_malloc __attribute__((malloc))
#define gcc_noreturn __attribute__((noreturn))
#define gcc_packed __attribute__((packed))
#define gcc_printf(a,b) __attribute__((format(printf, a, b)))
#define gcc_pure __attribute__((pure))
@ -101,7 +100,6 @@
#define gcc_deprecated
#define gcc_may_alias
#define gcc_malloc
#define gcc_noreturn
#define gcc_packed
#define gcc_printf(a,b)
#define gcc_pure

View File

@ -42,14 +42,14 @@
* the std::exception_ptr itself.
*/
template<typename T>
gcc_noreturn
[[noreturn]]
inline void
ThrowException(T &&t)
{
throw std::forward<T>(t);
}
gcc_noreturn
[[noreturn]]
inline void
ThrowException(std::exception_ptr ep)
{