Bug Fix: WM_GETTEXT should return NULL string if LB_GETCURSEL is LB_ERR

Francois Gouget fgouget at free.fr
Tue Jul 16 13:58:52 CDT 2002


On Tue, 16 Jul 2002, Shachar Shemesh wrote:

>
>
> Francois Gouget wrote:
>
> >Clumsy but this is the only way.
> >
> >
> >(for Winelib we play tricks with WINE_UNICODE_TEXT but these are not
> >perfect and must not be used in Wine. That's why they are in an #ifndef
> >__WINE__ anyway)
> >
> >
> didn't you just spot a serious problem with winelib?

Oh, no. I've known and dealt with this issue quite some time ago.

To summarise the situation:

 * gcc 2.95: does not support 16bit Unicode at all
 * gcc 3.x: has a -fshort-wchar option that defines wchar_t as an
unsigned short. Unfortunately I am not sure all distributions of gcc 3.x
include this option.

For Wine:
 * it should have some degree of portability across compilers.
 * right now it has to support gcc 2.95
 * using the 'array of chars' approach is acceptable since we write the
code

For Winelib:
 * requiring that Winelib users modify their application to use 32bit
unicode characters is not an option. This is fine for one page
applications but not for applications with hundreds of thousands of
lines of code. Btw, this would require more work than just modifying the
literal string declarations.`
 * it is reasonable to require gcc/g++ 3.x for porting, especially since
it will help a lot for many other C++ features
 * thus we can strongly recommend the use of -fshort-wchar
 * if a Winelib user cannot/does not want to use gcc/g++ 3.x, then we
still have a fallback mechanism that, while it won't work in 100% cases,
will still cover most of the situations. That mechanism uses the _TEXT
macro (which all well written Windows applications should use) to
convert a 32bit Unicode string to a 16bit Unicode string in place at
runtime (which means you have to use -fwritable-strings). See
WINE_UNICODE_REWRITE and the block that follows in 'include/winnt.h'.



--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
  Good judgment comes from experience, and experience comes from bad judgment
                               -- Barry LePatner




More information about the wine-devel mailing list