Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
45
third-party/vendor/objc-sys/src/image_info.rs
vendored
Normal file
45
third-party/vendor/objc-sys/src/image_info.rs
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#[repr(C)]
|
||||
#[doc(hidden)] // Private for now
|
||||
pub struct __ImageInfo {
|
||||
// These are not actually `unsigned int`, even though the docs say so
|
||||
/// The version of the image info struct.
|
||||
version: u32,
|
||||
flags: u32,
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
impl __ImageInfo {
|
||||
/// Unused
|
||||
const FIX_AND_CONTINUE: u32 = 1 << 0;
|
||||
const SUPPORTS_GARBAGE_COLLECTED: u32 = 1 << 1;
|
||||
const REQUIRES_GARBAGE_COLLECTION: u32 = 1 << 2;
|
||||
const OPTIMIZED_BY_DYLD: u32 = 1 << 3; // TODO
|
||||
/// Unused
|
||||
const CORRECTED_SYNTHESIZE: u32 = 1 << 4;
|
||||
/// Whether we're compiling this to run on a simulator.
|
||||
const IMAGE_IS_SIMULATED: u32 = 1 << 5;
|
||||
/// Whether we are generating class properties.
|
||||
const CLASS_PROPERTIES: u32 = 1 << 6;
|
||||
const DYLD_PREOPTIMIZED: u32 = 1 << 7;
|
||||
|
||||
const SWIFT_ABI_VERSION_SHIFT: u32 = 8;
|
||||
const SWIFT_ABI_VERSION_MASK: u32 = 0xff << Self::SWIFT_ABI_VERSION_SHIFT;
|
||||
const SWIFT_MINOR_VERSION_SHIFT: u32 = 16;
|
||||
const SWIFT_MINOR_VERSION_MASK: u32 = 0xff << Self::SWIFT_MINOR_VERSION_SHIFT;
|
||||
const SWIFT_MAJOR_VERSION_SHIFT: u32 = 24;
|
||||
const SWIFT_MAJOR_VERSION_MASK: u32 = 0xff << Self::SWIFT_MAJOR_VERSION_SHIFT;
|
||||
|
||||
/// Fetches the image info for the current runtime + target combination
|
||||
#[inline]
|
||||
pub const fn system() -> Self {
|
||||
// We don't currently do anything relating to class properties, but
|
||||
// let's just mimic what Clang does!
|
||||
let mut flags = Self::CLASS_PROPERTIES;
|
||||
|
||||
if cfg!(target_simulator) {
|
||||
flags |= Self::IMAGE_IS_SIMULATED;
|
||||
}
|
||||
|
||||
Self { version: 0, flags }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue