striker 2002/07/19 10:08:40
Modified: build apu-iconv.m4
xlate xlate.c
Log:
More fun with xlate...
Make sure the macros actually work. Suck in apu_config, so that we
actually have a value for HAVE_ICONV.
Revision Changes Path
1.3 +1 -1 apr-util/build/apu-iconv.m4
Index: apu-iconv.m4
===================================================================
RCS file: /home/cvs/apr-util/build/apu-iconv.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- apu-iconv.m4 19 Jul 2002 14:41:06 -0000 1.2
+++ apu-iconv.m4 19 Jul 2002 17:08:40 -0000 1.3
@@ -46,7 +46,7 @@
], apu_iconv_inbuf_const="0", apu_iconv_inbuf_const="1")
fi
if test "$apu_iconv_inbuf_const" = "1"; then
- AC_DEFINE(APR_ICONV_INBUF_CONST, 1, [Define if the inbuf parm to iconv()
is const char **])
+ AC_DEFINE(APU_ICONV_INBUF_CONST, 1, [Define if the inbuf parm to iconv()
is const char **])
msg="const char **"
else
msg="char **"
1.7 +12 -8 apr-util/xlate/xlate.c
Index: xlate.c
===================================================================
RCS file: /home/cvs/apr-util/xlate/xlate.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- xlate.c 19 Jul 2002 08:32:56 -0000 1.6
+++ xlate.c 19 Jul 2002 17:08:40 -0000 1.7
@@ -53,6 +53,7 @@
*/
#include "apu.h"
+#include "apu_config.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_xlate.h"
@@ -79,7 +80,7 @@
#include <iconv.h>
#endif
-#if defined(APR_ICONV_INBUF_CONST) || APR_HAS_APR_ICONV
+#if defined(APU_ICONV_INBUF_CONST) || APR_HAS_APR_ICONV
#define ICONV_INBUF_TYPE const char **
#else
#define ICONV_INBUF_TYPE char **
@@ -87,9 +88,9 @@
#if APR_HAS_APR_ICONV
#define HAVE_ICONV
-#define iconv_(n) apr_iconv_##n
+#define iconv_(n) apr_iconv##n
#else
-#define iconv_(n) iconv_##n
+#define iconv_(n) iconv##n
#endif
#ifndef min
@@ -208,8 +209,10 @@
}
inbytes_left = outbytes_left = sizeof(inbuf);
- translated = iconv_()(convset->ich, (ICONV_INBUF_TYPE)&inbufptr,
- &inbytes_left, &outbufptr, &outbytes_left);
+
+ /* The space in 'iconv_( )' is required by the preprocessor */
+ translated = iconv_( )(convset->ich, (ICONV_INBUF_TYPE)&inbufptr,
+ &inbytes_left, &outbufptr, &outbytes_left);
if (translated != (apr_size_t) -1 &&
inbytes_left == 0 &&
outbytes_left == 0) {
@@ -322,9 +325,10 @@
if (convset->ich != (iconv_(_t))-1) {
const char *inbufptr = inbuf;
char *outbufptr = outbuf;
-
- translated = iconv_()(convset->ich, (ICONV_INBUF_TYPE)&inbufptr,
- inbytes_left, &outbufptr, outbytes_left);
+
+ /* The space in 'iconv_( )' is required by the preprocessor */
+ 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
* bytes-left values anyway.