<div class="gmail_quote">On 16 January 2012 17:38, Iain Buclaw <span dir="ltr"><<a href="mailto:ibuclaw@ubuntu.com">ibuclaw@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 16 January 2012 14:27, Manu <<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>> wrote:<br>
> On 16 January 2012 15:30, Don Clugston <<a href="mailto:dac@nospam.com">dac@nospam.com</a>> wrote:<br>
>><br>
>> On 16/01/12 01:08, Jonathan M Davis wrote:<br>
>>><br>
>>> On Monday, January 16, 2012 01:44:56 Manu wrote:<br>
>>>><br>
>>>> Surely basic logical expressions within a version seem not only logical,<br>
>>>> but also very necessary?<br>
>>>> There must be a reason this is impossible, or else I can't believe it's<br>
>>>> not<br>
>>>> already like that...<br>
>>><br>
>>><br>
>>> People have requested it. Walter is against it. I don't remember his<br>
>>> exact<br>
>>> arguments, but he believes that it leads to worse code if you allow it.<br>
>>><br>
>>> As for<br>
>>><br>
>>> version(linux || OSX)<br>
>>><br>
>>> you can use<br>
>>><br>
>>> version(Posix)<br>
>>><br>
>>> It'll include FreeBSD as well, but then again, if something is common to<br>
>>> both<br>
>>> linux and OSX, then it's almost certainly in FreeBSD as well.<br>
>>><br>
>>> - Jonathan M Davis<br>
>><br>
>><br>
>> I think both approaches are wrong. I think the idea approach is to treat<br>
>> versions as booleans, and have a one-definition rule.<br>
>><br>
>> version VersionIdentifier = VersionExpression;<br>
>><br>
>> extern version VersionIdentifier;<br>
>> // means this version is set from command line, or is a compiler built-in<br>
>><br>
>> VersionExpression:<br>
>>        VersionExpression && VersionExpression<br>
>>        VersionExpression || VersionExpression<br>
>>        !VersionExpression<br>
>>        ( VersionExpression )<br>
>>        VersionIdentifier<br>
>>        true<br>
>>        false<br>
>><br>
>> version(A)<br>
>> {<br>
>>   version = AorNotB;<br>
>> }<br>
>> version(B)<br>
>> {<br>
>> }<br>
>> else {<br>
>>   version = AorNotB;<br>
>> }<br>
>><br>
>> becomes:<br>
>> version AorNotB = A || !B;<br>
>><br>
>> Make it illegal to reference a version identifier which hasn't been<br>
>> declared. Disallow version declarations inside version blocks, and all the<br>
>> spaghetti is gone.<br>
><br>
><br>
> Will that work? I don't think it's reasonable to expect all versions to be<br>
> declared in all cases/platforms. There are SSE version identifiers for<br>
> instance, why would they be defined on a PPC platform? Likewise any platform<br>
> specific features...<br>
> Otherwise I generally agree. Though again, too much water under the bridge<br>
> to change this decision in the language.<br>
><br>
<br>
</div></div>Are there SSE version identifiers?<br></blockquote><div><br></div><div>I thought I saw some in Walter's commit?</div><div>If not, there probably should be. The compiler receives an SSE level flag (ie. -msse3, etc), and that level needs to be known to the code at compile time so the library can adhere to the appropriate level.</div>
</div>