summaryrefslogtreecommitdiffstats
path: root/src/polyp/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/polyp/utf8.c')
-rw-r--r--src/polyp/utf8.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/polyp/utf8.c b/src/polyp/utf8.c
index 931328e5..33fa7214 100644
--- a/src/polyp/utf8.c
+++ b/src/polyp/utf8.c
@@ -34,7 +34,7 @@
#include <inttypes.h>
#include <string.h>
-#ifdef HAVE_ICONV_H
+#ifdef HAVE_ICONV
#include <iconv.h>
#endif
@@ -168,14 +168,15 @@ char* pa_utf8_filter (const char *str) {
return utf8_validate(str, new_str);
}
-#ifdef HAVE_ICONV_H
+#ifdef HAVE_ICONV
static char* iconv_simple(const char *str, const char *to, const char *from) {
char *new_str;
size_t len, inlen;
iconv_t cd;
- char *inbuf, *outbuf;
+ ICONV_CONST char *inbuf;
+ char *outbuf;
size_t res, inbytes, outbytes;
cd = iconv_open(to, from);
@@ -187,7 +188,7 @@ static char* iconv_simple(const char *str, const char *to, const char *from) {
assert(new_str);
while (1) {
- inbuf = (char*)str; /* Brain dead prototype for iconv() */
+ inbuf = (ICONV_CONST char*)str; /* Brain dead prototype for iconv() */
inbytes = inlen;
outbuf = new_str;
outbytes = len;