From 519aa9b2ef4ec1fdbbc746f753240113423e1b21 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 12 Jun 2006 14:18:19 +0000 Subject: Use AM_ICONV to determine what needs to be done for iconv support. (closes #19) git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1012 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/Makefile.am | 4 ++-- src/polyp/utf8.c | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 2e68ed94..a98ea697 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -420,7 +420,7 @@ endif libpolyp_la_CFLAGS = $(AM_CFLAGS) libpolyp_la_LDFLAGS = -version-info $(LIBPOLYP_VERSION_INFO) -libpolyp_la_LIBADD = $(AM_LIBADD) $(WINSOCK_LIBS) +libpolyp_la_LIBADD = $(AM_LIBADD) $(WINSOCK_LIBS) $(LIBICONV) if HAVE_X11 libpolyp_la_CFLAGS += $(X_CFLAGS) @@ -587,7 +587,7 @@ endif libpolypcore_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBOIL_CFLAGS) libpolypcore_la_LDFLAGS = -version-info $(LIBPOLYPCORE_VERSION_INFO) -libpolypcore_la_LIBADD = $(AM_LIBADD) $(LIBLTDL) $(LIBSAMPLERATE_LIBS) $(LIBSNDFILE_LIBS) $(WINSOCK_LIBS) $(LIBOIL_LIBS) +libpolypcore_la_LIBADD = $(AM_LIBADD) $(LIBLTDL) $(LIBSAMPLERATE_LIBS) $(LIBSNDFILE_LIBS) $(WINSOCK_LIBS) $(LIBOIL_LIBS) $(LIBICONV) ################################### # Plug-in support libraries # 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 #include -#ifdef HAVE_ICONV_H +#ifdef HAVE_ICONV #include #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; -- cgit