types.rs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 = i16;
  41. pub type wint_t = i32;
  42. pub type off_t = c_long;
  43. pub type mode_t = u16;
  44. pub type time_t = i64;
  45. pub type pid_t = usize;
  46. pub type gid_t = usize;
  47. pub type uid_t = usize;
  48. pub type useconds_t = i32;
  49. pub type suseconds_t = i64;