chiark / gitweb /
macro: avoid name clash with _unused on ppc
authorLennart Poettering <lennart@poettering.net>
Wed, 2 Jun 2010 19:34:03 +0000 (21:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 2 Jun 2010 19:34:03 +0000 (21:34 +0200)
src/log.c
src/log.h
src/macro.h
src/main.c
src/strv.h
src/unit.h

index 1343b9d98614f049cceeff8d15e5362ad3f3dd52..04ffb62913ffc132edaf3bba6a39acdd0b5c74fe 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -368,7 +368,7 @@ int log_meta(
         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;
index 6df1d59961f66cfd98f461a57e11e6ef8c69b8e8..0370cb90cd2daae6c02f900da3e5228e55124d6b 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -59,13 +59,13 @@ int log_meta(
         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__)
index 622c08eeda89ef840f06ac24638ae01873d13469..763a4de27ad8b7dafce11cc7655c2a114b4e684c 100644 (file)
 #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) {
@@ -70,7 +70,7 @@ 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__); \
index 7a829cea5c793a2fb4235f052e2ea90163f631f0..7c93f6d9c7c16eca8ee186f8d60fdb21c6ca74f3 100644 (file)
@@ -58,7 +58,7 @@ static int crash_chvt = -1;
 static bool confirm_spawn = false;
 static FILE* serialization = NULL;
 
-_noreturn static void freeze(void) {
+_noreturn_ static void freeze(void) {
         for (;;)
                 pause();
 }
@@ -66,7 +66,7 @@ _noreturn static void freeze(void) {
 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));
index f0be83dd59fed7107b4e93a8368824bf7984b921..11d2ea12076b2e6737e604ed60d72d5bc19d3c36 100644 (file)
@@ -29,7 +29,7 @@
 
 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);
@@ -41,20 +41,20 @@ char **strv_uniq(char **l);
 
 #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)++)
index f585fa623845a6c42d079f10bd1ecdd058b5f360..d3e6e8902dffff15be0fec254735576e592a8218 100644 (file)
@@ -431,7 +431,7 @@ char **unit_full_printf_strv(Unit *u, char **l);
 
 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);