aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonb <simonb>2006-05-22 07:34:25 (GMT)
committersimonb <simonb>2006-05-22 07:34:25 (GMT)
commitd508292a578f0bee4e96b232bf7d8f5180a07296 (patch)
tree9c8d07c270e87c0d3a765dfcb7add2664b14f2cf
parentf564d3c4cf6309d3b6d66f2139185434e7815cac (diff)
downloadfluxbox-d508292a578f0bee4e96b232bf7d8f5180a07296.zip
fluxbox-d508292a578f0bee4e96b232bf7d8f5180a07296.tar.bz2
fix build on cygwin (iconv constness)
-rw-r--r--ChangeLog2
-rw-r--r--src/FbTk/FbString.cc12
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 976981d..0ec5f8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.16: 2Changes for 0.9.16:
3*06/05/21: 3*06/05/21:
4 * Fix build on cygwin (iconv const error) (Simon)
5 FbTk/FbString.cc
4 * Fix background of external tabs when label background is 6 * Fix background of external tabs when label background is
5 ParentRelative (Simon) 7 ParentRelative (Simon)
6 FbWinFrame.cc 8 FbWinFrame.cc
diff --git a/src/FbTk/FbString.cc b/src/FbTk/FbString.cc
index 687a1bd..c11b11d 100644
--- a/src/FbTk/FbString.cc
+++ b/src/FbTk/FbString.cc
@@ -132,7 +132,7 @@ std::string recode(iconv_t cd,
132 size_t insize = in.size(); 132 size_t insize = in.size();
133 size_t outsize = insize; 133 size_t outsize = insize;
134 char * out = (char *) malloc(outsize * sizeof(char)); // need realloc 134 char * out = (char *) malloc(outsize * sizeof(char)); // need realloc
135 char * outptr = out; 135 char * out_ptr = out;
136 136
137 size_t inbytesleft = insize; 137 size_t inbytesleft = insize;
138 size_t outbytesleft = outsize; 138 size_t outbytesleft = outsize;
@@ -143,7 +143,13 @@ std::string recode(iconv_t cd,
143 143
144 while (again) { 144 while (again) {
145 again = false; 145 again = false;
146 result = iconv(cd, &in_ptr, &inbytesleft, &outptr, &outbytesleft); 146
147#ifdef HAVE_CONST_ICONV
148 result = iconv(cd, (const char**)(&in_ptr), &inbytesleft, &out_ptr, &outbytesleft);
149#else
150 result = iconv(cd, &in_ptr, &inbytesleft, &out_ptr, &outbytesleft);
151#endif // HAVE_CONST_ICONV
152
147 if (result == (size_t)(-1)) { 153 if (result == (size_t)(-1)) {
148 switch(errno) { 154 switch(errno) {
149 case EILSEQ: 155 case EILSEQ:
@@ -160,7 +166,7 @@ std::string recode(iconv_t cd,
160 if (out != NULL) 166 if (out != NULL)
161 again = true; 167 again = true;
162 outbytesleft += insize; 168 outbytesleft += insize;
163 outptr = out + outsize - outbytesleft; 169 out_ptr = out + outsize - outbytesleft;
164 break; 170 break;
165 default: 171 default:
166 // something else broke 172 // something else broke