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_BITS(RTCCommandData, Command, 4, 3);
|
||||||
DECL_BIT(RTCCommandData, Reading, 7);
|
DECL_BIT(RTCCommandData, Reading, 7);
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#pragma pack(push, 1)
|
||||||
#pragma pack(push,1)
|
|
||||||
#endif
|
|
||||||
struct GBARTC {
|
struct GBARTC {
|
||||||
int bytesRemaining;
|
int32_t bytesRemaining;
|
||||||
int transferStep;
|
int32_t transferStep;
|
||||||
int bitsRead;
|
int32_t bitsRead;
|
||||||
int bits;
|
int32_t bits;
|
||||||
int commandActive;
|
int32_t commandActive;
|
||||||
RTCCommandData command;
|
RTCCommandData command;
|
||||||
RTCControl control;
|
RTCControl control;
|
||||||
uint8_t time[7];
|
uint8_t time[7];
|
||||||
} ATTRIBUTE_PACKED;
|
};
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
#endif
|
|
||||||
|
|
||||||
struct GBARumble {
|
struct GBARumble {
|
||||||
void (*setRumble)(struct GBARumble*, int enable);
|
void (*setRumble)(struct GBARumble*, int enable);
|
||||||
|
|
|
@ -86,11 +86,9 @@ typedef int32_t ssize_t;
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define ATTRIBUTE_UNUSED
|
#define ATTRIBUTE_UNUSED
|
||||||
#define ATTRIBUTE_FORMAT(X, Y, Z)
|
#define ATTRIBUTE_FORMAT(X, Y, Z)
|
||||||
#define ATTRIBUTE_PACKED
|
|
||||||
#else
|
#else
|
||||||
#define ATTRIBUTE_UNUSED __attribute__((unused))
|
#define ATTRIBUTE_UNUSED __attribute__((unused))
|
||||||
#define ATTRIBUTE_FORMAT(X, Y, Z) __attribute__((format(X, Y, Z)))
|
#define ATTRIBUTE_FORMAT(X, Y, Z) __attribute__((format(X, Y, Z)))
|
||||||
#define ATTRIBUTE_PACKED __attribute__((packed))
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DECL_BITFIELD(NAME, TYPE) typedef TYPE NAME
|
#define DECL_BITFIELD(NAME, TYPE) typedef TYPE NAME
|
||||||
|
|
Loading…
Reference in New Issue