diff --git a/ChangeLog b/ChangeLog index a48ff34c..d502ccb8 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 26eb0589..7a0ef1b2 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 }