Closed hkonetzky closed 5 months ago
enum { BASS_FX_BFX_ROTATE = 0x10000 BASS_FX_BFX_ECHO, BASS_FX_BFX_FLANGER };
$ bindgen input.h --allowlist-item "BASS.*" -o output.rs
empty file - apart from the bindgen comment
one warning is outputted by bindgen: bindgen::ir::context] unused option: --allowlist-items BASS.*
bindgen::ir::context] unused option: --allowlist-items BASS.*
consts generated like this (works when omitting the allowlist-items flag or using allowlist-var instead):
allowlist-items
allowlist-var
/* automatically generated by rust-bindgen 0.69.4 */ pub const BASS_FX_BFX_ROTATE: _bindgen_ty_1 = 65536; pub const BASS_FX_BFX_ECHO: _bindgen_ty_1 = 65537; pub const BASS_FX_BFX_FLANGER: _bindgen_ty_1 = 65538; pub type _bindgen_ty_1 = ::std::os::raw::c_int;
Thanks for the report!
It seems that anonymous enums need some special casing that was overlooked when --allowlist-item was implemented.
--allowlist-item
Input C/C++ Header
Bindgen Invocation
Actual Results
empty file - apart from the bindgen comment
one warning is outputted by bindgen:
bindgen::ir::context] unused option: --allowlist-items BASS.*
Expected Results
consts generated like this (works when omitting the
allowlist-items
flag or usingallowlist-var
instead):