Add WUT_PACKED macro for struct packing.

This commit is contained in:
James Benton 2018-06-20 11:10:37 +01:00
parent e528a09ba5
commit 0cba642861
3 changed files with 6 additions and 3 deletions

View File

@ -153,7 +153,7 @@ struct FSCmdBlock
}; };
WUT_CHECK_SIZE(FSCmdBlock, 0xA80); WUT_CHECK_SIZE(FSCmdBlock, 0xA80);
struct __attribute__((packed)) FSStat struct WUT_PACKED FSStat
{ {
FSStatFlags flags; FSStatFlags flags;
FSMode mode; FSMode mode;

View File

@ -23,7 +23,7 @@ typedef enum MCPInstallTarget
MCP_INSTALL_TARGET_USB = 1, MCP_INSTALL_TARGET_USB = 1,
} MCPInstallTarget; } MCPInstallTarget;
struct __attribute__((__packed__)) MCPInstallProgress struct WUT_PACKED MCPInstallProgress
{ {
uint32_t inProgress; uint32_t inProgress;
uint64_t tid; uint64_t tid;

View File

@ -26,5 +26,8 @@
#define WUT_UNKNOWN_BYTES(Size) char WUT_PP_CAT(__unk, __COUNTER__) [Size] #define WUT_UNKNOWN_BYTES(Size) char WUT_PP_CAT(__unk, __COUNTER__) [Size]
#define WUT_PADDING_BYTES(Size) WUT_UNKNOWN_BYTES(Size) #define WUT_PADDING_BYTES(Size) WUT_UNKNOWN_BYTES(Size)
//! Unknown struct size // Unknown struct size
#define WUT_UNKNOWN_SIZE(x) #define WUT_UNKNOWN_SIZE(x)
// Marks a struct as packed
#define WUT_PACKED __attribute__((__packed__))