stdint.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __STDINT_H__
  2. #define __STDINT_H__
  3. #include <rtthread.h>
  4. typedef rt_int8_t int8_t;
  5. typedef rt_uint8_t uint8_t;
  6. typedef rt_int16_t int16_t;
  7. typedef rt_uint16_t uint16_t;
  8. typedef rt_int32_t int32_t;
  9. typedef rt_uint32_t uint32_t;
  10. typedef long long int64_t;
  11. typedef unsigned long long uint64_t;
  12. /*
  13. * 7.18.2 Limits of specified-width integer types.
  14. *
  15. * The following object-like macros specify the minimum and maximum limits
  16. * of integer types corresponding to the typedef names defined above.
  17. */
  18. /* 7.18.2.1 Limits of exact-width integer types */
  19. #define INT8_MIN (-0x7f - 1)
  20. #define INT16_MIN (-0x7fff - 1)
  21. #define INT32_MIN (-0x7fffffff - 1)
  22. #define INT8_MAX 0x7f
  23. #define INT16_MAX 0x7fff
  24. #define INT32_MAX 0x7fffffff
  25. #define UINT8_MAX 0xff
  26. #define UINT16_MAX 0xffff
  27. #define UINT32_MAX 0xffffffffU
  28. #ifndef __INT_MAX__
  29. #define __INT_MAX__ 2147483647
  30. #endif
  31. #define INT_MIN (-1 - INT_MAX)
  32. #define INT_MAX (__INT_MAX__)
  33. #define UINT_MAX (INT_MAX * 2U + 1U)
  34. #define LONG_MAX ((long)(~0UL>>1))
  35. #define LONG_MIN (-LONG_MAX - 1)
  36. #define ULONG_MAX (~0UL)
  37. #define SIZE_MAX ULONG_MAX
  38. #endif