Closed mssun closed 4 years ago
Add itoa 0.4.5
be0c32f9c8938ca0359bbb0d1477e31b07cb3358
diff --git a/Cargo.toml b/Cargo.toml index 03fe09b..119bd41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,13 @@ readme = "README.md" exclude = ["performance.png"] [features] -default = ["std"] +default = ["std", "mesalock_sgx"] i128 = [] std = [] +mesalock_sgx = ["sgx_tstd"] + +[dependencies] +sgx_tstd = { git = "https://github.com/apache/incubator-teaclave-sgx-sdk", tag = "v1.1.0", optional = true } [badges] travis-ci = { repository = "dtolnay/itoa" } diff --git a/src/lib.rs b/src/lib.rs index 1b0f1aa..e9f7018 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,6 +56,15 @@ allow(const_static_lifetime, transmute_ptr_to_ptr), )] + +#![cfg_attr(all(feature = "mesalock_sgx", + not(target_env = "sgx")), no_std)] +#![cfg_attr(all(target_env = "sgx", target_vendor = "mesalock"), + feature(rustc_private))] +#[cfg(all(feature = "mesalock_sgx", not(target_env = "sgx")))] +#[macro_use] +extern crate sgx_tstd as std; + #[cfg(feature = "i128")] mod udiv128; @@ -119,7 +128,7 @@ impl Buffer { #[allow(deprecated)] pub fn new() -> Buffer { Buffer { - bytes: unsafe { mem::uninitialized() }, + bytes: unsafe { mem::MaybeUninit::zeroed().assume_init() }, } }
Adding itoa 0.4.5
Description
Add itoa 0.4.5
Crate Meta
be0c32f9c8938ca0359bbb0d1477e31b07cb3358
Diff of Changes