[haiku-development] Re: Source-level incompatibility in iconv.h

  • From: "scott mc" <scottmc2@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 27 Oct 2008 12:34:42 -0700

On Mon, Oct 27, 2008 at 11:49 AM, Oliver Tappe <zooey@xxxxxxxxxxxxxxx> wrote:
> Hi there,
>
> our iconv.h declares the iconv function with this signature:
>
>    size_t iconv(iconv_t, char**, size_t *, char**, size_t *);
>
> but I think it should rather make use of a const char** for the source
> buffer, like this:
>
>    size_t iconv(iconv_t, const char**, size_t *, char**, size_t *);
>
> Using a non-const source buffer causes a problem when compiling libiconv on
> haiku, as that determines whether or not to use a const buffer by looking at
> the system's iconv.h header. As a result, the libiconv package on haiku-ports
> declares the source buffer as non-const.
> On R5, the iconv.h header didn't exist, which in turn caused the existing
> libiconv packages for R5 to declare the source buffer as const.
>
> With the current setup, any application that uses iconv() would have to
> explicitly cast away any potential constness of its internal buffers in order
> to be able to invoke haiku's iconv().
> In order to avoid this problem, I'd like to change our glibc-derived iconv.h
> to make that source buffer const, too.
>
> Any comments and/or objections?
>
> cheers,
>    Oliver
>
>

+1 for fixing it.

If/when it get's fixed in Haiku, let me know and I'll make a new
binary to post on Haiku-Ports for libiconv.
Also I've noticed that netsurf, vlc and beam all include their own
libiconv.so files...  Not sure if those are BeOS or Haiku native
versions, but I suspect they are BeOS ones.
-scottmc

Other related posts: