static void nop_handler(int sig) {
}
-_noreturn_ static void crash(int sig) {
+noreturn static void crash(int sig) {
if (getpid() != 1)
/* Pass this on immediately, if this is not PID 1 */
static bool arg_keep = false;
-_noreturn_ static void log_assert_errno(const char *text, int eno, const char *file, int line, const char *func) {
+noreturn static void log_assert_errno(const char *text, int eno, const char *file, int line, const char *func) {
log_meta(LOG_CRIT, file, line, func,
"'%s' failed at %s:%u (%s): %s.",
text, file, line, func, strerror(eno));
}
#pragma GCC diagnostic pop
-_noreturn_ void log_assert_failed(const char *text, const char *file, int line, const char *func) {
+noreturn void log_assert_failed(const char *text, const char *file, int line, const char *func) {
log_assert(LOG_CRIT, text, file, line, func, "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
abort();
}
-_noreturn_ void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func) {
+noreturn void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func) {
log_assert(LOG_CRIT, text, file, line, func, "Code should not be reached '%s' at %s:%u, function %s(). Aborting.");
abort();
}
const char *func,
char *buffer);
-_noreturn_ void log_assert_failed(
+noreturn void log_assert_failed(
const char *text,
const char *file,
int line,
const char *func);
-_noreturn_ void log_assert_failed_unreachable(
+noreturn void log_assert_failed_unreachable(
const char *text,
const char *file,
int line,
#define _printf_(a,b) __attribute__ ((format (printf, a, b)))
#define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__)))
#define _sentinel_ __attribute__ ((sentinel))
-#define _noreturn_ __attribute__((noreturn))
#define _unused_ __attribute__ ((unused))
#define _destructor_ __attribute__ ((destructor))
#define _pure_ __attribute__ ((pure))
_found; \
})
-/* Define C11 thread_local attribute even on older compilers */
+/* Define C11 thread_local attribute even on older gcc compiler
+ * version */
#ifndef thread_local
/*
* Don't break on glibc < 2.16 that doesn't define __STDC_NO_THREADS__
#endif
#endif
+/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
+ * compiler versions */
+#ifndef noreturn
+#if __STDC_VERSION__ >= 201112L
+#define noreturn _Noreturn
+#else
+#define noreturn __attribute__((noreturn))
+#endif
+#endif
+
#include "log.h"
static pid_t pager_pid = 0;
-_noreturn_ static void pager_fallback(void) {
+noreturn static void pager_fallback(void) {
ssize_t n;
do {
return -EPROTO;
}
-_noreturn_ void freeze(void) {
+noreturn void freeze(void) {
/* Make sure nobody waits for us on a socket anymore */
close_all_fds(NULL, 0);
int wait_for_terminate(pid_t pid, siginfo_t *status);
int wait_for_terminate_and_warn(const char *name, pid_t pid);
-_noreturn_ void freeze(void);
+noreturn void freeze(void);
bool null_or_empty(struct stat *st) _pure_;
int null_or_empty_path(const char *fn);
return container_of(node, struct _mate, node);
}
-_noreturn_ static void sig_alrm(int signo)
+noreturn static void sig_alrm(int signo)
{
exit(4);
}