No subject

Thu Aug 26 14:16:51 CDT 2010

#if defined _MSC_VER || defined RC_INVOKED || sizeof(wchar_t) == 2
# define RICHEDIT_CLASS20W      L"RichEdit20W"
#elif defined(__GNUC__)
# define RICHEDIT_CLASS20W (const WCHAR []){ 
'R','i','c','h','E','d','i','t','2','0','W',0 }
static const WCHAR RICHEDIT_CLASS20W[] = { 
'R','i','c','h','E','d','i','t','2','0','W',0 };

We will fall in the first case when the name expressed as string is currently 
1) because we are running under Microsoft Visual C++
2) because it is used by resource compiler
3) because the string format is currently safe since we are under UCS-2 
instead of UCS-4. Perhaps this point is not written as good as you want... I do 
not know if you prefer to use some informations emitted by configure script or 
you will prefer to simply check the size of wchar_t.

The second case is the specific hack normally used until now with GCC.

The third case is the last chance solution, as it was before.

I moved the __GNUC__ case after the one used by _MSC_VER because __GNUC__ and 
RC_INVOKED are both declared in windres.
Now I took this fragment from richedit.h as example, but perhaps I have also 
seen other places where the resource compiler could be "rejected".
I believe that this fix actually seems to be very helpful for porting some 
win32 apps.

What do you think?


Carlo Bramini.

More information about the wine-devel mailing list