Skip to content
Snippets Groups Projects
Verified Commit f29e6b00 authored by Dan Robertson's avatar Dan Robertson
Browse files

fenv: Add crate for fenv.h

Add a crate for building out stub functions and structures for the fenv
header.
parent ca7f3a00
No related branches found
No related tags found
No related merge requests found
...@@ -96,6 +96,15 @@ dependencies = [ ...@@ -96,6 +96,15 @@ dependencies = [
"platform 0.1.0", "platform 0.1.0",
] ]
[[package]]
name = "fenv"
version = "0.1.0"
dependencies = [
"cbindgen 0.5.0",
"platform 0.1.0",
"resource 0.1.0",
]
[[package]] [[package]]
name = "fuchsia-zircon" name = "fuchsia-zircon"
version = "0.3.3" version = "0.3.3"
...@@ -254,6 +263,7 @@ dependencies = [ ...@@ -254,6 +263,7 @@ dependencies = [
"ctype 0.1.0", "ctype 0.1.0",
"errno 0.1.0", "errno 0.1.0",
"fcntl 0.1.0", "fcntl 0.1.0",
"fenv 0.1.0",
"grp 0.1.0", "grp 0.1.0",
"mman 0.1.0", "mman 0.1.0",
"platform 0.1.0", "platform 0.1.0",
......
...@@ -15,6 +15,7 @@ compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-built ...@@ -15,6 +15,7 @@ compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-built
ctype = { path = "src/ctype" } ctype = { path = "src/ctype" }
errno = { path = "src/errno" } errno = { path = "src/errno" }
fcntl = { path = "src/fcntl" } fcntl = { path = "src/fcntl" }
fenv = { path = "src/fenv" }
grp = { path = "src/grp" } grp = { path = "src/grp" }
semaphore = { path = "src/semaphore" } semaphore = { path = "src/semaphore" }
mman = { path = "src/mman" } mman = { path = "src/mman" }
......
[package]
name = "fenv"
version = "0.1.0"
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
[build-dependencies]
cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }
extern crate cbindgen;
use std::{env, fs};
fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
fs::create_dir_all("../../target/include").expect("failed to create include directory");
cbindgen::generate(crate_dir)
.expect("failed to generate bindings")
.write_to_file("../../target/include/fenv.h");
}
sys_includes = ["sys/types.h"]
include_guard = "_FENV_H"
language = "C"
[enum]
prefix_with_name = true
//! fenv.h implementation for Redox, following
//! http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fenv.h.html
#![no_std]
extern crate platform;
use platform::types::*;
pub const FE_ALL_EXCEPT: c_int = 0;
pub const FE_TONEAREST: c_int = 0;
pub type fexcept_t = u64;
#[repr(C)]
pub struct fenv_t {
pub cw: u64,
}
pub unsafe extern "C" fn feclearexcept(excepts: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fegenenv(envp: *mut fenv_t) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fegetexceptflag(flagp: *mut fexcept_t, excepts: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fegetround() -> c_int {
FE_TONEAREST
}
pub unsafe extern "C" fn feholdexcept(envp: *mut fenv_t) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn feraiseexcept(except: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fesetenv(envp: *const fenv_t) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fesetexceptflag(flagp: *const fexcept_t, excepts: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fesetround(round: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fetestexcept(excepts: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn feupdateenv(envp: *const fenv_t) -> c_int {
unimplemented!();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment