From e8a6f45c9ef86451921d64285d1ab4f41dca351e Mon Sep 17 00:00:00 2001 From: simonb Date: Sat, 10 Jun 2006 16:42:39 +0000 Subject: fix compile in hosts without HAVE_ICONV --- ChangeLog | 2 ++ src/FbTk/FbString.cc | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a48ff34..d502ccb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.16: *06/06/10: + * Fix building on machines without iconv [sf.net #1499402] (Simon) + FbTk/FbString.cc * Fix some external tab alignment on shade (Simon) FbWinFrame.cc * Fix container size rounding for right alignment (Simon) diff --git a/src/FbTk/FbString.cc b/src/FbTk/FbString.cc index 26eb058..7a0ef1b 100644 --- a/src/FbTk/FbString.cc +++ b/src/FbTk/FbString.cc @@ -56,14 +56,14 @@ static int iconv_convs[CONVSIZE]; /// Initialise all of the iconv conversion descriptors void init() { + setlocale(LC_CTYPE, ""); + +#ifdef HAVE_ICONV if (iconv_convs != 0) return; iconv_convs = new iconv_t[CONVSIZE]; - setlocale(LC_CTYPE, ""); - -#ifdef HAVE_ICONV #ifdef CODESET std::string locale_codeset = nl_langinfo(CODESET); #else // openbsd doesnt have this (yet?) @@ -90,16 +90,17 @@ void init() { } void shutdown() { +#ifdef HAVE_ICONV if (iconv_convs == 0) return; -#ifdef HAVE_ICONV + for (int i=0; i < CONVSIZE; ++i) if (iconv_convs[i] != (iconv_t)(-1)) iconv_close(iconv_convs[i]); -#endif // HAVE_ICONV delete[] iconv_convs; iconv_convs = 0; +#endif // HAVE_ICONV } -- cgit v0.11.2