Skip to content

Undefined/redefined C macro keeps old value #2722

Open
@elfenpiff

Description

@elfenpiff

Input C/C++ Header

#define A 1
#define B 2

#undef A
#define A 2
#undef B
#define B 1

Bindgen Invocation

bindgen::Builder::default()
    .header("input.h")
    .generate()
    .unwrap()

Actual Results

/* automatically generated by rust-bindgen 0.69.2 */

pub const A: u32 = 1;
pub const B: u32 = 2;

Expected Results

/* automatically generated by rust-bindgen 0.69.2 */

pub const A: u32 = 2;
pub const B: u32 = 1;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions