aboutsummaryrefslogtreecommitdiffstats
path: root/include/align.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-06 18:29:53 -0700
committerChris Robinson <[email protected]>2014-05-06 18:29:53 -0700
commit0ea979a262d4409a830354cbbc6eb3bea6f455a3 (patch)
treec230c59be9f8556a47798c2641256bf3f4c9f294 /include/align.h
parent1a76a3238c86cc40499e0c724f698d9b17f776c4 (diff)
Move some headers to include/
Note, these are not installed. Only headers in include/AL/ are installed.
Diffstat (limited to 'include/align.h')
-rw-r--r--include/align.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/align.h b/include/align.h
new file mode 100644
index 00000000..babd4106
--- /dev/null
+++ b/include/align.h
@@ -0,0 +1,21 @@
+#ifndef AL_ALIGN_H
+#define AL_ALIGN_H
+
+#ifdef HAVE_STDALIGN_H
+#include <stdalign.h>
+#endif
+
+#ifndef alignas
+#ifdef HAVE_C11_ALIGNAS
+#define alignas _Alignas
+#elif defined(IN_IDE_PARSER)
+/* KDevelop has problems with our align macro, so just use nothing for parsing. */
+#define alignas(x)
+#else
+/* NOTE: Our custom ALIGN macro can't take a type name like alignas can. For
+ * maximum compatibility, only provide constant integer values to alignas. */
+#define alignas(_x) ALIGN(_x)
+#endif
+#endif
+
+#endif /* AL_ALIGN_H */