Skip to content
New issue

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

Incorrect enum generation when using "strip-enum-member-type-name" #576

Open
izicoder opened this issue Oct 7, 2024 · 0 comments
Open

Comments

@izicoder
Copy link

izicoder commented Oct 7, 2024

Original code C code

typedef enum WGPUInstanceBackend {
    WGPUInstanceBackend_All = 0x00000000,
    WGPUInstanceBackend_Vulkan = 1 << 0,
    WGPUInstanceBackend_GL = 1 << 1,
    WGPUInstanceBackend_Metal = 1 << 2,
    WGPUInstanceBackend_DX12 = 1 << 3,
    WGPUInstanceBackend_DX11 = 1 << 4,
    WGPUInstanceBackend_BrowserWebGPU = 1 << 5,
    WGPUInstanceBackend_Primary = WGPUInstanceBackend_Vulkan | WGPUInstanceBackend_Metal |
        WGPUInstanceBackend_DX12 |
        WGPUInstanceBackend_BrowserWebGPU,
    WGPUInstanceBackend_Secondary = WGPUInstanceBackend_GL | WGPUInstanceBackend_DX11,
    WGPUInstanceBackend_Force32 = 0x7FFFFFFF
} WGPUInstanceBackend;

Generated code

public enum WGPUInstanceBackend
{
    All = 0x00000000,
    Vulkan = 1 << 0,
    GL = 1 << 1,
    Metal = 1 << 2,
    DX12 = 1 << 3,
    DX11 = 1 << 4,
    BrowserWebGPU = 1 << 5,
    Primary =
        WGPUInstanceBackend_Vulkan
        | WGPUInstanceBackend_Metal
        | WGPUInstanceBackend_DX12
        | WGPUInstanceBackend_BrowserWebGPU,
    Secondary = WGPUInstanceBackend_GL | WGPUInstanceBackend_DX11,
    Force32 = 0x7FFFFFFF,
}

I mean it is not such critical issue, but still...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant