stdint.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #if defined(_MSC_VER) && defined(_WIN32_WCE) && (_WIN32_WCE < 0x800) && !defined(_STDINT_H_) && !defined(_STDINT)
  2. #define _STDINT
  3. typedef __int8
  4. int8_t,
  5. int_least8_t;
  6. typedef __int16
  7. int16_t,
  8. int_least16_t;
  9. typedef __int32
  10. int32_t,
  11. int_least32_t,
  12. int_fast8_t,
  13. int_fast16_t,
  14. int_fast32_t;
  15. typedef __int64
  16. int64_t,
  17. intmax_t,
  18. int_least64_t,
  19. int_fast64_t;
  20. typedef unsigned __int8
  21. uint8_t,
  22. uint_least8_t;
  23. typedef unsigned __int16
  24. uint16_t,
  25. uint_least16_t;
  26. typedef unsigned __int32
  27. uint32_t,
  28. uint_least32_t,
  29. uint_fast8_t,
  30. uint_fast16_t,
  31. uint_fast32_t;
  32. typedef unsigned __int64
  33. uint64_t,
  34. uintmax_t,
  35. uint_least64_t,
  36. uint_fast64_t;
  37. #ifndef _INTPTR_T_DEFINED
  38. #define _INTPTR_T_DEFINED
  39. typedef __int32 intptr_t;
  40. #endif
  41. #ifndef _UINTPTR_T_DEFINED
  42. #define _UINTPTR_T_DEFINED
  43. typedef unsigned __int32 uintptr_t;
  44. #endif
  45. #define INT8_MIN (-127i8 - 1)
  46. #define INT16_MIN (-32767i16 - 1)
  47. #define INT32_MIN (-2147483647i32 - 1)
  48. #define INT64_MIN (-9223372036854775807i64 - 1)
  49. #define INT8_MAX 127i8
  50. #define INT16_MAX 32767i16
  51. #define INT32_MAX 2147483647i32
  52. #define INT64_MAX 9223372036854775807i64
  53. #define UINT8_MAX 0xffui8
  54. #define UINT16_MAX 0xffffui16
  55. #define UINT32_MAX 0xffffffffui32
  56. #define UINT64_MAX 0xffffffffffffffffui64
  57. #define INT_LEAST8_MIN INT8_MIN
  58. #define INT_LEAST16_MIN INT16_MIN
  59. #define INT_LEAST32_MIN INT32_MIN
  60. #define INT_LEAST64_MIN INT64_MIN
  61. #define INT_LEAST8_MAX INT8_MAX
  62. #define INT_LEAST16_MAX INT16_MAX
  63. #define INT_LEAST32_MAX INT32_MAX
  64. #define INT_LEAST64_MAX INT64_MAX
  65. #define UINT_LEAST8_MAX UINT8_MAX
  66. #define UINT_LEAST16_MAX UINT16_MAX
  67. #define UINT_LEAST32_MAX UINT32_MAX
  68. #define UINT_LEAST64_MAX UINT64_MAX
  69. #define INT_FAST8_MIN INT8_MIN
  70. #define INT_FAST16_MIN INT32_MIN
  71. #define INT_FAST32_MIN INT32_MIN
  72. #define INT_FAST64_MIN INT64_MIN
  73. #define INT_FAST8_MAX INT8_MAX
  74. #define INT_FAST16_MAX INT32_MAX
  75. #define INT_FAST32_MAX INT32_MAX
  76. #define INT_FAST64_MAX INT64_MAX
  77. #define UINT_FAST8_MAX UINT8_MAX
  78. #define UINT_FAST16_MAX UINT32_MAX
  79. #define UINT_FAST32_MAX UINT32_MAX
  80. #define UINT_FAST64_MAX UINT64_MAX
  81. #define INTPTR_MIN INT32_MIN
  82. #define INTPTR_MAX INT32_MAX
  83. #define UINTPTR_MAX UINT32_MAX
  84. #define INTMAX_MIN INT64_MIN
  85. #define INTMAX_MAX INT64_MAX
  86. #define UINTMAX_MAX UINT64_MAX
  87. #define PTRDIFF_MIN INTPTR_MIN
  88. #define PTRDIFF_MAX INTPTR_MAX
  89. #ifndef SIZE_MAX
  90. #define SIZE_MAX UINTPTR_MAX
  91. #endif
  92. #define SIG_ATOMIC_MIN INT32_MIN
  93. #define SIG_ATOMIC_MAX INT32_MAX
  94. #define WCHAR_MIN 0x0000
  95. #define WCHAR_MAX 0xffff
  96. #define WINT_MIN 0x0000
  97. #define WINT_MAX 0xffff
  98. #define INT8_C(x) (x)
  99. #define INT16_C(x) (x)
  100. #define INT32_C(x) (x)
  101. #define INT64_C(x) (x ## LL)
  102. #define UINT8_C(x) (x)
  103. #define UINT16_C(x) (x)
  104. #define UINT32_C(x) (x ## U)
  105. #define UINT64_C(x) (x ## ULL)
  106. #define INTMAX_C(x) INT64_C(x)
  107. #define UINTMAX_C(x) UINT64_C(x)
  108. #endif