From 48d3afa86ae525a3eb0aacf92c85d2dedcd15bad Mon Sep 17 00:00:00 2001 From: Rokkuman X <50436544+RokkumanX@users.noreply.github.com> Date: Wed, 24 Jun 2020 15:12:00 +0200 Subject: [PATCH] Update save_state.h --- bsnes/gb/Core/save_state.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsnes/gb/Core/save_state.h b/bsnes/gb/Core/save_state.h index 546ac2d9..fcb91355 100644 --- a/bsnes/gb/Core/save_state.h +++ b/bsnes/gb/Core/save_state.h @@ -5,7 +5,7 @@ #define GB_PADDING(type, old_usage) type old_usage##__do_not_use -#define GB_SECTION(name, ...) __attribute__ ((aligned (8))) struct {} name##_section_start; __VA_ARGS__; struct {} name##_section_end +#define GB_SECTION(name, ...) __attribute__ ((aligned (8))) union {uint8_t name##_section_start; struct {__VA_ARGS__};}; uint8_t name##_section_end[0] #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))