I want to port some of my classes to FPC/Lazarus, what conditional symbol can I use to detect other platforms different of Win32 and .NET? I would prefer not to use an {$ELSE} if possible. :?
Regards!
-Marco
I want to port some of my classes to FPC/Lazarus, what conditional symbol can I use to detect other platforms different of Win32 and .NET? I would prefer not to use an {$ELSE} if possible. :?
Regards!
-Marco
You can use.
{$IFDEF FPC} // free pascal compiler
{$ENDIF}
{$IFDEF LINUX} //linux
{$ENDIF}
{$IFDEF DARWIN} //macosx
{$ENDIF}
Hope that helps
<A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
<br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
<br /></A>
Hey thanks!
Is there a list of all of those defines?
You can read the complete list of predefined symbols in the G appendix of the FPC's programmers manual.
Link
No signature provided yet.
Note that in general you want to use {$ifdef unix} for all Unix like platforms (FreeBSD, Mac OS X, Solaris , Linux).Originally Posted by technomage
Reserve linux for the real (relatively rare) linuxisms.
Also try to use system/sysutils variables as much as possible (e.g. dirseparator)
Bookmarks