fix compile in hosts without HAVE_ICONV
simonb simonb
2 files changed,
8 insertions(+),
5 deletions(-)
M
ChangeLog
→
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)
M
src/FbTk/FbString.cc
→
src/FbTk/FbString.cc
@@ -56,14 +56,14 @@ #endif // HAVE_ICONV
/// 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 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 }