stdint.h[int8_t, int16_t, int32_t, int64_t]

来源:互联网 发布:windows八寸平板有哪些 编辑:程序博客网 时间:2024/06/08 04:31

转载地址:http://blog.csdn.net/cocoasprite/article/details/54629887


http://pubs.opengroup.org/onlinepubs/9699919799/

[cpp] view plain copy
  1. //C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdint.h  
  2. /* stdint.h standard header */  
  3. #pragma once  
  4. #ifndef _STDINT  
  5. #define _STDINT  
  6. #ifndef RC_INVOKED  
  7. #include <crtdefs.h>  
  8.   
  9. typedef signed char        int8_t;  
  10. typedef short              int16_t;  
  11. typedef int                int32_t;  
  12. typedef long long          int64_t;  
  13. typedef unsigned char      uint8_t;  
  14. typedef unsigned short     uint16_t;  
  15. typedef unsigned int       uint32_t;  
  16. typedef unsigned long long uint64_t;  
  17.   
  18. typedef signed char        int_least8_t;  
  19. typedef short              int_least16_t;  
  20. typedef int                int_least32_t;  
  21. typedef long long          int_least64_t;  
  22. typedef unsigned char      uint_least8_t;  
  23. typedef unsigned short     uint_least16_t;  
  24. typedef unsigned int       uint_least32_t;  
  25. typedef unsigned long long uint_least64_t;  
  26.   
  27. typedef signed char        int_fast8_t;  
  28. typedef int                int_fast16_t;  
  29. typedef int                int_fast32_t;  
  30. typedef long long          int_fast64_t;  
  31. typedef unsigned char      uint_fast8_t;  
  32. typedef unsigned int       uint_fast16_t;  
  33. typedef unsigned int       uint_fast32_t;  
  34. typedef unsigned long long uint_fast64_t;  
  35.   
  36. #ifndef _INTPTR_T_DEFINED  
  37.  #define _INTPTR_T_DEFINED  
  38.  #ifdef _WIN64  
  39. typedef long long          intptr_t;  
  40.  #else /* _WIN64 */  
  41. typedef _W64 int           intptr_t;  
  42.  #endif /* _WIN64 */  
  43. #endif /* _INTPTR_T_DEFINED */  
  44.   
  45. #ifndef _UINTPTR_T_DEFINED  
  46.  #define _UINTPTR_T_DEFINED  
  47.  #ifdef _WIN64  
  48. typedef unsigned long long uintptr_t;  
  49.  #else /* _WIN64 */  
  50. typedef _W64 unsigned int  uintptr_t;  
  51.  #endif /* _WIN64 */  
  52. #endif /* _UINTPTR_T_DEFINED */  
  53.   
  54. typedef long long          intmax_t;  
  55. typedef unsigned long long uintmax_t;  
  56.   
  57. /* These macros must exactly match those in the Windows SDK's intsafe.h */  
  58. #define INT8_MIN         (-127i8 - 1)  
  59. #define INT16_MIN        (-32767i16 - 1)  
  60. #define INT32_MIN        (-2147483647i32 - 1)  
  61. #define INT64_MIN        (-9223372036854775807i64 - 1)  
  62. #define INT8_MAX         127i8  
  63. #define INT16_MAX        32767i16  
  64. #define INT32_MAX        2147483647i32  
  65. #define INT64_MAX        9223372036854775807i64  
  66. #define UINT8_MAX        0xffui8  
  67. #define UINT16_MAX       0xffffui16  
  68. #define UINT32_MAX       0xffffffffui32  
  69. #define UINT64_MAX       0xffffffffffffffffui64  
  70.   
  71. #define INT_LEAST8_MIN   INT8_MIN  
  72. #define INT_LEAST16_MIN  INT16_MIN  
  73. #define INT_LEAST32_MIN  INT32_MIN  
  74. #define INT_LEAST64_MIN  INT64_MIN  
  75. #define INT_LEAST8_MAX   INT8_MAX  
  76. #define INT_LEAST16_MAX  INT16_MAX  
  77. #define INT_LEAST32_MAX  INT32_MAX  
  78. #define INT_LEAST64_MAX  INT64_MAX  
  79. #define UINT_LEAST8_MAX  UINT8_MAX  
  80. #define UINT_LEAST16_MAX UINT16_MAX  
  81. #define UINT_LEAST32_MAX UINT32_MAX  
  82. #define UINT_LEAST64_MAX UINT64_MAX  
  83.   
  84. #define INT_FAST8_MIN    INT8_MIN  
  85. #define INT_FAST16_MIN   INT32_MIN  
  86. #define INT_FAST32_MIN   INT32_MIN  
  87. #define INT_FAST64_MIN   INT64_MIN  
  88. #define INT_FAST8_MAX    INT8_MAX  
  89. #define INT_FAST16_MAX   INT32_MAX  
  90. #define INT_FAST32_MAX   INT32_MAX  
  91. #define INT_FAST64_MAX   INT64_MAX  
  92. #define UINT_FAST8_MAX   UINT8_MAX  
  93. #define UINT_FAST16_MAX  UINT32_MAX  
  94. #define UINT_FAST32_MAX  UINT32_MAX  
  95. #define UINT_FAST64_MAX  UINT64_MAX  
  96.   
  97. #ifdef _WIN64  
  98.  #define INTPTR_MIN      INT64_MIN  
  99.  #define INTPTR_MAX      INT64_MAX  
  100.  #define UINTPTR_MAX     UINT64_MAX  
  101. #else /* _WIN64 */  
  102.  #define INTPTR_MIN      INT32_MIN  
  103.  #define INTPTR_MAX      INT32_MAX  
  104.  #define UINTPTR_MAX     UINT32_MAX  
  105. #endif /* _WIN64 */  
  106.   
  107. #define INTMAX_MIN       INT64_MIN  
  108. #define INTMAX_MAX       INT64_MAX  
  109. #define UINTMAX_MAX      UINT64_MAX  
  110.   
  111. #define PTRDIFF_MIN      INTPTR_MIN  
  112. #define PTRDIFF_MAX      INTPTR_MAX  
  113.   
  114. #ifndef SIZE_MAX  
  115.  #define SIZE_MAX        UINTPTR_MAX  
  116. #endif /* SIZE_MAX */  
  117.   
  118. #define SIG_ATOMIC_MIN   INT32_MIN  
  119. #define SIG_ATOMIC_MAX   INT32_MAX  
  120.   
  121. #define WCHAR_MIN        0x0000  
  122. #define WCHAR_MAX        0xffff  
  123.   
  124. #define WINT_MIN         0x0000  
  125. #define WINT_MAX         0xffff  
  126.   
  127. #define INT8_C(x)    (x)  
  128. #define INT16_C(x)   (x)  
  129. #define INT32_C(x)   (x)  
  130. #define INT64_C(x)   (x ## LL)  
  131.   
  132. #define UINT8_C(x)   (x)  
  133. #define UINT16_C(x)  (x)  
  134. #define UINT32_C(x)  (x ## U)  
  135. #define UINT64_C(x)  (x ## ULL)  
  136.   
  137. #define INTMAX_C(x)  INT64_C(x)  
  138. #define UINTMAX_C(x) UINT64_C(x)  
  139. #endif /* RC_INVOKED */  
  140. #endif /* _STDINT */  
  141.   
  142. /* 
  143.  * Copyright (c) 1992-2012 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  144.  * Consult your license regarding permissions and restrictions. 
  145. V6.00:0009 */  

原创粉丝点击