stdint.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #ifndef _STDINT_H
  2. #define _STDINT_H
  3. #define __NEED_int8_t
  4. #define __NEED_int16_t
  5. #define __NEED_int32_t
  6. #define __NEED_int64_t
  7. #define __NEED_uint8_t
  8. #define __NEED_uint16_t
  9. #define __NEED_uint32_t
  10. #define __NEED_uint64_t
  11. #define __NEED_int_fast8_t
  12. #define __NEED_int_fast16_t
  13. #define __NEED_int_fast32_t
  14. #define __NEED_int_fast64_t
  15. #define __NEED_uint_fast8_t
  16. #define __NEED_uint_fast16_t
  17. #define __NEED_uint_fast32_t
  18. #define __NEED_uint_fast64_t
  19. #define __NEED_intptr_t
  20. #define __NEED_uintptr_t
  21. #include <bits/alltypes.h>
  22. typedef int8_t int_least8_t;
  23. typedef int16_t int_least16_t;
  24. typedef int32_t int_least32_t;
  25. typedef int64_t int_least64_t;
  26. typedef uint8_t uint_least8_t;
  27. typedef uint16_t uint_least16_t;
  28. typedef uint32_t uint_least32_t;
  29. typedef uint64_t uint_least64_t;
  30. typedef long long intmax_t;
  31. typedef unsigned long long uintmax_t;
  32. #if !defined __cplusplus || defined __STDC_LIMIT_MACROS
  33. #define INT8_MIN (-1-0x7f)
  34. #define INT16_MIN (-1-0x7fff)
  35. #define INT32_MIN (-1-0x7fffffff)
  36. #define INT64_MIN (-1-0x7fffffffffffffffLL)
  37. #define INT8_MAX (0x7f)
  38. #define INT16_MAX (0x7fff)
  39. #define INT32_MAX (0x7fffffff)
  40. #define INT64_MAX (0x7fffffffffffffffLL)
  41. #define UINT8_MAX (0xff)
  42. #define UINT16_MAX (0xffff)
  43. #define UINT32_MAX (0xffffffff)
  44. #define UINT64_MAX (0xffffffffffffffffULL)
  45. #define INT_LEAST8_MIN INT8_MIN
  46. #define INT_LEAST16_MIN INT16_MIN
  47. #define INT_LEAST32_MIN INT32_MIN
  48. #define INT_LEAST64_MIN INT64_MIN
  49. #define INT_LEAST8_MAX INT8_MAX
  50. #define INT_LEAST16_MAX INT16_MAX
  51. #define INT_LEAST32_MAX INT32_MAX
  52. #define INT_LEAST64_MAX INT64_MAX
  53. #define UINT_LEAST8_MAX UINT8_MAX
  54. #define UINT_LEAST16_MAX UINT16_MAX
  55. #define UINT_LEAST32_MAX UINT32_MAX
  56. #define UINT_LEAST64_MAX UINT64_MAX
  57. #define INTMAX_MIN INT64_MIN
  58. #define INTMAX_MAX INT64_MAX
  59. #define UINTMAX_MAX UINT64_MAX
  60. #define WINT_MIN INT32_MIN
  61. #define WINT_MAX INT32_MAX
  62. #if L'\0'-1 > 0
  63. #define WCHAR_MAX (0xffffffffu+L'\0')
  64. #define WCHAR_MIN (0+L'\0')
  65. #else
  66. #define WCHAR_MAX (0x7fffffff+L'\0')
  67. #define WCHAR_MIN (-1-0x7fffffff+L'\0')
  68. #endif
  69. #include <bits/stdint.h>
  70. #endif
  71. #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
  72. #define INT8_C(c) c
  73. #define INT16_C(c) c
  74. #define INT32_C(c) c
  75. #define INT64_C(c) c ## LL
  76. #define UINT8_C(c) c
  77. #define UINT16_C(c) c
  78. #define UINT32_C(c) c ## U
  79. #define UINT64_C(c) c ## ULL
  80. #define INTMAX_C(c) c ## LL
  81. #define UINTMAX_C(c) c ## ULL
  82. #endif
  83. #endif