types.rs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help enable
  2. // more optimization opportunities around it recognizing things like
  3. // malloc/free.
  4. #[repr(u8)]
  5. pub enum c_void {
  6. // Two dummy variants so the #[repr] attribute can be used.
  7. #[doc(hidden)]
  8. __variant1,
  9. #[doc(hidden)]
  10. __variant2,
  11. }
  12. pub type int8_t = i8;
  13. pub type int16_t = i16;
  14. pub type int32_t = i32;
  15. pub type int64_t = i64;
  16. pub type uint8_t = u8;
  17. pub type uint16_t = u16;
  18. pub type uint32_t = u32;
  19. pub type uint64_t = u64;
  20. pub type c_schar = i8;
  21. pub type c_uchar = u8;
  22. pub type c_short = i16;
  23. pub type c_ushort = u16;
  24. pub type c_int = i32;
  25. pub type c_uint = u32;
  26. pub type c_float = f32;
  27. pub type c_double = f64;
  28. pub type c_longlong = i64;
  29. pub type c_ulonglong = u64;
  30. pub type intmax_t = i64;
  31. pub type uintmax_t = u64;
  32. pub type size_t = usize;
  33. pub type ptrdiff_t = isize;
  34. pub type intptr_t = isize;
  35. pub type uintptr_t = usize;
  36. pub type ssize_t = isize;
  37. pub type c_char = i8;
  38. pub type c_long = i64;
  39. pub type c_ulong = u64;
  40. pub type wchar_t = i32;
  41. pub type wint_t = u32;
  42. pub type wctype_t = i64;
  43. pub type off_t = c_long;
  44. pub type mode_t = c_int;
  45. pub type time_t = c_long;
  46. pub type pid_t = c_int;
  47. pub type id_t = c_uint;
  48. pub type gid_t = c_int;
  49. pub type uid_t = c_int;
  50. pub type dev_t = c_long;
  51. pub type ino_t = c_ulong;
  52. pub type nlink_t = c_ulong;
  53. pub type blksize_t = c_long;
  54. pub type blkcnt_t = c_ulong;
  55. pub type useconds_t = c_uint;
  56. pub type suseconds_t = c_int;
  57. pub type clock_t = c_long;
  58. pub type clockid_t = c_int;
  59. pub type timer_t = *mut c_void;