| ... | @@ -133,7 +133,11 @@ pub const MACH = struct { | ... | @@ -133,7 +133,11 @@ pub const MACH = struct { |
| 133 | /// Send 64-bit code and subcode in the exception header */ | 133 | /// Send 64-bit code and subcode in the exception header */ |
| 134 | CODES: bool = false, | 134 | CODES: bool = false, |
| 135 | | 135 | |
| 136 | pub const MASK = @compileError("use MACH.EXCEPTION and set/check all named fields"); | 136 | pub const MASK: exception_mask_t = @bitCast(MACH.EXCEPTION{ |
| | 137 | .BACKTRACE_PREFERRED = true, |
| | 138 | .ERRORS = true, |
| | 139 | .CODES = true, |
| | 140 | }); |
| 137 | }; | 141 | }; |
| 138 | | 142 | |
| 139 | pub const MSG = packed struct(kern_return_t) { | 143 | pub const MSG = packed struct(kern_return_t) { |
| ... | @@ -155,16 +159,16 @@ pub const MACH = struct { | ... | @@ -155,16 +159,16 @@ pub const MACH = struct { |
| 155 | .IPC_SPACE = true, | 159 | .IPC_SPACE = true, |
| 156 | }); | 160 | }); |
| 157 | | 161 | |
| 158 | pub const TIMEOUT_NONE = @compileError("use mach_msg_timeout_t.NONE"); | 162 | pub const TIMEOUT_NONE: mach_msg_timeout_t = .NONE; |
| 159 | pub const OPTION_NONE = @compileError("use MACH.RCV and/or MACH.SEND with their default values"); | 163 | pub const OPTION_NONE: mach_msg_option_t = .NONE; |
| 160 | pub const STRICT_REPLY = @compileError("use MACH.RCV.STRICT_REPLY and/or MACH.SEND.STRICT_REPLY"); | 164 | pub const STRICT_REPLY = @compileError("use MACH.RCV.STRICT_REPLY and/or MACH.SEND.STRICT_REPLY"); |
| 161 | | 165 | |
| 162 | pub const TYPE = @compileError("use mach_msg_type_name_t members"); | 166 | pub const TYPE = mach_msg_type_name_t; |
| 163 | }; | 167 | }; |
| 164 | | 168 | |
| 165 | pub const PORT = struct { | 169 | pub const PORT = struct { |
| 166 | pub const NULL: mach_port_t = 0; | 170 | pub const NULL: mach_port_t = 0; |
| 167 | pub const RIGHT = @compileError("use mach_port_right_t members"); | 171 | pub const RIGHT = mach_port_right_t; |
| 168 | }; | 172 | }; |
| 169 | | 173 | |
| 170 | pub const RCV = packed struct(integer_t) { | 174 | pub const RCV = packed struct(integer_t) { |
| ... | @@ -222,8 +226,8 @@ pub const MACH = struct { | ... | @@ -222,8 +226,8 @@ pub const MACH = struct { |
| 222 | }; | 226 | }; |
| 223 | }; | 227 | }; |
| 224 | | 228 | |
| 225 | pub const MACH_MSG_TYPE = @compileError("use use mach_msg_type_name_t members"); | 229 | pub const MACH_MSG_TYPE = @compileError("use MACH.MSG.TYPE"); |
| 226 | pub const MACH_PORT_RIGHT = @compileError("use mach_port_right_t members"); | 230 | pub const MACH_PORT_RIGHT = @compileError("use MACH.PORT.RIGHT"); |
| 227 | pub const MACH_TASK_BASIC_INFO = @compileError("use MACH.TASK.BASIC.INFO"); | 231 | pub const MACH_TASK_BASIC_INFO = @compileError("use MACH.TASK.BASIC.INFO"); |
| 228 | pub const MACH_TASK_BASIC_INFO_COUNT = @compileError("use MACH.TASK.BASIC.INFO_COUNT"); | 232 | pub const MACH_TASK_BASIC_INFO_COUNT = @compileError("use MACH.TASK.BASIC.INFO_COUNT"); |
| 229 | | 233 | |
| ... | @@ -522,6 +526,8 @@ pub const mach_msg_option_t = packed union { | ... | @@ -522,6 +526,8 @@ pub const mach_msg_option_t = packed union { |
| 522 | RCV: MACH.RCV, | 526 | RCV: MACH.RCV, |
| 523 | SEND: MACH.SEND, | 527 | SEND: MACH.SEND, |
| 524 | | 528 | |
| | 529 | pub const NONE: mach_msg_option_t = @bitCast(@as(integer_t, 0)); |
| | 530 | |
| 525 | pub fn sendAndRcv(send: MACH.SEND, rcv: MACH.RCV) mach_msg_option_t { | 531 | pub fn sendAndRcv(send: MACH.SEND, rcv: MACH.RCV) mach_msg_option_t { |
| 526 | return @bitCast(@as(integer_t, @bitCast(send)) | @as(integer_t, @bitCast(rcv))); | 532 | return @bitCast(@as(integer_t, @bitCast(send)) | @as(integer_t, @bitCast(rcv))); |
| 527 | } | 533 | } |