@@ -12,6 +12,7 @@ The following is a minimal example of calling a foreign function which will
1212compile if snappy is installed:
1313
1414``` no_run
15+ # #![feature(libc)]
1516extern crate libc;
1617use libc::size_t;
1718
@@ -45,6 +46,7 @@ keeping the binding correct at runtime.
4546The ` extern ` block can be extended to cover the entire snappy API:
4647
4748``` no_run
49+ # #![feature(libc)]
4850extern crate libc;
4951use libc::{c_int, size_t};
5052
@@ -80,6 +82,7 @@ length is number of elements currently contained, and the capacity is the total
8082the allocated memory. The length is less than or equal to the capacity.
8183
8284```
85+ # #![feature(libc)]
8386# extern crate libc;
8487# use libc::{c_int, size_t};
8588# unsafe fn snappy_validate_compressed_buffer(_: *const u8, _: size_t) -> c_int { 0 }
@@ -104,6 +107,7 @@ required capacity to hold the compressed output. The vector can then be passed t
104107the true length after compression for setting the length.
105108
106109```
110+ # #![feature(libc)]
107111# extern crate libc;
108112# use libc::{size_t, c_int};
109113# unsafe fn snappy_compress(a: *const u8, b: size_t, c: *mut u8,
@@ -130,6 +134,7 @@ Decompression is similar, because snappy stores the uncompressed size as part of
130134format and ` snappy_uncompressed_length ` will retrieve the exact buffer size required.
131135
132136```
137+ # #![feature(libc)]
133138# extern crate libc;
134139# use libc::{size_t, c_int};
135140# unsafe fn snappy_uncompress(compressed: *const u8,
@@ -408,6 +413,7 @@ global state. In order to access these variables, you declare them in `extern`
408413blocks with the ` static ` keyword:
409414
410415``` no_run
416+ # #![feature(libc)]
411417extern crate libc;
412418
413419#[link(name = "readline")]
@@ -426,6 +432,7 @@ interface. To do this, statics can be declared with `mut` so we can mutate
426432them.
427433
428434``` no_run
435+ # #![feature(libc)]
429436extern crate libc;
430437
431438use std::ffi::CString;
@@ -458,6 +465,7 @@ calling foreign functions. Some foreign functions, most notably the Windows API,
458465conventions. Rust provides a way to tell the compiler which convention to use:
459466
460467```
468+ # #![feature(libc)]
461469extern crate libc;
462470
463471#[cfg(all(target_os = "win32", target_arch = "x86"))]
0 commit comments