summaryrefslogtreecommitdiffstats
path: root/config.h.in
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-12-06 11:39:54 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-12-06 11:39:54 +0000
commitdf914aa64f9f9b6c5a472a438f5d6f7991d26068 (patch)
tree44dec31e97e15504f3d6ef4fd87757800ef97892 /config.h.in
parentd2bad43bb3559c3a14536ca14274210924906e5e (diff)
downloadrspamd-df914aa64f9f9b6c5a472a438f5d6f7991d26068.tar.gz
rspamd-df914aa64f9f9b6c5a472a438f5d6f7991d26068.zip
[Minor] Polish alignment macros
Diffstat (limited to 'config.h.in')
-rw-r--r--config.h.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/config.h.in b/config.h.in
index d6a3fc1d0..9487fd76e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -322,6 +322,17 @@ typedef off_t goffset;
#endif
#endif
+#ifndef __cplusplus
+# ifdef G_ALIGNOF
+# define RSPAMD_ALIGNOF G_ALIGNOF
+# else
+# define RSPAMD_ALIGNOF(t) _Alignof(t)
+# endif
+#else
+/* glib G_ALIGNOF nor C11 _Alignof are not good enough for C++, nuff said... */
+# define RSPAMD_ALIGNOF(t) alignof(t)
+#endif
+
/* Address sanitizer */
#ifdef __clang__
# if __has_feature(address_sanitizer)