diff options
author | simonb <simonb> | 2006-06-10 16:42:39 (GMT) |
---|---|---|
committer | simonb <simonb> | 2006-06-10 16:42:39 (GMT) |
commit | e8a6f45c9ef86451921d64285d1ab4f41dca351e (patch) | |
tree | 612cdbe9fa9beb5a8856fd5a9ec421c931897237 /src/FbTk/FbString.cc | |
parent | b8dc91871e116f51a061597e40e60d89d9f715cb (diff) | |
download | fluxbox-e8a6f45c9ef86451921d64285d1ab4f41dca351e.zip fluxbox-e8a6f45c9ef86451921d64285d1ab4f41dca351e.tar.bz2 |
fix compile in hosts without HAVE_ICONV
Diffstat (limited to 'src/FbTk/FbString.cc')
-rw-r--r-- | src/FbTk/FbString.cc | 11 |
1 files changed, 6 insertions, 5 deletions
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]; | |||
56 | 56 | ||
57 | /// Initialise all of the iconv conversion descriptors | 57 | /// Initialise all of the iconv conversion descriptors |
58 | void init() { | 58 | void init() { |
59 | setlocale(LC_CTYPE, ""); | ||
60 | |||
61 | #ifdef HAVE_ICONV | ||
59 | if (iconv_convs != 0) | 62 | if (iconv_convs != 0) |
60 | return; | 63 | return; |
61 | 64 | ||
62 | iconv_convs = new iconv_t[CONVSIZE]; | 65 | iconv_convs = new iconv_t[CONVSIZE]; |
63 | 66 | ||
64 | setlocale(LC_CTYPE, ""); | ||
65 | |||
66 | #ifdef HAVE_ICONV | ||
67 | #ifdef CODESET | 67 | #ifdef CODESET |
68 | std::string locale_codeset = nl_langinfo(CODESET); | 68 | std::string locale_codeset = nl_langinfo(CODESET); |
69 | #else // openbsd doesnt have this (yet?) | 69 | #else // openbsd doesnt have this (yet?) |
@@ -90,16 +90,17 @@ void init() { | |||
90 | } | 90 | } |
91 | 91 | ||
92 | void shutdown() { | 92 | void shutdown() { |
93 | #ifdef HAVE_ICONV | ||
93 | if (iconv_convs == 0) | 94 | if (iconv_convs == 0) |
94 | return; | 95 | return; |
95 | #ifdef HAVE_ICONV | 96 | |
96 | for (int i=0; i < CONVSIZE; ++i) | 97 | for (int i=0; i < CONVSIZE; ++i) |
97 | if (iconv_convs[i] != (iconv_t)(-1)) | 98 | if (iconv_convs[i] != (iconv_t)(-1)) |
98 | iconv_close(iconv_convs[i]); | 99 | iconv_close(iconv_convs[i]); |
99 | #endif // HAVE_ICONV | ||
100 | 100 | ||
101 | delete[] iconv_convs; | 101 | delete[] iconv_convs; |
102 | iconv_convs = 0; | 102 | iconv_convs = 0; |
103 | #endif // HAVE_ICONV | ||
103 | } | 104 | } |
104 | 105 | ||
105 | 106 | ||