| |
| #ifndef CCAN_COMPILER_H |
| #define CCAN_COMPILER_H |
| #include "config.h" |
| |
| #ifndef COLD |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define COLD __attribute__((__cold__)) |
| #endif |
| |
| #ifndef NORETURN |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define NORETURN __attribute__((__noreturn__)) |
| #endif |
| |
| #ifndef PRINTF_FMT |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define PRINTF_FMT(nfmt, narg) \ |
| __attribute__((format(__printf__, nfmt, narg))) |
| #endif |
| |
| #ifndef CONST_FUNCTION |
| |
| |
| |
| |
| |
| |
| |
| #define CONST_FUNCTION __attribute__((__const__)) |
| |
| #ifndef PURE_FUNCTION |
| |
| |
| |
| |
| |
| |
| #define PURE_FUNCTION __attribute__((__pure__)) |
| #endif |
| #endif |
| |
| #ifndef UNNEEDED |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define UNNEEDED __attribute__((__unused__)) |
| #endif |
| |
| #ifndef NEEDED |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define NEEDED __attribute__((__used__)) |
| #endif |
| |
| #ifndef UNUSED |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define UNUSED __attribute__((__unused__)) |
| #endif |
| |
| #ifndef IS_COMPILE_CONSTANT |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define IS_COMPILE_CONSTANT(expr) __builtin_constant_p(expr) |
| #endif |
| |
| #ifndef WARN_UNUSED_RESULT |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) |
| #endif |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define WARN_DEPRECATED __attribute__((__deprecated__)) |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define NO_NULL_ARGS __attribute__((__nonnull__)) |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define NON_NULL_ARGS(...) __attribute__((__nonnull__(__VA_ARGS__))) |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #define LAST_ARG_NULL __attribute__((__sentinel__)) |
| |
| #endif |