include: Remove 'l' modifier from numeric constants in d3d9caps.h
Kai Tietz
ktietz70 at googlemail.com
Wed Oct 26 05:20:44 CDT 2011
2011/10/26 Michael Stefaniuc <mstefani at redhat.com>:
> Hello Jacek!
>
> Jacek Caban wrote:
>> On 10/26/11 00:30, Michael Stefaniuc wrote:
>>> ---
>>> include/d3d9caps.h | 182
>>> ++++++++++++++++++++++++++--------------------------
>>> 1 files changed, 91 insertions(+), 91 deletions(-)
>>>
>>> diff --git a/include/d3d9caps.h b/include/d3d9caps.h
>>> index 8ed6598..64dba21 100644
>>> --- a/include/d3d9caps.h
>>> +++ b/include/d3d9caps.h
>>> @@ -29,13 +29,13 @@
>>> #define D3DCURSORCAPS_LOWRES 2
>>>
>>>
>>> -#define D3DDEVCAPS2_STREAMOFFSET 0x00000001L
>>> -#define D3DDEVCAPS2_DMAPNPATCH 0x00000002L
>>> -#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004L
>>> -#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008L
>>> -#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010L
>>> -#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020L
>>> -#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040L
>>> +#define D3DDEVCAPS2_STREAMOFFSET 0x00000001
>>> +#define D3DDEVCAPS2_DMAPNPATCH 0x00000002
>>> +#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004
>>> +#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008
>>> +#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010
>>> +#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020
>>> +#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040
>>>
>>
>> mingw-w64 project imports some of our headers, including most of d3d
>> headers. They would probably prefer to keep them with 'l' modifier since
>> that's the right thing to do. Given that it's mostly harmless for Wine,
>> could we please consider not changing it?
> Well ... the the dinput.h was a real change were Wine was affected.
> But the change should be mostly harmless for mingw-w64 as long == int on
> Win32 and Win64.
>
> Anyway this is a hit job from Alexandre so you'll have to convince him.
>
> bye
> michael
Hi Michael,
2011/10/26 Jacek Caban <jacek at codeweavers.com>:
> Hi Michael,
>
> On 10/26/11 00:30, Michael Stefaniuc wrote:
>>
>> ---
>> include/d3d9caps.h | 182
>> ++++++++++++++++++++++++++--------------------------
>> 1 files changed, 91 insertions(+), 91 deletions(-)
>>
>> diff --git a/include/d3d9caps.h b/include/d3d9caps.h
>> index 8ed6598..64dba21 100644
>> --- a/include/d3d9caps.h
>> +++ b/include/d3d9caps.h
>> @@ -29,13 +29,13 @@
>> #define D3DCURSORCAPS_LOWRES 2
>>
>>
>> -#define D3DDEVCAPS2_STREAMOFFSET 0x00000001L
>> -#define D3DDEVCAPS2_DMAPNPATCH 0x00000002L
>> -#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004L
>> -#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008L
>> -#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010L
>> -#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020L
>> -#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040L
>> +#define D3DDEVCAPS2_STREAMOFFSET 0x00000001
>> +#define D3DDEVCAPS2_DMAPNPATCH 0x00000002
>> +#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH 0x00000004
>> +#define D3DDEVCAPS2_ADAPTIVETESSNPATCH 0x00000008
>> +#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES 0x00000010
>> +#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH 0x00000020
>> +#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET 0x00000040
>>
>
> mingw-w64 project imports some of our headers, including most of d3d
> headers. They would probably prefer to keep them with 'l' modifier since
> that's the right thing to do. Given that it's mostly harmless for Wine,
> could we please consider not changing it?
>
> Thanks,
> Jacek
As Jacek mentioned already, it would be for our use of Wine direct-x
SDK a big flaw to have constants here not proper suffixed with L.
Especially in use for C++ this would cause big pain for 32-bit and
64-bit native Windows compilation.
I am not sure about this, but I assume that Wine might have an
interest to be able to use platform-headers and optional SDKs also
with a cross-compiler targeting for Windows native.
I would suggest to use here a helper-macro, which does on demand the
required L-suffix.
Something like in global configure headers:
#ifdef __SIZEOF_LONG <= 32
#define MSABI_LONG(VAL) VAL ## L
#else
#define MSABI_LONG(VAL) VAL
#endif
And then using in platform/sdk headers
...
#define XYZ MSABI_LONG(0x1234)
...
instead.
Regards,
Kai
More information about the wine-devel
mailing list