1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-06-08 01:21:52 +00:00
oot/include/attributes.h
Dragorn421 6d56b1b8e0
Cleanup includes in header files (#2540)
* Cleanup includes in header files

* include libc headers without libc/ prefix

* fix

* fix2

* fix3

* fix4

* some bss lol

* bss

* fix
2025-05-24 16:20:51 -04:00

37 lines
796 B
C

#ifndef ATTRIBUTES_H
#define ATTRIBUTES_H
#if !defined(__GNUC__) && !defined(__attribute__)
#define __attribute__(x)
#endif
#define UNUSED __attribute__((unused))
#define NO_REORDER __attribute__((no_reorder))
#define SECTION_DATA __attribute__((section(".data")))
#if __GNUC__ >= 7
#define FALLTHROUGH __attribute__((fallthrough))
#else
#define FALLTHROUGH
#endif
#if defined(__GNUC__) && defined(NON_MATCHING)
#define NORETURN __attribute__((noreturn))
#else
#define NORETURN
#endif
#if defined(__GNUC__) && defined(NON_MATCHING)
#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
#endif