diff options
author | Corey Richardson <corey@octayn.net> | 2016-05-02 14:39:11 +1000 |
---|---|---|
committer | Corey Richardson <corey@octayn.net> | 2016-05-02 14:39:11 +1000 |
commit | 0eeafb2eea2bb686bce1eaf02060dccbc2c14552 (patch) | |
tree | a0e51d1b49bee3fa2aa6072cc44183367ade60ab /src/lib.rs | |
parent | 77b7a0984f3f524900f739b72ae3bc77819193fa (diff) | |
download | byteorder-0eeafb2eea2bb686bce1eaf02060dccbc2c14552.tar.gz |
Enable usage in no_std contexts
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -39,15 +39,20 @@ assert_eq!(wtr, vec![5, 2, 0, 3]); #![crate_name = "byteorder"] #![doc(html_root_url = "http://burntsushi.net/rustdoc/byteorder")] +#![cfg_attr(not(feature = "std"), no_std)] + #![deny(missing_docs)] -use std::mem::transmute; -use std::ptr::copy_nonoverlapping; +#[cfg(feature = "std")] +extern crate core; + +use core::mem::transmute; +use core::ptr::copy_nonoverlapping; -#[cfg(not(feature = "no-std"))] +#[cfg(feature = "std")] pub use new::{ReadBytesExt, WriteBytesExt}; -#[cfg(not(feature = "no-std"))] +#[cfg(feature = "std")] mod new; #[inline] |