Skip to content

Keep literals for enum values #158

@jacob-carlborg

Description

@jacob-carlborg

Currently DStep translates the following code:

enum Foo
{
    a = 0x1,
    b = 0x2,
    c = 1 << 0,
    d = ((1 << 22) - 1)
};

To:

extern (C):

enum Foo
{
    a = 1,
    b = 2,
    c = 1,
    d = 4194303
}

It would be nice if the hexadecimal values from the original C code could be kept, like:

extern (C):

enum Foo
{
    a = 0x1,
    b = 0x2,
    c = 1 << 0,
    d = ((1 << 22) - 1)
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions