Thread overview
DMD compiler multiple -version
Jul 15, 2004
Pac
Jul 15, 2004
Andy Friesen
Jul 16, 2004
Thomas Kuehne
July 15, 2004
Hello,


is it possible to have something like this in D (in a context where I am interfacing with C code)

version(32Bits)
{
version(Windows)
{
...
}

version(MacOs)
{
...
}
}

version(64Bits)
{
version(Windows)
{
...
}

version(MacOS)
{
...
}
}


how do I tell the D compiler to compile the 32Bits and MacOS version code ?


Best regards

Pac
July 15, 2004
Pac wrote:
> Hello,
> 
> 
> is it possible to have something like this in D (in a context where I am interfacing with C code)
> 
> version(32Bits)
> {
> version(Windows)
> {
> ...
> }
> 
> version(MacOs)
> {
> ...
> }
> }
> 
> version(64Bits)
> {
> version(Windows)
> {
> ...
> }
> 
> version(MacOS)
> {
> ...
> }
> }
> 
> 
> how do I tell the D compiler to compile the 32Bits and MacOS version code ?

To start with, I don't think version identifiers can start with a digit.  You'll have rename them.

As for your question, you can either specify "-version=_32Bits -version=Windows" on the DMD commandline, or, in the source code, you can say "version=_32Bits;" to define a version flag.

 -- andy
July 16, 2004
> > how do I tell the D compiler to compile the 32Bits and MacOS version
code ?
>
> As for your question, you can either specify "-version=_32Bits -version=Windows" on the DMD commandline, or, in the source code, you can say "version=_32Bits;" to define a version flag.

Is there any way to "deregister" a version?

e.g. I am in a Linux environment and don't want to include the "version=linux" parts.

Thomas