2023-09-09 14:24:52 +00:00
|
|
|
#ifndef ATTRIBUTES_H
|
|
|
|
#define ATTRIBUTES_H
|
|
|
|
|
2024-12-02 09:40:49 +00:00
|
|
|
#include "versions.h"
|
|
|
|
|
2023-10-27 14:06:44 +00:00
|
|
|
#if !defined(__GNUC__) && !defined(__attribute__)
|
2023-09-09 14:24:52 +00:00
|
|
|
#define __attribute__(x)
|
|
|
|
#endif
|
|
|
|
|
2024-08-28 01:09:59 +00:00
|
|
|
#define UNUSED __attribute__((unused))
|
|
|
|
#define FALLTHROUGH __attribute__((fallthrough))
|
|
|
|
#define NORETURN __attribute__((noreturn))
|
|
|
|
#define NO_REORDER __attribute__((no_reorder))
|
|
|
|
#define SECTION_DATA __attribute__((section(".data")))
|
2023-09-09 14:24:52 +00:00
|
|
|
|
2024-12-02 09:40:49 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define UNREACHABLE() __builtin_unreachable()
|
|
|
|
#else
|
|
|
|
#define UNREACHABLE()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Variables may be unused in retail versions but used in debug versions
|
|
|
|
#if DEBUG_FEATURES
|
|
|
|
#define UNUSED_NDEBUG
|
|
|
|
#else
|
|
|
|
#define UNUSED_NDEBUG UNUSED
|
|
|
|
#endif
|
|
|
|
|
2023-09-09 14:24:52 +00:00
|
|
|
#endif
|