mirror of https://github.com/mgba-emu/mgba.git
GBA: Better portable GBARTC packing
This commit is contained in:
parent
cd2533edce
commit
91a66c9346
|
@ -74,22 +74,18 @@ DECL_BITS(RTCCommandData, Magic, 0, 4);
|
|||
DECL_BITS(RTCCommandData, Command, 4, 3);
|
||||
DECL_BIT(RTCCommandData, Reading, 7);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(push,1)
|
||||
#endif
|
||||
#pragma pack(push, 1)
|
||||
struct GBARTC {
|
||||
int bytesRemaining;
|
||||
int transferStep;
|
||||
int bitsRead;
|
||||
int bits;
|
||||
int commandActive;
|
||||
int32_t bytesRemaining;
|
||||
int32_t transferStep;
|
||||
int32_t bitsRead;
|
||||
int32_t bits;
|
||||
int32_t commandActive;
|
||||
RTCCommandData command;
|
||||
RTCControl control;
|
||||
uint8_t time[7];
|
||||
} ATTRIBUTE_PACKED;
|
||||
#ifdef _MSC_VER
|
||||
};
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
struct GBARumble {
|
||||
void (*setRumble)(struct GBARumble*, int enable);
|
||||
|
|
|
@ -86,11 +86,9 @@ typedef int32_t ssize_t;
|
|||
#ifdef _MSC_VER
|
||||
#define ATTRIBUTE_UNUSED
|
||||
#define ATTRIBUTE_FORMAT(X, Y, Z)
|
||||
#define ATTRIBUTE_PACKED
|
||||
#else
|
||||
#define ATTRIBUTE_UNUSED __attribute__((unused))
|
||||
#define ATTRIBUTE_FORMAT(X, Y, Z) __attribute__((format(X, Y, Z)))
|
||||
#define ATTRIBUTE_PACKED __attribute__((packed))
|
||||
#endif
|
||||
|
||||
#define DECL_BITFIELD(NAME, TYPE) typedef TYPE NAME
|
||||
|
|
Loading…
Reference in New Issue