diff options
| author | Fenrir <[email protected]> | 2016-09-05 13:47:25 -0700 |
|---|---|---|
| committer | Fenrir <[email protected]> | 2016-10-06 02:10:10 -0700 |
| commit | c7e709ffa41465779d9af727e061d1ab9fe916a9 (patch) | |
| tree | 631acc505e2a98029f448a518528085e1f2b8788 /ctru-sys/src | |
| parent | Add error module from libstd (diff) | |
| download | archived-ctru-rs-c7e709ffa41465779d9af727e061d1ab9fe916a9.tar.xz archived-ctru-rs-c7e709ffa41465779d9af727e061d1ab9fe916a9.zip | |
ctru-sys: add proper libc typedefs
Diffstat (limited to 'ctru-sys/src')
| -rw-r--r-- | ctru-sys/src/sys/libc.rs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/ctru-sys/src/sys/libc.rs b/ctru-sys/src/sys/libc.rs index b4d4a12..997744d 100644 --- a/ctru-sys/src/sys/libc.rs +++ b/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)] pub enum c_void { @@ -6,7 +6,23 @@ pub enum c_void { __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" { - pub fn abort() -> !; - pub fn write(fd: i32, buf: *const c_void, count: usize) -> isize; + pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t; + 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; } |