diff options
| author | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
|---|---|---|
| committer | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
| commit | 76424950e373d3b04ac3dd13019151bfba3e8423 (patch) | |
| tree | 4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/common/attributes.h | |
Add the files
Diffstat (limited to 'src/common/attributes.h')
| -rw-r--r-- | src/common/attributes.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/common/attributes.h b/src/common/attributes.h new file mode 100644 index 0000000..ff1e660 --- /dev/null +++ b/src/common/attributes.h @@ -0,0 +1,19 @@ +#pragma once + +#ifndef __has_attribute + #error Unsupported compiler + #define __attribute__(x) +#endif + +#define FF_A_FALLTHROUGH __attribute__((__fallthrough__)) +#define FF_A_DEPRECATED __attribute__((__deprecated__)) +#define FF_A_CLEANUP(func) __attribute__((__cleanup__(func))) +#define FF_A_NODISCARD __attribute__((__warn_unused_result__)) +#define FF_A_PRINTF(formatStrIndex, argsStartIndex) __attribute__((__format__(printf, formatStrIndex, argsStartIndex))) +#define FF_A_SCANF(formatStrIndex, argsStartIndex) __attribute__((__format__(scanf, formatStrIndex, argsStartIndex))) +#define FF_A_NONNULL(argIndex, ...) __attribute__((__nonnull__(argIndex, ##__VA_ARGS__))) +#define FF_A_RETURNS_NONNULL __attribute__((__returns_nonnull__)) +#define FF_A_UNUSED __attribute__((__unused__)) +#define FF_A_PACKED __attribute__((__packed__)) +#define FF_A_WEAK_IMPORT __attribute__((__weak_import__)) +#define FF_A_ALWAYS_INLINE __attribute__((__always_inline__)) |