add macros for packing and aligning

This commit is contained in:
Dave Murphy 2015-01-02 22:40:47 +00:00
parent 17298ffc2e
commit 39605bc6e2

View File

@ -42,3 +42,9 @@ typedef s32 Result;
typedef void (*ThreadFunc)(u32);
#define BIT(n) (1U<<(n))
//! aligns a struct (and other types?) to m, making sure that the size of the struct is a multiple of m.
#define ALIGN(m) __attribute__((aligned (m)))
//! packs a struct (and other types?) so it won't include padding bytes.
#define PACKED __attribute__ ((packed))