[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libutf8 mbstate_t



Bruno Haible <haible@xxxxxxx>:

> > If I define it in a private header file as follows, is there any
> > reason why my binary program shouldn't work with both libraries?
> 
> Why do you want to define mbstate_t in a private header of yours at all?
> The standardized way to get mbstate_t is #include <wchar.h>.

I thought that this was breaking because of some macro in
/usr/include/wchar.h preventing my code from working with
libutf8_plug.so, but I was wrong and confused.

> > ... to facilitate people building programs that are binary
> > compatible between glibc and libutf_plug.so?
> 
> libutf8_plug.so, built on a glibc system, is intended to be binary
> compatible with glibc. Do you have evidence that this is not the case?

No. And I don't see why there should be any problem provided the
mbstate_t struct defined by libutf8 is no bigger than the struct
defined by the C library, which is bound to be true since libutf8 only
uses a single int. Please ignore my previous ramblings.

(Unfortunately, however, the version of mbrtowc in libutf8 is
incompatible with my code, because I have assumed that the UNIX98 spec
applies, i.e. we can feed single bytes. Markus explained this issue
about a week ago. So I'm using my own version of mbrtowc for the time
being.)

Edmund
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/