summaryrefslogtreecommitdiff
path: root/i18n/unix
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2001-02-08 02:37:29 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2001-02-08 02:37:29 +0000
commit482ce86a79d41d751123dcfcfc29f4098135c4b7 (patch)
tree3b82c57a6bacdad3df7449dbc9034b5b997b9307 /i18n/unix
parentd0a0b022d94de59357e5e78107164cff370cd1d9 (diff)
downloadlibapr-482ce86a79d41d751123dcfcfc29f4098135c4b7.tar.gz
Handle the second parameter to iconv() differently, respecting that
some systems declare it "const char **" while other systems (and current Single UNIX Spec.) declare it "char **". We'll still have to add some hints for some platforms to avoid warnings. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61193 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'i18n/unix')
-rw-r--r--i18n/unix/xlate.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/i18n/unix/xlate.c b/i18n/unix/xlate.c
index b358d5f6c..3ae49c59e 100644
--- a/i18n/unix/xlate.c
+++ b/i18n/unix/xlate.c
@@ -80,6 +80,12 @@
#include <iconv.h>
#endif
+#ifdef APR_ICONV_INBUF_CONST
+#define ICONV_INBUF_TYPE const char **
+#else
+#define ICONV_INBUF_TYPE char **
+#endif
+
#ifndef min
#define min(x,y) ((x) <= (y) ? (x) : (y))
#endif
@@ -194,7 +200,7 @@ static void check_sbcs(apr_xlate_t *convset)
}
inbytes_left = outbytes_left = sizeof(inbuf);
- translated = iconv(convset->ich, &inbufptr,
+ translated = iconv(convset->ich, (ICONV_INBUF_TYPE)&inbufptr,
&inbytes_left, &outbufptr, &outbytes_left);
if (translated != (size_t) -1 &&
inbytes_left == 0 &&
@@ -285,10 +291,10 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf,
size_t translated;
if (convset->ich != (iconv_t)-1) {
- char *inbufptr = (char *)inbuf;
+ const char *inbufptr = inbuf;
char *outbufptr = outbuf;
- translated = iconv(convset->ich, &inbufptr,
+ translated = iconv(convset->ich, (ICONV_INBUF_TYPE)&inbufptr,
inbytes_left, &outbufptr, outbytes_left);
/* If everything went fine but we ran out of buffer, don't
* report it as an error. Caller needs to look at the two