diff options
author | Linus Färnstrand <faern@faern.net> | 2018-07-30 16:57:55 +0200 |
---|---|---|
committer | Linus Färnstrand <faern@faern.net> | 2018-07-30 16:57:55 +0200 |
commit | e167a73564f513e68d6c35dfa940bc7baefb9554 (patch) | |
tree | 418cda7a24e650c766c0459580ad1f2583ac95a3 | |
parent | 28196346966968741d6864557be5a2aa0ede2edb (diff) | |
download | rust-libc-e167a73564f513e68d6c35dfa940bc7baefb9554.tar.gz |
Describe the align feature in the readme
-rw-r--r-- | README.md | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -35,6 +35,16 @@ this via: libc = { version = "0.2", default-features = false } ``` +By default libc uses private fields in structs in order to enforce a certain +memory alignment on them. These structs can be hard to instantiate outside of +libc. To make libc use `#[repr(align(x))]`, instead of the private fields, +activate the *align* feature. This requires Rust 1.25 or newer: + +```toml +[dependencies] +libc = { version = "0.2", features = ["align"] } +``` + ## What is libc? The primary purpose of this crate is to provide all of the definitions necessary |