aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-26 14:10:56 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-26 14:10:56 +0100
commitfed6b79d3a501fd914eec27b0bb78a5274ddbe61 (patch)
tree2f843dba8f528c11068d0bdcfc0083d2518ee524 /src/libutil/str_util.c
parentb0061a0452e691c43fba6abbc4f5ea1bac21d1ea (diff)
downloadrspamd-fed6b79d3a501fd914eec27b0bb78a5274ddbe61.tar.gz
rspamd-fed6b79d3a501fd914eec27b0bb78a5274ddbe61.zip
[Minor] Add workaround for punny old distros (hello CentOS 6)
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r--src/libutil/str_util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index ab6be966a..7d346354f 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -22,7 +22,9 @@
#include "contrib/t1ha/t1ha.h"
#include <unicode/uversion.h>
#include <unicode/ucnv.h>
+#if U_ICU_VERSION_MAJOR_NUM >= 44
#include <unicode/unorm2.h>
+#endif
#include <math.h>
const guchar lc_map[256] = {
@@ -1967,6 +1969,7 @@ gboolean
rspamd_normalise_unicode_inplace (rspamd_mempool_t *pool, gchar *start,
guint *len)
{
+#if U_ICU_VERSION_MAJOR_NUM >= 44
UErrorCode uc_err = U_ZERO_ERROR;
static UConverter *utf8_conv = NULL;
static const UNormalizer2 *norm = NULL;
@@ -2040,4 +2043,8 @@ rspamd_normalise_unicode_inplace (rspamd_mempool_t *pool, gchar *start,
}
return ret;
+#else
+ /* Kill that with fire please */
+ return FALSE;
+#endif
}