Large reorganization of headers (WIP)

This commit is contained in:
Jeremy Soller
2018-08-26 08:11:35 -06:00
parent ff32c8cbbd
commit c20ce5ffed
261 changed files with 236 additions and 1672 deletions
+8
View File
@@ -0,0 +1,8 @@
sys_includes = ["stdint.h", "wchar.h"]
include_guard = "_INTTYPES_H"
trailer = "#include <bits/inttypes.h>"
language = "C"
style = "Type"
[enum]
prefix_with_name = true
+80
View File
@@ -0,0 +1,80 @@
use header::{ctype, stdlib};
use header::errno::*;
use platform;
use platform::types::*;
#[no_mangle]
pub extern "C" fn imaxabs(i: intmax_t) -> intmax_t {
i.abs()
}
#[no_mangle]
#[repr(C)]
pub struct intmaxdiv_t {
quot: intmax_t,
rem: intmax_t,
}
#[no_mangle]
pub extern "C" fn imaxdiv(i: intmax_t, j: intmax_t) -> intmaxdiv_t {
intmaxdiv_t {
quot: i / j,
rem: i % j,
}
}
#[no_mangle]
pub unsafe extern "C" fn strtoimax(
s: *const c_char,
endptr: *mut *mut c_char,
base: c_int,
) -> intmax_t {
use stdlib::*;
strto_impl!(
intmax_t,
false,
intmax_t::max_value(),
intmax_t::min_value(),
s,
endptr,
base
)
}
#[no_mangle]
pub unsafe extern "C" fn strtoumax(
s: *const c_char,
endptr: *mut *mut c_char,
base: c_int,
) -> uintmax_t {
use stdlib::*;
strto_impl!(
uintmax_t,
false,
uintmax_t::max_value(),
uintmax_t::min_value(),
s,
endptr,
base
)
}
#[allow(unused)]
// #[no_mangle]
pub extern "C" fn wcstoimax(
nptr: *const wchar_t,
endptr: *mut *mut wchar_t,
base: c_int,
) -> intmax_t {
unimplemented!();
}
#[allow(unused)]
// #[no_mangle]
pub extern "C" fn wcstoumax(
nptr: *const wchar_t,
endptr: *mut *mut wchar_t,
base: c_int,
) -> uintmax_t {
unimplemented!();
}