Jump to page: 1 2
Thread overview
version=Windows / version=linux illegal
Mar 15, 2005
TripleShift
Mar 15, 2005
Derek Parnell
Mar 15, 2005
Jamboree
Mar 15, 2005
Derek Parnell
Mar 15, 2005
AEon
Mar 15, 2005
Stewart Gordon
Mar 15, 2005
Stewart Gordon
Mar 15, 2005
Georg Wrede
Mar 15, 2005
Georg Wrede
March 15, 2005
The compiler's changed so I can't pass these on cmd line any longer, which means can't test compile for other platforms any more. This big problem for writing libs.

Please change back, or add override switch.


March 15, 2005
On Tue, 15 Mar 2005 06:12:18 +0000 (UTC), TripleShift wrote:

> The compiler's changed so I can't pass these on cmd line any longer, which means can't test compile for other platforms any more. This big problem for writing libs.
> 
> Please change back, or add override switch.

This just means you can't use the Windows version of DMD to test for Linux releases, and visa versa. You can't pretend to be using the 'wrong' version of DMD. In other words, DMD is not a cross-platform compiler - you have to use the version of DMD for the platform you are targeting.

-- 
Derek
Melbourne, Australia
15/03/2005 5:40:34 PM
March 15, 2005
"Derek Parnell" <derek@psych.ward> wrote in message news:66o80t47yj8$.1pna13mmd0vaz.dlg@40tude.net...
> On Tue, 15 Mar 2005 06:12:18 +0000 (UTC), TripleShift wrote:
>
>> The compiler's changed so I can't pass these on cmd line any longer,
>> which means
>> can't test compile for other platforms any more. This big problem for
>> writing
>> libs.
>>
>> Please change back, or add override switch.
>
> This just means you can't use the Windows version of DMD to test for
> Linux
> releases, and visa versa. You can't pretend to be using the 'wrong'
> version
> of DMD. In other words, DMD is not a cross-platform compiler - you
> have to
> use the version of DMD for the platform you are targeting.

Not true. I've used it for that also in past, and its worked fine.


March 15, 2005
On Tue, 15 Mar 2005 17:46:36 +1100, Jamboree wrote:

> "Derek Parnell" <derek@psych.ward> wrote in message news:66o80t47yj8$.1pna13mmd0vaz.dlg@40tude.net...
>> On Tue, 15 Mar 2005 06:12:18 +0000 (UTC), TripleShift wrote:
>>
>>> The compiler's changed so I can't pass these on cmd line any longer,
>>> which means
>>> can't test compile for other platforms any more. This big problem for
>>> writing
>>> libs.
>>>
>>> Please change back, or add override switch.
>>
>> This just means you can't use the Windows version of DMD to test for
>> Linux
>> releases, and visa versa. You can't pretend to be using the 'wrong'
>> version
>> of DMD. In other words, DMD is not a cross-platform compiler - you
>> have to
>> use the version of DMD for the platform you are targeting.
> 
> Not true. I've used it for that also in past, and its worked fine.

I was talking about what applies *now*, not what you used to be able to do.

You may have to resort to a trick like this ...

<code>
import std.stdio;

version(NIX)   version=linux;
version(GATES) version=Windows;

char[] graf;

void main()
{
    version(linux)
    {
        graf = "linux rules!";
    }
    else  // <<< Don't forget the 'else'!
    version(Windows)
    {
        graf = "MS-Windows(tm) rules!";
    }

    writefln("%s", graf);
}

</code>

then compile it with ...
   dmd myprog -version=NIX

and

   dmd myprog -version=GATES

-- 
Derek
Melbourne, Australia
15/03/2005 6:23:05 PM
March 15, 2005
Wasn't it
version=windows
version=Linux

A small w and a big L.

(I'm not at a DMD computer right now, but I think that could be it.)

TripleShift wrote:
> The compiler's changed so I can't pass these on cmd line any longer, which means
> can't test compile for other platforms any more. This big problem for writing
> libs.
> 
> Please change back, or add override switch.
> 
> 
March 15, 2005
Georg Wrede wrote:

> Wasn't it
> version=windows
> version=Linux
> 
> A small w and a big L.

Nope, it was Windows and then linux,cygwin,freebsd,darwin,solaris...

> (I'm not at a DMD computer right now, but I think that could be it.)

Setting the OS versions was made illegal, that's why it doesn't work.

--anders
March 15, 2005
Jamboree wrote:
> "Derek Parnell" <derek@psych.ward> wrote in message news:66o80t47yj8$.1pna13mmd0vaz.dlg@40tude.net...
<snip>
>> This just means you can't use the Windows version of DMD to test
>> for Linux releases, and visa versa. You can't pretend to be using
>> the 'wrong' version of DMD. In other words, DMD is not a
>> cross-platform compiler - you have to use the version of DMD for
>> the platform you are targeting.
> 
> Not true. I've used it for that also in past, and its worked fine.

Used it for what?  Cross-compiling, or checking that the other-platform code is valid?

Preventing the user from doing the latter seems an arbitrary restriction.

Stewart.

-- 
My e-mail is valid but not my primary mailbox.  Please keep replies on
the 'group where everyone may benefit.
March 15, 2005
Derek Parnell wrote...

><code>
>import std.stdio;
>
>version(NIX)   version=linux;
>version(GATES) version=Windows;
>
>char[] graf;
>
>void main()
>{
>    version(linux)
>    {
>        graf = "linux rules!";
>    }
>    else  // <<< Don't forget the 'else'!
>    version(Windows)
>    {
>        graf = "MS-Windows(tm) rules!";
>    }
> 
>    writefln("%s", graf);
>}
>
></code>
>
>then compile it with ...
>   dmd myprog -version=NIX
>
>and
>
>   dmd myprog -version=GATES

Just wanted to mention the above works perfectly, as was stated. Very handy source example.

AEon
March 15, 2005
Anders F Björklund wrote:
> Georg Wrede wrote:
> 
>> Wasn't it
>> version=windows
>> version=Linux
>>
>> A small w and a big L.
> 
> 
> Nope, it was Windows and then linux,cygwin,freebsd,darwin,solaris...
> 
>> (I'm not at a DMD computer right now, but I think that could be it.)
> 
> Setting the OS versions was made illegal, that's why it doesn't work.

Thanks! :-)

Seems I remembered there was an inconsistency, but not what.

:-)   (Could it be that Walter is a Windows person?)   :-)
March 15, 2005
Stewart Gordon wrote:
<snip>
> Used it for what?  Cross-compiling, or checking that the other-platform code is valid?
> 
> Preventing the user from doing the latter seems an arbitrary restriction.

JTAI, if we're going to allow setting these predefined versions, then we ought to have a way of switching off versions defined for the local platform.

Stewart.

-- 
My e-mail is valid but not my primary mailbox.  Please keep replies on the 'group where everyone may benefit.
« First   ‹ Prev
1 2