www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - version=Windows / version=linux illegal

reply TripleShift <TripleShift_member pathlink.com> writes:
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.
Mar 14 2005
next sibling parent reply Derek Parnell <derek psych.ward> writes:
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
Mar 14 2005
parent reply "Jamboree" <jam bor.ee> writes:
"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.
Mar 14 2005
next sibling parent reply Derek Parnell <derek psych.ward> writes:
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
Mar 14 2005
parent AEon <AEon_member pathlink.com> writes:
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
Mar 15 2005
prev sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Jamboree wrote:
 "Derek Parnell" <derek psych.ward> wrote in message 
 news:66o80t47yj8$.1pna13mmd0vaz.dlg 40tude.net...

 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.
Mar 15 2005
parent Stewart Gordon <smjg_1998 yahoo.com> writes:
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.
Mar 15 2005
prev sibling parent reply Georg Wrede <georg.wrede nospam.org> writes:
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.
 
 

Mar 15 2005
parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
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
Mar 15 2005
parent reply Georg Wrede <georg.wrede nospam.org> writes:
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?) :-)
Mar 15 2005
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Georg Wrede wrote:

 Seems I remembered there was an inconsistency, but not what.
 
 :-)   (Could it be that Walter is a Windows person?)   :-)

No, it's some kind of legacy from some old C compiler... I think the current platform "version"s are a bit limited anyway, since they focus on the running operating system. (so for DMD, that is either "Windows" or "linux" <sic> - and for GDC it's : linux/cygwin/freebsd/darwin/solaris) Probably would better to target APIs, like Win32 and Posix ? That would also mean that you could cross-compile to a different target, by using for instance the Wine libraries (or something) ? (http://www.winehq.com/ has most of the Win32 libs, for Unix) But that's a greater change than just changing the spelling from Windows to windows, for "consistency" over platforms... See also http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/Version (for some reason the non-DMD version take ages to appear in the spec) --anders
Mar 15 2005