C header file: tagged enumerations
    Steven Schveighoffer via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Wed Apr 27 09:04:13 PDT 2016
    
    
  
On 4/26/16 7:40 PM, Adam D. Ruppe wrote:
> On Tuesday, 26 April 2016 at 23:33:08 UTC, Stefan Koch wrote:
>> static if (win32msi >= 500) .....
>
> Won't work here because static if must have a complete declaration
> inside it, and the C pattern only has a few elements of the whole inside
> each #if.
>
> D doesn't handle this C pattern well... you basically have to rewrite
> the whole thing for each version.
>
> Personally, I just decide to support all of them and say the older
> versions with less declarations are less supported...
Hm... doesn't the way the enumeration assigns values mean that on older 
systems, the values would change for the same symbols?
BTW, this enumeration looks terrible. I would flag this as blocking if 
it were a code review, even in C++.
-Steve
    
    
More information about the Digitalmars-d-learn
mailing list