aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2003-07-07 04:46:29 +0000
committerAndreas Jaeger <aj@gcc.gnu.org>2003-07-07 06:46:29 +0200
commit5beadb33d9d7f527d1797141ffccb05d9f58aaf5 (patch)
treefa13e634d6a6bac42004b688b63a251ec2248b86
parent1dbb6ce879d7b8c80ebf2dac903c6c9379f1d705 (diff)
downloadgcc-5beadb33d9d7f527d1797141ffccb05d9f58aaf5.zip
gcc-5beadb33d9d7f527d1797141ffccb05d9f58aaf5.tar.gz
gcc-5beadb33d9d7f527d1797141ffccb05d9f58aaf5.tar.bz2
cppcharset.c (ICONV_CONST): Define iff !HAVE_ICONV.
2003-07-07 Andrew Pinski <pinskia@physics.uc.edu> * cppcharset.c (ICONV_CONST): Define iff !HAVE_ICONV. (convert_cset): Change inbuf to type ICONV_CONST char. * Makefile.in (LIBS): Add LIBICONV. From-SVN: r69029
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/cppcharset.c6
3 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b7d4823..ac441c0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-07-07 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * cppcharset.c (ICONV_CONST): Define iff !HAVE_ICONV.
+ (convert_cset): Change inbuf to type ICONV_CONST char.
+ * Makefile.in (LIBS): Add LIBICONV.
+
2003-07-06 Art Haas <ahaas@airmail.net>
* f/global.c (ffeglobal_type_string_): Fix obsolete GCC array
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 5ebb42b..3825d8a 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -691,7 +691,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
# How to link with both our special library facilities
# and the system's installed libraries.
-LIBS = $(INTLLIBS) @LIBS@ $(LIBIBERTY)
+LIBS = $(INTLLIBS) @LIBS@ $(LIBIBERTY) $(LIBICONV)
# Any system libraries needed just for GNAT.
SYSLIBS = @GNAT_LIBEXC@
diff --git a/gcc/cppcharset.c b/gcc/cppcharset.c
index 84187b9..0e9805f 100644
--- a/gcc/cppcharset.c
+++ b/gcc/cppcharset.c
@@ -81,6 +81,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define iconv_open(x, y) (errno = EINVAL, (iconv_t)-1)
#define iconv(a,b,c,d,e) (errno = EINVAL, (size_t)-1)
#define iconv_close(x) 0
+#define ICONV_CONST
#endif
#if HOST_CHARSET == HOST_CHARSET_ASCII
@@ -210,14 +211,15 @@ convert_cset (iconv_t cd, const uchar *from, size_t flen, struct strbuf *to)
}
else
{
- char *inbuf, *outbuf;
+ ICONV_CONST char *inbuf;
+ char *outbuf;
size_t inbytesleft, outbytesleft;
/* Reset conversion descriptor and check that it is valid. */
if (iconv (cd, 0, 0, 0, 0) == (size_t)-1)
return false;
- inbuf = (char *)from;
+ inbuf = (ICONV_CONST char *)from;
inbytesleft = flen;
outbuf = (char *)to->text + to->len;
outbytesleft = to->asize - to->len;