Chinaunix首页 | 论坛 | 博客
  • 博客访问: 597109
  • 博文数量: 1958
  • 博客积分: 44693
  • 博客等级: 大将
  • 技术积分: 22125
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-29 15:19
文章分类

全部博文(1958)

文章存档

2012年(560)

2011年(1398)

分类: LINUX

2011-03-14 21:10:25

root@ubuntu:/home/zhangbin# find /usr/  -name stdint.h
/usr/src/linux-headers-2.6.32-26/arch/arm/mach-bcmring/include/csp/stdint.h
/usr/include/c++/4.4/tr1/stdint.h
/usr/include/stdint.h

  1. root@ubuntu:/home/zhangbin# cat /usr/include/stdint.h
  2. /* Copyright (C) 1997,1998,1999,2000,2001,2006 Free Software Foundation, Inc.
  3.    This file is part of the GNU C Library.

  4.    The GNU C Library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Lesser General Public
  6.    License as published by the Free Software Foundation; either
  7.    version 2.1 of the License, or (at your option) any later version.

  8.    The GNU C Library is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11.    Lesser General Public License for more details.

  12.    You should have received a copy of the GNU Lesser General Public
  13.    License along with the GNU C Library; if not, write to the Free
  14.    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15.    02111-1307 USA. */

  16. /*
  17.  *    ISO C99: 7.18 Integer types  
  18.  */

  19. #ifndef _STDINT_H
  20. #define _STDINT_H    1

  21. #include <features.h>
  22. #include <bits/wchar.h>
  23. #include <bits/wordsize.h>

  24. /* Exact integral types. */

  25. /* Signed. */

  26. /* There is some amount of overlap with as known by inet code */
  27. #ifndef __int8_t_defined
  28. # define __int8_t_defined
  29. typedef signed char        int8_t;
  30. typedef short int        int16_t;
  31. typedef int            int32_t;
  32. # if __WORDSIZE == 64
  33. typedef long int        int64_t;
  34. # else
  35. __extension__
  36. typedef long long int        int64_t;
  37. # endif
  38. #endif

  39. /* Unsigned. */
  40. typedef unsigned char        uint8_t;
  41. typedef unsigned short int    uint16_t;
  42. #ifndef __uint32_t_defined
  43. typedef unsigned int        uint32_t;
  44. # define __uint32_t_defined
  45. #endif
  46. #if __WORDSIZE == 64
  47. typedef unsigned long int    uint64_t;
  48. #else
  49. __extension__
  50. typedef unsigned long long int    uint64_t;
  51. #endif


  52. /* Small types. */

  53. /* Signed. */
  54. typedef signed char        int_least8_t;
  55. typedef short int        int_least16_t;
  56. typedef int            int_least32_t;
  57. #if __WORDSIZE == 64
  58. typedef long int        int_least64_t;
  59. #else
  60. __extension__
  61. typedef long long int        int_least64_t;
  62. #endif

  63. /* Unsigned. */
  64. typedef unsigned char        uint_least8_t;
  65. typedef unsigned short int    uint_least16_t;
  66. typedef unsigned int        uint_least32_t;
  67. #if __WORDSIZE == 64
  68. typedef unsigned long int    uint_least64_t;
  69. #else
  70. __extension__
  71. typedef unsigned long long int    uint_least64_t;
  72. #endif


  73. /* Fast types. */

  74. /* Signed. */
  75. typedef signed char        int_fast8_t;
  76. #if __WORDSIZE == 64
  77. typedef long int        int_fast16_t;
  78. typedef long int        int_fast32_t;
  79. typedef long int        int_fast64_t;
  80. #else
  81. typedef int            int_fast16_t;
  82. typedef int            int_fast32_t;
  83. __extension__
  84. typedef long long int        int_fast64_t;
  85. #endif

  86. /* Unsigned. */
  87. typedef unsigned char        uint_fast8_t;
  88. #if __WORDSIZE == 64
  89. typedef unsigned long int    uint_fast16_t;
  90. typedef unsigned long int    uint_fast32_t;
  91. typedef unsigned long int    uint_fast64_t;
  92. #else
  93. typedef unsigned int        uint_fast16_t;
  94. typedef unsigned int        uint_fast32_t;
  95. __extension__
  96. typedef unsigned long long int    uint_fast64_t;
  97. #endif


  98. /* Types for `void *' pointers. */
  99. #if __WORDSIZE == 64
  100. # ifndef __intptr_t_defined
  101. typedef long int        intptr_t;
  102. # define __intptr_t_defined
  103. # endif
  104. typedef unsigned long int    uintptr_t;
  105. #else
  106. # ifndef __intptr_t_defined
  107. typedef int            intptr_t;
  108. # define __intptr_t_defined
  109. # endif
  110. typedef unsigned int        uintptr_t;
  111. #endif


  112. /* Largest integral types. */
  113. #if __WORDSIZE == 64
  114. typedef long int        intmax_t;
  115. typedef unsigned long int    uintmax_t;
  116. #else
  117. __extension__
  118. typedef long long int        intmax_t;
  119. __extension__
  120. typedef unsigned long long int    uintmax_t;
  121. #endif


  122. /* The ISO C99 standard specifies that in C++ implementations these
  123.    macros should only be defined if explicitly requested. */
  124. #if !defined __cplusplus || defined __STDC_LIMIT_MACROS

  125. # if __WORDSIZE == 64
  126. # define __INT64_C(c)    c ## L
  127. # define __UINT64_C(c)    c ## UL
  128. # else
  129. # define __INT64_C(c)    c ## LL
  130. # define __UINT64_C(c)    c ## ULL
  131. # endif

  132. /* Limits of integral types. */

  133. /* Minimum of signed integral types. */
  134. # define INT8_MIN        (-128)
  135. # define INT16_MIN        (-32767-1)
  136. # define INT32_MIN        (-2147483647-1)
  137. # define INT64_MIN        (-__INT64_C(9223372036854775807)-1)
  138. /* Maximum of signed integral types. */
  139. # define INT8_MAX        (127)
  140. # define INT16_MAX        (32767)
  141. # define INT32_MAX        (2147483647)
  142. # define INT64_MAX        (__INT64_C(9223372036854775807))

  143. /* Maximum of unsigned integral types. */
  144. # define UINT8_MAX        (255)
  145. # define UINT16_MAX        (65535)
  146. # define UINT32_MAX        (4294967295U)
  147. # define UINT64_MAX        (__UINT64_C(18446744073709551615))


  148. /* Minimum of signed integral types having a minimum size. */
  149. # define INT_LEAST8_MIN        (-128)
  150. # define INT_LEAST16_MIN    (-32767-1)
  151. # define INT_LEAST32_MIN    (-2147483647-1)
  152. # define INT_LEAST64_MIN    (-__INT64_C(9223372036854775807)-1)
  153. /* Maximum of signed integral types having a minimum size. */
  154. # define INT_LEAST8_MAX        (127)
  155. # define INT_LEAST16_MAX    (32767)
  156. # define INT_LEAST32_MAX    (2147483647)
  157. # define INT_LEAST64_MAX    (__INT64_C(9223372036854775807))

  158. /* Maximum of unsigned integral types having a minimum size. */
  159. # define UINT_LEAST8_MAX    (255)
  160. # define UINT_LEAST16_MAX    (65535)
  161. # define UINT_LEAST32_MAX    (4294967295U)
  162. # define UINT_LEAST64_MAX    (__UINT64_C(18446744073709551615))


  163. /* Minimum of fast signed integral types having a minimum size. */
  164. # define INT_FAST8_MIN        (-128)
  165. # if __WORDSIZE == 64
  166. # define INT_FAST16_MIN    (-9223372036854775807L-1)
  167. # define INT_FAST32_MIN    (-9223372036854775807L-1)
  168. # else
  169. # define INT_FAST16_MIN    (-2147483647-1)
  170. # define INT_FAST32_MIN    (-2147483647-1)
  171. # endif
  172. # define INT_FAST64_MIN        (-__INT64_C(9223372036854775807)-1)
  173. /* Maximum of fast signed integral types having a minimum size. */
  174. # define INT_FAST8_MAX        (127)
  175. # if __WORDSIZE == 64
  176. # define INT_FAST16_MAX    (9223372036854775807L)
  177. # define INT_FAST32_MAX    (9223372036854775807L)
  178. # else
  179. # define INT_FAST16_MAX    (2147483647)
  180. # define INT_FAST32_MAX    (2147483647)
  181. # endif
  182. # define INT_FAST64_MAX        (__INT64_C(9223372036854775807))

  183. /* Maximum of fast unsigned integral types having a minimum size. */
  184. # define UINT_FAST8_MAX        (255)
  185. # if __WORDSIZE == 64
  186. # define UINT_FAST16_MAX    (18446744073709551615UL)
  187. # define UINT_FAST32_MAX    (18446744073709551615UL)
  188. # else
  189. # define UINT_FAST16_MAX    (4294967295U)
  190. # define UINT_FAST32_MAX    (4294967295U)
  191. # endif
  192. # define UINT_FAST64_MAX    (__UINT64_C(18446744073709551615))


  193. /* Values to test for integral types holding `void *' pointer. */
  194. # if __WORDSIZE == 64
  195. # define INTPTR_MIN        (-9223372036854775807L-1)
  196. # define INTPTR_MAX        (9223372036854775807L)
  197. # define UINTPTR_MAX        (18446744073709551615UL)
  198. # else
  199. # define INTPTR_MIN        (-2147483647-1)
  200. # define INTPTR_MAX        (2147483647)
  201. # define UINTPTR_MAX        (4294967295U)
  202. # endif


  203. /* Minimum for largest signed integral type. */
  204. # define INTMAX_MIN        (-__INT64_C(9223372036854775807)-1)
  205. /* Maximum for largest signed integral type. */
  206. # define INTMAX_MAX        (__INT64_C(9223372036854775807))

  207. /* Maximum for largest unsigned integral type. */
  208. # define UINTMAX_MAX        (__UINT64_C(18446744073709551615))


  209. /* Limits of other integer types. */

  210. /* Limits of `ptrdiff_t' type. */
  211. # if __WORDSIZE == 64
  212. # define PTRDIFF_MIN        (-9223372036854775807L-1)
  213. # define PTRDIFF_MAX        (9223372036854775807L)
  214. # else
  215. # define PTRDIFF_MIN        (-2147483647-1)
  216. # define PTRDIFF_MAX        (2147483647)
  217. # endif

  218. /* Limits of `sig_atomic_t'. */
  219. # define SIG_ATOMIC_MIN        (-2147483647-1)
  220. # define SIG_ATOMIC_MAX        (2147483647)

  221. /* Limit of `size_t' type. */
  222. # if __WORDSIZE == 64
  223. # define SIZE_MAX        (18446744073709551615UL)
  224. # else
  225. # define SIZE_MAX        (4294967295U)
  226. # endif

  227. /* Limits of `wchar_t'. */
  228. # ifndef WCHAR_MIN
  229. /* These constants might also be defined in . */
  230. # define WCHAR_MIN        __WCHAR_MIN
  231. # define WCHAR_MAX        __WCHAR_MAX
  232. # endif

  233. /* Limits of `wint_t'. */
  234. # define WINT_MIN        (0u)
  235. # define WINT_MAX        (4294967295u)

  236. #endif    /* C++ && limit macros */


  237. /* The ISO C99 standard specifies that in C++ implementations these
  238.    should only be defined if explicitly requested. */
  239. #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS

  240. /* Signed. */
  241. # define INT8_C(c)    c
  242. # define INT16_C(c)    c
  243. # define INT32_C(c)    c
  244. # if __WORDSIZE == 64
  245. # define INT64_C(c)    c ## L
  246. # else
  247. # define INT64_C(c)    c ## LL
  248. # endif

  249. /* Unsigned. */
  250. # define UINT8_C(c)    c
  251. # define UINT16_C(c)    c
  252. # define UINT32_C(c)    c ## U
  253. # if __WORDSIZE == 64
  254. # define UINT64_C(c)    c ## UL
  255. # else
  256. # define UINT64_C(c)    c ## ULL
  257. # endif

  258. /* Maximal type. */
  259. # if __WORDSIZE == 64
  260. # define INTMAX_C(c)    c ## L
  261. # define UINTMAX_C(c)    c ## UL
  262. # else
  263. # define INTMAX_C(c)    c ## LL
  264. # define UINTMAX_C(c)    c ## ULL
  265. # endif

  266. #endif    /* C++ && constant macros */

  267. #endif /* stdint.h */
  268. root@ubuntu:/home/zhangbin#
阅读(1695) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~