summaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/mem_pool.h6
-rw-r--r--src/libutil/multipattern.c4
-rw-r--r--src/libutil/str_util.h2
3 files changed, 4 insertions, 8 deletions
diff --git a/src/libutil/mem_pool.h b/src/libutil/mem_pool.h
index 2db36e03a..c369f116a 100644
--- a/src/libutil/mem_pool.h
+++ b/src/libutil/mem_pool.h
@@ -68,11 +68,7 @@ struct f_str_s;
#define MEMPOOL_UID_LEN 20
/* All pointers are aligned as this variable */
#define MIN_MEM_ALIGNMENT G_MEM_ALIGN
-#ifndef __cplusplus
-#define RSPAMD_ALIGNOF G_ALIGNOF
-#else
-#define RSPAMD_ALIGNOF(t) alignof(t)
-#endif
+
/**
* Destructor type definition
*/
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index 2842b1d59..8f959f486 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -256,7 +256,7 @@ rspamd_multipattern_create (enum rspamd_multipattern_flags flags)
struct rspamd_multipattern *mp;
/* Align due to blake2b state */
- (void) !posix_memalign((void **)&mp, _Alignof (struct rspamd_multipattern),
+ (void) !posix_memalign((void **)&mp, RSPAMD_ALIGNOF(struct rspamd_multipattern),
sizeof (*mp));
g_assert (mp != NULL);
memset (mp, 0, sizeof (*mp));
@@ -285,7 +285,7 @@ rspamd_multipattern_create_sized (guint npatterns,
struct rspamd_multipattern *mp;
/* Align due to blake2b state */
- (void) !posix_memalign((void **)&mp, _Alignof (struct rspamd_multipattern), sizeof (*mp));
+ (void) !posix_memalign((void **)&mp, RSPAMD_ALIGNOF(struct rspamd_multipattern), sizeof (*mp));
g_assert (mp != NULL);
memset (mp, 0, sizeof (*mp));
mp->flags = flags;
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h
index b08dd56ad..47abf062e 100644
--- a/src/libutil/str_util.h
+++ b/src/libutil/str_util.h
@@ -473,7 +473,7 @@ gsize rspamd_memspn (const gchar *s, const gchar *e, gsize len);
* Check if a pointer is aligned; n must be power of two
*/
#define rspamd_is_aligned(p, n) (((uintptr_t)(p) & ((uintptr_t)(n) - 1)) == 0)
-#define rspamd_is_aligned_as(p, v) rspamd_is_aligned(p, _Alignof(__typeof((v))))
+#define rspamd_is_aligned_as(p, v) rspamd_is_aligned(p, RSPAMD_ALIGNOF(__typeof((v))))
gboolean rspamd_str_has_8bit (const guchar *beg, gsize len);
struct UConverter;