]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
macro: Move attribute defintions to macro-fundamental
authorJan Janssen <medhefgo@web.de>
Sat, 28 May 2022 09:25:33 +0000 (11:25 +0200)
committerJan Janssen <medhefgo@web.de>
Sat, 28 May 2022 09:34:16 +0000 (11:34 +0200)
This also sorts them.

src/basic/macro.h
src/fundamental/macro-fundamental.h

index e6f89608f49ee2b0c9ccbc70200169cea41a85b0..972727915513de58bbd56409bea9f343f105fea2 100644 (file)
 
 #include "macro-fundamental.h"
 
-#define _printf_(a, b) __attribute__((__format__(printf, a, b)))
-#ifdef __clang__
-#  define _alloc_(...)
-#else
-#  define _alloc_(...) __attribute__((__alloc_size__(__VA_ARGS__)))
-#endif
-#define _sentinel_ __attribute__((__sentinel__))
-#define _destructor_ __attribute__((__destructor__))
-#define _deprecated_ __attribute__((__deprecated__))
-#define _malloc_ __attribute__((__malloc__))
-#define _weak_ __attribute__((__weak__))
-#define _public_ __attribute__((__visibility__("default")))
-#define _hidden_ __attribute__((__visibility__("hidden")))
-#define _weakref_(x) __attribute__((__weakref__(#x)))
-#define _alignas_(x) __attribute__((__aligned__(__alignof__(x))))
-#define _alignptr_ __attribute__((__aligned__(sizeof(void*))))
-#define _warn_unused_result_ __attribute__((__warn_unused_result__))
-
 #if !defined(HAS_FEATURE_MEMORY_SANITIZER)
 #  if defined(__has_feature)
 #    if __has_feature(memory_sanitizer)
index 77efb51ba0274d33c16cf7dfbae435d0f437b7c0..eb43cf3647c86b003e15bcd4af2bf5e8e417a712 100644 (file)
 #include "types-fundamental.h"
 
 #define _align_(x) __attribute__((__aligned__(x)))
+#define _alignas_(x) __attribute__((__aligned__(__alignof__(x))))
+#define _alignptr_ __attribute__((__aligned__(sizeof(void *))))
+#define _cleanup_(x) __attribute__((__cleanup__(x)))
 #define _const_ __attribute__((__const__))
-#define _pure_ __attribute__((__pure__))
-#define _section_(x) __attribute__((__section__(x)))
+#define _deprecated_ __attribute__((__deprecated__))
+#define _destructor_ __attribute__((__destructor__))
+#define _hidden_ __attribute__((__visibility__("hidden")))
+#define _likely_(x) (__builtin_expect(!!(x), 1))
+#define _malloc_ __attribute__((__malloc__))
+#define _noreturn_ _Noreturn
 #define _packed_ __attribute__((__packed__))
+#define _printf_(a, b) __attribute__((__format__(printf, a, b)))
+#define _public_ __attribute__((__visibility__("default")))
+#define _pure_ __attribute__((__pure__))
 #define _retain_ __attribute__((__retain__))
-#define _used_ __attribute__((__used__))
-#define _unused_ __attribute__((__unused__))
-#define _cleanup_(x) __attribute__((__cleanup__(x)))
-#define _likely_(x) (__builtin_expect(!!(x), 1))
+#define _section_(x) __attribute__((__section__(x)))
+#define _sentinel_ __attribute__((__sentinel__))
 #define _unlikely_(x) (__builtin_expect(!!(x), 0))
+#define _unused_ __attribute__((__unused__))
+#define _used_ __attribute__((__used__))
+#define _warn_unused_result_ __attribute__((__warn_unused_result__))
+#define _weak_ __attribute__((__weak__))
+#define _weakref_(x) __attribute__((__weakref__(#x)))
+
+#ifdef __clang__
+#  define _alloc_(...)
+#else
+#  define _alloc_(...) __attribute__((__alloc_size__(__VA_ARGS__)))
+#endif
+
 #if __GNUC__ >= 7
-#define _fallthrough_ __attribute__((__fallthrough__))
+#  define _fallthrough_ __attribute__((__fallthrough__))
 #else
-#define _fallthrough_
+#  define _fallthrough_
 #endif
-#define _noreturn_ _Noreturn
 
 #define XSTRINGIFY(x) #x
 #define STRINGIFY(x) XSTRINGIFY(x)