Skip to content

Commit cdeb1d5

Browse files
authored
Merge pull request #59 from JohnTitor/feat/test-cleanup
2 parents c620d2a + a939b8f commit cdeb1d5

File tree

3 files changed

+5
-52
lines changed

3 files changed

+5
-52
lines changed

mach-test/build.rs

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -129,44 +129,19 @@ fn main() {
129129
.header("mach/vm_task.h")
130130
.header("mach/vm_types.h");
131131

132-
// The below doesn't exist in Xcode 14:
133-
if xcode < Xcode(14, 0) {
134-
cfg.header("mach/lock_set.h");
135-
}
136-
137132
cfg.skip_struct(move |s| {
138133
match s.ident() {
139-
// TODO: this type is a bitfield and must be verified by hand
140-
"mach_msg_type_descriptor_t" |
141-
142-
// TODO: this type is a bitfield and must be verified by hand
143-
"mach_msg_port_descriptor_t" |
144-
145-
// TODO: this type is a bitfield and must be verified by hand
146-
"mach_msg_ool_descriptor_t" |
147-
148-
// TODO: this type is a bitfield and must be verified by hand
149-
"mach_msg_ool_ports_descriptor_t" |
150-
151-
// FIXME: this type is not exposed in /usr/include/mach
152-
// but seems to be exposed in
153-
// SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach
154-
"ipc_port" => true,
155-
156-
// FIXME: Changed in XCode 11, figure out what's changed.
157-
"vm_region_submap_info_64" if xcode >= Xcode(11, 0) => true,
158-
134+
// TODO: these types are bitfields and must be verified by hand
135+
"mach_msg_type_descriptor_t"
136+
| "mach_msg_port_descriptor_t"
137+
| "mach_msg_ool_descriptor_t"
138+
| "mach_msg_ool_ports_descriptor_t" => true,
159139
_ => false,
160140
}
161141
});
162142

163143
cfg.skip_alias(move |s| {
164144
match s.ident() {
165-
// FIXME: this type is not exposed in /usr/include/mach
166-
// but seems to be exposed in
167-
// SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach
168-
"ipc_port_t" => true,
169-
170145
// FIXME: Changed in XCode 11, see `vm_region_submap_info_data_64`'s comment.
171146
"vm_region_submap_info_data_64_t" if xcode >= Xcode(11, 0) => true,
172147

@@ -178,10 +153,6 @@ fn main() {
178153
});
179154

180155
cfg.skip_fn(move |s| {
181-
// FIXME: The return type of these functions are different in Xcode 13 or higher.
182-
if s.ident().starts_with("semaphore") {
183-
return true;
184-
}
185156
match s.ident() {
186157
// mac_task_self and current_tasl are not functions, but macro that map to the
187158
// mask_task_self_ static variable:
@@ -192,16 +163,6 @@ fn main() {
192163
});
193164

194165
cfg.skip_const(move |s| match s.ident() {
195-
"MACH_RCV_NOTIFY" | "MACH_RCV_OVERWRITE" if xcode <= Xcode(11, 0) => true,
196-
197-
// FIXME: Somehow it fails, like:
198-
// bad VM_PROT_NO_CHANGE value at byte 0: rust: 8 (0x8) != c 0 (0x0)
199-
// bad VM_PROT_NO_CHANGE value at byte 3: rust: 0 (0x0) != c 1 (0x1)
200-
"VM_PROT_NO_CHANGE" if xcode >= Xcode(13, 0) => true,
201-
202-
// FIXME: Unavailable since Xcode 14:
203-
"EXC_CORPSE_VARIANT_BIT" if xcode >= Xcode(14, 0) => true,
204-
205166
_ => false,
206167
});
207168

@@ -210,7 +171,6 @@ fn main() {
210171
match c {
211172
// struct types:
212173
"mach_timespec_t" |
213-
"ipc_port_t" |
214174
"vm_statistics_data_t" |
215175
"fsid_t" |
216176
"fsobj_id_t" |

src/exception_types.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub const EXC_CRASH: c_uint = 10;
1818
pub const EXC_RESOURCE: c_uint = 11;
1919
pub const EXC_GUARD: c_uint = 12;
2020
pub const EXC_CORPSE_NOTIFY: c_uint = 13;
21-
pub const EXC_CORPSE_VARIANT_BIT: c_uint = 256;
2221
pub const EXCEPTION_DEFAULT: c_uint = 1;
2322
pub const EXCEPTION_STATE: c_uint = 2;
2423
pub const EXCEPTION_STATE_IDENTITY: c_uint = 3;

src/port.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ use core::ffi::c_uint;
55

66
pub type mach_port_name_t = natural_t;
77

8-
#[repr(C)]
9-
#[derive(Copy, Clone, Debug, Default, Hash, PartialOrd, PartialEq, Eq, Ord)]
10-
pub struct ipc_port;
11-
12-
pub type ipc_port_t = *mut ipc_port;
13-
148
pub type mach_port_t = c_uint;
159
pub type mach_port_array_t = *mut mach_port_t;
1610

0 commit comments

Comments
 (0)