mirror of
https://github.com/dovecot/core.git
synced 2026-10-23 22:08:58 +03:00
global: Drop support for old iconv()
iconv() is part of POSIX.1-2001.
This commit is contained in:
@@ -47,7 +47,6 @@ dovecot-config: dovecot-config.in Makefile
|
||||
(echo "DOVECOT_INSTALLED=no"; cat dovecot-config.in | sed \
|
||||
-e "s|\$$(top_builddir)|$$abs_builddir|g" \
|
||||
-e "s|\$$(incdir)|$$abs_srcdir|g" \
|
||||
-e "s|\$$(LIBICONV)|$(LIBICONV)|g" \
|
||||
-e "s|\$$(MODULE_LIBS)|$(MODULE_LIBS)|g" \
|
||||
-e "s|^\(dovecot_pkgincludedir\)=|\1=$(pkgincludedir)|" \
|
||||
-e "s|^\(dovecot_pkglibdir\)=|\1=$(pkglibdir)|" \
|
||||
|
||||
12
autogen.sh
12
autogen.sh
@@ -1,15 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
# If you've non-standard directories, set these
|
||||
#GETTEXT_DIR=
|
||||
|
||||
if ! test -f build-aux/config.rpath; then
|
||||
for dir in $GETTEXT_DIR /usr/share/gettext /usr/local/share/gettext; do
|
||||
if test -f $dir/config.rpath; then
|
||||
/bin/cp -f $dir/config.rpath build-aux/
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
autoreconf -vif
|
||||
|
||||
@@ -263,7 +263,6 @@ AS_IF([test "$FLEX" = ":" && test ! -e "$srcdir/src/lib/event-filter-lexer.c"],
|
||||
])
|
||||
AC_C_INLINE
|
||||
LT_INIT
|
||||
AM_ICONV
|
||||
|
||||
# SIZE_MAX is missing without this
|
||||
CXXFLAGS="$CXXFLAGS -D__STDC_LIMIT_MACROS"
|
||||
@@ -608,7 +607,7 @@ if test "$want_shared_libs" = "yes"; then
|
||||
fi
|
||||
else
|
||||
LIBDOVECOT_DEPS="$LIBDOVECOT_LA_LIBS"
|
||||
LIBDOVECOT="$LIBDOVECOT_DEPS \$(LIBICONV) \$(MODULE_LIBS)"
|
||||
LIBDOVECOT="$LIBDOVECOT_DEPS \$(MODULE_LIBS)"
|
||||
LIBDOVECOT_STORAGE_DEPS='$(top_builddir)/src/lib-storage/libstorage.la'
|
||||
LIBDOVECOT_LOGIN='$(top_builddir)/src/login-common/liblogin.la'
|
||||
LIBDOVECOT_LDA='$(top_builddir)/src/lib-lda/liblda.la'
|
||||
|
||||
@@ -4,11 +4,9 @@ AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/lib \
|
||||
-I$(top_srcdir)/src/lib-test
|
||||
|
||||
libcharset_la_LIBADD = $(LTLIBICONV)
|
||||
libcharset_la_SOURCES = \
|
||||
charset-iconv.c \
|
||||
charset-utf8.c \
|
||||
charset-utf8-only.c
|
||||
charset-utf8.c
|
||||
|
||||
headers = \
|
||||
charset-utf8.h \
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#include "buffer.h"
|
||||
#include "charset-utf8-private.h"
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
|
||||
#include <iconv.h>
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -56,7 +54,7 @@ charset_to_utf8_try(struct charset_translation *t,
|
||||
const unsigned char *src, size_t *src_size, buffer_t *dest,
|
||||
enum charset_result *result)
|
||||
{
|
||||
ICONV_CONST char *ic_srcbuf;
|
||||
char *ic_srcbuf;
|
||||
char tmpbuf[8192], *ic_destbuf;
|
||||
size_t srcleft, destleft, tmpbuf_used;
|
||||
bool ret = TRUE;
|
||||
@@ -69,7 +67,7 @@ charset_to_utf8_try(struct charset_translation *t,
|
||||
destleft = sizeof(tmpbuf);
|
||||
ic_destbuf = tmpbuf;
|
||||
srcleft = *src_size;
|
||||
ic_srcbuf = (ICONV_CONST char *) src;
|
||||
ic_srcbuf = (char *) src;
|
||||
|
||||
if (iconv(t->cd, &ic_srcbuf, &srcleft,
|
||||
&ic_destbuf, &destleft) != SIZE_MAX) {
|
||||
@@ -143,5 +141,3 @@ const struct charset_utf8_vfuncs charset_iconv = {
|
||||
.to_utf8_reset = iconv_charset_to_utf8_reset,
|
||||
.to_utf8 = iconv_charset_to_utf8,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
|
||||
|
||||
#include "lib.h"
|
||||
#include "charset-utf8-private.h"
|
||||
|
||||
struct charset_translation {
|
||||
normalizer_func_t *normalizer;
|
||||
};
|
||||
|
||||
static int
|
||||
utf8only_charset_to_utf8_begin(const char *charset,
|
||||
normalizer_func_t *normalizer,
|
||||
struct charset_translation **t_r)
|
||||
{
|
||||
struct charset_translation *t;
|
||||
|
||||
if (!charset_is_utf8(charset)) {
|
||||
/* no support for charsets that need translation */
|
||||
return -1;
|
||||
}
|
||||
|
||||
t = i_new(struct charset_translation, 1);
|
||||
t->normalizer = normalizer;
|
||||
*t_r = t;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void utf8only_charset_to_utf8_end(struct charset_translation *t)
|
||||
{
|
||||
i_free(t);
|
||||
}
|
||||
|
||||
static void
|
||||
utf8only_charset_to_utf8_reset(struct charset_translation *t ATTR_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
static enum charset_result
|
||||
utf8only_charset_to_utf8(struct charset_translation *t,
|
||||
const unsigned char *src, size_t *src_size,
|
||||
buffer_t *dest)
|
||||
{
|
||||
return charset_utf8_to_utf8(t->normalizer, src, src_size, dest);
|
||||
}
|
||||
|
||||
const struct charset_utf8_vfuncs charset_utf8only = {
|
||||
.to_utf8_begin = utf8only_charset_to_utf8_begin,
|
||||
.to_utf8_end = utf8only_charset_to_utf8_end,
|
||||
.to_utf8_reset = utf8only_charset_to_utf8_reset,
|
||||
.to_utf8 = utf8only_charset_to_utf8,
|
||||
};
|
||||
@@ -7,11 +7,7 @@
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
const struct charset_utf8_vfuncs *charset_utf8_vfuncs = &charset_iconv;
|
||||
#else
|
||||
const struct charset_utf8_vfuncs *charset_utf8_vfuncs = &charset_utf8only;
|
||||
#endif
|
||||
|
||||
bool charset_is_utf8(const char *charset)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user