riched20: EM_GETLINE implementation and test

Kari Hurtta hurtta+gmane at siilo.fmi.fi
Thu Jun 22 17:26:24 CDT 2006


"James Hawkins" <truiken at gmail.com> writes in gmane.comp.emulators.wine.devel:

> On 6/22/06, Andrew Talbot <Andrew.Talbot at talbotville.com> wrote:
> > James Hawkins wrote:
> > > Probably, L"" is not portable, and you have to use:
> > >
> > > static const WHCAR string[] = {'s','t','r','i','n','g',0};
> > >
> > I'm just curious: not arguing, ;) but Plauger says, in "The Standard C
> > Library" (1992, p. 219): "You write a wide character constant as, for
> > example, L'x'. It has type wchar_t. You write a wide characer string
> > literal as, for example, L"hello". It has type array of wchar_t. wchar_t is
> > an integer type that can represent all the code values for all
> > wide-character encodings supported by the implementation." Why might it not
> > be portable?
> >
> 
> To be as portable as possible, we code to the lowest common
> denominator.  Not all compilers support L"".  We adhere to C89, but I
> can't remember what it says about L"", if anything.  The point is that
> WCHAR blah[] ={...} will work for every compiler.

Well, perhaps you then need also special options if you use L"..."

man gcc:

      -fshort-wchar
           Override the underlying type for wchar_t to be short unsigned int
           instead of the default for the target.  This option is useful for
           building programs to run under WINE.

/ Kari Hurtta




More information about the wine-devel mailing list