replace noreturn attribute with standard C++ version

Signed-off-by: 's avatarRosen Penev <rosenp@gmail.com>
parent b5d1a090
...@@ -106,7 +106,7 @@ static constexpr OptionDef option_defs[] = { ...@@ -106,7 +106,7 @@ static constexpr OptionDef option_defs[] = {
static constexpr Domain cmdline_domain("cmdline"); static constexpr Domain cmdline_domain("cmdline");
gcc_noreturn [[noreturn]]
static void version() static void version()
{ {
printf("Music Player Daemon " VERSION " (%s)" printf("Music Player Daemon " VERSION " (%s)"
...@@ -272,7 +272,7 @@ static void PrintOption(const OptionDef &opt) ...@@ -272,7 +272,7 @@ static void PrintOption(const OptionDef &opt)
opt.GetDescription()); opt.GetDescription());
} }
gcc_noreturn [[noreturn]]
static void help() static void help()
{ {
printf("Usage:\n" printf("Usage:\n"
......
...@@ -277,6 +277,7 @@ Convert(TagType tag_type) noexcept ...@@ -277,6 +277,7 @@ Convert(TagType tag_type) noexcept
return MPD_TAG_COUNT; return MPD_TAG_COUNT;
} }
[[noreturn]]
static void static void
ThrowError(struct mpd_connection *connection) ThrowError(struct mpd_connection *connection)
{ {
......
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
return error.message; return error.message;
} }
gcc_noreturn [[noreturn]]
void Throw(const char *prefix) const; void Throw(const char *prefix) const;
void CheckThrow(const char *prefix) const; void CheckThrow(const char *prefix) const;
}; };
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
static constexpr Domain fatal_error_domain("fatal_error"); static constexpr Domain fatal_error_domain("fatal_error");
gcc_noreturn [[noreturn]]
static void static void
Abort() Abort()
{ {
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
/** /**
* Log the specified message and abort the process. * Log the specified message and abort the process.
*/ */
gcc_noreturn [[noreturn]]
void void
FatalError(const char *msg); FatalError(const char *msg);
gcc_noreturn [[noreturn]]
void void
FormatFatalError(const char *fmt, ...); FormatFatalError(const char *fmt, ...);
...@@ -42,19 +42,19 @@ FormatFatalError(const char *fmt, ...); ...@@ -42,19 +42,19 @@ FormatFatalError(const char *fmt, ...);
* fail. Prints the given message, the system error message (from * fail. Prints the given message, the system error message (from
* errno or GetLastError()) and abort the process. * errno or GetLastError()) and abort the process.
*/ */
gcc_noreturn [[noreturn]]
void void
FatalSystemError(const char *msg); FatalSystemError(const char *msg);
#ifdef _WIN32 #ifdef _WIN32
gcc_noreturn [[noreturn]]
void void
FatalSystemError(const char *msg, DWORD code); FatalSystemError(const char *msg, DWORD code);
#endif #endif
gcc_noreturn [[noreturn]]
void void
FormatFatalSystemError(const char *fmt, ...); FormatFatalSystemError(const char *fmt, ...);
......
...@@ -45,10 +45,12 @@ daemonize_finish() ...@@ -45,10 +45,12 @@ daemonize_finish()
* pid file. * pid file.
*/ */
#ifndef _WIN32 #ifndef _WIN32
[[noreturn]]
void void
daemonize_kill(); daemonize_kill();
#else #else
#include <stdexcept> #include <stdexcept>
[[noreturn]]
static inline void static inline void
daemonize_kill() daemonize_kill()
{ {
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
gcc_noreturn [[noreturn]]
static void static void
oom() oom()
{ {
......
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
#define gcc_deprecated __attribute__((deprecated)) #define gcc_deprecated __attribute__((deprecated))
#define gcc_may_alias __attribute__((may_alias)) #define gcc_may_alias __attribute__((may_alias))
#define gcc_malloc __attribute__((malloc)) #define gcc_malloc __attribute__((malloc))
#define gcc_noreturn __attribute__((noreturn))
#define gcc_packed __attribute__((packed)) #define gcc_packed __attribute__((packed))
#define gcc_printf(a,b) __attribute__((format(printf, a, b))) #define gcc_printf(a,b) __attribute__((format(printf, a, b)))
#define gcc_pure __attribute__((pure)) #define gcc_pure __attribute__((pure))
...@@ -101,7 +100,6 @@ ...@@ -101,7 +100,6 @@
#define gcc_deprecated #define gcc_deprecated
#define gcc_may_alias #define gcc_may_alias
#define gcc_malloc #define gcc_malloc
#define gcc_noreturn
#define gcc_packed #define gcc_packed
#define gcc_printf(a,b) #define gcc_printf(a,b)
#define gcc_pure #define gcc_pure
......
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
* the std::exception_ptr itself. * the std::exception_ptr itself.
*/ */
template<typename T> template<typename T>
gcc_noreturn [[noreturn]]
inline void inline void
ThrowException(T &&t) ThrowException(T &&t)
{ {
throw std::forward<T>(t); throw std::forward<T>(t);
} }
gcc_noreturn [[noreturn]]
inline void inline void
ThrowException(std::exception_ptr ep) ThrowException(std::exception_ptr ep)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment