]> Chaos Git - corbenik/ctrulib.git/commitdiff
add macros for packing and aligning
authorDave Murphy <davem@devkitpro.org>
Fri, 2 Jan 2015 22:40:47 +0000 (22:40 +0000)
committerDave Murphy <davem@devkitpro.org>
Fri, 2 Jan 2015 22:42:11 +0000 (22:42 +0000)
libctru/include/3ds/types.h

index 2f7d01a53b31c62636341538f1ff24c82079f665..550c0d243c1ce14cb0ac4420600303efb4d65de1 100644 (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))