@@ -17,8 +17,15 @@ We follow the conventions laid out in [Keep A CHANGELOG][kacl].
17
17
18
18
## libc constants, functions and structs
19
19
20
- We do not define integer constants ourselves, but use or reexport them from the
21
- [ libc crate] [ libc ] .
20
+ We do not define ffi functions or their associated constants and types ourselves,
21
+ but use or reexport them from the [ libc crate] [ libc ] , if your PR uses something
22
+ that does not exist in the libc crate, you should add it to libc first. Once
23
+ your libc PR gets merged, you can adjust our ` libc ` dependency to include that
24
+ libc change. Use a git dependency if necessary.
25
+
26
+ ``` toml
27
+ libc = { git = " https://github.com/rust-lang/libc" , rev = " the commit includes your libc PR" , ... }
28
+ ```
22
29
23
30
We use the functions exported from [ libc] [ libc ] instead of writing our own
24
31
` extern ` declarations.
@@ -40,7 +47,7 @@ When creating newtypes, we use Rust's `CamelCase` type naming convention.
40
47
## cfg gates
41
48
42
49
When creating operating-system-specific functionality, we gate it by
43
- ` #[cfg(target_os = ...)] ` . If more than one operating system is affected, we
50
+ ` #[cfg(target_os = ...)] ` . If more than one operating system is affected, we
44
51
prefer to use the cfg aliases defined in build.rs, like ` #[cfg(bsd)] ` .
45
52
46
53
## Bitflags
@@ -115,5 +122,5 @@ To deprecate an interface, put the following attribute on the top of it:
115
122
` <Version> ` is the version where this interface will be deprecated, in most
116
123
cases, it will be the version of the next release. And a user-friendly note
117
124
should be added. Normally, there should be a new interface that will replace
118
- the old one, so a note should be something like: "<New Interface > should be
125
+ the old one, so a note should be something like: "` <New Interface> ` should be
119
126
used instead".
0 commit comments