Re: u_int32_t vs uint32_t

Alan Coopersmith <Alan.Coopersmith-UdXhSnd/[email protected]>
Newsgroups gmane.comp.freedesktop.release-wranglers
Organization Sun Microsystems
Message-ID <[email protected]>
So what about just using CARD32 as the rest of the X code does to define
this portably?

	-alan-

Torrey Lyons wrote:
> uint32_t might be preferred, but that does not mean it is defined in 
> <sys/types.h> on all platforms. On Darwin one needs to use <stdint.h> or 
> <inttypes.h> as suggested in the Solaris 10 documentation. In any case, 
> <sys/types.h> is definitely not the right cross platform header file and 
> causes build breakage.
> 
> --Torrey
> 
> At 10:04 AM -0700 8/23/04, Stuart Kreitman wrote:
> 
>> Here is a reference to the C99 standard that uint32_t is preferred:
>>
>>
>> http://www.oreillynet.com/pub/a/network/2003/10/07/michael_barr.html
>>
>>
>> With that I'm putting back the update to Wraphelp.c
>>
>> skk
>> Matthieu Herrb wrote:
>>
>>> Stuart Kreitman wrote:
>>>
>>>> Matthieu:
>>>> The editor "fgsch" made the change to u_int32_t in OpenBSD sources
>>>> in April 2002 with your review.  Jim Gettys picked it up this weekend
>>>> for the X.ORG next release.
>>>>
>>>> We need to explain how the typedefs "u_int32_t" vs "uint32_t" 
>>>> conform to various
>>>> standards in ANSI or ISO.  I do not have access to the OpenBSD 
>>>> files, but include
>>>> the relevent statements from Solaris:
>>>
>>>
>>>
>>> the u_ variants are the traditional types used on BSD systems and 
>>> defined by including <sys/types.h>.
>>>
>>> There is some (limited) previous art of using the u_ types in the X 
>>> tree, that's why it looked right to me.
>>>
>>> Defining a fixed width type in a portable manner can be tricky.
>>> I'd suggest include the relevant X header and use CARD32 instead of 
>>> u_int32_t / uint32_t. (Even though CARD32 is normally reserved for 
>>> the on the wire protocol iirc).
> 
> _______________________________________________
> release-wranglers mailing list
> [email protected]
> http://freedesktop.org/mailman/listinfo/release-wranglers


-- 
	-Alan Coopersmith-           [email protected]
	 Sun Microsystems, Inc. - X Window System Engineering
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.