diff --git a/libc-test/build.rs b/libc-test/build.rs index 84e0999639924..24a6fdab26e81 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -202,14 +202,6 @@ fn test_apple(target: &str) { "libproc.h", "limits.h", "locale.h", - "mach-o/dyld.h", - "mach/mach_init.h", - "mach/mach.h", - "mach/mach_time.h", - "mach/mach_types.h", - "mach/mach_vm.h", - "mach/thread_act.h", - "mach/thread_policy.h", "malloc/malloc.h", "net/bpf.h", "net/dlil.h", @@ -319,10 +311,6 @@ fn test_apple(target: &str) { }); cfg.skip_const(move |name| { - // They're declared via `deprecated_mach` and we don't support it anymore. - if name.starts_with("VM_FLAGS_") { - return true; - } match name { // These OSX constants are removed in Sierra. // https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOS10_12/Swift/Darwin.html diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index e33b84e746769..da5e2c77caa74 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -1353,9 +1353,6 @@ STA_RONLY STA_UNSYNC ST_NOSUID ST_RDONLY -SUPERPAGE_NONE -SUPERPAGE_SIZE_2MB -SUPERPAGE_SIZE_ANY SYSPROTO_CONTROL SYSPROTO_EVENT S_IEXEC @@ -1516,95 +1513,10 @@ UTUN_OPT_IFNAME VDISCARD VDSUSP VLNEXT -VM_FLAGS_ALIAS_MASK -VM_FLAGS_ANYWHERE -VM_FLAGS_FIXED -VM_FLAGS_NO_CACHE -VM_FLAGS_OVERWRITE -VM_FLAGS_PURGABLE -VM_FLAGS_RANDOM_ADDR -VM_FLAGS_RESILIENT_CODESIGN -VM_FLAGS_RESILIENT_MEDIA -VM_FLAGS_RETURN_4K_DATA_ADDR -VM_FLAGS_RETURN_DATA_ADDR -VM_FLAGS_SUPERPAGE_MASK -VM_FLAGS_SUPERPAGE_NONE -VM_FLAGS_SUPERPAGE_SHIFT -VM_FLAGS_SUPERPAGE_SIZE_2MB -VM_FLAGS_SUPERPAGE_SIZE_ANY -VM_FLAGS_USER_ALLOCATE -VM_FLAGS_USER_MAP -VM_FLAGS_USER_REMAP VM_LOADAVG VM_MACHFACTOR VM_MAKE_TAG VM_MAXID -VM_MEMORY_ACCELERATE -VM_MEMORY_ANALYSIS_TOOL -VM_MEMORY_APPKIT -VM_MEMORY_APPLICATION_SPECIFIC_1 -VM_MEMORY_APPLICATION_SPECIFIC_16 -VM_MEMORY_ASL -VM_MEMORY_ASSETSD -VM_MEMORY_ATS -VM_MEMORY_CARBON -VM_MEMORY_CGIMAGE -VM_MEMORY_COREDATA -VM_MEMORY_COREDATA_OBJECTIDS -VM_MEMORY_COREGRAPHICS -VM_MEMORY_COREGRAPHICS_BACKINGSTORES -VM_MEMORY_COREGRAPHICS_DATA -VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS -VM_MEMORY_COREGRAPHICS_MISC -VM_MEMORY_COREGRAPHICS_SHARED -VM_MEMORY_COREGRAPHICS_XALLOC -VM_MEMORY_COREIMAGE -VM_MEMORY_COREPROFILE -VM_MEMORY_CORESERVICES -VM_MEMORY_COREUI -VM_MEMORY_COREUIFILE -VM_MEMORY_CORPSEINFO -VM_MEMORY_DHMM -VM_MEMORY_DYLD -VM_MEMORY_DYLD_MALLOC -VM_MEMORY_DYLIB -VM_MEMORY_FOUNDATION -VM_MEMORY_GENEALOGY -VM_MEMORY_GLSL -VM_MEMORY_GUARD -VM_MEMORY_IMAGEIO -VM_MEMORY_IOKIT -VM_MEMORY_JAVA -VM_MEMORY_JAVASCRIPT_CORE -VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR -VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE -VM_MEMORY_LAYERKIT -VM_MEMORY_LIBDISPATCH -VM_MEMORY_MACH_MSG -VM_MEMORY_MALLOC -VM_MEMORY_MALLOC_HUGE -VM_MEMORY_MALLOC_LARGE -VM_MEMORY_MALLOC_LARGE_REUSABLE -VM_MEMORY_MALLOC_LARGE_REUSED -VM_MEMORY_MALLOC_NANO -VM_MEMORY_MALLOC_SMALL -VM_MEMORY_MALLOC_TINY -VM_MEMORY_OBJC_DISPATCHERS -VM_MEMORY_OPENCL -VM_MEMORY_OS_ALLOC_ONCE -VM_MEMORY_RAWCAMERA -VM_MEMORY_REALLOC -VM_MEMORY_SBRK -VM_MEMORY_SCENEKIT -VM_MEMORY_SHARED_PMAP -VM_MEMORY_SKYWALK -VM_MEMORY_SQLITE -VM_MEMORY_STACK -VM_MEMORY_SWIFT_METADATA -VM_MEMORY_SWIFT_RUNTIME -VM_MEMORY_TCMALLOC -VM_MEMORY_UNSHARED_PMAP -VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS VM_METER VM_PROT_EXECUTE VM_PROT_NONE @@ -1685,7 +1597,6 @@ _IOFBF _IOLBF _IONBF _NSGetEnviron -_NSGetExecutablePath _POSIX_VDISABLE _PTHREAD_COND_SIG_init _PTHREAD_MUTEX_SIG_init @@ -1820,10 +1731,6 @@ __PTHREAD_RWLOCKATTR_SIZE__ __PTHREAD_RWLOCK_SIZE__ __darwin_mcontext64 __error -_dyld_get_image_header -_dyld_get_image_name -_dyld_get_image_vmaddr_slide -_dyld_image_count abs acct aio_cancel @@ -1985,18 +1892,6 @@ lockf log2phys login_tty lutimes -mach_absolute_time -mach_header -mach_header_64 -mach_host_self -mach_port_t -mach_thread_self -mach_timebase_info -mach_timebase_info_data_t -mach_vm_address_t -mach_vm_map -mach_vm_offset_t -mach_vm_size_t madvise malloc_default_zone malloc_good_size @@ -2121,8 +2016,6 @@ pthread_cancel pthread_condattr_getpshared pthread_condattr_setpshared pthread_cpu_number_np -pthread_create_from_mach_thread -pthread_from_mach_thread_np pthread_get_stackaddr_np pthread_get_stacksize_np pthread_getname_np diff --git a/src/macros.rs b/src/macros.rs index 8119ae5fad05d..aa08505239c58 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -251,40 +251,6 @@ macro_rules! __item { }; } -// This macro is used to deprecate items that should be accessed via the mach2 crate -macro_rules! deprecated_mach { - (pub const $id:ident: $ty:ty = $expr:expr;) => { - #[deprecated( - since = "0.2.55", - note = "Use the `mach2` crate instead", - )] - #[allow(deprecated)] - pub const $id: $ty = $expr; - }; - ($(pub const $id:ident: $ty:ty = $expr:expr;)*) => { - $( - deprecated_mach!( - pub const $id: $ty = $expr; - ); - )* - }; - (pub type $id:ident = $ty:ty;) => { - #[deprecated( - since = "0.2.55", - note = "Use the `mach2` crate instead", - )] - #[allow(deprecated)] - pub type $id = $ty; - }; - ($(pub type $id:ident = $ty:ty;)*) => { - $( - deprecated_mach!( - pub type $id = $ty; - ); - )* - } -} - macro_rules! ptr_addr_of { ($place:expr) => { ::core::ptr::addr_of!($place) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index b475c4b6797fb..5cad5d320e472 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -159,10 +159,6 @@ pub type copyfile_callback_t = ::Option< pub type attrgroup_t = u32; pub type vol_capabilities_set_t = [u32; 4]; -deprecated_mach! { - pub type mach_timebase_info_data_t = mach_timebase_info; -} - #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} impl ::Copy for timezone {} @@ -295,15 +291,6 @@ s! { pub ai_next: *mut addrinfo, } - #[deprecated( - since = "0.2.55", - note = "Use the `mach2` crate instead", - )] - pub struct mach_timebase_info { - pub numer: u32, - pub denom: u32, - } - pub struct stat { pub st_dev: dev_t, pub st_mode: mode_t, @@ -656,35 +643,6 @@ s! { pub cr_groups: [::gid_t;16] } - #[deprecated( - since = "0.2.55", - note = "Use the `mach2` crate instead", - )] - pub struct mach_header { - pub magic: u32, - pub cputype: cpu_type_t, - pub cpusubtype: cpu_subtype_t, - pub filetype: u32, - pub ncmds: u32, - pub sizeofcmds: u32, - pub flags: u32, - } - - #[deprecated( - since = "0.2.55", - note = "Use the `mach2` crate instead", - )] - pub struct mach_header_64 { - pub magic: u32, - pub cputype: cpu_type_t, - pub cpusubtype: cpu_subtype_t, - pub filetype: u32, - pub ncmds: u32, - pub sizeofcmds: u32, - pub flags: u32, - pub reserved: u32, - } - pub struct segment_command { pub cmd: u32, pub cmdsize: u32, @@ -3303,107 +3261,6 @@ pub const PROCESSOR_TEMPERATURE: ::c_int = 0x10000002; pub const PROCESSOR_SET_LOAD_INFO: ::c_int = 4; pub const PROCESSOR_SET_BASIC_INFO: ::c_int = 5; -deprecated_mach! { - pub const VM_FLAGS_FIXED: ::c_int = 0x0000; - pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001; - pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002; - pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008; - pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010; - pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020; - pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040; - pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000; - pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000; - pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000; - pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000; - pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000; - pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401f; - pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401f; - pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | - VM_FLAGS_ANYWHERE | - VM_FLAGS_RANDOM_ADDR | - VM_FLAGS_OVERWRITE | - VM_FLAGS_RETURN_DATA_ADDR | - VM_FLAGS_RESILIENT_CODESIGN; - - pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16; - pub const SUPERPAGE_NONE: ::c_int = 0; - pub const SUPERPAGE_SIZE_ANY: ::c_int = 1; - pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE << - VM_FLAGS_SUPERPAGE_SHIFT; - pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY << - VM_FLAGS_SUPERPAGE_SHIFT; - pub const SUPERPAGE_SIZE_2MB: ::c_int = 2; - pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB << - VM_FLAGS_SUPERPAGE_SHIFT; - - pub const VM_MEMORY_MALLOC: ::c_int = 1; - pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2; - pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3; - pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4; - pub const VM_MEMORY_SBRK: ::c_int = 5; - pub const VM_MEMORY_REALLOC: ::c_int = 6; - pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7; - pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8; - pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9; - pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10; - pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11; - pub const VM_MEMORY_MACH_MSG: ::c_int = 20; - pub const VM_MEMORY_IOKIT: ::c_int = 21; - pub const VM_MEMORY_STACK: ::c_int = 30; - pub const VM_MEMORY_GUARD: ::c_int = 31; - pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32; - pub const VM_MEMORY_DYLIB: ::c_int = 33; - pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34; - pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35; - pub const VM_MEMORY_APPKIT: ::c_int = 40; - pub const VM_MEMORY_FOUNDATION: ::c_int = 41; - pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42; - pub const VM_MEMORY_CORESERVICES: ::c_int = 43; - pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES; - pub const VM_MEMORY_JAVA: ::c_int = 44; - pub const VM_MEMORY_COREDATA: ::c_int = 45; - pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46; - pub const VM_MEMORY_ATS: ::c_int = 50; - pub const VM_MEMORY_LAYERKIT: ::c_int = 51; - pub const VM_MEMORY_CGIMAGE: ::c_int = 52; - pub const VM_MEMORY_TCMALLOC: ::c_int = 53; - pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54; - pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55; - pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56; - pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57; - pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58; - pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS; - pub const VM_MEMORY_DYLD: ::c_int = 60; - pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61; - pub const VM_MEMORY_SQLITE: ::c_int = 62; - pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63; - pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64; - pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65; - pub const VM_MEMORY_GLSL: ::c_int = 66; - pub const VM_MEMORY_OPENCL: ::c_int = 67; - pub const VM_MEMORY_COREIMAGE: ::c_int = 68; - pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69; - pub const VM_MEMORY_IMAGEIO: ::c_int = 70; - pub const VM_MEMORY_COREPROFILE: ::c_int = 71; - pub const VM_MEMORY_ASSETSD: ::c_int = 72; - pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73; - pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74; - pub const VM_MEMORY_ACCELERATE: ::c_int = 75; - pub const VM_MEMORY_COREUI: ::c_int = 76; - pub const VM_MEMORY_COREUIFILE: ::c_int = 77; - pub const VM_MEMORY_GENEALOGY: ::c_int = 78; - pub const VM_MEMORY_RAWCAMERA: ::c_int = 79; - pub const VM_MEMORY_CORPSEINFO: ::c_int = 80; - pub const VM_MEMORY_ASL: ::c_int = 81; - pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82; - pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83; - pub const VM_MEMORY_DHMM: ::c_int = 84; - pub const VM_MEMORY_SCENEKIT: ::c_int = 86; - pub const VM_MEMORY_SKYWALK: ::c_int = 87; - pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240; - pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255; -} - pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; pub const MCL_CURRENT: ::c_int = 0x0001; @@ -5649,13 +5506,6 @@ extern "C" { newp: *mut ::c_void, newlen: ::size_t, ) -> ::c_int; - #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] - pub fn mach_absolute_time() -> u64; - #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] - #[allow(deprecated)] - pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int; - pub fn mach_host_self() -> mach_port_t; - pub fn mach_thread_self() -> mach_port_t; pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int; pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int; pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t; @@ -5971,15 +5821,6 @@ extern "C" { pub fn brk(addr: *const ::c_void) -> *mut ::c_void; pub fn sbrk(increment: ::c_int) -> *mut ::c_void; pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int; - #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] - pub fn _dyld_image_count() -> u32; - #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] - #[allow(deprecated)] - pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header; - #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] - pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t; - #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] - pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char; pub fn posix_spawn( pid: *mut ::pid_t, @@ -6243,23 +6084,8 @@ extern "C" { pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus; pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; - pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int; pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char; - pub fn mach_vm_map( - target_task: ::vm_map_t, - address: *mut ::mach_vm_address_t, - size: ::mach_vm_size_t, - mask: ::mach_vm_offset_t, - flags: ::c_int, - object: ::mem_entry_name_port_t, - offset: ::memory_object_offset_t, - copy: ::boolean_t, - cur_protection: ::vm_prot_t, - max_protection: ::vm_prot_t, - inheritance: ::vm_inherit_t, - ) -> ::kern_return_t; - pub fn vm_allocate( target_task: vm_map_t, address: *mut vm_address_t,