From: Dave Murphy Date: Fri, 2 Jan 2015 22:40:47 +0000 (+0000) Subject: add macros for packing and aligning X-Git-Tag: v0.3.0~12 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=39605bc6e216e29fc68ad424d861a6fe5476714d;p=corbenik%2Fctrulib.git add macros for packing and aligning --- diff --git a/libctru/include/3ds/types.h b/libctru/include/3ds/types.h index 2f7d01a..550c0d2 100644 --- a/libctru/include/3ds/types.h +++ b/libctru/include/3ds/types.h @@ -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))