From 39605bc6e216e29fc68ad424d861a6fe5476714d Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Fri, 2 Jan 2015 22:40:47 +0000 Subject: [PATCH] add macros for packing and aligning --- libctru/include/3ds/types.h | 6 ++++++ 1 file changed, 6 insertions(+) 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))