aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/t1ha/t1ha.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-01 13:07:43 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-01 13:07:43 +0000
commit41dc9d8afff3b11110e190a6869959f415b8dc7b (patch)
tree4e0edb9879a2c3818cf8e8d17d28a6fa483a94a1 /contrib/t1ha/t1ha.h
parentf0615c9cb4b72c25d32e818e86bc030810fa00e7 (diff)
downloadrspamd-41dc9d8afff3b11110e190a6869959f415b8dc7b.tar.gz
rspamd-41dc9d8afff3b11110e190a6869959f415b8dc7b.zip
[Minor] Improve portability
Diffstat (limited to 'contrib/t1ha/t1ha.h')
-rw-r--r--contrib/t1ha/t1ha.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/t1ha/t1ha.h b/contrib/t1ha/t1ha.h
index 2f6e48e3f..1ad763c3a 100644
--- a/contrib/t1ha/t1ha.h
+++ b/contrib/t1ha/t1ha.h
@@ -113,7 +113,15 @@
#endif
#define likely(cond) __builtin_expect(!!(cond), 1)
#define unlikely(cond) __builtin_expect(!!(cond), 0)
+# if __GNUC_PREREQ(4, 6) || defined(__clang__)
#define unreachable() __builtin_unreachable()
+# else
+#define unreachable() \
+ do { \
+ for (;;) \
+ ; \
+ } while (0)
+# endif
#define bswap64(v) __builtin_bswap64(v)
#define bswap32(v) __builtin_bswap32(v)
#if __GNUC_PREREQ(4, 8) || __has_builtin(__builtin_bswap16)