Add __aligned() and __alignas() macros
authorH. Peter Anvin <hpa@zytor.com>
Thu, 14 Feb 2008 08:01:20 +0000 (00:01 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 14 Feb 2008 08:01:20 +0000 (00:01 -0800)
Add macros __aligned() (which takes a byte count), and __alignas()
(which takes a type or expression whose type is used, same as sizeof).

com32/include/klibc/compiler.h

index 02af9a0..9f5d36e 100644 (file)
 /* Packed structures */
 #define __packed       __attribute__((packed))
 
+/* Alignment */
+#define __aligned(x)   __attribute__((aligned(x)))
+#define __alignas(x)   __attribute__((aligned(__alignof__(x))))
+
 #endif