From d6a7942ec457872e701cf9830362b0a07e9072d4 Mon Sep 17 00:00:00 2001 From: Tom Almeida Date: Wed, 14 Mar 2018 01:01:23 +0800 Subject: [PATCH 1/7] Change the type of byteset from [u8] to [usize] in strcspn and strspn. Hopefully this is the last bug in these! --- src/string/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/string/src/lib.rs b/src/string/src/lib.rs index ca56dff001..9c89220184 100644 --- a/src/string/src/lib.rs +++ b/src/string/src/lib.rs @@ -8,6 +8,8 @@ extern crate errno; extern crate platform; extern crate stdlib; +pub use compiler_builtins::mem::*; + use platform::types::*; use errno::*; use core::cmp; @@ -125,7 +127,7 @@ pub unsafe extern "C" fn strcspn(s1: *const c_char, s2: *const c_char) -> c_ulon // The below logic is effectively ripped from the musl implementation - let mut byteset = [0u8; 32 / mem::size_of::()]; + let mut byteset = [0usize; 32 / mem::size_of::()]; let mut i = 0; while *s2.offset(i) != 0 { @@ -277,7 +279,7 @@ pub unsafe extern "C" fn strspn(s1: *const c_char, s2: *const c_char) -> c_ulong // The below logic is effectively ripped from the musl implementation - let mut byteset = [0u8; 32 / mem::size_of::()]; + let mut byteset = [0usize; 32 / mem::size_of::()]; let mut i = 0; while *s2.offset(i) != 0 { From ca82b6df5bdccb7556c986b666a2554f4166ddd8 Mon Sep 17 00:00:00 2001 From: Tom Almeida Date: Wed, 14 Mar 2018 01:03:48 +0800 Subject: [PATCH 2/7] remove erroneous import in string --- src/string/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/string/src/lib.rs b/src/string/src/lib.rs index 9c89220184..cef3406e02 100644 --- a/src/string/src/lib.rs +++ b/src/string/src/lib.rs @@ -8,8 +8,6 @@ extern crate errno; extern crate platform; extern crate stdlib; -pub use compiler_builtins::mem::*; - use platform::types::*; use errno::*; use core::cmp; From d3e44da5272c036e1e445be9ff5290ebbfe08d86 Mon Sep 17 00:00:00 2001 From: Dan Robertson Date: Tue, 13 Mar 2018 23:27:32 +0000 Subject: [PATCH 3/7] Add the no_mangle attribute to fns Add the no_mangle attribute to functions without it. --- src/fenv/src/lib.rs | 11 +++++++++++ src/float/src/lib.rs | 1 + 2 files changed, 12 insertions(+) diff --git a/src/fenv/src/lib.rs b/src/fenv/src/lib.rs index b97e7e3b5e..49ad7d29cf 100644 --- a/src/fenv/src/lib.rs +++ b/src/fenv/src/lib.rs @@ -17,46 +17,57 @@ pub struct fenv_t { pub cw: u64, } +#[no_mangle] pub unsafe extern "C" fn feclearexcept(excepts: c_int) -> c_int { unimplemented!(); } +#[no_mangle] pub unsafe extern "C" fn fegenenv(envp: *mut fenv_t) -> c_int { unimplemented!(); } +#[no_mangle] pub unsafe extern "C" fn fegetexceptflag(flagp: *mut fexcept_t, excepts: c_int) -> c_int { unimplemented!(); } +#[no_mangle] pub unsafe extern "C" fn fegetround() -> c_int { FE_TONEAREST } +#[no_mangle] pub unsafe extern "C" fn feholdexcept(envp: *mut fenv_t) -> c_int { unimplemented!(); } +#[no_mangle] pub unsafe extern "C" fn feraiseexcept(except: c_int) -> c_int { unimplemented!(); } +#[no_mangle] pub unsafe extern "C" fn fesetenv(envp: *const fenv_t) -> c_int { unimplemented!(); } +#[no_mangle] pub unsafe extern "C" fn fesetexceptflag(flagp: *const fexcept_t, excepts: c_int) -> c_int { unimplemented!(); } +#[no_mangle] pub unsafe extern "C" fn fesetround(round: c_int) -> c_int { unimplemented!(); } +#[no_mangle] pub unsafe extern "C" fn fetestexcept(excepts: c_int) -> c_int { unimplemented!(); } +#[no_mangle] pub unsafe extern "C" fn feupdateenv(envp: *const fenv_t) -> c_int { unimplemented!(); } diff --git a/src/float/src/lib.rs b/src/float/src/lib.rs index e594fdba78..723e0d6fb4 100644 --- a/src/float/src/lib.rs +++ b/src/float/src/lib.rs @@ -11,6 +11,7 @@ use fenv::{fegetround, FE_TONEAREST}; pub const FLT_RADIX: c_int = 2; +#[no_mangle] pub unsafe extern "C" fn flt_rounds() -> c_int { match fegetround() { FE_TONEAREST => 1, From 9d46fa4d8c5fbde1d6520f7635d6f83e8c3653df Mon Sep 17 00:00:00 2001 From: Tom Almeida Date: Wed, 14 Mar 2018 08:48:56 +0800 Subject: [PATCH 4/7] Missed having both loops look at themselves. I'm not sure how long this has been here. --- src/string/src/lib.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/string/src/lib.rs b/src/string/src/lib.rs index ca56dff001..b97f8773fa 100644 --- a/src/string/src/lib.rs +++ b/src/string/src/lib.rs @@ -8,6 +8,8 @@ extern crate errno; extern crate platform; extern crate stdlib; +pub use compiler_builtins::mem::*; + use platform::types::*; use errno::*; use core::cmp; @@ -135,9 +137,9 @@ pub unsafe extern "C" fn strcspn(s1: *const c_char, s2: *const c_char) -> c_ulon } i = 0; // reset - while *s2.offset(i) != 0 { - if byteset[(*s2.offset(i) as usize) / (8 * byteset.len())] - & 1 << (*s2.offset(i) as usize % (8 * byteset.len())) > 0 + while *s1.offset(i) != 0 { + if byteset[(*s1.offset(i) as usize) / (8 * byteset.len())] + & 1 << (*s1.offset(i) as usize % (8 * byteset.len())) > 0 { break; } @@ -287,9 +289,9 @@ pub unsafe extern "C" fn strspn(s1: *const c_char, s2: *const c_char) -> c_ulong } i = 0; // reset - while *s2.offset(i) != 0 { - if byteset[(*s2.offset(i) as usize) / (8 * byteset.len())] - & 1 << (*s2.offset(i) as usize % (8 * byteset.len())) < 1 + while *s1.offset(i) != 0 { + if byteset[(*s1.offset(i) as usize) / (8 * byteset.len())] + & 1 << (*s1.offset(i) as usize % (8 * byteset.len())) < 1 { break; } From d058390b7568340b5792060fb5bb8d5dad14b87d Mon Sep 17 00:00:00 2001 From: Tom Almeida Date: Wed, 14 Mar 2018 08:56:18 +0800 Subject: [PATCH 5/7] The erroneous use came back! --- src/string/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/string/src/lib.rs b/src/string/src/lib.rs index 4f42613567..5b5c15832b 100644 --- a/src/string/src/lib.rs +++ b/src/string/src/lib.rs @@ -8,8 +8,6 @@ extern crate errno; extern crate platform; extern crate stdlib; -pub use compiler_builtins::mem::*; - use platform::types::*; use errno::*; use core::cmp; From 1d6115fd095e4475b5891937b5c7f2b0288b265b Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 13 Mar 2018 19:41:31 -0600 Subject: [PATCH 6/7] Update cbindgen and lock file --- Cargo.lock | 272 ++++++++++++++--------------------------------------- cbindgen | 2 +- 2 files changed, 69 insertions(+), 205 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d695d178dc..2351f79c04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,20 +23,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cbindgen" -version = "0.5.1" +version = "0.5.2" dependencies = [ "clap 2.31.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "standalone-syn 0.12.10 (registry+https://github.com/rust-lang/crates.io-index)", + "standalone-syn 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cc" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -74,7 +75,7 @@ dependencies = [ name = "ctype" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -87,7 +88,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "errno" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -95,7 +96,7 @@ dependencies = [ name = "fcntl" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -103,7 +104,7 @@ dependencies = [ name = "fenv" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -111,7 +112,7 @@ dependencies = [ name = "float" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "fenv 0.1.0", "platform 0.1.0", ] @@ -134,7 +135,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "grp" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -177,7 +178,7 @@ dependencies = [ name = "mman" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -186,34 +187,6 @@ name = "num-traits" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "owning_ref" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "parking_lot" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "parking_lot_core" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "platform" version = "0.1.0" @@ -232,11 +205,8 @@ dependencies = [ [[package]] name = "quote" -version = "0.4.2" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "ralloc" @@ -316,87 +286,11 @@ dependencies = [ name = "resource" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", "sys_time 0.1.0", ] -[[package]] -name = "rustc-ap-proc_macro" -version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc-ap-rustc_errors 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-syntax 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-syntax_pos 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-ap-rustc_cratesio_shim" -version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-ap-rustc_data_structures" -version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-serialize 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-ap-rustc_errors" -version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc-ap-rustc_data_structures 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-serialize 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-syntax_pos 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-ap-serialize" -version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc-ap-syntax" -version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-rustc_cratesio_shim 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-rustc_data_structures 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-rustc_errors 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-serialize 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-syntax_pos 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-ap-syntax_pos" -version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc-ap-rustc_data_structures 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-ap-serialize 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sc" version = "0.2.2" @@ -406,36 +300,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "semaphore" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] [[package]] name = "serde" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.29" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive_internals 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive_internals" -version = "0.20.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -446,45 +339,24 @@ dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "smallvec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "stable_deref_trait" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "standalone-proc-macro2" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc-ap-proc_macro 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "standalone-quote" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-ap-proc_macro 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "standalone-proc-macro2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "standalone-syn" -version = "0.12.10" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-ap-proc_macro 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "standalone-proc-macro2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "standalone-quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "standalone-quote 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -492,7 +364,7 @@ dependencies = [ name = "stat" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -500,7 +372,7 @@ dependencies = [ name = "stdio" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "errno 0.1.0", "platform 0.1.0", "va_list 0.1.0", @@ -510,7 +382,7 @@ dependencies = [ name = "stdlib" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "ctype 0.1.0", "errno 0.1.0", "platform 0.1.0", @@ -521,7 +393,7 @@ dependencies = [ name = "string" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins.git)", "errno 0.1.0", "platform 0.1.0", @@ -535,19 +407,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.12.14" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "synom" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sys_time" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -560,15 +440,6 @@ dependencies = [ "remove_dir_all 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "term" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "termion" version = "1.5.1" @@ -591,7 +462,7 @@ dependencies = [ name = "time" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -600,7 +471,7 @@ name = "toml" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -613,6 +484,11 @@ name = "unicode-width" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-xid" version = "0.1.0" @@ -622,7 +498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "unistd" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -637,7 +513,7 @@ dependencies = [ name = "va_list-helper" version = "0.0.2" dependencies = [ - "cc 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -649,7 +525,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "wait" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", "resource 0.1.0", ] @@ -658,7 +534,7 @@ dependencies = [ name = "wctype" version = "0.1.0" dependencies = [ - "cbindgen 0.5.1", + "cbindgen 0.5.2", "platform 0.1.0", ] @@ -695,7 +571,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "af80143d6f7608d746df1520709e5d141c96f240b0e62b0aa41bdfb53374d9d4" "checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" -"checksum cc 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fedf677519ac9e865c4ff43ef8f930773b37ed6e6ea61b6b83b400a7b5787f49" +"checksum cc 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "87f38f122db5615319a985757e526c00161d924d19b71a0f3e80c52bab1adcf6" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" "checksum clap 2.31.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5dc18f6f4005132120d9711636b32c46a233fad94df6217fa1d81c5e97a9f200" "checksum compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins.git)" = "" @@ -708,41 +584,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" "checksum num-traits 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3c2bd9b9d21e48e956b763c9f37134dc62d9e95da6edb3f672cacb6caf3cd3" -"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" -"checksum parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd9d732f2de194336fb02fe11f9eed13d9e76f13f4315b4d88a14ca411750cd" -"checksum parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "538ef00b7317875071d5e00f603f24d16f0b474c1a5fc0ccb8b454ca72eafa79" "checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" -"checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408" +"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum remove_dir_all 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b5d2f806b0fcdabd98acd380dc8daef485e22bcb7cddc811d1337967f2528cf5" -"checksum rustc-ap-proc_macro 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d96f017dd18a6925618e1caf4a375ba2a5a175471172e18cc4855ac0587231ff" -"checksum rustc-ap-rustc_cratesio_shim 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6773cafaa546d932d62eb22fe854772f4d1b973245b36727c893a9fea3dbc4c6" -"checksum rustc-ap-rustc_data_structures 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a64e8c55c343448d6a0904e2066710be2734284d904b52b8fd064ca201ca854b" -"checksum rustc-ap-rustc_errors 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad6d84133da5f6b51c544b981c6b405e79db0a4fca41e34d77849846ed3b9121" -"checksum rustc-ap-serialize 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "43d227b1b3de1ec6d3fb48e10799d08c073c57e45f536766e1d897d46b737e0b" -"checksum rustc-ap-syntax 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b6e525fc674e8a75eaed08a90a6df7adfa73a66135056577722185dd7ca0771" -"checksum rustc-ap-syntax_pos 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e157f53ad5c4a6cf9ae5b5be15325dd2eeca190c03ab9873cc1460788767e5e9" "checksum sc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4ebbb026ba4a707c25caec2db5ef59ad8b41f7ad77cad06257e06229c891f376" -"checksum serde 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)" = "4763b773978e495252615e814d2ad04773b2c1f85421c7913869a537f35cb406" -"checksum serde_derive 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)" = "8ab31f00ae5574bb643c196d5e302961c122da1c768604c6d16a35c5d551948a" -"checksum serde_derive_internals 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fc848d073be32cd982380c06587ea1d433bc1a4c4a111de07ec2286a3ddade8" +"checksum serde 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "c73f63e08b33f6e59dfb3365b009897ebc3a3edc4af6e4f3ce8e483cf3d80ce7" +"checksum serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "652bc323d694dc925829725ec6c890156d8e70ae5202919869cb00fe2eff3788" +"checksum serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32f1926285523b2db55df263d2aa4eb69ddcfa7a7eade6430323637866b513ab" "checksum serde_json 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "fab6c4d75bedcf880711c85e39ebf8ccc70d0eba259899047ec5d7436643ee17" -"checksum smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44db0ecb22921ef790d17ae13a3f6d15784183ff5f2a01aa32098c7498d2b4b9" -"checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" -"checksum standalone-proc-macro2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "04b0e28c7fb04d85743490bd2a24bd0ec0ff6efc74e7c848748fd9fd2b105410" -"checksum standalone-quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "45bd227b8113ff91db4f6eadcc73928dc602af00a851f4fe65f3c1cb1a96b5e1" -"checksum standalone-syn 0.12.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d800cb9b3b2e08877667aace544bb0882ea3d5cf3ae83c2730a9032becf1f6bd" +"checksum standalone-quote 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dcedac1d6d98e7e9d1d6e628f5635af9566688ae5f6cea70a3976f495ae8d839" +"checksum standalone-syn 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "115808f5187c07c23cb93eee49d542fae54c6e8285d3a24c6ff683fcde9243db" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" -"checksum syn 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)" = "8c5bc2d6ff27891209efa5f63e9de78648d7801f085e4653701a692ce938d6fd" +"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" +"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum tempdir 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f73eebdb68c14bcb24aef74ea96079830e7fa7b31a6106e42ea7ee887c1e134e" -"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" "checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e" "checksum unborrow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e92e959f029e4f8ee25d70d15ab58d2b46f98a17bc238b9265ff0c26f6f3d67f" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" +"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" diff --git a/cbindgen b/cbindgen index fe26d47afd..d14295f3ca 160000 --- a/cbindgen +++ b/cbindgen @@ -1 +1 @@ -Subproject commit fe26d47afd3e959a8cd73f81f430b061d28c4c3b +Subproject commit d14295f3ca588f1d1752ea0a579f0597dd2ce248 From 996fad709238e5c4e24395f1c4ff8c90dfb984e5 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 13 Mar 2018 19:52:15 -0600 Subject: [PATCH 7/7] Fix fcntl header constants --- src/fcntl/cbindgen.toml | 4 ++++ src/fcntl/src/lib.rs | 52 ++++++++++++++++++++++++++++++++++++----- src/fcntl/src/linux.rs | 8 ------- src/fcntl/src/redox.rs | 20 ---------------- 4 files changed, 50 insertions(+), 34 deletions(-) delete mode 100644 src/fcntl/src/linux.rs delete mode 100644 src/fcntl/src/redox.rs diff --git a/src/fcntl/cbindgen.toml b/src/fcntl/cbindgen.toml index e9893c078d..19d473cd4a 100644 --- a/src/fcntl/cbindgen.toml +++ b/src/fcntl/cbindgen.toml @@ -3,5 +3,9 @@ include_guard = "_FCNTL_H" trailer = "#include " language = "C" +[defines] +"target_os = linux" = "__linux__" +"target_os = redox" = "__redox__" + [enum] prefix_with_name = true diff --git a/src/fcntl/src/lib.rs b/src/fcntl/src/lib.rs index 0c0fa43ce2..0e5048277a 100644 --- a/src/fcntl/src/lib.rs +++ b/src/fcntl/src/lib.rs @@ -6,15 +6,55 @@ extern crate platform; use platform::types::*; -pub use sys::*; - #[cfg(target_os = "linux")] -#[path = "linux.rs"] -pub mod sys; +pub const O_RDONLY: c_int = 0x0000; +#[cfg(target_os = "linux")] +pub const O_WRONLY: c_int = 0x0001; +#[cfg(target_os = "linux")] +pub const O_RDWR: c_int = 0x0002; +#[cfg(target_os = "linux")] +pub const O_CREAT: c_int = 0x0040; +#[cfg(target_os = "linux")] +pub const O_TRUNC: c_int = 0x0200; +#[cfg(target_os = "linux")] +pub const O_ACCMODE: c_int = O_RDONLY | O_WRONLY | O_RDWR; #[cfg(target_os = "redox")] -#[path = "redox.rs"] -pub mod sys; +pub const O_RDONLY: c_int = 0x0001_0000; +#[cfg(target_os = "redox")] +pub const O_WRONLY: c_int = 0x0002_0000; +#[cfg(target_os = "redox")] +pub const O_RDWR: c_int = 0x0003_0000; +#[cfg(target_os = "redox")] +pub const O_NONBLOCK: c_int = 0x0004_0000; +#[cfg(target_os = "redox")] +pub const O_APPEND: c_int = 0x0008_0000; +#[cfg(target_os = "redox")] +pub const O_SHLOCK: c_int = 0x0010_0000; +#[cfg(target_os = "redox")] +pub const O_EXLOCK: c_int = 0x0020_0000; +#[cfg(target_os = "redox")] +pub const O_ASYNC: c_int = 0x0040_0000; +#[cfg(target_os = "redox")] +pub const O_FSYNC: c_int = 0x0080_0000; +#[cfg(target_os = "redox")] +pub const O_CLOEXEC: c_int = 0x0100_0000; +#[cfg(target_os = "redox")] +pub const O_CREAT: c_int = 0x0200_0000; +#[cfg(target_os = "redox")] +pub const O_TRUNC: c_int = 0x0400_0000; +#[cfg(target_os = "redox")] +pub const O_EXCL: c_int = 0x0800_0000; +#[cfg(target_os = "redox")] +pub const O_DIRECTORY: c_int = 0x1000_0000; +#[cfg(target_os = "redox")] +pub const O_STAT: c_int = 0x2000_0000; +#[cfg(target_os = "redox")] +pub const O_SYMLINK: c_int = 0x4000_0000; +#[cfg(target_os = "redox")] +pub const O_NOFOLLOW: c_int = 0x8000_0000; +#[cfg(target_os = "redox")] +pub const O_ACCMODE: c_int = O_RDONLY | O_WRONLY | O_RDWR; pub const F_DUPFD: c_int = 0; pub const F_GETFD: c_int = 1; diff --git a/src/fcntl/src/linux.rs b/src/fcntl/src/linux.rs deleted file mode 100644 index fd68ffcf14..0000000000 --- a/src/fcntl/src/linux.rs +++ /dev/null @@ -1,8 +0,0 @@ -use platform::types::*; - -pub const O_RDONLY: c_int = 0x0000; -pub const O_WRONLY: c_int = 0x0001; -pub const O_RDWR: c_int = 0x0002; -pub const O_CREAT: c_int = 0x0040; -pub const O_TRUNC: c_int = 0x0200; -pub const O_ACCMODE: c_int = O_RDONLY | O_WRONLY | O_RDWR; diff --git a/src/fcntl/src/redox.rs b/src/fcntl/src/redox.rs deleted file mode 100644 index 1ea3ca45de..0000000000 --- a/src/fcntl/src/redox.rs +++ /dev/null @@ -1,20 +0,0 @@ -use platform::types::*; - -pub const O_RDONLY: c_int = 0x0001_0000; -pub const O_WRONLY: c_int = 0x0002_0000; -pub const O_RDWR: c_int = 0x0003_0000; -pub const O_NONBLOCK: c_int = 0x0004_0000; -pub const O_APPEND: c_int = 0x0008_0000; -pub const O_SHLOCK: c_int = 0x0010_0000; -pub const O_EXLOCK: c_int = 0x0020_0000; -pub const O_ASYNC: c_int = 0x0040_0000; -pub const O_FSYNC: c_int = 0x0080_0000; -pub const O_CLOEXEC: c_int = 0x0100_0000; -pub const O_CREAT: c_int = 0x0200_0000; -pub const O_TRUNC: c_int = 0x0400_0000; -pub const O_EXCL: c_int = 0x0800_0000; -pub const O_DIRECTORY: c_int = 0x1000_0000; -pub const O_STAT: c_int = 0x2000_0000; -pub const O_SYMLINK: c_int = 0x4000_0000; -pub const O_NOFOLLOW: c_int = 0x8000_0000; -pub const O_ACCMODE: c_int = O_RDONLY | O_WRONLY | O_RDWR;