version and extern problems

torhu fake at address.dude
Sun Jul 8 08:49:03 PDT 2007


Mike Wey wrote:
> Should this work?
> 
> version(Windows)
> {   const char[] external = "extern(Windows):"; }
> else
> {   const char[] external = "extern(C):"; }
> 
> mixin(external);
> typedef void function() foo;
> 

DMD 1.018 accepts that.  But maybe that's a bug too, since string mixins 
are supposed to be either an expression, a statement, or a declaration 
or definition?  According to the spec, it seems to be a valid 
AttributeSpecifier, which in turn is a valid DeclDef.  But Walter didn't 
suggest it as a workaround, which makes me worried.



More information about the Digitalmars-d mailing list