Thread overview | ||||||
---|---|---|---|---|---|---|
|
April 10, 2016 version pairs? | ||||
---|---|---|---|---|
| ||||
Seems like there should be an extra level to the version statement, something like version(arch,x86). I must be missing something about the intended use of the version statement. |
April 10, 2016 Re: version pairs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jay Norwood | On Sunday, 10 April 2016 at 13:58:17 UTC, Jay Norwood wrote:
> Seems like there should be an extra level to the version statement, something like version(arch,x86).
>
> I must be missing something about the intended use of the version statement.
This will never be done. The language creator has strong arguments against that. If you search a bit on the forum you'll find the topics where the rationale is given.
|
April 11, 2016 Re: version pairs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jay Norwood | On Sunday, 10 April 2016 at 13:58:17 UTC, Jay Norwood wrote:
> Seems like there should be an extra level to the version statement, something like version(arch,x86).
>
> I must be missing something about the intended use of the version statement.
What's wrong with version(X86)?
|
April 10, 2016 Re: version pairs? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jay Norwood | On Sunday, April 10, 2016 13:58:17 Jay Norwood via Digitalmars-d-learn wrote:
> Seems like there should be an extra level to the version
> statement, something like version(arch,x86).
>
> I must be missing something about the intended use of the version statement.
In most cases that I've seen, you only need one level of version statement - usually a version for the OS is all that's needed. The need for specifying the architecture is _very_ rare from what I've seen. But if you need more levels, then just nest version statements. e.g.
version(linux)
{
version(X86)
{
}
else version(X86_64)
{
}
}
There some places in druntime that nest like that (I think primarily to separate the various C runtimes on systems that don't have only one), but as it is, version statements of any kind aren't needed all that frequently in Phobos - and when they are, it's almost inevitably because they're wrapping C functionality. Pure D stuff tends to be system-agnostic and therefore not version-statement heavy.
- Jonathan M Davis
|
Copyright © 1999-2021 by the D Language Foundation