www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DMD compiler multiple -version

reply Pac <Pac_member pathlink.com> writes:
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
Jul 15 2004
parent reply Andy Friesen <andy ikagames.com> writes:
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
Jul 15 2004
parent "Thomas Kuehne" <eisvogel users.sourceforge.net> writes:
 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
Jul 16 2004