Main Page | Alphabetical List | Class List | File List | Class Members | File Members

stdint.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------------
00002  * /
00003  * / apeNEXT stdint for nlcc
00004  * /
00005  * / $Id: stdint.h,v 1.11 2005/06/08 14:06:53 pleiter Exp $
00006  * /
00007  * /
00008  * / ISO/IEC 9899:1999 (E) Standard
00009  * / Integer types  <stdint.h>
00010  * /
00011  * /
00012  * /
00013  * / IMPLEMENTATION for APEnext: Implem                                 (stdint.h) 
00014  * / 
00015  * / IMPLEMENTATION for APEnext: Implem int64_t
00016  * / IMPLEMENTATION for APEnext: Implem uint64_t
00017  * / IMPLEMENTATION for APEnext: Implem LLONG_MIN
00018  * / IMPLEMENTATION for APEnext: Implem ULLONG_MIN
00019  * / IMPLEMENTATION for APEnext: Implem LLONG_MAX
00020  * / IMPLEMENTATION for APEnext: Implem ULLONG_MAX
00021  * /-----------------------------------------------------------------------------*/
00022 
00023 #ifndef _STDINT_H
00024 #define _STDINT_H
00025 
00026 #include <nlibc.h>
00027 #include <limits.h>
00028 
00029 /*---------------------------------------------------------------------------------
00030  * / NAME   
00031  * /           stdint.h - definition of integer types
00032  * /
00033  * / SYNOPSIS
00034  * /           #include <stdint.h>
00035  * /
00036  * / DESCRIPTION
00037  * /           The <stdint.h> header declares sets of integer types with specified 
00038  * /           widths, and defines corresponding sets of macros. 
00039  * /           It also defines macros that specify limits of integer types 
00040  * /           corresponding to types defined in other standard headers, 
00041  * /           like <inttypes.h> and <limits.h>
00042  * /
00043  * / Notes
00044  * /           The "width" of an integer type is the number of bits used to 
00045  * /           store its value in a pure binary system 
00046  * /     
00047  * / IMPLEMENTATION for APEnext:   
00048  * /           Types are defined in the following categories:
00049  * /              Integer having certain exact widths
00050  * /              Integer having at least certain specified widths
00051  * /              Fastest integer having at least certain specified widths
00052  * /              Integer wide enough to hold pointers to objects
00053  * /              Integer having greatest width                
00054  * /-----------------------------------------------------------------------------*/
00055 
00056 /* exact-width types...    
00057    ++++OPTIONAL++++ 
00058    The EXACT width available in apeNEXT is 64 bit. Therefore ONLY int64_t
00059    and uint64_t can be defined */       
00060 //typedef short                  int8_t; 
00061 //typedef int                    int16_t;
00062 //typedef long int               int32_t; 
00063 typedef long long int          int64_t;
00064 typedef unsigned long long int uint64_t;
00065 
00066 /* lower and upper bound of exact-width integer types... 
00067    ++++OPTIONAL++++ 
00068    Also here the lower of upper size of EXACT width is 
00069    as given above restrected */
00070 //#define INT8_MIN          SHRT_MIN
00071 //#define INT16_MIN         INT_MIN
00072 //#define INT32_MIN         LONG_MIN
00073 #define INT64_MIN         LLONG_MIN
00074 
00075 //#define INT8_MAX          SHRT_MAX
00076 //#define INT16_MAX         INT_MAX
00077 //#define INT32_MAX         LONG_MAX
00078 #define INT64_MAX         LLONG_MAX
00079 
00080 //#define UINT8_MAX         USHRT_MAX
00081 //#define UINT16_MAX        UINT_MAX
00082 //#define UINT32_MAX        ULONG_MAX
00083 #define UINT64_MAX        ULLONG_MAX
00084 
00085 #define INTMAX_MIN        INT64_MIN
00086 #define INTMAX_MAX        INT64_MAX
00087 #define UINTMAX_MAX       UINT64_MAX
00088 
00089 /* minimum-width signed and unsigned integer types...  
00090    ++++REQUIRED++++ 
00091    As argumented above following definations are ALSO possible */
00092 typedef short int               int_least8_t;
00093 typedef int                     int_least16_t;
00094 typedef long int                int_least32_t;
00095 typedef long long int           int_least64_t;      
00096 
00097 typedef unsigned short int      uint_least8_t;
00098 typedef unsigned int            uint_least16_t;
00099 typedef unsigned long int       uint_least32_t;
00100 typedef unsigned long long int  uint_least64_t;      
00101 
00102 
00103 /* lower and upper bound of AT-LEAST width integer types... 
00104    ++++ REQUIRED ++++ 
00105    As argumented above following definations are ALSO possible */
00106 #define INT_LEAST8_MIN    SHRT_MIN   //  
00107 #define INT_LEAST16_MIN   INT_MIN    // 
00108 #define INT_LEAST32_MIN   LONG_MIN   // 
00109 #define INT_LEAST64_MIN   LLONG_MIN  // 
00110 
00111 #define INT_LEAST8_MAX    SHRT_MAX   //
00112 #define INT_LEAST16_MAX   INT_MAX    // 
00113 #define INT_LEAST32_MAX   LONG_MAX   // 
00114 #define INT_LEAST64_MAX   LLONG_MAX  // 
00115 
00116 #define UINT_LEAST8_MAX   USHRT_MAX  //
00117 #define UINT_LEAST16_MAX  UINT_MAX   //
00118 #define UINT_LEAST32_MAX  ULONG_MAX  //
00119 #define UINT_LEAST64_MAX  ULLONG_MAX //
00120 
00121 /* fastest minimum-width signed and unsigned integer types... 
00122    ++++REQUIRED++++ */
00123 typedef short int               int_fast8_t;
00124 typedef int                     int_fast16_t;
00125 typedef long int                int_fast32_t;
00126 typedef long long int           int_fast64_t;        
00127 
00128 typedef unsigned short int      uint_fast8_t;
00129 typedef unsigned int            uint_fast16_t;
00130 typedef unsigned long int       uint_fast32_t;
00131 typedef unsigned long long int  uint_fast64_t;      
00132 
00133 /* lower and upper bound of fastest minimum-width integer types... 
00134    ++++REQUIRED++++ */
00135 #define INT_FAST8_MIN     SHRT_MIN   // 
00136 #define INT_FAST16_MIN    INT_MIN    // 
00137 #define INT_FAST32_MIN    LONG_MIN   // 
00138 #define INT_FAST64_MIN    LLONG_MIN  // 
00139 
00140 #define INT_FAST8_MAX     SHRT_MAX   // 
00141 #define INT_FAST16_MAX    INT_MAX    // 
00142 #define INT_FAST32_MAX    LONG_MAX   // 
00143 #define INT_FAST64_MAX    LLONG_MAX  // 
00144 
00145 #define UINT_FAST8_MAX    USHRT_MAX  //
00146 #define UINT_FAST16_MAX   UINT_MAX   //
00147 #define UINT_FAST32_MAX   ULONG_MAX  //
00148 #define UINT_FAST64_MAX   ULLONG_MAX //
00149 
00150 /* maximum-width integer types used by pointers ... */
00151 typedef int64_t                 intptr_t;
00152 typedef uint64_t                uintptr_t;
00153 
00154 #define INTPTR_MIN              LLONG_MIN
00155 #define INTPTR_MAX              LLONG_MAX
00156 #define UINTPTR_MAX             ULLONG_MAX
00157 
00158 typedef int64_t                 intmax_t;
00159 typedef uint64_t                uintmax_t;
00160 
00161 
00162 /* ========================================================================= 
00163 !! The following macro expands to an integer constant-expression having 
00164 !! the value specified (MINIMUM) by its argument and the corresponding type.
00165 !! =======================================================================*/
00166 
00167 #define   INT8_C(value)   value
00168 #define  INT16_C(value)   value 
00169 #define  INT32_C(value)   value ##L   // long
00170 #define  INT64_C(value)   value ##LL  // long long
00171 #define  UINT8_C(value)   value ##U   // unsigned 
00172 #define UINT16_C(value)   value ##U   // unsigned 
00173 #define UINT32_C(value)   value ##UL  // unsigned long
00174 #define UINT64_C(value)   value ##ULL // unsigned long long 
00175 
00176 /*              ++++ maximum-width integer ++++              */    
00177 #define   INTMAX_C(value) value ##L   // int    
00178 #define  UINTMAX_C(value) value ##UL  // uint   
00179 #define  LONGMAX_C(value) value ##LL  // long   
00180 #define ULONGMAX_C(value) value ##ULL // ulong  
00181 
00182 
00183 /* limits for other integer types... 
00184    ++++OPTIONAL++++*/
00185 #ifndef _PTRDIFF_T
00186 #define _PTRDIFF_T
00187 typedef int    ptrdiff_t;    /* difference of two pointers */
00188 #endif 
00189 #ifndef PTRDIFF_MIN
00190 #define PTRDIFF_MIN       INT64_MIN
00191 #endif 
00192 #ifndef PTRDIFF_MAX
00193 #define PTRDIFF_MAX       INT64_MAX
00194 #endif 
00195 
00196 #define SIG_ATOMIC_MIN    INT_MIN
00197 #define SIG_ATOMIC_MAX    INT_MAX
00198 
00199 /* +++ for 64 bit SIZE_MAX defined as 18446744073709551615UL +++ */
00200 #define SIZE_MAX          UINT_MAX 
00201 #define WINT_MIN          INT64_MIN
00202 #define WINT_MAX          INT64_MAX
00203 
00204 #endif /* ifndef _STDINT_H */
00205 
00206 /*                                                                            @AT*/
00207 
00208 
00209 
00210 
00211 
00212 
00213 
00214 
00215 

Generated on Fri Jul 14 10:51:32 2006 for nlibc by doxygen 1.3.5