Guest User

Untitled

a guest
Jun 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1. /* stdint.h standard header */
  2. #pragma once
  3. #ifndef _STDINT
  4. #define _STDINT
  5. #ifndef RC_INVOKED
  6. #include <yvals.h>
  7.  
  8. /* NB: assumes
  9. byte has 8 bits
  10. long is 32 bits
  11. pointer can convert to and from long long
  12. long long is longest type
  13. */
  14.  
  15. _C_STD_BEGIN
  16. /* TYPE DEFINITIONS */
  17. typedef signed char int8_t;
  18. typedef short int16_t;
  19. typedef int int32_t;
  20.  
  21. typedef unsigned char uint8_t;
  22. typedef unsigned short uint16_t;
  23. typedef unsigned int uint32_t;
  24.  
  25. typedef signed char int_least8_t;
  26. typedef short int_least16_t;
  27. typedef int int_least32_t;
  28.  
  29. typedef unsigned char uint_least8_t;
  30. typedef unsigned short uint_least16_t;
  31. typedef unsigned int uint_least32_t;
  32.  
  33. typedef char int_fast8_t;
  34. typedef int int_fast16_t;
  35. typedef int int_fast32_t;
  36.  
  37. typedef unsigned char uint_fast8_t;
  38. typedef unsigned int uint_fast16_t;
  39. typedef unsigned int uint_fast32_t;
  40.  
  41. #ifndef _INTPTR_T_DEFINED
  42. #define _INTPTR_T_DEFINED
  43. #ifdef _WIN64
  44. typedef __int64 intptr_t;
  45. #else /* _WIN64 */
  46. typedef _W64 int intptr_t;
  47. #endif /* _WIN64 */
  48. #endif /* _INTPTR_T_DEFINED */
  49.  
  50. #ifndef _UINTPTR_T_DEFINED
  51. #define _UINTPTR_T_DEFINED
  52. #ifdef _WIN64
  53. typedef unsigned __int64 uintptr_t;
  54. #else /* _WIN64 */
  55. typedef _W64 unsigned int uintptr_t;
  56. #endif /* _WIN64 */
  57. #endif /* _UINTPTR_T_DEFINED */
  58.  
  59. typedef _Longlong int64_t;
  60. typedef _ULonglong uint64_t;
  61.  
  62. typedef _Longlong int_least64_t;
  63. typedef _ULonglong uint_least64_t;
  64.  
  65. typedef _Longlong int_fast64_t;
  66. typedef _ULonglong uint_fast64_t;
  67.  
  68. typedef _Longlong intmax_t;
  69. typedef _ULonglong uintmax_t;
  70.  
  71. /* LIMIT MACROS */
  72. #define INT8_MIN (-0x7f - _C2)
  73. #define INT16_MIN (-0x7fff - _C2)
  74. #define INT32_MIN (-0x7fffffff - _C2)
  75.  
  76. #define INT8_MAX 0x7f
  77. #define INT16_MAX 0x7fff
  78. #define INT32_MAX 0x7fffffff
  79. #define UINT8_MAX 0xff
  80. #define UINT16_MAX 0xffff
  81. #define UINT32_MAX 0xffffffff
  82.  
  83. #define INT_LEAST8_MIN (-0x7f - _C2)
  84. #define INT_LEAST16_MIN (-0x7fff - _C2)
  85. #define INT_LEAST32_MIN (-0x7fffffff - _C2)
  86.  
  87. #define INT_LEAST8_MAX 0x7f
  88. #define INT_LEAST16_MAX 0x7fff
  89. #define INT_LEAST32_MAX 0x7fffffff
  90. #define UINT_LEAST8_MAX 0xff
  91. #define UINT_LEAST16_MAX 0xffff
  92. #define UINT_LEAST32_MAX 0xffffffff
  93.  
  94. #define INT_FAST8_MIN (-0x7f - _C2)
  95. #define INT_FAST16_MIN (-0x7fff - _C2)
  96. #define INT_FAST32_MIN (-0x7fffffff - _C2)
  97.  
  98. #define INT_FAST8_MAX 0x7f
  99. #define INT_FAST16_MAX 0x7fff
  100. #define INT_FAST32_MAX 0x7fffffff
  101. #define UINT_FAST8_MAX 0xff
  102. #define UINT_FAST16_MAX 0xffff
  103. #define UINT_FAST32_MAX 0xffffffff
  104.  
  105. #if _INTPTR == 0 || _INTPTR == 1
  106. #define INTPTR_MAX 0x7fffffff
  107. #define INTPTR_MIN (-INTPTR_MAX - _C2)
  108. #define UINTPTR_MAX 0xffffffff
  109.  
  110. #else /* _INTPTR == 2 */
  111. #define INTPTR_MIN (-_LLONG_MAX - _C2)
  112. #define INTPTR_MAX _LLONG_MAX
  113. #define UINTPTR_MAX _ULLONG_MAX
  114. #endif /* _INTPTR */
  115.  
  116. #define INT8_C(x) (x)
  117. #define INT16_C(x) (x)
  118. #define INT32_C(x) ((x) + (INT32_MAX - INT32_MAX))
  119.  
  120. #define UINT8_C(x) (x)
  121. #define UINT16_C(x) (x)
  122. #define UINT32_C(x) ((x) + (UINT32_MAX - UINT32_MAX))
  123.  
  124. #ifdef _WIN64
  125. #define PTRDIFF_MIN INT64_MIN
  126. #define PTRDIFF_MAX INT64_MAX
  127. #else /* _WIN64 */
  128. #define PTRDIFF_MIN INT32_MIN
  129. #define PTRDIFF_MAX INT32_MAX
  130. #endif /* _WIN64 */
  131.  
  132. #define SIG_ATOMIC_MIN INT32_MIN
  133. #define SIG_ATOMIC_MAX INT32_MAX
  134.  
  135. #ifndef SIZE_MAX
  136. #ifdef _WIN64
  137. #define SIZE_MAX UINT64_MAX
  138. #else /* _WIN64 */
  139. #define SIZE_MAX UINT32_MAX
  140. #endif /* _WIN64 */
  141. #endif /* SIZE_MAX */
  142.  
  143. #define WCHAR_MIN 0x0000
  144. #define WCHAR_MAX 0xffff
  145.  
  146. #define WINT_MIN 0x0000
  147. #define WINT_MAX 0xffff
  148.  
  149. #define INT64_MIN (-0x7fffffffffffffff - _C2)
  150. #define INT64_MAX 0x7fffffffffffffff
  151. #define UINT64_MAX 0xffffffffffffffffU
  152.  
  153. #define INT_LEAST64_MIN (-0x7fffffffffffffff - _C2)
  154. #define INT_LEAST64_MAX 0x7fffffffffffffff
  155. #define UINT_LEAST64_MAX 0xffffffffffffffffU
  156.  
  157. #define INT_FAST64_MIN (-0x7fffffffffffffff - _C2)
  158. #define INT_FAST64_MAX 0x7fffffffffffffff
  159. #define UINT_FAST64_MAX 0xffffffffffffffffU
  160.  
  161. #define INTMAX_MIN (-0x7fffffffffffffff - _C2)
  162. #define INTMAX_MAX 0x7fffffffffffffff
  163. #define UINTMAX_MAX 0xffffffffffffffffU
  164.  
  165. #define INT64_C(x) ((x) + (INT64_MAX - INT64_MAX))
  166. #define UINT64_C(x) ((x) + (UINT64_MAX - UINT64_MAX))
  167. #define INTMAX_C(x) INT64_C(x)
  168. #define UINTMAX_C(x) UINT64_C(x)
  169. _C_STD_END
  170. #endif /* RC_INVOKED */
  171. #endif /* _STDINT */
  172.  
  173. #if defined(_STD_USING)
  174. using _CSTD int8_t; using _CSTD int16_t;
  175. using _CSTD int32_t; using _CSTD int64_t;
  176.  
  177. using _CSTD uint8_t; using _CSTD uint16_t;
  178. using _CSTD uint32_t; using _CSTD uint64_t;
  179.  
  180. using _CSTD int_least8_t; using _CSTD int_least16_t;
  181. using _CSTD int_least32_t; using _CSTD int_least64_t;
  182. using _CSTD uint_least8_t; using _CSTD uint_least16_t;
  183. using _CSTD uint_least32_t; using _CSTD uint_least64_t;
  184.  
  185. using _CSTD intmax_t; using _CSTD uintmax_t;
  186.  
  187. using _CSTD uintptr_t;
  188. using _CSTD intptr_t;
  189.  
  190. using _CSTD int_fast8_t; using _CSTD int_fast16_t;
  191. using _CSTD int_fast32_t; using _CSTD int_fast64_t;
  192. using _CSTD uint_fast8_t; using _CSTD uint_fast16_t;
  193. using _CSTD uint_fast32_t; using _CSTD uint_fast64_t;
  194. #endif /* defined(_STD_USING) */
  195.  
  196. /*
  197. * Copyright (c) 1992-2009 by P.J. Plauger. ALL RIGHTS RESERVED.
  198. * Consult your license regarding permissions and restrictions.
  199. V5.20:0009 */
Add Comment
Please, Sign In to add comment