Re: When using Win32/x86 in a version block is that the compiler or OS?

2014-01-13 Thread Jacob Carlborg

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


When using Win32/x86 in a version block is that the compiler or OS?

2014-01-12 Thread Gary Willoughby
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.


Re: When using Win32/x86 in a version block is that the compiler or OS?

2014-01-12 Thread John Colvin

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.


Re: When using Win32/x86 in a version block is that the compiler or OS?

2014-01-12 Thread Gary Willoughby

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?


Re: When using Win32/x86 in a version block is that the compiler or OS?

2014-01-12 Thread John Colvin

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?