aboutsummaryrefslogtreecommitdiffstats
path: root/common/align.h
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-04-07 23:39:04 +0200
committerSven Gothel <[email protected]>2019-04-07 23:39:04 +0200
commit73233ce69919fc19c53ce8663c5b8cc05227f07e (patch)
treef2b6ccc1a14d7c387f33398a44ea4511d7ecb212 /common/align.h
parent8efa4c7ba5ee8eb399d31a9884e45f743d4625ad (diff)
parent99a55c445211fea77af6ab61cbc6a6ec4fbdc9b9 (diff)
Merge branch 'v1.19' of git://repo.or.cz/openal-soft into v1.19v1.19
Diffstat (limited to 'common/align.h')
-rw-r--r--common/align.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/align.h b/common/align.h
new file mode 100644
index 00000000..e2dc81df
--- /dev/null
+++ b/common/align.h
@@ -0,0 +1,21 @@
+#ifndef AL_ALIGN_H
+#define AL_ALIGN_H
+
+#if defined(HAVE_STDALIGN_H) && defined(HAVE_C11_ALIGNAS)
+#include <stdalign.h>
+#endif
+
+#ifndef alignas
+#if defined(IN_IDE_PARSER)
+/* KDevelop has problems with our align macro, so just use nothing for parsing. */
+#define alignas(x)
+#elif defined(HAVE_C11_ALIGNAS)
+#define alignas _Alignas
+#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 */