version and extern problems

Julio César Carrascal Urquijo jcesar at phreaker.net
Sun Jul 8 15:24:55 PDT 2007


Russell Lewis wrote:
> This sounds like the perfect place for alias, or something like it.  The 
> idea would be to write code like this:
> 

(...)

> 
> 2) alias extern(Windows) myAlias;
> 
> I don't like how this breaks the parallelism.  Would you use the alias 
> extern(myAlias)?  Or would you drop the extern() part around it?  If the 
> latter, how would you parse it without ambiguities?
> 
> Plus, the same problem as before where it looks like extern(Windows) is 
> an attribute on something else.

This is exactly what I thought while reading the OP. Maybe it would be 
clearer if the scope syntax is reused for alias:

version (Windows)
	alias(extern) Windows MyAlias;
else
	alias(extern) C MyAlias;

extern(MyAlias):

void foo();
void bar();

...



More information about the Digitalmars-d mailing list