From 76424950e373d3b04ac3dd13019151bfba3e8423 Mon Sep 17 00:00:00 2001 From: sumuel Date: Mon, 17 Aug 2026 20:44:55 +0000 Subject: Add the files --- src/common/attributes.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/common/attributes.h (limited to 'src/common/attributes.h') 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__)) -- cgit v1.2.3