Skip to content

Commit 2148802

Browse files
committed
Add IOKit methods that use task_port_t
1 parent 1b4230d commit 2148802

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

crates/header-translator/configs/libc.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ tvos = "9.0"
1313
watchos = "2.0"
1414
visionos = "1.0"
1515
gnustep = true
16+
17+
# HACK: Define `task_port_t` in the using crate (it's a simple alias to `task_t`).
18+
external.task_port_t.module = "__builtin__"

framework-crates/objc2-io-kit/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,8 @@ pub(crate) type io_struct_inband_t = *mut [core::ffi::c_char; 4096];
5353
// uuid/uuid_t.h
5454
#[allow(dead_code, non_camel_case_types)]
5555
pub(crate) type uuid_t = [u8; 16]; // Usage sites are all in structs
56+
57+
// mach/mach_types.h
58+
#[allow(dead_code, non_camel_case_types)]
59+
#[cfg(feature = "libc")]
60+
pub(crate) type task_port_t = libc::task_t;

framework-crates/objc2-io-kit/translation-config.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ typedef.OSAsyncReference64.skipped = true
4848
struct.OSNotificationHeader64.skipped = true
4949
struct.IOServiceInterestContent64.skipped = true
5050

51-
# Needs mach_msg_size_t/mach_msg_header_t/mach_timespec_t/task_port_t, which isn't exposed by libc
51+
# Needs mach_msg_size_t/mach_msg_header_t/mach_timespec_t, which isn't exposed by libc
5252
typedef.OSAsyncReference.skipped = true
5353
struct.OSNotificationHeader.skipped = true
5454
fn.IODispatchCalloutFromMessage.skipped = true
@@ -62,11 +62,6 @@ struct.IORPCMessageMach.skipped = true
6262
struct.IORPCMessageErrorReturn.skipped = true
6363
struct.IORPC.skipped = true
6464
fn.IORPCMessageFromMach.skipped = true
65-
fn.IOServiceOpen.skipped = true
66-
fn.IOConnectMapMemory.skipped = true
67-
fn.IOConnectMapMemory64.skipped = true
68-
fn.IOConnectUnmapMemory.skipped = true
69-
fn.IOConnectUnmapMemory64.skipped = true
7065

7166
# Needs libdispatch
7267
fn.IONotificationPortSetDispatchQueue.skipped = true
@@ -139,9 +134,6 @@ typedef._evGlobals.skipped = true
139134
const.IOSharedLockData.skipped = true
140135
const.ev_lock_data_t.skipped = true
141136

142-
# Needs `task_port_t` to be available in `libc`
143-
fn.IOFramebufferOpen.skipped = true
144-
145137
# Unknown ABI
146138
typedef.IOPixelEncoding.skipped = true
147139
struct.IOPixelInformation.skipped = true

generated

0 commit comments

Comments
 (0)