You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -297,6 +297,14 @@ pub struct Foo { .. }; // This won't be emitted by cbindgen in the header
297
297
fn bar() -> Foo { .. } // Will be emitted as `struct foo bar();`
298
298
```
299
299
300
+
### Volatile annotation
301
+
302
+
cbindgen will emit the C volatile type qualifier for transparent 1-field structs and struct/union fields that have the `volatile` annotation.
303
+
304
+
There is no equivalent in rust. You should use `read_volatile` and `write_volatile` to get C-like behavior.
305
+
306
+
Example usage can be found in `tests/rust/volatile.rs`.
307
+
300
308
### Struct Annotations
301
309
302
310
* field-names=\[field1, field2, ...\] -- sets the names of all the fields in the output struct. These names will be output verbatim, and are not eligible for renaming.
0 commit comments