-
Notifications
You must be signed in to change notification settings - Fork 768
Open
Description
I want to generate corresponding Rust macro definitions from C language macro definitions, input C header as follow:
// test.h
enum { FRAME_TYPE, FRAME_TYPEP, FRAME_LUA };
#define frame_type(f) ((f) & FRAME_TYPE)
Run bindgen command:
$ bindgen ./test.h --default-enum-style moduleconsts --no-layout-tests --no-derive-default --use-core --ctypes-prefix ::aya_ebpf::cty --generate functions,types,vars,methods,constructors,destructors --no-doc-comments --no-prepend-enum-name --rust-target 1.82.0 --clang-macro-fallback -- -Wno-unknown-attributes
Output rust as follow:
/* automatically generated by rust-bindgen 0.71.1 */
pub mod _bindgen_ty_1 {
pub type Type = ::aya_ebpf::cty::c_uint;
pub const FRAME_TYPE: Type = 0;
pub const FRAME_TYPEP: Type = 1;
pub const FRAME_LUA: Type = 2;
}
The expectation is to have the frame_type
macro definition.
Here is the related issue:
Metadata
Metadata
Assignees
Labels
No labels