More stuff about the headers
Shachar Shemesh
wine-devel at shemesh.biz
Sun Sep 7 04:56:08 CDT 2003
Eric Pouech wrote:
> Shachar Shemesh wrote:
>
>> Steven Edwards wrote:
>>
>>> First thing is first. Whats up with the
>>> *_must_be_suffixed_with_W_or_A_in_this_context error?
>>>
>>>
>> If you are compiling a core Wine DLL, you are not allowed to use the
>> base name (IDC_ARROW). You must pick either the Ansi (IDC_ARROWA) or
>> Wide (IDC_ARROWW) versions. To achieve this, wine uses a macro called
>> "WINELIB_NAME_AW". It is defined in windef.h. You can see that if
>> UNICODE is defined, this macro adds the "W" at the end, if not
>> defined, it adds an "A" at the end, but if it is part of the wine
>> compilation, it defines a name that is bound to cause an error, by
>> appending "func_must_be_suffixed_with_W_or_A_in_this_context".
>
>
> Steven's point is that MS headers don't define the A and W version of
> the resource identifiers (both resource types - RT_???? - and default
> resources - ID?_???? -). Which means we cannot compile some Wine DLLs
> (like commctrl, but also winmm, shell32...) without the wine headers.
> Since Wine code relies on information which isn't defined by the MS
> headers (nor the Mingw's), we do have an issue here.
That's not entirely true.
It's true that only IDC_ARROW is defined, but it is defined as
"MAKEINTRESOURCE(32512)". MAKEINTRESOURCE, in turn, is defined as a AW
macro.
Still, I agree that we are in a somewhat of a fix here. How about if we
do it this way:
Define IDC_ARROWn as 32512
Define IDC_ARROW as MAKEINTRESOURCE(IDC_ARROWn)
This way, you will still get the error, you are still prohibited from
using an unqualified version. From within the Wine sources, you can just
do MAKEINTRESOURCEA(IDC_ARROWn).
Shachar
--
Shachar Shemesh
Open Source integration consultant
Home page & resume - http://www.shemesh.biz/
More information about the wine-devel
mailing list