u_int32_t vs uint32_t

Stuart Kreitman Stuart.Kreitman at Sun.COM
Mon Aug 23 09:36:35 PDT 2004


I found in the OpenBSD cvsweb that both types were defined at one 
point.  I'm not able to locate their <machine/types.h> file.

This is a request that WrapHelp.c be changed to use "uint32_t" form 
(also uint8_t in that file).
I would like someone to help confirm that current OpenBSD defines this 
form. I'm happy to change or have someone else change
the cvs.

skk



          |            39: /*
             |            40:  * Fixed-size integer types as specified in XPG4.2.
             |            41:  * int8_t, int16_t, int32_t, int64_t are defined in <machine/types.h>
             |            42:  */
             |            43: 
             |            44: typedef u_int8_t               uint8_t;
             |            45: typedef u_int16_t              uint16_t;
             |            46: typedef u_int32_t              uint32_t;
             |            47: typedef u_int64_t              uint64_t;
             |            48: 


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:
>
>
> Excerpted from <sys/int_types.h> on Solaris 10:
>
> #pragma ident   "@(#)int_types.h        1.9     04/06/14 SMI"
>
> /*
> * This file, <sys/int_types.h>, is part of the Sun Microsystems 
> implementation
> * of <inttypes.h> defined in the ISO C standard, ISO/IEC 9899:1999
> * Programming language - C.
> *
> * Programs/Modules should not directly include this file.  Access to the
> * types defined in this file should be through the inclusion of one of 
> the
> * following files:
> *
> *      <sys/types.h>           Provides only the "_t" types defined in 
> this
> *                              file which is a subset of the contents of
> *                              <inttypes.h>.  (This can be appropriate 
> for
> *                              all programs/modules except those claiming
> *                              ANSI-C conformance.)
> *
> *      <sys/inttypes.h>        Provides the Kernel and Driver appropriate
> *                              components of <inttypes.h>.
> *
> *      <inttypes.h>            For use by applications.
> *
> * See these files for more details.
> */
>
> #include <sys/feature_tests.h>
> #include <sys/isa_defs.h>
>
> #ifdef __cplusplus
> extern "C" {
> #endif
>
> /*
> * Basic / Extended integer types
> *
> * The following defines the basic fixed-size integer types.
> *
> * Implementations are free to typedef them to Standard C integer types or
> * extensions that they support. If an implementation does not support one
> * of the particular integer data types below, then it should not 
> define the
> * typedefs and macros corresponding to that data type.  Note that int8_t
> * is not defined in -Xs mode on ISAs for which the ABI specifies "char"
> * as an unsigned entity because there is no way to define an eight bit
> * signed integral.
> */
> #if defined(_CHAR_IS_SIGNED)
> typedef char                    int8_t;
> #else
> #if defined(__STDC__)
> typedef signed char             int8_t;
> #endif
> #endif
> typedef short                   int16_t;
> typedef int                     int32_t;
> #ifdef  _LP64
> #define _INT64_TYPE
> typedef long                    int64_t;
> #else   /* _ILP32 */
> #if defined(_LONGLONG_TYPE)
> #define _INT64_TYPE
> typedef long long               int64_t;
> #endif
> #endif
>
> typedef unsigned char           uint8_t;
> typedef unsigned short          uint16_t;
> typedef unsigned int            uint32_t;
> #ifdef  _LP64
> typedef unsigned long           uint64_t;
> #else   /* _ILP32 */
> #if defined(_LONGLONG_TYPE)
> typedef unsigned long long      uint64_t;
> #endif
> #endif
>
>
> _______________________________________________
> release-wranglers mailing list
> release-wranglers at freedesktop.org
> http://freedesktop.org/mailman/listinfo/release-wranglers




More information about the release-wranglers mailing list