Advertisement
Shiny_

2

Nov 11th, 2023 (edited)
836
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 2.51 KB | None | 0 0
  1. #[cfg(feature = "stdint_h")]
  2. use std::os::raw::{c_short, c_int, c_long, c_longlong};
  3.  
  4. #[cfg(feature = "inttypes_h")]
  5. use std::os::raw::{c_ushort, c_uint, c_ulong, c_ulonglong};
  6.  
  7. #[cfg(not(any(feature = "stdint_h", feature = "inttypes_h")))]
  8. #[cfg(not(feature = "mach"))]
  9. #[cfg(not(feature = "freebsd"))]
  10. #[cfg(not(feature = "sn_target_ps2"))]
  11. #[cfg(not(any(feature = "win32", feature = "gnu")))]
  12. mod types {
  13.     pub type int16_t = c_short;
  14.     pub type uint16_t = c_ushort;
  15.     pub type int32_t = c_int;
  16.     pub type uint32_t = c_uint;
  17.     pub type int64_t = c_longlong;
  18.     pub type uint64_t = c_ulonglong;
  19. }
  20.  
  21. #[cfg(feature = "mach")]
  22. mod types {
  23.     pub type uint16_t = u16;
  24.     pub type uint32_t = u32;
  25. }
  26.  
  27. #[cfg(feature = "freebsd")]
  28. use std::os::raw::{int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t};
  29.  
  30. #[cfg(feature = "sn_target_ps2")]
  31. use std::os::raw::{int16_t, uint16_t, int32_t, uint32_t};
  32.  
  33. #[cfg(any(feature = "win32", feature = "gnu"))]
  34. use std::os::raw::{int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t};
  35.  
  36. #[cfg(feature = "stdint_h")]
  37. pub type int16_t = c_short;
  38. #[cfg(feature = "stdint_h")]
  39. pub type uint16_t = c_ushort;
  40. #[cfg(feature = "stdint_h")]
  41. pub type int32_t = c_int;
  42. #[cfg(feature = "stdint_h")]
  43. pub type uint32_t = c_uint;
  44. #[cfg(feature = "stdint_h")]
  45. pub type int64_t = c_longlong;
  46. #[cfg(feature = "stdint_h")]
  47. pub type uint64_t = c_ulonglong;
  48.  
  49. #[cfg(feature = "inttypes_h")]
  50. pub type int16_t = c_short;
  51. #[cfg(feature = "inttypes_h")]
  52. pub type uint16_t = c_ushort;
  53. #[cfg(feature = "inttypes_h")]
  54. pub type int32_t = c_int;
  55. #[cfg(feature = "inttypes_h")]
  56. pub type uint32_t = c_uint;
  57. #[cfg(feature = "inttypes_h")]
  58. pub type int64_t = c_longlong;
  59. #[cfg(feature = "inttypes_h")]
  60. pub type uint64_t = c_ulonglong;
  61.  
  62. #[cfg(feature = "mach")]
  63. pub type uint16_t = u16;
  64. #[cfg(feature = "mach")]
  65. pub type uint32_t = u32;
  66.  
  67. #[cfg(feature = "win32")]
  68. pub type int64_t = c_longlong;
  69. #[cfg(feature = "win32")]
  70. pub type uint64_t = c_ulonglong;
  71.  
  72. #[cfg(feature = "gnu")]
  73. pub type int64_t = c_longlong;
  74. #[cfg(feature = "gnu")]
  75. pub type uint64_t = c_ulonglong;
  76.  
  77. #[cfg(any(feature = "stdint_h", feature = "inttypes_h"))]
  78. pub const HAVE_STDINT_H: bool = true;
  79. #[cfg(not(any(feature = "stdint_h", feature = "inttypes_h")))]
  80. pub const HAVE_STDINT_H: bool = false;
  81.  
  82. #[cfg(any(feature = "win64", feature = "lp64"))]
  83. #[cfg(not(feature = "__64BIT__"))]
  84. pub const __64BIT__: bool = true;
  85. #[cfg(not(any(feature = "win64", feature = "lp64")))]
  86. pub const __64BIT__: bool = false;
  87.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement