aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-06-08 19:20:03 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-06-13 23:18:59 -0400
commit220a1e419760e4854f5b4ad9565f1c42e75f7bc2 (patch)
tree0b41247bb69dfd74df6e2e8a5bf2b4669e648f2d /src/compiler.h
parent4dd3478fc126690182f7da44275eac40f42816c6 (diff)
downloadkutter-220a1e419760e4854f5b4ad9565f1c42e75f7bc2.tar.gz
kutter-220a1e419760e4854f5b4ad9565f1c42e75f7bc2.tar.xz
kutter-220a1e419760e4854f5b4ad9565f1c42e75f7bc2.zip
compiler.h: Check if __aligned and __section macros are already defined
Don't define these macros if they are already - doing so causes compiler warnings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/compiler.h')
-rw-r--r--src/compiler.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler.h b/src/compiler.h
index e414d093..ab16efbd 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -15,8 +15,12 @@
#define __noreturn __attribute__((noreturn))
#define PACKED __attribute__((packed))
+#ifndef __aligned
#define __aligned(x) __attribute__((aligned(x)))
+#endif
+#ifndef __section
#define __section(S) __attribute__((section(S)))
+#endif
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)