version and extern problems

Chris Miller chris at dprogramming.com
Tue Jul 10 09:31:17 PDT 2007


On Mon, 09 Jul 2007 14:01:11 -0400, Walter Bright  
<newshound1 at digitalmars.com> wrote:

> Georg Wrede wrote:
>> Why not
>>    extern(ecc) void function() foo;
>>  where ecc would resolve to Windows or C.
>>  This of course requires some tweaking of the compiler, but it might be  
>> worth it.
>
> Do you mean "ecc" being a magic identifier that the compiler sets to  
> Windows on Windows, and C otherwise? That might be a pretty good idea.  
> Why "ecc", though? It doesn't jump out at me what it might mean.
>
> How about "System" ?

I don't know; why not let it just be a string literal...

version(Windows)
	const char[] mylibcall = "Windows";
else
	const char[] mylibcall = "C";

extern(mylibcall) void function() foo;



More information about the Digitalmars-d mailing list