www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - When using Win32/x86 in a version block is that the compiler or OS?

reply "Gary Willoughby" <dev nomad.so> writes:
When using Win32/x86 in a version block, does that relate to the 
compiler or OS?

for example:

version(Win32)
{
     // 32bit Windows or 32bit Compiler?
}

version(X86)
{
     // 32bit OS or 32bit Compiler?
}

If these don't relate to the compiler is there any indication 
that the program is being compiled with a 32bit compiler?

I'm primarily asking because i need to use this to constrain dub 
to build different things depending on what compiler is used and 
on what architecture.
Jan 12 2014
next sibling parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Sunday, 12 January 2014 at 18:47:43 UTC, Gary Willoughby wrote:
 When using Win32/x86 in a version block, does that relate to 
 the compiler or OS?

 for example:

 version(Win32)
 {
     // 32bit Windows or 32bit Compiler?
 }

 version(X86)
 {
     // 32bit OS or 32bit Compiler?
 }

 If these don't relate to the compiler is there any indication 
 that the program is being compiled with a 32bit compiler?

 I'm primarily asking because i need to use this to constrain 
 dub to build different things depending on what compiler is 
 used and on what architecture.
version arguments are for the target architecture, not the compiler/build-environment.
Jan 12 2014
parent reply "Gary Willoughby" <dev nomad.so> writes:
On Sunday, 12 January 2014 at 19:01:05 UTC, John Colvin wrote:
 On Sunday, 12 January 2014 at 18:47:43 UTC, Gary Willoughby 
 wrote:
 When using Win32/x86 in a version block, does that relate to 
 the compiler or OS?

 for example:

 version(Win32)
 {
    // 32bit Windows or 32bit Compiler?
 }

 version(X86)
 {
    // 32bit OS or 32bit Compiler?
 }

 If these don't relate to the compiler is there any indication 
 that the program is being compiled with a 32bit compiler?

 I'm primarily asking because i need to use this to constrain 
 dub to build different things depending on what compiler is 
 used and on what architecture.
version arguments are for the target architecture, not the compiler/build-environment.
Are there any for the compiler?
Jan 12 2014
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Sunday, 12 January 2014 at 19:01:56 UTC, Gary Willoughby wrote:
 On Sunday, 12 January 2014 at 19:01:05 UTC, John Colvin wrote:
 On Sunday, 12 January 2014 at 18:47:43 UTC, Gary Willoughby 
 wrote:
 When using Win32/x86 in a version block, does that relate to 
 the compiler or OS?

 for example:

 version(Win32)
 {
   // 32bit Windows or 32bit Compiler?
 }

 version(X86)
 {
   // 32bit OS or 32bit Compiler?
 }

 If these don't relate to the compiler is there any indication 
 that the program is being compiled with a 32bit compiler?

 I'm primarily asking because i need to use this to constrain 
 dub to build different things depending on what compiler is 
 used and on what architecture.
version arguments are for the target architecture, not the compiler/build-environment.
Are there any for the compiler?
http://dlang.org/phobos/std_compiler.html perhaps?
Jan 12 2014
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2014-01-12 19:47, Gary Willoughby wrote:
 When using Win32/x86 in a version block, does that relate to the
 compiler or OS?

 for example:

 version(Win32)
 {
      // 32bit Windows or 32bit Compiler?
 }
Microsoft 32-bit Windows systems
 version(X86)
 {
      // 32bit OS or 32bit Compiler?
 }
Intel and AMD 32-bit processors
 If these don't relate to the compiler is there any indication that the
 program is being compiled with a 32bit compiler?
You might want to use: D_LP64 - Pointers are 64 bits (command line switch -m64). (Do not confuse this with C's LP64 model) I don't think what you're asking for is useful. The 32bit compiler can compile both 32bit and 64bit code, at least DMD.
 I'm primarily asking because i need to use this to constrain dub to
 build different things depending on what compiler is used and on what
 architecture.
DigitalMars - DMD GNU - GDC LDC - LDC SDC - SDC A complete list of predefined versions can be found here: http://dlang.org/version.html#PredefinedVersions -- /Jacob Carlborg
Jan 13 2014