digitalmars.D - version=Windows / version=linux illegal
- TripleShift (4/4) Mar 14 2005 The compiler's changed so I can't pass these on cmd line any longer, whi...
- Derek Parnell (9/14) Mar 14 2005 This just means you can't use the Windows version of DMD to test for Lin...
- Jamboree (3/18) Mar 14 2005 Not true. I've used it for that also in past, and its worked fine.
- Derek Parnell (31/52) Mar 14 2005 I was talking about what applies *now*, not what you used to be able to ...
- AEon (4/28) Mar 15 2005 Just wanted to mention the above works perfectly, as was stated. Very ha...
- Stewart Gordon (9/18) Mar 15 2005 Used it for what? Cross-compiling, or checking that the other-platform
- Stewart Gordon (9/13) Mar 15 2005 JTAI, if we're going to allow setting these predefined versions, then we...
- Georg Wrede (6/13) Mar 15 2005 Wasn't it
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (4/10) Mar 15 2005 Setting the OS versions was made illegal, that's why it doesn't work.
- Georg Wrede (4/18) Mar 15 2005 Thanks! :-)
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (15/18) Mar 15 2005 No, it's some kind of legacy from some old C compiler...
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
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
"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:Not true. I've used it for that also in past, and its worked fine.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.
Mar 14 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...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 PMOn Tue, 15 Mar 2005 06:12:18 +0000 (UTC), TripleShift wrote:Not true. I've used it for that also in past, and its worked fine.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.
Mar 14 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=GATESJust wanted to mention the above works perfectly, as was stated. Very handy source example. AEon
Mar 15 2005
Jamboree wrote:"Derek Parnell" <derek psych.ward> wrote in message news:66o80t47yj8$.1pna13mmd0vaz.dlg 40tude.net...<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. Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.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 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.
Mar 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.
Mar 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
Mar 15 2005
Anders F Björklund wrote:Georg Wrede wrote:Thanks! :-) Seems I remembered there was an inconsistency, but not what. :-) (Could it be that Walter is a Windows person?) :-)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.
Mar 15 2005
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