jacob-carlborg / dstep

A tool for converting C and Objective-C headers to D modules
205 stars 37 forks source link

enh? add enum alias (as dpp do) #283

Closed mw66 closed 2 years ago

mw66 commented 2 years ago

Hi,

I'm using both dpp and dstep, and I found one difference for generated enums:

enum cudaRoundMode
{
    cudaRoundNearest = 0,
    cudaRoundZero = 1,
    cudaRoundPosInf = 2,
    cudaRoundMinInf = 3
}
// dpp will also generate the following alias:
alias cudaRoundNearest = cudaRoundMode.cudaRoundNearest;
alias cudaRoundZero = cudaRoundMode.cudaRoundZero;
alias cudaRoundPosInf = cudaRoundMode.cudaRoundPosInf;
alias cudaRoundMinInf = cudaRoundMode.cudaRoundMinInf;

I'm just wondering if dstep can also generate such alias for enums?

Thanks.

jacob-carlborg commented 2 years ago

Yes, there's a flag for that --alias-enum-members=true.