[PATCH v2 1/2] widl: Define _WIN64 for 64-bit targets.

Bernhard Übelacker bernhardu at mailbox.org
Thu Dec 23 06:04:58 CST 2021


Am 23.12.21 um 12:02 schrieb Alexandre Julliard:
> Bernhard Übelacker <bernhardu at mailbox.org> writes:
> 
>> Am 23.12.21 um 09:58 schrieb Alexandre Julliard:
>>> Bernhard Übelacker <bernhardu at mailbox.org> writes:
>>>
>>>> @@ -849,6 +849,8 @@ int main(int argc,char *argv[])
>>>>        add_widl_version_define();
>>>>      wpp_add_cmdline_define("_WIN32=1");
>>>> +  if (pointer_size == 8)
>>>> +    wpp_add_cmdline_define("_WIN64=1");
>>> You can't use #ifdef _WIN64 in idl files, this would make the
>>> generated
>>> headers platform-dependent.
>>>
>>
>> Thanks for looking into it.
>> I guess I could then delay this decision in the idl file like this:
>>
>> cpp_quote("#ifdef _WIN64")
>> cpp_quote("typedef long ADO_LONGPTR;")
>> cpp_quote("#else")
>> cpp_quote("typedef __int64 ADO_LONGPTR;")
>> cpp_quote("#endif")
>>
>> But then the type is not known to widl:
>>
>> .../include/msado15_backcompat.idl:639: error: type 'ADO_LONGPTR' not found in global namespace
>>
>> How has such a type made known to widl?
> 
> LONG_PTR is already defined (as __int3264), you should be able to simply
> do 'typedef LONG_PTR ADO_LONGPTR'.
> 

Thank you, I am going that way.



More information about the wine-devel mailing list