From bd4d65615b3a5360d455b99e77bd113ad90f1539 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 21 Apr 2016 09:17:11 +0200 Subject: w32: Replace libiconv DLL by iconv feature of libgpg-error. * configure.ac: Do nor require libiconv for W32. * common/utf8conv.c [W32]: Do not incluce iconv.h. Request libgpg-error iconv macros. (jnlib_iconv): Use ICONV_CONST macro. * build-aux/speedo/w32/inst.nsi [!WITH_GUI]: Do not install libiconv. * build-aux/speedo.mk (speedo_spkgs) [!WITH_GUI]: Likewise. Signed-off-by: Werner Koch --- common/utf8conv.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'common/utf8conv.c') diff --git a/common/utf8conv.c b/common/utf8conv.c index 8a2cf8a20..83e6eae93 100644 --- a/common/utf8conv.c +++ b/common/utf8conv.c @@ -38,10 +38,17 @@ #include #endif #include -#ifndef HAVE_ANDROID_SYSTEM + +#if HAVE_W32_SYSTEM +# /* Tell libgpg-error to provide the iconv macros. */ +# define GPGRT_ENABLE_W32_ICONV_MACROS 1 +#elif HAVE_ANDROID_SYSTEM +# /* No iconv support. */ +#else # include #endif + #include "util.h" #include "common-defs.h" #include "i18n.h" @@ -244,8 +251,8 @@ set_native_charset (const char *newset) as Latin-1. This makes sense because many Unix system don't have their locale set up properly and thus would get annoying error messages and we have to handle all the "bug" reports. Latin-1 has - always been the character set used for 8 bit characters on Unix - systems. */ + traditionally been the character set used for 8 bit characters on + Unix systems. */ if ( !*newset || !ascii_strcasecmp (newset, "8859-1" ) || !ascii_strcasecmp (newset, "646" ) @@ -700,7 +707,8 @@ jnlib_iconv (jnlib_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { - return iconv ((iconv_t)cd, (char**)inbuf, inbytesleft, outbuf, outbytesleft); + return iconv ((iconv_t)cd, (ICONV_CONST char**)inbuf, inbytesleft, + outbuf, outbytesleft); } /* Wrapper function for iconv_close, required for W32 as we dlopen that -- cgit v1.2.3