Browse Source

ctru-sys: add proper libc typedefs

pull/10/head
Fenrir 8 years ago
parent
commit
c7e709ffa4
  1. 22
      ctru-sys/src/sys/libc.rs

22
ctru-sys/src/sys/libc.rs

@ -1,4 +1,4 @@
pub const STDOUT_FILENO: i32 = 1; pub const STDOUT_FILENO: c_int = 1;
#[repr(u8)] #[repr(u8)]
pub enum c_void { pub enum c_void {
@ -6,7 +6,23 @@ pub enum c_void {
__variant2, __variant2,
} }
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_char = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type size_t = usize;
pub type ssize_t = isize;
extern "C" { extern "C" {
pub fn abort() -> !; pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
pub fn write(fd: i32, buf: *const c_void, count: usize) -> isize; pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
} }

Loading…
Cancel
Save