@@ -6,8 +6,10 @@ various systems, including libc.
66
77[ ![ Build Status] ( https://travis-ci.org/rust-lang/libc.svg?branch=master )] ( https://travis-ci.org/rust-lang/libc )
88[ ![ Build status] ( https://ci.appveyor.com/api/projects/status/github/rust-lang/libc?svg=true )] ( https://ci.appveyor.com/project/rust-lang-libs/libc )
9+ [ ![ Latest version] ( https://img.shields.io/crates/v/libc.svg )] ( https://crates.io/crates/libc )
10+ [ ![ Documentation] ( https://docs.rs/libc/badge.svg )] ( https://docs.rs/libc )
11+ ![ License] ( https://img.shields.io/crates/l/libc.svg )
912
10- [ Documentation] ( #platforms-and-documentation )
1113
1214## Usage
1315
@@ -33,6 +35,16 @@ this via:
3335libc = { version = " 0.2" , default-features = false }
3436```
3537
38+ By default libc uses private fields in structs in order to enforce a certain
39+ memory alignment on them. These structs can be hard to instantiate outside of
40+ libc. To make libc use ` #[repr(align(x))] ` , instead of the private fields,
41+ activate the * align* feature. This requires Rust 1.25 or newer:
42+
43+ ``` toml
44+ [dependencies ]
45+ libc = { version = " 0.2" , features = [" align" ] }
46+ ```
47+
3648## What is libc?
3749
3850The primary purpose of this crate is to provide all of the definitions necessary
@@ -122,41 +134,41 @@ it. If you'd like to get a release out ASAP you can follow these steps:
122134The following platforms are currently tested and have documentation available:
123135
124136Tested:
125- * [ ` i686-pc-windows-msvc ` ] ( https://doc. rust-lang.org /libc/i686-pc-windows-msvc/libc/ )
126- * [ ` x86_64-pc-windows-msvc ` ] ( https://doc. rust-lang.org /libc/x86_64-pc-windows-msvc/libc/ )
137+ * [ ` i686-pc-windows-msvc ` ] ( https://rust-lang.github.io /libc/i686-pc-windows-msvc/libc/ )
138+ * [ ` x86_64-pc-windows-msvc ` ] ( https://rust-lang.github.io /libc/x86_64-pc-windows-msvc/libc/ )
127139 (Windows)
128- * [ ` i686-pc-windows-gnu ` ] ( https://doc. rust-lang.org /libc/i686-pc-windows-gnu/libc/ )
129- * [ ` x86_64-pc-windows-gnu ` ] ( https://doc. rust-lang.org /libc/x86_64-pc-windows-gnu/libc/ )
130- * [ ` i686-apple-darwin ` ] ( https://doc. rust-lang.org /libc/i686-apple-darwin/libc/ )
131- * [ ` x86_64-apple-darwin ` ] ( https://doc. rust-lang.org /libc/x86_64-apple-darwin/libc/ )
140+ * [ ` i686-pc-windows-gnu ` ] ( https://rust-lang.github.io /libc/i686-pc-windows-gnu/libc/ )
141+ * [ ` x86_64-pc-windows-gnu ` ] ( https://rust-lang.github.io /libc/x86_64-pc-windows-gnu/libc/ )
142+ * [ ` i686-apple-darwin ` ] ( https://rust-lang.github.io /libc/i686-apple-darwin/libc/ )
143+ * [ ` x86_64-apple-darwin ` ] ( https://rust-lang.github.io /libc/x86_64-apple-darwin/libc/ )
132144 (OSX)
133145 * ` i386-apple-ios `
134146 * ` x86_64-apple-ios `
135- * [ ` i686-unknown-linux-gnu ` ] ( https://doc. rust-lang.org /libc/i686-unknown-linux-gnu/libc/ )
136- * [ ` x86_64-unknown-linux-gnu ` ] ( https://doc. rust-lang.org /libc/x86_64-unknown-linux-gnu/libc/ )
147+ * [ ` i686-unknown-linux-gnu ` ] ( https://rust-lang.github.io /libc/i686-unknown-linux-gnu/libc/ )
148+ * [ ` x86_64-unknown-linux-gnu ` ] ( https://rust-lang.github.io /libc/x86_64-unknown-linux-gnu/libc/ )
137149 (Linux)
138- * [ ` x86_64-unknown-linux-musl ` ] ( https://doc. rust-lang.org /libc/x86_64-unknown-linux-musl/libc/ )
150+ * [ ` x86_64-unknown-linux-musl ` ] ( https://rust-lang.github.io /libc/x86_64-unknown-linux-musl/libc/ )
139151 (Linux MUSL)
140- * [ ` aarch64-unknown-linux-gnu ` ] ( https://doc. rust-lang.org /libc/aarch64-unknown-linux-gnu/libc/ )
152+ * [ ` aarch64-unknown-linux-gnu ` ] ( https://rust-lang.github.io /libc/aarch64-unknown-linux-gnu/libc/ )
141153 (Linux)
142154 * ` aarch64-unknown-linux-musl `
143155 (Linux MUSL)
144- * [ ` sparc64-unknown-linux-gnu ` ] ( https://doc. rust-lang.org /libc/sparc64-unknown-linux-gnu/libc/ )
156+ * [ ` sparc64-unknown-linux-gnu ` ] ( https://rust-lang.github.io /libc/sparc64-unknown-linux-gnu/libc/ )
145157 (Linux)
146- * [ ` mips-unknown-linux-gnu ` ] ( https://doc. rust-lang.org /libc/mips-unknown-linux-gnu/libc/ )
147- * [ ` arm-unknown-linux-gnueabihf ` ] ( https://doc. rust-lang.org /libc/arm-unknown-linux-gnueabihf/libc/ )
148- * [ ` arm-linux-androideabi ` ] ( https://doc. rust-lang.org /libc/arm-linux-androideabi/libc/ )
158+ * [ ` mips-unknown-linux-gnu ` ] ( https://rust-lang.github.io /libc/mips-unknown-linux-gnu/libc/ )
159+ * [ ` arm-unknown-linux-gnueabihf ` ] ( https://rust-lang.github.io /libc/arm-unknown-linux-gnueabihf/libc/ )
160+ * [ ` arm-linux-androideabi ` ] ( https://rust-lang.github.io /libc/arm-linux-androideabi/libc/ )
149161 (Android)
150- * [ ` x86_64-unknown-freebsd ` ] ( https://doc. rust-lang.org /libc/x86_64-unknown-freebsd/libc/ )
151- * [ ` x86_64-unknown-openbsd ` ] ( https://doc. rust-lang.org /libc/x86_64-unknown-openbsd/libc/ )
152- * [ ` x86_64-rumprun-netbsd ` ] ( https://doc. rust-lang.org /libc/x86_64-unknown-netbsd/libc/ )
162+ * [ ` x86_64-unknown-freebsd ` ] ( https://rust-lang.github.io /libc/x86_64-unknown-freebsd/libc/ )
163+ * [ ` x86_64-unknown-openbsd ` ] ( https://rust-lang.github.io /libc/x86_64-unknown-openbsd/libc/ )
164+ * [ ` x86_64-rumprun-netbsd ` ] ( https://rust-lang.github.io /libc/x86_64-unknown-netbsd/libc/ )
153165
154166The following may be supported, but are not guaranteed to always work:
155167
156168 * ` i686-unknown-freebsd `
157- * [ ` x86_64-unknown-bitrig ` ] ( https://doc. rust-lang.org /libc/x86_64-unknown-bitrig/libc/ )
158- * [ ` x86_64-unknown-dragonfly ` ] ( https://doc. rust-lang.org /libc/x86_64-unknown-dragonfly/libc/ )
169+ * [ ` x86_64-unknown-bitrig ` ] ( https://rust-lang.github.io /libc/x86_64-unknown-bitrig/libc/ )
170+ * [ ` x86_64-unknown-dragonfly ` ] ( https://rust-lang.github.io /libc/x86_64-unknown-dragonfly/libc/ )
159171 * ` i686-unknown-haiku `
160172 * ` x86_64-unknown-haiku `
161- * [ ` x86_64-unknown-netbsd ` ] ( https://doc. rust-lang.org /libc/x86_64-unknown-netbsd/libc/ )
162- * [ ` x86_64-sun-solaris ` ] ( https://doc. rust-lang.org /libc/x86_64-sun-solaris/libc/ )
173+ * [ ` x86_64-unknown-netbsd ` ] ( https://rust-lang.github.io /libc/x86_64-unknown-netbsd/libc/ )
174+ * [ ` x86_64-sun-solaris ` ] ( https://rust-lang.github.io /libc/x86_64-sun-solaris/libc/ )
0 commit comments