Re: Ver 4.0 ifdef question
- Posted by bernie Sep 03, 2008
- 853 views
I don't think you understand my question.
I write a cross platform library that can be used on the following platforms.
DOS WINDOWS LINUXA user can include it on any platform.
How does the library know what platform it is running on without the platform() ???
What big advantage does removing platform() from the interpeter have ???
Derek answered this incorrect assumption about the future of platform(), but since the question keeps coming up, maybe we need multiple answers, too.
platform() exists in 4.0. There are no plans to remove it. There was an incorrect statement in an earlier version of the docs.
Something that Derek didn't explicitly say is that the parser defines an ifdef (that's awkwardwhat's the correct wording for this?) for the native platform of the binary itself (exw.exe, exu, ec.exe, etc) by default. So however you run your code, it will know which platform it's running on because WIN or DOS or UNIX or LINUX or BSD or OSX (multiples on Unix-like OSes) will be defined.
Additional defs (which are application specific, or possibly 'special' ones like SAFE) can be defined either on the command line (-D <word>) or in the source code like this:
with define MATT
Matt
Thanks Everyone !
For your replys.
Bernie