aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-14 00:01:20 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-14 00:01:20 -0800
commitd1bf83be601ec71c32f1e5ebe511f42f5e44195f (patch)
tree36b8e1300500792d6563c08a60a1fd1729712e36
parent545ef8479f39a162be3d37ac1253bbaa394e9681 (diff)
downloadsyslinux-elf-d1bf83be601ec71c32f1e5ebe511f42f5e44195f.tar.gz
syslinux-elf-d1bf83be601ec71c32f1e5ebe511f42f5e44195f.tar.xz
syslinux-elf-d1bf83be601ec71c32f1e5ebe511f42f5e44195f.zip
Add __aligned() and __alignas() macros
Add macros __aligned() (which takes a byte count), and __alignas() (which takes a type or expression whose type is used, same as sizeof).
-rw-r--r--com32/include/klibc/compiler.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/com32/include/klibc/compiler.h b/com32/include/klibc/compiler.h
index 02af9a0e..9f5d36e2 100644
--- a/com32/include/klibc/compiler.h
+++ b/com32/include/klibc/compiler.h
@@ -115,4 +115,8 @@
/* Packed structures */
#define __packed __attribute__((packed))
+/* Alignment */
+#define __aligned(x) __attribute__((aligned(x)))
+#define __alignas(x) __attribute__((aligned(__alignof__(x))))
+
#endif