[prototype-PATCH] Change CARDXX and INTXX defines to use stdint.h

Eamon Walsh ewalsh at tycho.nsa.gov
Thu Jan 17 14:30:50 PST 2008


Peter Harris wrote:
> Maarten Maathuis wrote:
>   
>> An inconsistent CARD32 has been bothering me for some time (for printf
>> alike functions you get warnings on some arches), so i propose
>> switching the defines to using stdint. I have a few questions though:
>>
>> 1: What is the purpose of UNSIGNEDBITFIELDS?
>>     
>
> To support older platforms where B16 and B32 are required, but signed 
> bitfields are not permitted.
>
>   
>> 2: What is the purpose of B32 and B16?
>>     
>
> To support platforms (older Cray? Embedded DSP-like CPUs?) that do not 
> have a native 16 or 32-bit integer.
>   

The XCB folks have already dropped support for this on the client side:
http://lists.freedesktop.org/archives/xcb/2007-March/002635.html


>   
>> I attached a patch against x11proto, which i used on my x86_64 system
>> to compile the xserver with (i did not recompile anything for testing
>> ABI compatibility).
>>
>> What do other people have to say about this?
>>     

There is an autoconf macro AX_CREATE_STDINT_H that claims to manufacture 
one of these files for you if you don't have it:
http://autoconf-archive.cryp.to/ax_create_stdint_h.html

>
> stdint.h is a C99ism. As far as I know, the reference x11proto still 
> targets C89.
>
> If you were to only include and use stdint.h on platforms that are known 
> to have a working C99 environment, that would be a much safer change.
>
>  > +/* Why is INT8 always signed? */
>
> Unlike INT16 and INT32, INT8 is not ever used in conjunction with B16 or 
> B32, so it doesn't need to be unsigned when UNSIGNEDBITFIELDS is set.
>
> Peter Harris
>   


-- 
Eamon Walsh <ewalsh at tycho.nsa.gov>
National Security Agency




More information about the xorg mailing list