Skip to content

Macro defining a constant with unsigned long suffix generates unsigned integer #923

@SuperHeron

Description

@SuperHeron

Input C/C++ Header

#define CK_INVALID_HANDLE	(0UL)

Bindgen Invocation

bindgen::Builder::default()
    .header("input.h")
    .generate()
    .expect("Unable to generate bindings");

Actual Results

pub const CK_INVALID_HANDLE: ::std::os::raw::c_uint = 0;

Expected Results

pub const CK_INVALID_HANDLE: ::std::os::raw::c_ulong = 0;

The U (unsigned) prefix is taken into account, but not the L (long) one.
This causes types and casts problems.

Debugging logs:
bindgen.txt

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