|
25 | 25 | #include <sys/param.h> |
26 | 26 | #include <sys/types.h> |
27 | 27 |
|
28 | | -#define _printf_(a,b) __attribute__ ((format (printf, a, b))) |
29 | | -#define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__))) |
30 | | -#define _sentinel_ __attribute__ ((sentinel)) |
31 | | -#define _unused_ __attribute__ ((unused)) |
32 | | -#define _destructor_ __attribute__ ((destructor)) |
33 | | -#define _pure_ __attribute__ ((pure)) |
34 | | -#define _const_ __attribute__ ((const)) |
35 | | -#define _deprecated_ __attribute__ ((deprecated)) |
36 | | -#define _packed_ __attribute__ ((packed)) |
37 | | -#define _malloc_ __attribute__ ((malloc)) |
38 | | -#define _weak_ __attribute__ ((weak)) |
39 | | -#define _likely_(x) (__builtin_expect(!!(x),1)) |
40 | | -#define _unlikely_(x) (__builtin_expect(!!(x),0)) |
41 | | -#define _public_ __attribute__ ((visibility("default"))) |
42 | | -#define _hidden_ __attribute__ ((visibility("hidden"))) |
43 | | -#define _weakref_(x) __attribute__((weakref(#x))) |
44 | | -#define _alignas_(x) __attribute__((aligned(__alignof(x)))) |
45 | | -#define _cleanup_(x) __attribute__((cleanup(x))) |
| 28 | +#include "attributes.h" |
| 29 | +#include "log.h" |
46 | 30 |
|
47 | 31 | /* Temporarily disable some warnings */ |
48 | 32 | #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \ |
@@ -361,30 +345,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { |
361 | 345 | _found; \ |
362 | 346 | }) |
363 | 347 |
|
364 | | -/* Define C11 thread_local attribute even on older gcc compiler |
365 | | - * version */ |
366 | | -#ifndef thread_local |
367 | | -/* |
368 | | - * Don't break on glibc < 2.16 that doesn't define __STDC_NO_THREADS__ |
369 | | - * see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769 |
370 | | - */ |
371 | | -#if __STDC_VERSION__ >= 201112L && !(defined(__STDC_NO_THREADS__) || (defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16)) |
372 | | -#define thread_local _Thread_local |
373 | | -#else |
374 | | -#define thread_local __thread |
375 | | -#endif |
376 | | -#endif |
377 | | - |
378 | | -/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc |
379 | | - * compiler versions */ |
380 | | -#ifndef noreturn |
381 | | -#if __STDC_VERSION__ >= 201112L |
382 | | -#define noreturn _Noreturn |
383 | | -#else |
384 | | -#define noreturn __attribute__((noreturn)) |
385 | | -#endif |
386 | | -#endif |
387 | | - |
388 | 348 | #define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \ |
389 | 349 | static inline void func##p(type *p) { \ |
390 | 350 | if (*p) \ |
|
0 commit comments