Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: migrate from mach to mach2 #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ build = "build.rs"

[dependencies]
libc = "0.2"
mach = "0.1.1"
mach2 = "0.4"
CoreFoundation-sys = "0.1.4"
6 changes: 3 additions & 3 deletions examples/list_serial_ports.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate IOKit_sys;
extern crate CoreFoundation_sys as cf;
extern crate libc;
extern crate mach;
extern crate mach2;

use std::mem;
use std::ptr;
Expand All @@ -10,8 +10,8 @@ use std::ffi::{CString,CStr};

use libc::{c_char,c_void};

use mach::port::{mach_port_t,MACH_PORT_NULL};
use mach::kern_return::KERN_SUCCESS;
use mach2::port::{mach_port_t,MACH_PORT_NULL};
use mach2::kern_return::KERN_SUCCESS;

use IOKit_sys::*;
use cf::*;
Expand Down
2 changes: 1 addition & 1 deletion src/io_return.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// exports from <IOKit/IOReturn.h>

use mach::kern_return::{kern_return_t,KERN_SUCCESS};
use mach2::kern_return::{kern_return_t,KERN_SUCCESS};

pub type IOReturn = kern_return_t;

Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ extern crate mach;
use cf::{CFTypeRef,CFDictionaryRef,CFMutableDictionaryRef,CFStringRef,CFAllocatorRef};
use libc::{c_void,c_char,c_int,size_t,uintptr_t};

use mach::boolean::boolean_t;
use mach::clock_types::mach_timespec_t;
use mach::kern_return::kern_return_t;
use mach::port::mach_port_t;
use mach::types::task_port_t;
use mach::vm_types::{mach_vm_address_t,mach_vm_size_t};
use mach2::boolean::boolean_t;
use mach2::clock_types::mach_timespec_t;
use mach2::kern_return::kern_return_t;
use mach2::port::mach_port_t;
use mach2::types::task_port_t;
use mach2::vm_types::{mach_vm_address_t,mach_vm_size_t};

pub use io_return::*;
pub use keys::*;
Expand Down
6 changes: 3 additions & 3 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

use libc::{c_char,c_int,c_uint};

use mach::port::mach_port_t;
use mach::vm_types::mach_vm_address_t;
use mach2::port::mach_port_t;
use mach2::vm_types::mach_vm_address_t;

#[cfg(target_pointer_width = "32")]
use mach::vm_types::{mach_vm_size_t, vm_address_t};
use mach2::vm_types::{mach_vm_size_t, vm_address_t};

pub type IOOptionBits = u32;
pub type IOFixed = i32;
Expand Down