mirror of https://github.com/LIJI32/SameBoy.git
This might hint GCC 9 and make it suck less
This commit is contained in:
parent
5b37d3c402
commit
aaba172c02
|
@ -15,11 +15,13 @@
|
|||
#define GB_SECTION(name, ...) _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wpedantic\"") alignas(8) char _align_##name[0]; __VA_ARGS__ _Pragma("GCC diagnostic pop")
|
||||
#endif
|
||||
#else
|
||||
#define GB_SECTION(name, ...) union __attribute__ ((aligned (8))) {uint8_t name##_section_start; struct {__VA_ARGS__};}; uint8_t name##_section_end[0];
|
||||
#define GB_SECTION(name, ...) union __attribute__ ((aligned (8))) {uint8_t name##_section_start[0]; struct {__VA_ARGS__};}; uint8_t name##_section_end[0];
|
||||
#ifdef GB_INTERNAL
|
||||
#define GB_SECTION_OFFSET(name) (offsetof(GB_gameboy_t, name##_section_start))
|
||||
#define GB_SECTION_SIZE(name) (offsetof(GB_gameboy_t, name##_section_end) - offsetof(GB_gameboy_t, name##_section_start))
|
||||
#define GB_GET_SECTION(gb, name) ((void*)&((gb)->name##_section_start))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __clang_major__ >= 8 || __GNUC__ >= 13
|
||||
#define GB_ENUM(type, ...) enum : type __VA_ARGS__
|
||||
|
|
Loading…
Reference in New Issue