File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,23 @@ foreign code. Rust is currently unable to call directly into a C++ library, but
8
8
snappy includes a C interface (documented in
9
9
[ ` snappy-c.h ` ] ( https://github.com/google/snappy/blob/master/snappy-c.h ) ).
10
10
11
+ ## A note about libc
12
+
13
+ Many of these examples use [ the ` libc ` crate] [ libc ] , which provides various
14
+ type definitions for C types, among other things. If you’re trying these
15
+ examples yourself, you’ll need to add ` libc ` to your ` Cargo.toml ` :
16
+
17
+ ``` toml
18
+ [dependencies ]
19
+ libc = " 0.2.0"
20
+ ```
21
+
22
+ [ libc ] : https://crates.io/crates/libc
23
+
24
+ and add ` extern crate libc; ` to your crate root.
25
+
26
+ ## Calling foreign functions
27
+
11
28
The following is a minimal example of calling a foreign function which will
12
29
compile if snappy is installed:
13
30
You can’t perform that action at this time.
0 commit comments