Results 1 to 5 of 5

Thread: {$IFDEF Win32}, {$IFDEF CLR}, and what for multiplatform?

  1. #1

    {$IFDEF Win32}, {$IFDEF CLR}, and what for multiplatform?

    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

  2. #2

    {$IFDEF Win32}, {$IFDEF CLR}, and what for multiplatform?

    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>

  3. #3

    {$IFDEF Win32}, {$IFDEF CLR}, and what for multiplatform?

    Hey thanks!

    Is there a list of all of those defines?

  4. #4

    {$IFDEF Win32}, {$IFDEF CLR}, and what for multiplatform?

    You can read the complete list of predefined symbols in the G appendix of the FPC's programmers manual.

    Link
    No signature provided yet.

  5. #5

    {$IFDEF Win32}, {$IFDEF CLR}, and what for multiplatform?

    Quote Originally Posted by technomage

    {$IFDEF LINUX} //linux
    {$ENDIF}
    Note that in general you want to use {$ifdef unix} for all Unix like platforms (FreeBSD, Mac OS X, Solaris , Linux).

    Reserve linux for the real (relatively rare) linuxisms.

    Also try to use system/sysutils variables as much as possible (e.g. dirseparator)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •