home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue6 / SDL.ZIP / !gcc / include / unixlib / h / stdint < prev    next >
Encoding:
Text File  |  2006-09-17  |  6.1 KB  |  243 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /usr/local/cvsroot/gccsdk/unixlib/source/clib/stdint.h,v $
  4.  * $Date: 2004/04/10 10:25:32 $
  5.  * $Revision: 1.8 $
  6.  * $State: Exp $
  7.  * $Author: nick $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. #ifndef __STDINT_H
  12. #define __STDINT_H 1
  13.  
  14. #ifndef __UNIXLIB_FEATURES_H
  15. #include <features.h>
  16. #endif
  17.  
  18. /* Exact integral types.  */
  19.  
  20. /* Signed.  */
  21.  
  22. #ifndef __int8_t_defined
  23. #define __int8_t_defined
  24. typedef signed char int8_t;
  25. typedef short int int16_t;
  26. typedef int int32_t;
  27. #if defined(__CC_NORCROFT) && (__CC_NORCROFT_VERSION < 550)
  28. typedef __int64 int64_t;
  29. #else
  30. __extension__
  31. typedef long long int int64_t;
  32. #endif
  33. #endif
  34.  
  35. /* Unsigned.  */
  36. typedef unsigned char uint8_t;
  37. typedef unsigned short int uint16_t;
  38. typedef unsigned int uint32_t;
  39. #if defined(__CC_NORCROFT) && (__CC_NORCROFT_VERSION < 550)
  40. typedef unsigned __int64 uint64_t;
  41. #else
  42. __extension__
  43. typedef unsigned long long int uint64_t;
  44. #endif
  45.  
  46.  
  47. /* Small types.  */
  48.  
  49. /* Signed.  */
  50. typedef signed char int_least8_t;
  51. typedef short int int_least16_t;
  52. typedef int int_least32_t;
  53. #if defined(__CC_NORCROFT) && (__CC_NORCROFT_VERSION < 550)
  54. typedef __int64 int_least64_t;
  55. #else
  56. __extension__
  57. typedef long long int int_least64_t;
  58. #endif
  59.  
  60. /* Unsigned.  */
  61. typedef unsigned char uint_least8_t;
  62. typedef unsigned short int uint_least16_t;
  63. typedef unsigned int uint_least32_t;
  64. #if defined(__CC_NORCROFT) && (__CC_NORCROFT_VERSION < 550)
  65. typedef unsigned __int64 uint_least64_t;
  66. #else
  67. __extension__
  68. typedef unsigned long long int uint_least64_t;
  69. #endif
  70.  
  71.  
  72. /* Fast types.  */
  73.  
  74. /* Signed.  */
  75. typedef signed char int_fast8_t;
  76. typedef int int_fast16_t;
  77. typedef int int_fast32_t;
  78. #if defined(__CC_NORCROFT) && (__CC_NORCROFT_VERSION < 550)
  79. typedef __int64 int_fast64_t;
  80. #else
  81. __extension__
  82. typedef long long int int_fast64_t;
  83. #endif
  84.  
  85. /* Unsigned.  */
  86. typedef unsigned char uint_fast8_t;
  87. typedef unsigned int uint_fast16_t;
  88. typedef unsigned int uint_fast32_t;
  89. #if defined(__CC_NORCROFT) && (__CC_NORCROFT_VERSION < 550)
  90. typedef unsigned __int64 uint_fast64_t;
  91. #else
  92. __extension__
  93. typedef unsigned long long int uint_fast64_t;
  94. #endif
  95.  
  96.  
  97. /* Types for `void *' pointers.  */
  98. #ifndef __intptr_t_defined
  99. #define __intptr_t_defined
  100. typedef int intptr_t;
  101. #endif
  102. typedef unsigned int uintptr_t;
  103.  
  104.  
  105. #ifdef __GNUC__
  106. /* Largest integral types.  */
  107. __extension__
  108. typedef long long int intmax_t;
  109. __extension__
  110. typedef unsigned long long int uintmax_t;
  111. #elif defined(__CC_NORCROFT) && (__CC_NORCROFT_VERSION < 550)
  112. typedef __int64 intmax_t;
  113. typedef unsigned __int64 uintmax_t;
  114. #else
  115. /* Largest integral types.  */
  116. typedef long int intmax_t;
  117. typedef unsigned long int uintmax_t;
  118. #endif
  119.  
  120. /* The ISO C 9X standard specifies that in C++ implementations these
  121.    macros should only be defined if explicitly requested.  */
  122. #if !defined __cplusplus || defined __STDC_LIMIT_MACROS
  123.  
  124. /* Limits of integral types.  */
  125.  
  126. /* Minimum of signed integral types.  */
  127. #define INT8_MIN        (-128)
  128. #define INT16_MIN        (-32767-1)
  129. #define INT32_MIN        (-2147483647-1)
  130. #define INT64_MIN        (-9223372036854775807LL-1)
  131.  
  132. /* Maximum of signed integral types.  */
  133. #define INT8_MAX        (127)
  134. #define INT16_MAX        (32767)
  135. #define INT32_MAX        (2147483647)
  136. #define INT64_MAX        (9223372036854775807LL)
  137.  
  138. /* Maximum of unsigned integral types.  */
  139. #define UINT8_MAX        (255U)
  140. #define UINT16_MAX        (65535U)
  141. #define UINT32_MAX        (4294967295U)
  142. #define UINT64_MAX        (18446744073709551615ULL)
  143.  
  144.  
  145. /* Minimum of signed integral types having a minimum size.  */
  146. #define INT_LEAST8_MIN        (-128)
  147. #define INT_LEAST16_MIN    (-32767-1)
  148. #define INT_LEAST32_MIN    (-2147483647-1)
  149. #define INT_LEAST64_MIN    (-9223372036854775807LL-1)
  150.  
  151. /* Maximum of signed integral types having a minimum size.  */
  152. #define INT_LEAST8_MAX        (127)
  153. #define INT_LEAST16_MAX    (32767)
  154. #define INT_LEAST32_MAX    (2147483647)
  155. #define INT_LEAST64_MAX    (9223372036854775807LL)
  156.  
  157. /* Maximum of unsigned integral types having a minimum size.  */
  158. #define UINT_LEAST8_MAX    (255U)
  159. #define UINT_LEAST16_MAX    (65535U)
  160. #define UINT_LEAST32_MAX    (4294967295U)
  161. #define UINT_LEAST64_MAX    (18446744073709551615ULL)
  162.  
  163. /* Minimum of fast signed integral types having a minimum size.  */
  164. #define INT_FAST8_MIN        (-128)
  165. #define INT_FAST16_MIN        (-2147483647-1)
  166. #define INT_FAST32_MIN        (-2147483647-1)
  167. #define INT_FAST64_MIN        (-9223372036854775807LL-1)
  168.  
  169. /* Maximum of fast signed integral types having a minimum size.  */
  170. #define INT_FAST8_MAX        (127)
  171. #define INT_FAST16_MAX        (2147483647)
  172. #define INT_FAST32_MAX        (2147483647)
  173. #define INT_FAST64_MAX        (9223372036854775807LL)
  174.  
  175. /* Maximum of fast unsigned integral types having a minimum size.  */
  176. #define UINT_FAST8_MAX        (255U)
  177. #define UINT_FAST16_MAX    (4294967295U)
  178. #define UINT_FAST32_MAX    (4294967295U)
  179. #define UINT_FAST64_MAX    (18446744073709551615ULL)
  180.  
  181.  
  182. /* Values to test for integral types holding `void *' pointer.  */
  183. #define INTPTR_MIN        (-2147483647-1)
  184. #define INTPTR_MAX        (2147483647)
  185. #define UINTPTR_MAX        (4294967295U)
  186.  
  187.  
  188. /* Minimum for largest signed integral type.  */
  189. #define INTMAX_MIN        (-9223372036854775807LL-1)
  190. /* Maximum for largest signed integral type.  */
  191. #define INTMAX_MAX        (9223372036854775807LL)
  192.  
  193. /* Maximum for largest unsigned integral type.  */
  194. #define UINTMAX_MAX        (18446744073709551615ULL)
  195.  
  196. /* Limits of other integer types.  */
  197.  
  198. /* Limits of `ptrdiff_t' type.  */
  199. #define PTRDIFF_MIN    (-2147483647-1)
  200. #define PTRDIFF_MAX    (2147483647)
  201.  
  202. /* Limits of `sig_atomic_t'.  */
  203. #define SIG_ATOMIC_MIN    (-2147483647-1)
  204. #define SIG_ATOMIC_MAX    (2147483647)
  205.  
  206. /* Limit of `size_t' type.  */
  207. #define SIZE_MAX    (4294967295U)
  208.  
  209. /* Limits of `wchar_t'.  */
  210. #ifndef WCHAR_MIN
  211. /* These constants might also be defined in <wchar.h>.  */
  212. #define WCHAR_MIN    (-2147483647-1)
  213. #define WCHAR_MAX    (2147483647)
  214. #endif
  215.  
  216. /* Limits of `wint_t'.  */
  217. #define WINT_MIN    (0)
  218. #define WINT_MAX    (4294967295U)
  219.  
  220. #endif    /* C++ && limit macros */
  221.  
  222. #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
  223.  
  224. /* Signed.  */
  225. #define INT8_C(c)    c
  226. #define INT16_C(c)    c
  227. #define INT32_C(c)    c
  228. #define INT64_C(c)    c ## LL
  229.  
  230. /* Unsigned.  */
  231. #define UINT8_C(c)    c ## U
  232. #define UINT16_C(c)    c ## U
  233. #define UINT32_C(c)    c ## U
  234. #define UINT64_C(c)    c ## ULL
  235.  
  236. /* Maximal type.  */
  237. #define INTMAX_C(c)    c ## LL
  238. #define UINTMAX_C(c)    c ## ULL
  239.  
  240. #endif
  241.  
  242. #endif
  243.