int saved_errno, r;
va_list ap;
- if (_likely(LOG_PRI(level) > log_max_level))
+ if (_likely_(LOG_PRI(level) > log_max_level))
return 0;
saved_errno = errno;
const char*file,
int line,
const char *func,
- const char *format, ...) _printf_attr(5,6);
+ const char *format, ...) _printf_attr_(5,6);
-_noreturn void log_assert(
+_noreturn_ void log_assert(
const char*file,
int line,
const char *func,
- const char *format, ...) _printf_attr(4,5);
+ const char *format, ...) _printf_attr_(4,5);
#define log_debug(...) log_meta(LOG_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_info(...) log_meta(LOG_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__)
#include <assert.h>
#include <sys/types.h>
-#define _printf_attr(a,b) __attribute__ ((format (printf, a, b)))
-#define _sentinel __attribute__ ((sentinel))
-#define _noreturn __attribute__((noreturn))
-#define _unused __attribute__ ((unused))
-#define _destructor __attribute__ ((destructor))
-#define _pure __attribute__ ((pure))
-#define _const __attribute__ ((const))
-#define _deprecated __attribute__ ((deprecated))
-#define _packed __attribute__ ((packed))
-#define _malloc __attribute__ ((malloc))
-#define _weak __attribute__ ((weak))
-#define _likely(x) (__builtin_expect(!!(x),1))
-#define _unlikely(x) (__builtin_expect(!!(x),0))
+#define _printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
+#define _sentinel_ __attribute__ ((sentinel))
+#define _noreturn_ __attribute__((noreturn))
+#define _unused_ __attribute__ ((unused))
+#define _destructor_ __attribute__ ((destructor))
+#define _pure_ __attribute__ ((pure))
+#define _const_ __attribute__ ((const))
+#define _deprecated_ __attribute__ ((deprecated))
+#define _packed_ __attribute__ ((packed))
+#define _malloc_ __attribute__ ((malloc))
+#define _weak_ __attribute__ ((weak))
+#define _likely_(x) (__builtin_expect(!!(x),1))
+#define _unlikely_(x) (__builtin_expect(!!(x),0))
/* Rounds up */
static inline size_t ALIGN(size_t l) {
#define assert_se(expr) \
do { \
- if (_unlikely(!(expr))) \
+ if (_unlikely_(!(expr))) \
log_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__, \
"Assertion '%s' failed at %s:%u, function %s(). Aborting.", \
#expr , __FILE__, __LINE__, __PRETTY_FUNCTION__); \
static bool confirm_spawn = false;
static FILE* serialization = NULL;
-_noreturn static void freeze(void) {
+_noreturn_ static void freeze(void) {
for (;;)
pause();
}
static void nop_handler(int sig) {
}
-_noreturn static void crash(int sig) {
+_noreturn_ static void crash(int sig) {
if (!dump_core)
log_error("Caught <%s>, not dumping core.", strsignal(sig));
char *strv_find(char **l, const char *name);
void strv_free(char **l);
-char **strv_copy(char **l) _malloc;
+char **strv_copy(char **l) _malloc_;
unsigned strv_length(char **l);
char **strv_merge(char **a, char **b);
#define strv_contains(l, s) (!!strv_find((l), (s)))
-char **strv_new(const char *x, ...) _sentinel _malloc;
-char **strv_new_ap(const char *x, va_list ap) _malloc;
+char **strv_new(const char *x, ...) _sentinel_ _malloc_;
+char **strv_new_ap(const char *x, va_list ap) _malloc_;
static inline bool strv_isempty(char **l) {
return !l || !*l;
}
-char **strv_split(const char *s, const char *separator) _malloc;
-char **strv_split_quoted(const char *s) _malloc;
+char **strv_split(const char *s, const char *separator) _malloc_;
+char **strv_split_quoted(const char *s) _malloc_;
-char *strv_join(char **l, const char *separator) _malloc;
+char *strv_join(char **l, const char *separator) _malloc_;
-char **strv_env_merge(char **x, ...) _sentinel;
-char **strv_env_delete(char **x, ...) _sentinel;
+char **strv_env_merge(char **x, ...) _sentinel_;
+char **strv_env_delete(char **x, ...) _sentinel_;
#define STRV_FOREACH(s, l) \
for ((s) = (l); (s) && *(s); (s)++)
bool unit_can_serialize(Unit *u);
int unit_serialize(Unit *u, FILE *f, FDSet *fds);
-void unit_serialize_item_format(Unit *u, FILE *f, const char *key, const char *value, ...) _printf_attr(4,5);
+void unit_serialize_item_format(Unit *u, FILE *f, const char *key, const char *value, ...) _printf_attr_(4,5);
void unit_serialize_item(Unit *u, FILE *f, const char *key, const char *value);
int unit_deserialize(Unit *u, FILE *f, FDSet *fds);