fix compile in hosts without HAVE_ICONV

This commit is contained in:
simonb 2006-06-10 16:42:39 +00:00
parent b8dc91871e
commit e8a6f45c9e
2 changed files with 8 additions and 5 deletions

View file

@ -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)

View file

@ -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
}