| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176 |
- {$IFDEF CONDITIONALEXPRESSIONS}
- // Must be at the top...
- {$IF CompilerVersion >= 24.0}
- {$LEGACYIFEND ON}
- {$IFEND}
- {$ENDIF}
- // General
- // Make this $DEFINE to use the 16 color icons required by Borland
- // or DEFINE to use the 256 color Indy versions
- {.$DEFINE Borland}
- // When generating C++Builder output files, certain workarounds to compiler
- // problems need to be enabled! When invoking DCC on the command-line, use
- // the -DBCB parameter. When invoking MSBUILD, include the DCC_Define="BCB"
- // attribute in the /p parameter.
- {$IFDEF BCB}
- {$DEFINE CBUILDER}
- {$ELSE}
- {$DEFINE DELPHI}
- {$ENDIF}
- {$UNDEF STATICLOAD_OPENSSL}
- // Make sure the following are $DEFINE'd only for Delphi/C++Builder 2009 onwards
- // as specified further below. The VCL is fully Unicode, where the 'String'
- // type maps to System.UnicodeString, not System.AnsiString anymore
- {$UNDEF STRING_IS_UNICODE}
- {$UNDEF STRING_IS_ANSI}
- // Make sure the following are $DEFINE'd only for suitable environments
- // as specified further below. Delphi/C++Builder Mobile/NextGen compilers
- // do not support Ansi data types anymore, and is moving away from raw
- // pointers as well.
- //
- // UPDATE: in Delphi/C++Builder 10.4, all Ansi types are supported again on
- // all platforms, including the mobile compilers.
- {$DEFINE HAS_PAnsiChar}
- {$UNDEF NO_ANSI_TYPES}
- // Make sure the following are $DEFINE'd only for suitable environments
- // as specified further below. Delphi/C++Builder Mobile/NextGen compilers
- // use ARC for TObject life time management.
- //
- // UPDATE: ARC for TObject lifetime management has been removed in
- // Delphi/C++Builder 10.4 mobile compilers. All platforms now use a single
- // unified memory management model!
- {$UNDEF USE_MARSHALLED_PTRS}
- {$UNDEF USE_OBJECT_ARC}
- //Define for Delphi cross-compiler targetting Posix
- {$UNDEF USE_VCL_POSIX}
- // detect compiler versions
- {$IFNDEF FPC}
- // TODO: to detect features in Delphi/C++Builder v6 and later, use CompilerVersion
- // and RTLVersion constants instead of VERXXX defines. We still support v5, which
- // does not have such constants.
- // Delphi 4
- {$IFDEF VER120}
- {$DEFINE DCC}
- {$DEFINE VCL_40}
- {$DEFINE DELPHI_4}
- {$ENDIF}
- // C++Builder 4
- {$IFDEF VER125}
- {$DEFINE DCC}
- {$DEFINE VCL_40}
- {$DEFINE CBUILDER_4}
- {$ENDIF}
- // Delphi & C++Builder 5
- {$IFDEF VER130}
- {$DEFINE DCC}
- {$DEFINE VCL_50}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_5}
- {$ELSE}
- {$DEFINE DELPHI_5}
- {$ENDIF}
- {$ENDIF}
- //Delphi & C++Builder 6
- {$IFDEF VER140}
- {$DEFINE DCC}
- {$DEFINE VCL_60}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_6}
- {$ELSE}
- {$DEFINE DELPHI_6}
- {$ENDIF}
- {$ENDIF}
- //Delphi 7
- {$IFDEF VER150}
- {$DEFINE DCC}
- {$DEFINE VCL_70}
- {$DEFINE DELPHI_7} // there was no C++ Builder 7
- {$ENDIF}
- //Delphi 8
- {$IFDEF VER160}
- {$DEFINE DCC}
- {$DEFINE VCL_80}
- {$DEFINE DELPHI_8} // there was no C++ Builder 8
- {$ENDIF}
- //Delphi 2005
- {$IFDEF VER170}
- {$DEFINE DCC}
- {$DEFINE VCL_2005}
- {$DEFINE DELPHI_2005} // there was no C++Builder 2005
- {$ENDIF}
- // NOTE: CodeGear decided to make Highlander be a non-breaking release
- // (no interface changes, thus fully backwards compatible without any
- // end user code changes), so VER180 applies to both BDS 2006 and
- // Highlander prior to the release of RAD Studio 2007. Use VER185 to
- // identify Highlanger specifically.
- //Delphi & C++Builder 2006
- //Delphi & C++Builder 2007 (Highlander)
- {$IFDEF VER180}
- {$DEFINE DCC}
- {$DEFINE VCL_2006}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_2006}
- {$ELSE}
- {$DEFINE DELPHI_2006}
- {$ENDIF}
- {$ENDIF}
- //Delphi & C++Builder 2007 (Highlander)
- {$IFDEF VER185}
- {$DEFINE DCC}
- {$UNDEF VCL_2006}
- {$DEFINE VCL_2007}
- {$IFDEF CBUILDER}
- {$UNDEF CBUILDER_2006}
- {$DEFINE CBUILDER_2007}
- {$ELSE}
- {$UNDEF DELPHI_2006}
- {$DEFINE DELPHI_2007}
- {$ENDIF}
- {$ENDIF}
- // BDS 2007 NET personality uses VER190 instead of 185.
- //Delphi .NET 2007
- {$IFDEF VER190}
- {$DEFINE DCC}
- {$IFDEF CIL}
- //Delphi 2007
- {$DEFINE VCL_2007}
- {$DEFINE DELPHI_2007}
- {$ENDIF}
- {$ENDIF}
- //Delphi & C++Builder 2009 (Tiburon)
- {$IFDEF VER200}
- {$DEFINE DCC}
- {$DEFINE VCL_2009}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_2009}
- {$ELSE}
- {$DEFINE DELPHI_2009}
- {$ENDIF}
- {$ENDIF}
- //Delphi & C++Builder 2010 (Weaver)
- {$IFDEF VER210}
- {$DEFINE DCC}
- {$DEFINE VCL_2010}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_2010}
- {$ELSE}
- {$DEFINE DELPHI_2010}
- {$ENDIF}
- {$ENDIF}
- //Delphi & C++Builder XE (Fulcrum)
- {$IFDEF VER220}
- //REMOVE DCC DEFINE after the next Fulcrum beta.
- //It will be defined there.
- {$IFNDEF DCC}
- {$DEFINE DCC}
- {$ENDIF}
- {$DEFINE VCL_XE}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_XE}
- {$ELSE}
- {$DEFINE DELPHI_XE}
- {$ENDIF}
- {$ENDIF}
- // DCC is now defined by the Delphi compiler starting in XE2
- //Delphi & CBuilder XE2 (Pulsar)
- {$IFDEF VER230}
- {$DEFINE VCL_XE2}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_XE2}
- {$ELSE}
- {$DEFINE DELPHI_XE2}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder XE3 (Waterdragon)
- //Delphi & CBuilder XE3.5 (Quintessence - early betas only)
- {$IFDEF VER240}
- {$DEFINE VCL_XE3}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_XE3}
- {$ELSE}
- {$DEFINE DELPHI_XE3}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder XE4 (Quintessence)
- {$IFDEF VER250}
- {$UNDEF VCL_XE3}
- {$DEFINE VCL_XE4}
- {$IFDEF CBUILDER}
- {$UNDEF CBUILDER_XE3}
- {$DEFINE CBUILDER_XE4}
- {$ELSE}
- {$UNDEF DELPHI_XE3}
- {$DEFINE DELPHI_XE4}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder XE5 (Zephyr)
- {$IFDEF VER260}
- {$DEFINE VCL_XE5}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_XE5}
- {$ELSE}
- {$DEFINE DELPHI_XE5}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder AppMethod
- //AppMethod is just XE5 for mobile only, VCL is removed
- {$IFDEF VER265}
- {$DEFINE VCL_XE5}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_XE5}
- {$ELSE}
- {$DEFINE DELPHI_XE5}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder XE6 (Proteus)
- {$IFDEF VER270}
- {$DEFINE VCL_XE6}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_XE6}
- {$ELSE}
- {$DEFINE DELPHI_XE6}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder XE7 (Carpathia)
- {$IFDEF VER280}
- {$DEFINE VCL_XE7}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_XE7}
- {$ELSE}
- {$DEFINE DELPHI_XE7}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder XE8 (Elbrus)
- {$IFDEF VER290}
- {$DEFINE VCL_XE8}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_XE8}
- {$ELSE}
- {$DEFINE DELPHI_XE8}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder 10.0 Seattle (Aitana)
- {$IFDEF VER300}
- {$DEFINE VCL_10_0}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_VCL_10_0}
- {$ELSE}
- {$DEFINE DELPHI_VCL_10_0}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder 10.1 Berlin (BigBen)
- {$IFDEF VER310}
- {$DEFINE VCL_10_1}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_10_1}
- {$ELSE}
- {$DEFINE DELPHI_10_1}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder 10.2 Tokyo (Godzilla)
- {$IFDEF VER320}
- {$DEFINE VCL_10_2}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_10_2}
- {$ELSE}
- {$DEFINE DELPHI_10_2}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder 10.3 Rio (Carnival)
- {$IFDEF VER330}
- {$DEFINE VCL_10_3}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_10_3}
- {$ELSE}
- {$DEFINE DELPHI_10_3}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder 10.4 Sydney (Denali)
- {$IFDEF VER340}
- {$DEFINE VCL_10_4}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_10_4}
- {$ELSE}
- {$DEFINE DELPHI_10_4}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder 11.0 Alexandria (Olympus)
- {$IFDEF VER350}
- {$DEFINE VCL_11}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_11}
- {$ELSE}
- {$DEFINE DELPHI_11}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder 12.0 Athens (Yukon)
- {$IFDEF VER360}
- {$DEFINE VCL_12}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_12}
- {$ELSE}
- {$DEFINE DELPHI_12}
- {$ENDIF}
- {$ENDIF}
- //Delphi & CBuilder 13.0+ (?)
- {$IFDEF CONDITIONALEXPRESSIONS}
- {$IF CompilerVersion >= 37}
- {$MESSAGE WARN 'Unknown compiler version detected! Assuming >= 13.x '}
- {$DEFINE VCL_UNKNOWN_VERSION}
- {$DEFINE VCL_13}
- {$IFDEF CBUILDER}
- {$DEFINE CBUILDER_13}
- {$ELSE}
- {$DEFINE DELPHI_13}
- {$ENDIF}
- {$IFEND}
- {$ENDIF}
- // Kylix
- //
- //Important: Don't use CompilerVersion here as IF's are evaluated before
- //IFDEF's and Kylix 1 does not have CompilerVersion defined at all.
- {$IFDEF LINUX}
- {$DEFINE UNIX}
- {$IFDEF CONDITIONALEXPRESSIONS}
- {$IF (RTLVersion >= 14.0) and (RTLVersion <= 14.5) }
- {$DEFINE KYLIX}
- {$IF RTLVersion = 14.5}
- {$DEFINE KYLIX_3}
- {$ELSEIF RTLVersion >= 14.2}
- {$DEFINE KYLIX_2}
- {$ELSE}
- {$DEFINE KYLIX_1}
- {$IFEND}
- {$IFEND}
- {$ENDIF}
- {$ENDIF}
- {$ENDIF}
- // Delphi.NET
- // Covers D8+
- {$IFDEF CIL}
- // Platform specific conditional. Used for platform specific code.
- {$DEFINE DOTNET}
- {$DEFINE STRING_IS_UNICODE}
- {$ENDIF}
- {$IFDEF KYLIX}
- {$DEFINE VCL_60}
- {$DEFINE CPUI386}
- {$UNDEF USE_BASEUNIX}
- {$IFDEF KYLIX_3}
- {$DEFINE KYLIX_3_OR_ABOVE}
- {$ENDIF}
- {$IFDEF KYLIX_3_OR_ABOVE}
- {$DEFINE KYLIX_2_OR_ABOVE}
- {$ELSE}
- {$IFDEF KYLIX_2}
- {$DEFINE KYLIX_2_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF KYLIX_2_OR_ABOVE}
- {$DEFINE KYLIX_1_OR_ABOVE}
- {$ELSE}
- {$IFDEF KYLIX_1}
- {$DEFINE KYLIX_1_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFNDEF KYLIX_3_OR_ABOVE}
- {$DEFINE KYLIXCOMPAT}
- {$ENDIF}
- {$ENDIF}
- // FPC (2+)
- {$IFDEF FPC}
- // TODO: In FreePascal 4.2.0+, a Delphi-like UnicodeString type is supported.
- // However, String/(P)Char do not map to UnicodeString/(P)WideChar unless
- // either {$MODE DelphiUnicode} or {$MODESWITCH UnicodeStrings} is used.
- // We should consider enabling one of them so Indy uses the same Unicode logic
- // in Delphi 2009+ and FreePascal 4.2.0+ and reduces IFDEFs (in particular,
- // STRING_UNICODE_MISMATCH, see further below). However, FreePascal's RTL
- // is largely not UnicodeString-enabled yet. Maybe we should enable
- // {$MODE DelphiUnicode} anyway, and then deal with any RTL function issues
- // on an as-needed basis...
- {$MODE Delphi}
- {$IFDEF FPC_2_7_1_OR_ABOVE}
- {.$MODE DelphiUnicode}
- {.$MODESWITCH UnicodeStrings}
- {.$CODEPAGE UTF8} // needed for Unicode string literals to work properly
- {$ENDIF}
- //note that we may need further defines for widget types depending on
- //what we do and what platforms we support in FPC.
- //I'll let Marco think about that one.
- {$IFDEF UNIX}
- {$DEFINE USE_BASEUNIX}
- {$IFDEF LINUX}
- //In Linux for I386, you can choose between a Kylix-libc API or
- //the standard RTL Unix API. Just pass -dKYLIXCOMPAT to the FPC compiler.
- //I will see what I can do about the Makefile.
- {$IFDEF KYLIXCOMPAT}
- {$IFDEF CPUI386}
- {$UNDEF USE_BASEUNIX}
- {$ENDIF}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF USE_BASEUNIX}
- {$UNDEF KYLIXCOMPAT}
- {$ENDIF}
- {$ENDIF}
- // FPC_FULLVERSION was added in FPC 2.2.4
- // Have to use Defined() or else Delphi compiler chokes, since it
- // evaluates $IF statements before $IFDEF statements...
- {$MACRO ON} // must be on in order to use versioning macros
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30101)}
- {$DEFINE FPC_3_1_1_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30000)}
- {$DEFINE FPC_3_0_0_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20701)}
- {$DEFINE FPC_2_7_1_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20604)}
- {$DEFINE FPC_2_6_4_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20602)}
- {$DEFINE FPC_2_6_2_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20600)}
- {$DEFINE FPC_2_6_0_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20404)}
- {$DEFINE FPC_2_4_4_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20402)}
- {$DEFINE FPC_2_4_2_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20400)}
- {$DEFINE FPC_2_4_0_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20204)}
- {$DEFINE FPC_2_2_4_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20202)}
- {$DEFINE FPC_2_2_2_OR_ABOVE}
- {$IFEND}
- {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20105)}
- {$DEFINE FPC_2_1_5_OR_ABOVE}
- {$IFEND}
- // just in case
- {$IFDEF FPC_3_1_1}
- {$DEFINE FPC_3_1_1_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_3_0_0}
- {$DEFINE FPC_3_0_0_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_7_1}
- {$DEFINE FPC_2_7_1_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_6_4}
- {$DEFINE FPC_2_6_4_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_6_2}
- {$DEFINE FPC_2_6_2_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_6_0}
- {$DEFINE FPC_2_6_0_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_4_4}
- {$DEFINE FPC_2_4_4_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_4_2}
- {$DEFINE FPC_2_4_2_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_4_0}
- {$DEFINE FPC_2_4_0_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_2_4}
- {$DEFINE FPC_2_2_4_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_2_2}
- {$DEFINE FPC_2_2_2_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_2_1_5}
- {$DEFINE FPC_2_1_5_OR_ABOVE}
- {$ENDIF}
- {$IFDEF FPC_3_1_1_OR_ABOVE}
- {$DEFINE FPC_3_0_0_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_3_0_0}
- {$DEFINE FPC_3_0_0_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_3_0_0_OR_ABOVE}
- {$DEFINE FPC_2_7_1_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_7_1}
- {$DEFINE FPC_2_7_1_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_7_1_OR_ABOVE}
- {$DEFINE FPC_2_6_4_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_6_4}
- {$DEFINE FPC_2_6_4_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_6_4_OR_ABOVE}
- {$DEFINE FPC_2_6_2_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_6_2}
- {$DEFINE FPC_2_6_2_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_6_2_OR_ABOVE}
- {$DEFINE FPC_2_6_0_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_6_0}
- {$DEFINE FPC_2_6_0_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_6_0_OR_ABOVE}
- {$DEFINE FPC_2_4_4_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_4_4}
- {$DEFINE FPC_2_4_4_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_4_4_OR_ABOVE}
- {$DEFINE FPC_2_4_2_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_4_2}
- {$DEFINE FPC_2_4_2_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_4_2_OR_ABOVE}
- {$DEFINE FPC_2_4_0_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_4_0}
- {$DEFINE FPC_2_4_0_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_4_0_OR_ABOVE}
- {$DEFINE FPC_2_2_4_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_2_4}
- {$DEFINE FPC_2_2_4_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_2_4_OR_ABOVE}
- {$DEFINE FPC_2_2_2_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_2_2}
- {$DEFINE FPC_2_2_2_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_2_2_OR_ABOVE}
- {$DEFINE FPC_2_2_0_OR_ABOVE}
- {$ELSE}
- {$IFDEF VER2_2}
- {$DEFINE FPC_2_2_0_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC_2_2_0_OR_ABOVE}
- {$DEFINE FPC_2_1_5_OR_ABOVE}
- {$ELSE}
- {$IFDEF FPC_2_1_5}
- {$DEFINE FPC_2_1_5_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {.$IFDEF FPC_2_7_1_OR_ABOVE}
- // support for RawByteString and UnicodeString
- {.$DEFINE VCL_2009}
- {.$DEFINE DELPHI_2009}
- {.$ELSE}
- {$DEFINE VCL_70}
- {$DEFINE DELPHI_7}
- {.$ENDIF}
- {$ENDIF}
- // end FPC
- {$IFDEF VCL_13}
- {$DEFINE VCL_13_OR_ABOVE}
- {$ENDIF}
- {$IFDEF VCL_13_OR_ABOVE}
- {$DEFINE VCL_12_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_12}
- {$DEFINE VCL_12_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_12_OR_ABOVE}
- {$DEFINE VCL_11_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_11}
- {$DEFINE VCL_11_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_11_OR_ABOVE}
- {$DEFINE VCL_10_4_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_10_4}
- {$DEFINE VCL_10_4_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_10_4_OR_ABOVE}
- {$DEFINE VCL_10_3_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_10_3}
- {$DEFINE VCL_10_3_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_10_3_OR_ABOVE}
- {$DEFINE VCL_10_2_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_10_2}
- {$DEFINE VCL_10_2_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_10_2_OR_ABOVE}
- {$DEFINE VCL_10_1_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_10_1}
- {$DEFINE VCL_10_1_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_10_1_OR_ABOVE}
- {$DEFINE VCL_10_0_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_10_0}
- {$DEFINE VCL_10_0_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_10_0_OR_ABOVE}
- {$DEFINE VCL_XE8_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_XE8}
- {$DEFINE VCL_XE8_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE8_OR_ABOVE}
- {$DEFINE VCL_XE7_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_XE7}
- {$DEFINE VCL_XE7_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE7_OR_ABOVE}
- {$DEFINE VCL_XE6_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_XE6}
- {$DEFINE VCL_XE6_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE6_OR_ABOVE}
- {$DEFINE VCL_XE5_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_XE5}
- {$DEFINE VCL_XE5_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE5_OR_ABOVE}
- {$DEFINE VCL_XE4_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_XE4}
- {$DEFINE VCL_XE4_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE4_OR_ABOVE}
- {$DEFINE VCL_XE3_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_XE3}
- {$DEFINE VCL_XE3_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE3_OR_ABOVE}
- {$DEFINE VCL_XE2_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_XE2}
- {$DEFINE VCL_XE2_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE2_OR_ABOVE}
- {$DEFINE VCL_XE_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_XE}
- {$DEFINE VCL_XE_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE_OR_ABOVE}
- {$DEFINE VCL_2010_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_2010}
- {$DEFINE VCL_2010_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_2010_OR_ABOVE}
- {$DEFINE VCL_2009_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_2009}
- {$DEFINE VCL_2009_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_2009_OR_ABOVE}
- {$DEFINE VCL_2007_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_2007}
- {$DEFINE VCL_2007_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_2007_OR_ABOVE}
- {$DEFINE VCL_2006_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_2006}
- {$DEFINE VCL_2006_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_2006_OR_ABOVE}
- {$DEFINE VCL_2005_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_2005}
- {$DEFINE VCL_2005_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_2005_OR_ABOVE}
- {$DEFINE VCL_8_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_80}
- {$DEFINE VCL_8_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_8_OR_ABOVE}
- {$DEFINE VCL_7_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_70}
- {$DEFINE VCL_7_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_7_OR_ABOVE}
- {$DEFINE VCL_6_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_60}
- {$DEFINE VCL_6_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_6_OR_ABOVE}
- {$DEFINE VCL_5_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_50}
- {$DEFINE VCL_5_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_5_OR_ABOVE}
- {$DEFINE VCL_4_OR_ABOVE}
- {$ELSE}
- {$IFDEF VCL_40}
- {$DEFINE VCL_4_OR_ABOVE}
- {$ENDIF}
- {$ENDIF}
- // Normalize Delphi compiler defines to match FPC for consistency:
- //
- // CPU32 - any 32-bit CPU
- // CPU64 - any 64-bit CPU
- // WINDOWS - any Windows platform (32-bit, 64-bit, CE)
- // WIN32 - Windows 32-bit
- // WIN64 - Windows 64-bit
- // WINCE - Windows CE
- //
- // Consult the "Free Pascal Programmer's Guide", Appendix G for the complete
- // list of defines that are used. Do not work on this unless you understand
- // what the FreePascal developers are doing. Not only do you have to
- // descriminate with operating systems, but also with chip architectures
- // are well.
- //
- // DCC Pulsar+ define the following values:
- // ASSEMBLER
- // DCC
- // CONDITIONALEXPRESSIONS
- // NATIVECODE
- // UNICODE
- // MACOS
- // MACOS32
- // MACOS64
- // MSWINDOWS
- // WIN32
- // WIN64
- // LINUX
- // POSIX
- // POSIX32
- // CPU386
- // CPUX86
- // CPUX64
- //
- // Kylix defines the following values:
- // LINUX
- // (others??)
- //
- {$IFNDEF FPC}
- // TODO: We need to use ENDIAN_BIG for big endian chip architectures,
- // such as 680x0, PowerPC, Sparc, and MIPS, once DCC supports them,
- // provided it does not already define its own ENDIAN values by then...
- {$DEFINE ENDIAN_LITTLE}
- {$IFNDEF VCL_6_OR_ABOVE}
- {$DEFINE MSWINDOWS}
- {$ENDIF}
- {$IFDEF MSWINDOWS}
- {$DEFINE WINDOWS}
- {$ENDIF}
- // TODO: map Pulsar's non-Windows platform defines...
- {$IFDEF VCL_XE2_OR_ABOVE}
- {$IFDEF VCL_XE8_OR_ABOVE}
- {$IFDEF CPU32BITS}
- //any 32-bit CPU
- {$DEFINE CPU32}
- {$ENDIF}
- {$IFDEF CPU64BITS}
- {$DEFINE CPU64}
- {$ENDIF}
- {$ELSE}
- {$IFDEF CPU386}
- //any 32-bit CPU
- {$DEFINE CPU32}
- //Intel 386 compatible chip architecture
- {$DEFINE CPUI386}
- {$ENDIF}
- {$IFDEF CPUX86}
- {$DEFINE CPU32}
- {$ENDIF}
- {$IFDEF CPUX64}
- //any 64-bit CPU
- {$DEFINE CPU64}
- //AMD64 compatible chip architecture
- {$DEFINE CPUX86_64} //historical name for AMD64
- {$DEFINE CPUAMD64}
- {$ENDIF}
- {$ENDIF}
- {$ELSE}
- {$IFNDEF DOTNET}
- {$IFNDEF KYLIX}
- {$DEFINE I386}
- {$ENDIF}
- {$ENDIF}
- {$DEFINE CPU32}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF DOTNET}
- //differences in DotNET Framework versions.
- {$IFDEF VCL_2007_OR_ABOVE}
- {$DEFINE DOTNET_2}
- {$DEFINE DOTNET_2_OR_ABOVE}
- {$ELSE}
- {$DEFINE DOTNET_1_1}
- {$ENDIF}
- {$DEFINE DOTNET_1_1_OR_ABOVE}
- // Extra include used in D7 for testing. Remove later when all comps are
- // ported. Used to selectively exclude non ported parts. Allowed in places
- // IFDEFs are otherwise not permitted.
- {$DEFINE DOTNET_EXCLUDE}
- {$ENDIF}
- // Check for available features
- {$IFDEF VCL_6_OR_ABOVE}
- {$DEFINE HAS_PPointer}
- {$IFNDEF FPC}
- {$DEFINE HAS_TSelectionEditor}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_2006_OR_ABOVE}
- {$DEFINE USE_INLINE}
- {$ENDIF}
- {$IFDEF VCL_2009_OR_ABOVE}
- {$IFNDEF DOTNET}
- {$DEFINE STRING_IS_UNICODE}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE3_OR_ABOVE}
- {$DEFINE HAS_DIRECTIVE_ZEROBASEDSTRINGS}
- {$IFDEF NEXTGEN}
- {$DEFINE DCC_NEXTGEN}
- {$DEFINE USE_MARSHALLED_PTRS}
- {$IFDEF AUTOREFCOUNT}
- {$DEFINE USE_OBJECT_ARC}
- {$ENDIF}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_XE5_UPDATE2_OR_ABOVE}
- {$DEFINE HAS_DIRECTIVE_HPPEMIT_LINKUNIT}
- {$DEFINE HAS_DIRECTIVE_HPPEMIT_NAMESPACE}
- {$ENDIF}
- {$IFDEF VCL_10_2_OR_ABOVE}
- {.$WARN IMPLICIT_INTEGER_CAST_LOSS OFF}
- {.$WARN IMPLICIT_CONVERSION_LOSS OFF}
- {.$WARN COMBINING_SIGNED_UNSIGNED64 OFF}
- {$ENDIF}
- {$IFDEF VCL_10_4_OR_ABOVE}
- // 0-based string indexing via '[]' is turned off by default in Delphi 10.4.
- // TStringHelper is always 0-indexed, flat RTL functions are always 1-indexed,
- // and now '[]' is 1-indexed again on all platforms - {$ZEROBASEDSTRINGS OFF}
- // is the default.
- {.$UNDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
- {$ENDIF}
- // Delphi XE+ cross-compiling
- {$IFNDEF FPC}
- {$IFDEF POSIX}
- {$IF RTLVersion >= 22.0}
- {$DEFINE UNIX}
- {$UNDEF USE_BASEUNIX}
- {$DEFINE VCL_CROSS_COMPILE}
- {$DEFINE USE_VCL_POSIX}
- {$IFEND}
- {$ENDIF}
- {$IFDEF LINUX}
- {$IFDEF CONDITIONALEXPRESSIONS}
- {$IF RTLVersion >= 22.0}
- {$DEFINE VCL_CROSS_COMPILE}
- {$DEFINE USE_VCL_POSIX}
- {$IFEND}
- {$ENDIF}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF VCL_CROSS_COMPILE}
- {$UNDEF KYLIXCOMPAT}
- {$ELSE}
- {$IFDEF KYLIXCOMPAT}
- {$linklib c}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC}
- {$DEFINE USE_INLINE}
- {$IFDEF FPC_UNICODESTRINGS}
- {$DEFINE STRING_IS_UNICODE}
- {$ENDIF}
- {$ENDIF}
- // .NET and Delphi 2009+ support UNICODE strings natively!
- //
- // NOTE: Do not define UNICODE here. The compiler defines
- // the symbol automatically.
- {$IFNDEF STRING_IS_UNICODE}
- {$DEFINE STRING_IS_ANSI}
- {$ENDIF}
- {$IFDEF DCC_NEXTGEN}
- {$DEFINE NO_ANSI_TYPES}
- {$IFDEF USE_OBJECT_ARC}
- // TODO: move these to an appropriate section. Not doing this yet because
- // it is a major interface change to switch to Generics and we should
- // maintain backwards compatibility with earlier compilers for the time
- // being. Defining them only here for now because the non-Generic versions
- // of these classes have become deprecated by ARC and so we need to start
- // taking advantage of the Generics versions...
- {$DEFINE HAS_UNIT_Generics_Collections}
- {$DEFINE HAS_GENERICS_TList}
- {$DEFINE HAS_GENERICS_TThreadList}
- {$ENDIF}
- {$ENDIF}
- // TODO: Ansi data types were disabled on mobile platforms in XE3, but
- // UTF8String and RawByteString were re-enabled in 10.1 Berlin! What else,
- // if anything, was re-enabled to facilitate that?
- //
- // UPDATE: In 10.4 Sydney, AnsiChar and AnsiString were re-enabled on
- // mobile platforms! NEXTGEN is no longer defined in the mobile compilers.
- {$IFDEF NO_ANSI_TYPES}
- {$UNDEF HAS_PAnsiChar}
- {$ENDIF}
- {$IFDEF WIN32}
- {$DEFINE WIN32_OR_WIN64}
- {$ENDIF}
- {$IFDEF WIN64}
- {$DEFINE WIN32_OR_WIN64}
- {$ENDIF}
- {$IFDEF IOS}
- // Support for 64-bit ARM iOS Simulator was added in Delphi 11.2
- // TODO: how to detect iOS Simulator in FPC? Does it support 64-bit ARM?
- {$IFDEF CPUARM}
- {$IFNDEF IOSSIMULATOR}
- // RLebeau: For iOS devices, OpenSSL cannot be used as an external library,
- // it must be statically linked into the app. For the iOS simulator, this
- // is not true. Users who want to use OpenSSL in iOS device apps will need
- // to add the static OpenSSL library to the project and then include the
- // IdSSLOpenSSLHeaders_static unit in their uses clause. It hooks up the
- // statically linked functions for the IdSSLOpenSSLHeaders unit to use...
- {$DEFINE STATICLOAD_OPENSSL}
- {$ENDIF}
- {$ENDIF}
- {$ENDIF}
- {$UNDEF USE_INVALIDATE_MOD_CACHE}
- //This must come after the iconv defines because this compiler targets a Unix-like
- //operating system. One key difference is that it does have a TEncoding class.
- //If this comes before the ICONV defines, it creates problems.
- //This also must go before the THandle size calculations.
- {$IFDEF VCL_CROSS_COMPILE}
- {$IFDEF POSIX}
- {$IFNDEF LINUX}
- {$DEFINE BSD}
- {$ENDIF}
- {$DEFINE USE_INVALIDATE_MOD_CACHE}
- {$ENDIF}
- {$ENDIF}
- //IMPORTANT!!!!
- //
- //Do not remove this!!! This is to work around a conflict. In DCC, MACOS
- //will mean OS X. In FreePascal, the DEFINE MACOS means MacIntosh System OS Classic.
- {$IFDEF DCC}
- // DCC defines MACOS for both iOS and OS X platforms, need to differentiate
- {$IFDEF MACOS}
- {$IFNDEF IOS}
- {$DEFINE OSX}
- {$DEFINE DARWIN}
- {$ENDIF}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF FPC}
- // FPC defines DARWIN for both OSX and iOS, need to differentiate
- {$IFDEF DARWIN}
- {$IFNDEF IOS}
- {$DEFINE OSX}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF MACOS}
- {$DEFINE MACOS_CLASSIC}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF BSD}
- //I think BSD might handle FreeBSD, NetBSD, OpenBSD, and Darwin
- {$IFDEF IOS}
- {$IFDEF CPUARM64}
- {$DEFINE CPU64}
- {$ELSE}
- {$IFDEF CPUARM32}
- {$DEFINE CPU32}
- {$ENDIF}
- {$ENDIF}
- {$ENDIF}
- {$ENDIF}
- {$IFDEF LINUX}
- {$IFDEF LINUX64}
- {$DEFINE CPU64}
- {$ELSE}
- {$IFDEF LINUX32}
- {$DEFINE CPU32}
- {$ENDIF}
- {$ENDIF}
- {$ENDIF}
- {end Unix OS specific stuff}
- {$IFDEF DEBUG}
- {$UNDEF USE_INLINE}
- {$ENDIF}
- // RLebeau 9/5/2013: it would take a lot of work to re-write Indy to support
- // both 0-based and 1-based string indexing, so we'll just turn off 0-based
- // indexing for now...
- {$IFDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
- {$ZEROBASEDSTRINGS OFF}
- {$ENDIF}
|