]> git.sesse.net Git - bcachefs-tools-debian/blob - bch_bindgen/src/libbcachefs_wrapper.h
fix(bindgen): expand the Fix753 workaround for any type and document it
[bcachefs-tools-debian] / bch_bindgen / src / libbcachefs_wrapper.h
1 #include "libbcachefs/super-io.h"
2 #include "libbcachefs/checksum.h"
3 #include "libbcachefs/bcachefs_format.h"
4 #include "libbcachefs/btree_cache.h"
5 #include "libbcachefs/btree_iter.h"
6 #include "libbcachefs/debug.h"
7 #include "libbcachefs/errcode.h"
8 #include "libbcachefs/error.h"
9 #include "libbcachefs/opts.h"
10 #include "libbcachefs.h"
11 #include "crypto.h"
12 #include "include/linux/bio.h"
13 #include "include/linux/blkdev.h"
14 #include "cmds.h"
15 #include "raid/raid.h"
16
17 /* Fix753 is a workaround for https://github.com/rust-lang/rust-bindgen/issues/753
18  * Functional macro are not expanded with bindgen, e.g. ioctl are automatically ignored
19  * from the generation
20  *
21  * To avoid this, use `MARK_FIX_753` to force the synthesis of your macro constant.
22  * It will appear in Rust with its proper name and not Fix753_{name}.
23  */
24
25 /* MARK_FIX_753: force generate a macro constant in Rust
26  *
27  * @type_name   - a type for this constant
28  * @req_name    - a name for this constant which will be used inside of Rust
29  */
30 #define MARK_FIX_753(type_name, req_name) const type_name Fix753_##req_name = req_name;
31
32 MARK_FIX_753(blk_mode_t, BLK_OPEN_READ);
33 MARK_FIX_753(blk_mode_t, BLK_OPEN_WRITE);
34 MARK_FIX_753(blk_mode_t, BLK_OPEN_EXCL);
35