We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default
I don't know if this is a bug, or it is by design.
A minimal header
typedef enum cudaError_enum { CUDA_SUCCESS = 0, CUDA_ERROR_INVALID_VALUE = 1, CUDA_ERROR_OUT_OF_MEMORY = 2, };
With bindgen 0.69.4.
bindgen \ --default-enum-style=newtype \ --with-derive-default \ header.h
impl cudaError_enum { pub const CUDA_SUCCESS: cudaError_enum = cudaError_enum(0); } impl cudaError_enum { pub const CUDA_ERROR_INVALID_VALUE: cudaError_enum = cudaError_enum(1); } impl cudaError_enum { pub const CUDA_ERROR_OUT_OF_MEMORY: cudaError_enum = cudaError_enum(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct cudaError_enum(pub ::std::os::raw::c_uint);
Currently I have to use
bindgen \ --default-enum-style=newtype \ --with-derive-default \ --with-derive-custom .*_enum=Default \ header.h
to generate
impl cudaError_enum { pub const CUDA_SUCCESS: cudaError_enum = cudaError_enum(0); } impl cudaError_enum { pub const CUDA_ERROR_INVALID_VALUE: cudaError_enum = cudaError_enum(1); } impl cudaError_enum { pub const CUDA_ERROR_OUT_OF_MEMORY: cudaError_enum = cudaError_enum(2); } #[repr(transparent)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Default)] pub struct cudaError_enum(pub ::std::os::raw::c_uint);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I don't know if this is a bug, or it is by design.
Input C/C++ Header
A minimal header
Bindgen Invocation
With bindgen 0.69.4.
Actual Results
Expected Results
Currently I have to use
to generate
The text was updated successfully, but these errors were encountered: