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

  1. /* stdint.h header for the RISC OS SharedCLibrary.
  2.    Copyright (c) 2005 GCCSDK Developers
  3.    All rights reserved.
  4.  
  5.    Redistribution and use in source and binary forms, with or without
  6.    modification, are permitted provided that the following conditions
  7.    are met:
  8.    1. Redistributions of source code must retain the above copyright
  9.       notice, this list of conditions and the following disclaimer.
  10.    2. Redistributions in binary form must reproduce the above copyright
  11.       notice, this list of conditions and the following disclaimer in the
  12.       documentation and/or other materials provided with the distribution.
  13.    3. The name of the author may not be used to endorse or promote products
  14.       derived from this software without specific prior written permission.
  15.  
  16.    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  17.    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  18.    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  19.    IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  20.    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  21.    NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22.    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  23.    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24.    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  25.    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
  26.  
  27.  
  28. /* Modified from UnixLib's stdint.h */
  29.  
  30.  
  31. #ifndef __STDINT_H
  32. #define __STDINT_H 1
  33.  
  34. #include <sys/types.h>
  35.  
  36. /* Exact integral types.  */
  37.  
  38. /* Signed.  */
  39.  
  40. #ifndef __int8_t_defined
  41. #define __int8_t_defined
  42. typedef signed char int8_t;
  43. typedef short int int16_t;
  44. typedef int int32_t;
  45. __extension__
  46. typedef long long int int64_t;
  47. #endif
  48.  
  49. /* Unsigned.  */
  50. typedef unsigned char uint8_t;
  51. typedef unsigned short int uint16_t;
  52. typedef unsigned int uint32_t;
  53. __extension__
  54. typedef unsigned long long int uint64_t;
  55.  
  56.  
  57. /* Small types.  */
  58.  
  59. /* Signed.  */
  60. typedef signed char int_least8_t;
  61. typedef short int int_least16_t;
  62. typedef int int_least32_t;
  63. __extension__
  64. typedef long long int int_least64_t;
  65.  
  66. /* Unsigned.  */
  67. typedef unsigned char uint_least8_t;
  68. typedef unsigned short int uint_least16_t;
  69. typedef unsigned int uint_least32_t;
  70. __extension__
  71. typedef unsigned long long int uint_least64_t;
  72.  
  73.  
  74. /* Fast types.  */
  75.  
  76. /* Signed.  */
  77. typedef signed char int_fast8_t;
  78. typedef int int_fast16_t;
  79. typedef int int_fast32_t;
  80. __extension__
  81. typedef long long int int_fast64_t;
  82.  
  83. /* Unsigned.  */
  84. typedef unsigned char uint_fast8_t;
  85. typedef unsigned int uint_fast16_t;
  86. typedef unsigned int uint_fast32_t;
  87. __extension__
  88. typedef unsigned long long int uint_fast64_t;
  89.  
  90.  
  91. /* Types for `void *' pointers.  */
  92. #ifndef __intptr_t_defined
  93. #define __intptr_t_defined
  94. typedef int intptr_t;
  95. #endif
  96. typedef unsigned int uintptr_t;
  97.  
  98.  
  99. #ifdef __GNUC__
  100. /* Largest integral types.  */
  101. __extension__
  102. typedef long long int intmax_t;
  103. __extension__
  104. typedef unsigned long long int uintmax_t;
  105. #else
  106. /* Largest integral types.  */
  107. typedef long int intmax_t;
  108. typedef unsigned long int uintmax_t;
  109. #endif
  110.  
  111. /* The ISO C 9X standard specifies that in C++ implementations these
  112.    macros should only be defined if explicitly requested.  */
  113. #if !defined __cplusplus || defined __STDC_LIMIT_MACROS
  114.  
  115. /* Limits of integral types.  */
  116.  
  117. /* Minimum of signed integral types.  */
  118. #define INT8_MIN        (-128)
  119. #define INT16_MIN        (-32767-1)
  120. #define INT32_MIN        (-2147483647-1)
  121. #define INT64_MIN        (-9223372036854775807LL-1)
  122.  
  123. /* Maximum of signed integral types.  */
  124. #define INT8_MAX        (127)
  125. #define INT16_MAX        (32767)
  126. #define INT32_MAX        (2147483647)
  127. #define INT64_MAX        (9223372036854775807LL)
  128.  
  129. /* Maximum of unsigned integral types.  */
  130. #define UINT8_MAX        (255U)
  131. #define UINT16_MAX        (65535U)
  132. #define UINT32_MAX        (4294967295U)
  133. #define UINT64_MAX        (18446744073709551615ULL)
  134.  
  135.  
  136. /* Minimum of signed integral types having a minimum size.  */
  137. #define INT_LEAST8_MIN        (-128)
  138. #define INT_LEAST16_MIN    (-32767-1)
  139. #define INT_LEAST32_MIN    (-2147483647-1)
  140. #define INT_LEAST64_MIN    (-9223372036854775807LL-1)
  141.  
  142. /* Maximum of signed integral types having a minimum size.  */
  143. #define INT_LEAST8_MAX        (127)
  144. #define INT_LEAST16_MAX    (32767)
  145. #define INT_LEAST32_MAX    (2147483647)
  146. #define INT_LEAST64_MAX    (9223372036854775807LL)
  147.  
  148. /* Maximum of unsigned integral types having a minimum size.  */
  149. #define UINT_LEAST8_MAX    (255U)
  150. #define UINT_LEAST16_MAX    (65535U)
  151. #define UINT_LEAST32_MAX    (4294967295U)
  152. #define UINT_LEAST64_MAX    (18446744073709551615ULL)
  153.  
  154. /* Minimum of fast signed integral types having a minimum size.  */
  155. #define INT_FAST8_MIN        (-128)
  156. #define INT_FAST16_MIN        (-2147483647-1)
  157. #define INT_FAST32_MIN        (-2147483647-1)
  158. #define INT_FAST64_MIN        (-9223372036854775807LL-1)
  159.  
  160. /* Maximum of fast signed integral types having a minimum size.  */
  161. #define INT_FAST8_MAX        (127)
  162. #define INT_FAST16_MAX        (2147483647)
  163. #define INT_FAST32_MAX        (2147483647)
  164. #define INT_FAST64_MAX        (9223372036854775807LL)
  165.  
  166. /* Maximum of fast unsigned integral types having a minimum size.  */
  167. #define UINT_FAST8_MAX        (255U)
  168. #define UINT_FAST16_MAX    (4294967295U)
  169. #define UINT_FAST32_MAX    (4294967295U)
  170. #define UINT_FAST64_MAX    (18446744073709551615ULL)
  171.  
  172.  
  173. /* Values to test for integral types holding `void *' pointer.  */
  174. #define INTPTR_MIN        (-2147483647-1)
  175. #define INTPTR_MAX        (2147483647)
  176. #define UINTPTR_MAX        (4294967295U)
  177.  
  178.  
  179. /* Minimum for largest signed integral type.  */
  180. #define INTMAX_MIN        (-9223372036854775807LL-1)
  181. /* Maximum for largest signed integral type.  */
  182. #define INTMAX_MAX        (9223372036854775807LL)
  183.  
  184. /* Maximum for largest unsigned integral type.  */
  185. #define UINTMAX_MAX        (18446744073709551615ULL)
  186.  
  187. /* Limits of other integer types.  */
  188.  
  189. /* Limits of `ptrdiff_t' type.  */
  190. #define PTRDIFF_MIN    (-2147483647-1)
  191. #define PTRDIFF_MAX    (2147483647)
  192.  
  193. /* Limits of `sig_atomic_t'.  */
  194. #define SIG_ATOMIC_MIN    (-2147483647-1)
  195. #define SIG_ATOMIC_MAX    (2147483647)
  196.  
  197. /* Limit of `size_t' type.  */
  198. #define SIZE_MAX    (4294967295U)
  199.  
  200. /* Limits of `wchar_t'.  */
  201. #ifndef WCHAR_MIN
  202. /* These constants might also be defined in <wchar.h>.  */
  203. #define WCHAR_MIN    (-2147483647-1)
  204. #define WCHAR_MAX    (2147483647)
  205. #endif
  206.  
  207. /* Limits of `wint_t'.  */
  208. #define WINT_MIN    (0)
  209. #define WINT_MAX    (4294967295U)
  210.  
  211. #endif    /* C++ && limit macros */
  212.  
  213. #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
  214.  
  215. /* Signed.  */
  216. #define INT8_C(c)    c
  217. #define INT16_C(c)    c
  218. #define INT32_C(c)    c
  219. #define INT64_C(c)    c ## LL
  220.  
  221. /* Unsigned.  */
  222. #define UINT8_C(c)    c ## U
  223. #define UINT16_C(c)    c ## U
  224. #define UINT32_C(c)    c ## U
  225. #define UINT64_C(c)    c ## ULL
  226.  
  227. /* Maximal type.  */
  228. #define INTMAX_C(c)    c ## LL
  229. #define UINTMAX_C(c)    c ## ULL
  230.  
  231. #endif
  232.  
  233. #endif
  234.