2
0

IdCompilerDefines.inc 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016
  1. {$IFDEF CONDITIONALEXPRESSIONS}
  2. // Must be at the top...
  3. {$IF CompilerVersion >= 24.0}
  4. {$LEGACYIFEND ON}
  5. {$IFEND}
  6. {$ENDIF}
  7. // General
  8. // Make this $DEFINE to use the 16 color icons required by Borland
  9. // or DEFINE to use the 256 color Indy versions
  10. {.$DEFINE Borland}
  11. // S.G. 4/9/2002: IPv4/IPv6 general switch (for defaults only)
  12. {$DEFINE IdIPv4} // use IPv4 by default
  13. {.$IFDEF IdIPv6} // use IPv6 by default
  14. {$DEFINE INDY100}
  15. {$DEFINE 10_6_2} //so developers can IFDEF for this specific version
  16. // When generating C++Builder output files, certain workarounds to compiler
  17. // problems need to be enabled! When invoking DCC on the command-line, use
  18. // the -DBCB parameter. When invoking MSBUILD, include the DCC_Define="BCB"
  19. // attribute in the /p parameter.
  20. {$IFDEF BCB}
  21. {$DEFINE CBUILDER}
  22. {$ELSE}
  23. {$DEFINE DELPHI}
  24. {$ENDIF}
  25. {$UNDEF USE_OPENSSL}
  26. {$UNDEF STATICLOAD_OPENSSL}
  27. {$UNDEF USE_ZLIB_UNIT}
  28. {$UNDEF USE_SSPI}
  29. // $DEFINE the following if the global objects in the IdStack and IdThread
  30. // units should be freed on finalization
  31. {.$DEFINE FREE_ON_FINAL}
  32. {$UNDEF FREE_ON_FINAL}
  33. // Make sure the following is $DEFINE'd only for suitable environments
  34. // as specified further below. This works in conjunction with the
  35. // FREE_ON_FINAL define above.
  36. {$UNDEF REGISTER_EXPECTED_MEMORY_LEAK}
  37. {$UNDEF HAS_System_RegisterExpectedMemoryLeak}
  38. // FastMM is natively available in BDS 2006 and higher. $DEFINE the
  39. // following if FastMM has been installed manually in earlier versions
  40. {.$DEFINE USE_FASTMM4}
  41. {$UNDEF USE_FASTMM4}
  42. // $DEFINE the following if MadExcept has been installed manually in
  43. // BDS 2005 or earlier (System.RegisterExpectedMemoryLeak() was introduced
  44. // in BDS 2006)
  45. {.$DEFINE USE_MADEXCEPT}
  46. {$UNDEF USE_MADEXCEPT}
  47. // $DEFINE the following if LeakCheck has been installed manually in
  48. // BDS 2005 or earlier (System.RegisterExpectedMemoryLeak() was introduced
  49. // in BDS 2006)
  50. {.$DEFINE USE_LEAKCHECK}
  51. {$UNDEF USE_LEAKCHECK}
  52. // Make sure the following are $DEFINE'd only for Delphi/C++Builder 2009 onwards
  53. // as specified further below. The VCL is fully Unicode, where the 'String'
  54. // type maps to System.UnicodeString, not System.AnsiString anymore
  55. {$UNDEF STRING_IS_UNICODE}
  56. {$UNDEF STRING_IS_ANSI}
  57. {$UNDEF STRING_UNICODE_MISMATCH}
  58. // Make sure the following are $DEFINE'd only for suitable environments
  59. // as specified further below. Delphi/C++Builder Mobile/NextGen compilers
  60. // do not support Ansi data types anymore, and is moving away from raw
  61. // pointers as well.
  62. //
  63. // UPDATE: in Delphi/C++Builder 10.4, all Ansi types are supported again on
  64. // all platforms, including the mobile compilers.
  65. {$DEFINE HAS_AnsiString}
  66. {$DEFINE HAS_AnsiChar}
  67. {$DEFINE HAS_PAnsiChar}
  68. {$UNDEF HAS_PPAnsiChar}
  69. {$UNDEF NO_ANSI_TYPES}
  70. // Make sure the following are $DEFINE'd only for suitable environments
  71. // as specified further below. Delphi/C++Builder Mobile/NextGen compilers
  72. // use ARC for TObject life time management.
  73. //
  74. // UPDATE: ARC for TObject lifetime management has been removed in
  75. // Delphi/C++Builder 10.4 mobile compilers. All platforms now use a single
  76. // unified memory management model!
  77. {$UNDEF USE_MARSHALLED_PTRS}
  78. {$UNDEF HAS_MarshaledAString}
  79. {$UNDEF USE_OBJECT_ARC}
  80. // Make sure the following is $DEFINE'd only for suitable environments
  81. // as specified further below.
  82. {$UNDEF STRING_IS_IMMUTABLE}
  83. {$UNDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
  84. // Make sure the following are $DEFINE'd only for suitable environments
  85. // as specified further below.
  86. {$UNDEF HAS_TEncoding}
  87. {$UNDEF HAS_TEncoding_GetEncoding_ByEncodingName}
  88. {$UNDEF HAS_Exception_RaiseOuterException}
  89. {$UNDEF HAS_System_ReturnAddress}
  90. {$UNDEF HAS_TCharacter}
  91. {$UNDEF HAS_TInterlocked}
  92. {$UNDEF HAS_TNetEncoding}
  93. // Make sure that this is defined only for environments where we are using
  94. // the iconv library to charactor conversions.
  95. {.$UNDEF USE_ICONV}
  96. {.$UNDEF USE_LCONVENC}
  97. //Define for Delphi cross-compiler targetting Posix
  98. {$UNDEF USE_VCL_POSIX}
  99. {$UNDEF HAS_ComponentPlatformsAttribute}
  100. {$UNDEF HAS_ComponentPlatformsAttribute_Win32}
  101. {$UNDEF HAS_ComponentPlatformsAttribute_Win64}
  102. {$UNDEF HAS_ComponentPlatformsAttribute_OSX32}
  103. {$UNDEF HAS_ComponentPlatformsAttribute_iOS_Simulator}
  104. {$UNDEF HAS_ComponentPlatformsAttribute_iOS_Simulator32}
  105. {$UNDEF HAS_ComponentPlatformsAttribute_Android}
  106. {$UNDEF HAS_ComponentPlatformsAttribute_Android32Arm}
  107. {$UNDEF HAS_ComponentPlatformsAttribute_Linux32}
  108. {$UNDEF HAS_ComponentPlatformsAttribute_iOS_Device}
  109. {$UNDEF HAS_ComponentPlatformsAttribute_iOS_Device32}
  110. {$UNDEF HAS_ComponentPlatformsAttribute_Linux64}
  111. {$UNDEF HAS_ComponentPlatformsAttribute_WinNX32}
  112. {$UNDEF HAS_ComponentPlatformsAttribute_WinIoT32}
  113. {$UNDEF HAS_ComponentPlatformsAttribute_iOS_Device64}
  114. {$UNDEF HAS_ComponentPlatformsAttribute_WinARM}
  115. {$UNDEF HAS_ComponentPlatformsAttribute_WinARM32}
  116. {$UNDEF HAS_ComponentPlatformsAttribute_OSX64}
  117. {$UNDEF HAS_ComponentPlatformsAttribute_OSXNX64}
  118. {$UNDEF HAS_ComponentPlatformsAttribute_Linux32Arm}
  119. {$UNDEF HAS_ComponentPlatformsAttribute_Linux64Arm}
  120. {$UNDEF HAS_ComponentPlatformsAttribute_Android64}
  121. {$UNDEF HAS_ComponentPlatformsAttribute_Android64Arm}
  122. {$UNDEF HAS_ComponentPlatformsAttribute_iOS_Simulator64}
  123. {$UNDEF HAS_ComponentPlatformsAttribute_AndroidArm32}
  124. {$UNDEF HAS_ComponentPlatformsAttribute_AndroidArm64}
  125. {$UNDEF HAS_ComponentPlatformsAttribute_OSXArm64}
  126. {$UNDEF HAS_ComponentPlatformsAttribute_AllPlatforms}
  127. {$UNDEF HAS_DIRECTIVE_WARN_DEFAULT}
  128. // Define for Delphi to auto-generate platform-appropriate '#pragma link' statements in HPP files
  129. {$UNDEF HAS_DIRECTIVE_HPPEMIT_LINKUNIT}
  130. // detect compiler versions
  131. {$IFNDEF FPC}
  132. // TODO: to detect features in Delphi/C++Builder v6 and later, use CompilerVersion
  133. // and RTLVersion constants instead of VERXXX defines. We still support v5, which
  134. // does not have such constants.
  135. // Delphi 4
  136. {$IFDEF VER120}
  137. {$DEFINE DCC}
  138. {$DEFINE VCL_40}
  139. {$DEFINE DELPHI_4}
  140. {$ENDIF}
  141. // C++Builder 4
  142. {$IFDEF VER125}
  143. {$DEFINE DCC}
  144. {$DEFINE VCL_40}
  145. {$DEFINE CBUILDER_4}
  146. {$ENDIF}
  147. // Delphi & C++Builder 5
  148. {$IFDEF VER130}
  149. {$DEFINE DCC}
  150. {$DEFINE VCL_50}
  151. {$IFDEF CBUILDER}
  152. {$DEFINE CBUILDER_5}
  153. {$ELSE}
  154. {$DEFINE DELPHI_5}
  155. {$ENDIF}
  156. {$ENDIF}
  157. //Delphi & C++Builder 6
  158. {$IFDEF VER140}
  159. {$DEFINE DCC}
  160. {$DEFINE VCL_60}
  161. {$IFDEF CBUILDER}
  162. {$DEFINE CBUILDER_6}
  163. {$ELSE}
  164. {$DEFINE DELPHI_6}
  165. {$ENDIF}
  166. {$ENDIF}
  167. //Delphi 7
  168. {$IFDEF VER150}
  169. {$DEFINE DCC}
  170. {$DEFINE VCL_70}
  171. {$DEFINE DELPHI_7} // there was no C++ Builder 7
  172. {$ENDIF}
  173. //Delphi 8
  174. {$IFDEF VER160}
  175. {$DEFINE DCC}
  176. {$DEFINE VCL_80}
  177. {$DEFINE DELPHI_8} // there was no C++ Builder 8
  178. {$ENDIF}
  179. //Delphi 2005
  180. {$IFDEF VER170}
  181. {$DEFINE DCC}
  182. {$DEFINE VCL_2005}
  183. {$DEFINE DELPHI_2005} // there was no C++Builder 2005
  184. {$ENDIF}
  185. // NOTE: CodeGear decided to make Highlander be a non-breaking release
  186. // (no interface changes, thus fully backwards compatible without any
  187. // end user code changes), so VER180 applies to both BDS 2006 and
  188. // Highlander prior to the release of RAD Studio 2007. Use VER185 to
  189. // identify Highlanger specifically.
  190. //Delphi & C++Builder 2006
  191. //Delphi & C++Builder 2007 (Highlander)
  192. {$IFDEF VER180}
  193. {$DEFINE DCC}
  194. {$DEFINE VCL_2006}
  195. {$IFDEF CBUILDER}
  196. {$DEFINE CBUILDER_2006}
  197. {$ELSE}
  198. {$DEFINE DELPHI_2006}
  199. {$ENDIF}
  200. {$ENDIF}
  201. //Delphi & C++Builder 2007 (Highlander)
  202. {$IFDEF VER185}
  203. {$DEFINE DCC}
  204. {$UNDEF VCL_2006}
  205. {$DEFINE VCL_2007}
  206. {$IFDEF CBUILDER}
  207. {$UNDEF CBUILDER_2006}
  208. {$DEFINE CBUILDER_2007}
  209. {$ELSE}
  210. {$UNDEF DELPHI_2006}
  211. {$DEFINE DELPHI_2007}
  212. {$ENDIF}
  213. {$ENDIF}
  214. // BDS 2007 NET personality uses VER190 instead of 185.
  215. //Delphi .NET 2007
  216. {$IFDEF VER190}
  217. {$DEFINE DCC}
  218. {$IFDEF CIL}
  219. //Delphi 2007
  220. {$DEFINE VCL_2007}
  221. {$DEFINE DELPHI_2007}
  222. {$ENDIF}
  223. {$ENDIF}
  224. //Delphi & C++Builder 2009 (Tiburon)
  225. {$IFDEF VER200}
  226. {$DEFINE DCC}
  227. {$DEFINE VCL_2009}
  228. {$IFDEF CBUILDER}
  229. {$DEFINE CBUILDER_2009}
  230. {$ELSE}
  231. {$DEFINE DELPHI_2009}
  232. {$ENDIF}
  233. {$ENDIF}
  234. //Delphi & C++Builder 2010 (Weaver)
  235. {$IFDEF VER210}
  236. {$DEFINE DCC}
  237. {$DEFINE VCL_2010}
  238. {$IFDEF CBUILDER}
  239. {$DEFINE CBUILDER_2010}
  240. {$ELSE}
  241. {$DEFINE DELPHI_2010}
  242. {$ENDIF}
  243. {$ENDIF}
  244. //Delphi & C++Builder XE (Fulcrum)
  245. {$IFDEF VER220}
  246. //REMOVE DCC DEFINE after the next Fulcrum beta.
  247. //It will be defined there.
  248. {$IFNDEF DCC}
  249. {$DEFINE DCC}
  250. {$ENDIF}
  251. {$DEFINE VCL_XE}
  252. {$IFDEF CBUILDER}
  253. {$DEFINE CBUILDER_XE}
  254. {$ELSE}
  255. {$DEFINE DELPHI_XE}
  256. {$ENDIF}
  257. {$ENDIF}
  258. // DCC is now defined by the Delphi compiler starting in XE2
  259. //Delphi & CBuilder XE2 (Pulsar)
  260. {$IFDEF VER230}
  261. {$DEFINE VCL_XE2}
  262. {$IFDEF CBUILDER}
  263. {$DEFINE CBUILDER_XE2}
  264. {$ELSE}
  265. {$DEFINE DELPHI_XE2}
  266. {$ENDIF}
  267. {$ENDIF}
  268. //Delphi & CBuilder XE3 (Waterdragon)
  269. //Delphi & CBuilder XE3.5 (Quintessence - early betas only)
  270. {$IFDEF VER240}
  271. {$DEFINE VCL_XE3}
  272. {$IFDEF CBUILDER}
  273. {$DEFINE CBUILDER_XE3}
  274. {$ELSE}
  275. {$DEFINE DELPHI_XE3}
  276. {$ENDIF}
  277. {$ENDIF}
  278. //Delphi & CBuilder XE4 (Quintessence)
  279. {$IFDEF VER250}
  280. {$UNDEF VCL_XE3}
  281. {$DEFINE VCL_XE4}
  282. {$IFDEF CBUILDER}
  283. {$UNDEF CBUILDER_XE3}
  284. {$DEFINE CBUILDER_XE4}
  285. {$ELSE}
  286. {$UNDEF DELPHI_XE3}
  287. {$DEFINE DELPHI_XE4}
  288. {$ENDIF}
  289. {$ENDIF}
  290. //Delphi & CBuilder XE5 (Zephyr)
  291. {$IFDEF VER260}
  292. {$DEFINE VCL_XE5}
  293. {$IFDEF CBUILDER}
  294. {$DEFINE CBUILDER_XE5}
  295. {$ELSE}
  296. {$DEFINE DELPHI_XE5}
  297. {$ENDIF}
  298. {$ENDIF}
  299. //Delphi & CBuilder AppMethod
  300. //AppMethod is just XE5 for mobile only, VCL is removed
  301. {$IFDEF VER265}
  302. {$DEFINE VCL_XE5}
  303. {$IFDEF CBUILDER}
  304. {$DEFINE CBUILDER_XE5}
  305. {$ELSE}
  306. {$DEFINE DELPHI_XE5}
  307. {$ENDIF}
  308. {$ENDIF}
  309. //Delphi & CBuilder XE6 (Proteus)
  310. {$IFDEF VER270}
  311. {$DEFINE VCL_XE6}
  312. {$IFDEF CBUILDER}
  313. {$DEFINE CBUILDER_XE6}
  314. {$ELSE}
  315. {$DEFINE DELPHI_XE6}
  316. {$ENDIF}
  317. {$ENDIF}
  318. //Delphi & CBuilder XE7 (Carpathia)
  319. {$IFDEF VER280}
  320. {$DEFINE VCL_XE7}
  321. {$IFDEF CBUILDER}
  322. {$DEFINE CBUILDER_XE7}
  323. {$ELSE}
  324. {$DEFINE DELPHI_XE7}
  325. {$ENDIF}
  326. {$ENDIF}
  327. //Delphi & CBuilder XE8 (Elbrus)
  328. {$IFDEF VER290}
  329. {$DEFINE VCL_XE8}
  330. {$IFDEF CBUILDER}
  331. {$DEFINE CBUILDER_XE8}
  332. {$ELSE}
  333. {$DEFINE DELPHI_XE8}
  334. {$ENDIF}
  335. {$ENDIF}
  336. //Delphi & CBuilder 10.0 Seattle (Aitana)
  337. {$IFDEF VER300}
  338. {$DEFINE VCL_10_0}
  339. {$IFDEF CBUILDER}
  340. {$DEFINE CBUILDER_VCL_10_0}
  341. {$ELSE}
  342. {$DEFINE DELPHI_VCL_10_0}
  343. {$ENDIF}
  344. {$ENDIF}
  345. //Delphi & CBuilder 10.1 Berlin (BigBen)
  346. {$IFDEF VER310}
  347. {$DEFINE VCL_10_1}
  348. {$IFDEF CBUILDER}
  349. {$DEFINE CBUILDER_10_1}
  350. {$ELSE}
  351. {$DEFINE DELPHI_10_1}
  352. {$ENDIF}
  353. {$ENDIF}
  354. //Delphi & CBuilder 10.2 Tokyo (Godzilla)
  355. {$IFDEF VER320}
  356. {$DEFINE VCL_10_2}
  357. {$IFDEF CBUILDER}
  358. {$DEFINE CBUILDER_10_2}
  359. {$ELSE}
  360. {$DEFINE DELPHI_10_2}
  361. {$ENDIF}
  362. {$ENDIF}
  363. //Delphi & CBuilder 10.3 Rio (Carnival)
  364. {$IFDEF VER330}
  365. {$DEFINE VCL_10_3}
  366. {$IFDEF CBUILDER}
  367. {$DEFINE CBUILDER_10_3}
  368. {$ELSE}
  369. {$DEFINE DELPHI_10_3}
  370. {$ENDIF}
  371. {$ENDIF}
  372. //Delphi & CBuilder 10.4 Sydney (Denali)
  373. {$IFDEF VER340}
  374. {$DEFINE VCL_10_4}
  375. {$IFDEF CBUILDER}
  376. {$DEFINE CBUILDER_10_4}
  377. {$ELSE}
  378. {$DEFINE DELPHI_10_4}
  379. {$ENDIF}
  380. {$ENDIF}
  381. //Delphi & CBuilder 11.0 (Olympus)
  382. {$IFDEF VER350}
  383. {$DEFINE VCL_11_0}
  384. {$IFDEF CBUILDER}
  385. {$DEFINE CBUILDER_11_0}
  386. {$ELSE}
  387. {$DEFINE DELPHI_11_0}
  388. {$ENDIF}
  389. {$ENDIF}
  390. // Kylix
  391. //
  392. //Important: Don't use CompilerVersion here as IF's are evaluated before
  393. //IFDEF's and Kylix 1 does not have CompilerVersion defined at all.
  394. {$IFDEF LINUX}
  395. {$DEFINE UNIX}
  396. {$IFDEF CONDITIONALEXPRESSIONS}
  397. {$IF (RTLVersion >= 14.0) and (RTLVersion <= 14.5) }
  398. {$DEFINE KYLIX}
  399. {$IF RTLVersion = 14.5}
  400. {$DEFINE KYLIX_3}
  401. {$ELSEIF RTLVersion >= 14.2}
  402. {$DEFINE KYLIX_2}
  403. {$ELSE}
  404. {$DEFINE KYLIX_1}
  405. {$IFEND}
  406. {$IFEND}
  407. {$ENDIF}
  408. {$ENDIF}
  409. {$ENDIF}
  410. // Delphi.NET
  411. // Covers D8+
  412. {$IFDEF CIL}
  413. // Platform specific conditional. Used for platform specific code.
  414. {$DEFINE DOTNET}
  415. {$DEFINE STRING_IS_UNICODE}
  416. {$DEFINE STRING_IS_IMMUTABLE}
  417. {.$DEFINE HAS_Int8}
  418. {.$DEFINE HAS_UInt8}
  419. {$DEFINE HAS_Int16}
  420. {$DEFINE HAS_UInt16}
  421. {$DEFINE HAS_Int32}
  422. {$DEFINE HAS_UInt32}
  423. {$DEFINE HAS_UInt64}
  424. {$ENDIF}
  425. {$IFDEF KYLIX}
  426. {$DEFINE VCL_60}
  427. {$DEFINE INT_THREAD_PRIORITY}
  428. {$DEFINE CPUI386}
  429. {$UNDEF USE_BASEUNIX}
  430. {$IFDEF KYLIX_3}
  431. {$DEFINE KYLIX_3_OR_ABOVE}
  432. {$ENDIF}
  433. {$IFDEF KYLIX_3_OR_ABOVE}
  434. {$DEFINE KYLIX_2_OR_ABOVE}
  435. {$ELSE}
  436. {$IFDEF KYLIX_2}
  437. {$DEFINE KYLIX_2_OR_ABOVE}
  438. {$ENDIF}
  439. {$ENDIF}
  440. {$IFDEF KYLIX_2_OR_ABOVE}
  441. {$DEFINE KYLIX_1_OR_ABOVE}
  442. {$ELSE}
  443. {$IFDEF KYLIX_1}
  444. {$DEFINE KYLIX_1_OR_ABOVE}
  445. {$ENDIF}
  446. {$ENDIF}
  447. {$IFNDEF KYLIX_3_OR_ABOVE}
  448. {$DEFINE KYLIXCOMPAT}
  449. {$ENDIF}
  450. {$IFDEF KYLIX_2_OR_ABOVE}
  451. {$DEFINE USE_ZLIB_UNIT}
  452. {$ENDIF}
  453. {$ENDIF}
  454. // FPC (2+)
  455. {$IFDEF FPC}
  456. // TODO: In FreePascal 4.2.0+, a Delphi-like UnicodeString type is supported.
  457. // However, String/(P)Char do not map to UnicodeString/(P)WideChar unless
  458. // either {$MODE DelphiUnicode} or {$MODESWITCH UnicodeStrings} is used.
  459. // We should consider enabling one of them so Indy uses the same Unicode logic
  460. // in Delphi 2009+ and FreePascal 4.2.0+ and reduces IFDEFs (in particular,
  461. // STRING_UNICODE_MISMATCH, see further below). However, FreePascal's RTL
  462. // is largely not UnicodeString-enabled yet. Maybe we should enable
  463. // {$MODE DelphiUnicode} anyway, and then deal with any RTL function issues
  464. // on an as-needed basis...
  465. {$MODE Delphi}
  466. {$IFDEF FPC_2_7_1_OR_ABOVE}
  467. {.$MODE DelphiUnicode}
  468. {.$MODESWITCH UnicodeStrings}
  469. {.$CODEPAGE UTF8} // needed for Unicode string literals to work properly
  470. {$ENDIF}
  471. //note that we may need further defines for widget types depending on
  472. //what we do and what platforms we support in FPC.
  473. //I'll let Marco think about that one.
  474. {$IFDEF UNIX}
  475. {$DEFINE USE_BASEUNIX}
  476. {$IFDEF LINUX}
  477. //In Linux for I386, you can choose between a Kylix-libc API or
  478. //the standard RTL Unix API. Just pass -dKYLIXCOMPAT to the FPC compiler.
  479. //I will see what I can do about the Makefile.
  480. {$IFDEF KYLIXCOMPAT}
  481. {$IFDEF CPUI386}
  482. {$UNDEF USE_BASEUNIX}
  483. {$ENDIF}
  484. {$ENDIF}
  485. {$ENDIF}
  486. {$IFDEF USE_BASEUNIX}
  487. {$UNDEF KYLIXCOMPAT}
  488. {$ENDIF}
  489. {$ENDIF}
  490. // FPC_FULLVERSION was added in FPC 2.2.4
  491. // Have to use Defined() or else Delphi compiler chokes, since it
  492. // evaluates $IF statements before $IFDEF statements...
  493. {$MACRO ON} // must be on in order to use versioning macros
  494. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30101)}
  495. {$DEFINE FPC_3_1_1_OR_ABOVE}
  496. {$IFEND}
  497. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30000)}
  498. {$DEFINE FPC_3_0_0_OR_ABOVE}
  499. {$IFEND}
  500. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20701)}
  501. {$DEFINE FPC_2_7_1_OR_ABOVE}
  502. {$IFEND}
  503. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20604)}
  504. {$DEFINE FPC_2_6_4_OR_ABOVE}
  505. {$IFEND}
  506. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20602)}
  507. {$DEFINE FPC_2_6_2_OR_ABOVE}
  508. {$IFEND}
  509. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20600)}
  510. {$DEFINE FPC_2_6_0_OR_ABOVE}
  511. {$IFEND}
  512. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20404)}
  513. {$DEFINE FPC_2_4_4_OR_ABOVE}
  514. {$IFEND}
  515. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20402)}
  516. {$DEFINE FPC_2_4_2_OR_ABOVE}
  517. {$IFEND}
  518. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20400)}
  519. {$DEFINE FPC_2_4_0_OR_ABOVE}
  520. {$IFEND}
  521. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20204)}
  522. {$DEFINE FPC_2_2_4_OR_ABOVE}
  523. {$IFEND}
  524. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20202)}
  525. {$DEFINE FPC_2_2_2_OR_ABOVE}
  526. {$IFEND}
  527. {$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 20105)}
  528. {$DEFINE FPC_2_1_5_OR_ABOVE}
  529. {$IFEND}
  530. // just in case
  531. {$IFDEF FPC_3_1_1}
  532. {$DEFINE FPC_3_1_1_OR_ABOVE}
  533. {$ENDIF}
  534. {$IFDEF FPC_3_0_0}
  535. {$DEFINE FPC_3_0_0_OR_ABOVE}
  536. {$ENDIF}
  537. {$IFDEF FPC_2_7_1}
  538. {$DEFINE FPC_2_7_1_OR_ABOVE}
  539. {$ENDIF}
  540. {$IFDEF FPC_2_6_4}
  541. {$DEFINE FPC_2_6_4_OR_ABOVE}
  542. {$ENDIF}
  543. {$IFDEF FPC_2_6_2}
  544. {$DEFINE FPC_2_6_2_OR_ABOVE}
  545. {$ENDIF}
  546. {$IFDEF FPC_2_6_0}
  547. {$DEFINE FPC_2_6_0_OR_ABOVE}
  548. {$ENDIF}
  549. {$IFDEF FPC_2_4_4}
  550. {$DEFINE FPC_2_4_4_OR_ABOVE}
  551. {$ENDIF}
  552. {$IFDEF FPC_2_4_2}
  553. {$DEFINE FPC_2_4_2_OR_ABOVE}
  554. {$ENDIF}
  555. {$IFDEF FPC_2_4_0}
  556. {$DEFINE FPC_2_4_0_OR_ABOVE}
  557. {$ENDIF}
  558. {$IFDEF FPC_2_2_4}
  559. {$DEFINE FPC_2_2_4_OR_ABOVE}
  560. {$ENDIF}
  561. {$IFDEF FPC_2_2_2}
  562. {$DEFINE FPC_2_2_2_OR_ABOVE}
  563. {$ENDIF}
  564. {$IFDEF FPC_2_1_5}
  565. {$DEFINE FPC_2_1_5_OR_ABOVE}
  566. {$ENDIF}
  567. {$IFDEF FPC_3_1_1_OR_ABOVE}
  568. {$DEFINE FPC_3_0_0_OR_ABOVE}
  569. {$ELSE}
  570. {$IFDEF FPC_3_0_0}
  571. {$DEFINE FPC_3_0_0_OR_ABOVE}
  572. {$ENDIF}
  573. {$ENDIF}
  574. {$IFDEF FPC_3_0_0_OR_ABOVE}
  575. {$DEFINE FPC_2_7_1_OR_ABOVE}
  576. {$ELSE}
  577. {$IFDEF FPC_2_7_1}
  578. {$DEFINE FPC_2_7_1_OR_ABOVE}
  579. {$ENDIF}
  580. {$ENDIF}
  581. {$IFDEF FPC_2_7_1_OR_ABOVE}
  582. {$DEFINE FPC_2_6_4_OR_ABOVE}
  583. {$ELSE}
  584. {$IFDEF FPC_2_6_4}
  585. {$DEFINE FPC_2_6_4_OR_ABOVE}
  586. {$ENDIF}
  587. {$ENDIF}
  588. {$IFDEF FPC_2_6_4_OR_ABOVE}
  589. {$DEFINE FPC_2_6_2_OR_ABOVE}
  590. {$ELSE}
  591. {$IFDEF FPC_2_6_2}
  592. {$DEFINE FPC_2_6_2_OR_ABOVE}
  593. {$ENDIF}
  594. {$ENDIF}
  595. {$IFDEF FPC_2_6_2_OR_ABOVE}
  596. {$DEFINE FPC_2_6_0_OR_ABOVE}
  597. {$ELSE}
  598. {$IFDEF FPC_2_6_0}
  599. {$DEFINE FPC_2_6_0_OR_ABOVE}
  600. {$ENDIF}
  601. {$ENDIF}
  602. {$IFDEF FPC_2_6_0_OR_ABOVE}
  603. {$DEFINE FPC_2_4_4_OR_ABOVE}
  604. {$ELSE}
  605. {$IFDEF FPC_2_4_4}
  606. {$DEFINE FPC_2_4_4_OR_ABOVE}
  607. {$ENDIF}
  608. {$ENDIF}
  609. {$IFDEF FPC_2_4_4_OR_ABOVE}
  610. {$DEFINE FPC_2_4_2_OR_ABOVE}
  611. {$ELSE}
  612. {$IFDEF FPC_2_4_2}
  613. {$DEFINE FPC_2_4_2_OR_ABOVE}
  614. {$ENDIF}
  615. {$ENDIF}
  616. {$IFDEF FPC_2_4_2_OR_ABOVE}
  617. {$DEFINE FPC_2_4_0_OR_ABOVE}
  618. {$ELSE}
  619. {$IFDEF FPC_2_4_0}
  620. {$DEFINE FPC_2_4_0_OR_ABOVE}
  621. {$ENDIF}
  622. {$ENDIF}
  623. {$IFDEF FPC_2_4_0_OR_ABOVE}
  624. {$DEFINE FPC_2_2_4_OR_ABOVE}
  625. {$ELSE}
  626. {$IFDEF FPC_2_2_4}
  627. {$DEFINE FPC_2_2_4_OR_ABOVE}
  628. {$ENDIF}
  629. {$ENDIF}
  630. {$IFDEF FPC_2_2_4_OR_ABOVE}
  631. {$DEFINE FPC_2_2_2_OR_ABOVE}
  632. {$ELSE}
  633. {$IFDEF FPC_2_2_2}
  634. {$DEFINE FPC_2_2_2_OR_ABOVE}
  635. {$ENDIF}
  636. {$ENDIF}
  637. {$IFDEF FPC_2_2_2_OR_ABOVE}
  638. {$DEFINE FPC_2_2_0_OR_ABOVE}
  639. {$ELSE}
  640. {$IFDEF VER2_2}
  641. {$DEFINE FPC_2_2_0_OR_ABOVE}
  642. {$ENDIF}
  643. {$ENDIF}
  644. {$IFDEF FPC_2_2_0_OR_ABOVE}
  645. {$DEFINE FPC_2_1_5_OR_ABOVE}
  646. {$ELSE}
  647. {$IFDEF FPC_2_1_5}
  648. {$DEFINE FPC_2_1_5_OR_ABOVE}
  649. {$ENDIF}
  650. {$ENDIF}
  651. {.$IFDEF FPC_2_7_1_OR_ABOVE}
  652. // support for RawByteString and UnicodeString
  653. {.$DEFINE VCL_2009}
  654. {.$DEFINE DELPHI_2009}
  655. {.$ELSE}
  656. {$DEFINE VCL_70}
  657. {$DEFINE DELPHI_7}
  658. {.$ENDIF}
  659. {$ENDIF}
  660. // end FPC
  661. {$IFDEF VCL_11_0}
  662. {$DEFINE VCL_11_0_OR_ABOVE}
  663. {$ENDIF}
  664. {$IFDEF VCL_11_0_OR_ABOVE}
  665. {$DEFINE VCL_10_4_OR_ABOVE}
  666. {$ELSE}
  667. {$IFDEF VCL_10_4}
  668. {$DEFINE VCL_10_4_OR_ABOVE}
  669. {$ENDIF}
  670. {$ENDIF}
  671. {$IFDEF VCL_10_4_OR_ABOVE}
  672. {$DEFINE VCL_10_3_OR_ABOVE}
  673. {$DEFINE VCL_10_3_UPDATE2_OR_ABOVE}
  674. {$ELSE}
  675. {$IFDEF VCL_10_3}
  676. {$DEFINE VCL_10_3_OR_ABOVE}
  677. // TODO: figure out how to detect this version
  678. {.$DEFINE VCL_10_3_UPDATE2_OR_ABOVE}
  679. {$ENDIF}
  680. {$ENDIF}
  681. {$IFDEF VCL_10_3_OR_ABOVE}
  682. {$DEFINE VCL_10_2_OR_ABOVE}
  683. {$ELSE}
  684. {$IFDEF VCL_10_2}
  685. {$DEFINE VCL_10_2_OR_ABOVE}
  686. {$ENDIF}
  687. {$ENDIF}
  688. {$IFDEF VCL_10_2_OR_ABOVE}
  689. {$DEFINE VCL_10_1_OR_ABOVE}
  690. {$ELSE}
  691. {$IFDEF VCL_10_1}
  692. {$DEFINE VCL_10_1_OR_ABOVE}
  693. {$ENDIF}
  694. {$ENDIF}
  695. {$IFDEF VCL_10_1_OR_ABOVE}
  696. {$DEFINE VCL_10_0_OR_ABOVE}
  697. {$ELSE}
  698. {$IFDEF VCL_10_0}
  699. {$DEFINE VCL_10_0_OR_ABOVE}
  700. {$ENDIF}
  701. {$ENDIF}
  702. {$IFDEF VCL_10_0_OR_ABOVE}
  703. {$DEFINE VCL_XE8_OR_ABOVE}
  704. {$ELSE}
  705. {$IFDEF VCL_XE8}
  706. {$DEFINE VCL_XE8_OR_ABOVE}
  707. {$ENDIF}
  708. {$ENDIF}
  709. {$IFDEF VCL_XE8_OR_ABOVE}
  710. {$DEFINE VCL_XE7_OR_ABOVE}
  711. {$ELSE}
  712. {$IFDEF VCL_XE7}
  713. {$DEFINE VCL_XE7_OR_ABOVE}
  714. {$ENDIF}
  715. {$ENDIF}
  716. {$IFDEF VCL_XE7_OR_ABOVE}
  717. {$DEFINE VCL_XE6_OR_ABOVE}
  718. {$ELSE}
  719. {$IFDEF VCL_XE6}
  720. {$DEFINE VCL_XE6_OR_ABOVE}
  721. {$ENDIF}
  722. {$ENDIF}
  723. {$IFDEF VCL_XE6_OR_ABOVE}
  724. {$DEFINE VCL_XE5_OR_ABOVE}
  725. {$DEFINE VCL_XE5_UPDATE2_OR_ABOVE}
  726. {$ELSE}
  727. {$IFDEF VCL_XE5}
  728. {$DEFINE VCL_XE5_OR_ABOVE}
  729. // TODO: figure out how to detect this version
  730. {.$DEFINE VCL_XE5_UPDATE2_OR_ABOVE}
  731. {$ENDIF}
  732. {$ENDIF}
  733. {$IFDEF VCL_XE5_OR_ABOVE}
  734. {$DEFINE VCL_XE4_OR_ABOVE}
  735. {$ELSE}
  736. {$IFDEF VCL_XE4}
  737. {$DEFINE VCL_XE4_OR_ABOVE}
  738. {$ENDIF}
  739. {$ENDIF}
  740. {$IFDEF VCL_XE4_OR_ABOVE}
  741. {$DEFINE VCL_XE3_OR_ABOVE}
  742. {$ELSE}
  743. {$IFDEF VCL_XE3}
  744. {$DEFINE VCL_XE3_OR_ABOVE}
  745. {$ENDIF}
  746. {$ENDIF}
  747. {$IFDEF VCL_XE3_OR_ABOVE}
  748. {$DEFINE VCL_XE2_OR_ABOVE}
  749. {$ELSE}
  750. {$IFDEF VCL_XE2}
  751. {$DEFINE VCL_XE2_OR_ABOVE}
  752. {$ENDIF}
  753. {$ENDIF}
  754. {$IFDEF VCL_XE2_OR_ABOVE}
  755. {$DEFINE VCL_XE_OR_ABOVE}
  756. {$ELSE}
  757. {$IFDEF VCL_XE}
  758. {$DEFINE VCL_XE_OR_ABOVE}
  759. {$ENDIF}
  760. {$ENDIF}
  761. {$IFDEF VCL_XE_OR_ABOVE}
  762. {$DEFINE VCL_2010_OR_ABOVE}
  763. {$ELSE}
  764. {$IFDEF VCL_2010}
  765. {$DEFINE VCL_2010_OR_ABOVE}
  766. {$ENDIF}
  767. {$ENDIF}
  768. {$IFDEF VCL_2010_OR_ABOVE}
  769. {$DEFINE VCL_2009_OR_ABOVE}
  770. {$ELSE}
  771. {$IFDEF VCL_2009}
  772. {$DEFINE VCL_2009_OR_ABOVE}
  773. {$ENDIF}
  774. {$ENDIF}
  775. {$IFDEF VCL_2009_OR_ABOVE}
  776. {$DEFINE VCL_2007_OR_ABOVE}
  777. {$ELSE}
  778. {$IFDEF VCL_2007}
  779. {$DEFINE VCL_2007_OR_ABOVE}
  780. {$ENDIF}
  781. {$ENDIF}
  782. {$IFDEF VCL_2007_OR_ABOVE}
  783. {$DEFINE VCL_2006_OR_ABOVE}
  784. {$ELSE}
  785. {$IFDEF VCL_2006}
  786. {$DEFINE VCL_2006_OR_ABOVE}
  787. {$ENDIF}
  788. {$ENDIF}
  789. {$IFDEF VCL_2006_OR_ABOVE}
  790. {$DEFINE VCL_2005_OR_ABOVE}
  791. {$ELSE}
  792. {$IFDEF VCL_2005}
  793. {$DEFINE VCL_2005_OR_ABOVE}
  794. {$ENDIF}
  795. {$ENDIF}
  796. {$IFDEF VCL_2005_OR_ABOVE}
  797. {$DEFINE VCL_8_OR_ABOVE}
  798. {$ELSE}
  799. {$IFDEF VCL_80}
  800. {$DEFINE VCL_8_OR_ABOVE}
  801. {$ENDIF}
  802. {$ENDIF}
  803. {$IFDEF VCL_8_OR_ABOVE}
  804. {$DEFINE VCL_7_OR_ABOVE}
  805. {$ELSE}
  806. {$IFDEF VCL_70}
  807. {$DEFINE VCL_7_OR_ABOVE}
  808. {$ENDIF}
  809. {$ENDIF}
  810. {$IFDEF VCL_7_OR_ABOVE}
  811. {$DEFINE VCL_6_OR_ABOVE}
  812. {$ELSE}
  813. {$IFDEF VCL_60}
  814. {$DEFINE VCL_6_OR_ABOVE}
  815. {$ENDIF}
  816. {$ENDIF}
  817. {$IFDEF VCL_6_OR_ABOVE}
  818. {$DEFINE VCL_5_OR_ABOVE}
  819. {$ELSE}
  820. {$IFDEF VCL_50}
  821. {$DEFINE VCL_5_OR_ABOVE}
  822. {$ENDIF}
  823. {$ENDIF}
  824. {$IFDEF VCL_5_OR_ABOVE}
  825. {$DEFINE VCL_4_OR_ABOVE}
  826. {$ELSE}
  827. {$IFDEF VCL_40}
  828. {$DEFINE VCL_4_OR_ABOVE}
  829. {$ENDIF}
  830. {$ENDIF}
  831. // Normalize Delphi compiler defines to match FPC for consistency:
  832. //
  833. // CPU32 - any 32-bit CPU
  834. // CPU64 - any 64-bit CPU
  835. // WINDOWS - any Windows platform (32-bit, 64-bit, CE)
  836. // WIN32 - Windows 32-bit
  837. // WIN64 - Windows 64-bit
  838. // WINCE - Windows CE
  839. //
  840. // Consult the "Free Pascal Programmer's Guide", Appendix G for the complete
  841. // list of defines that are used. Do not work on this unless you understand
  842. // what the FreePascal developers are doing. Not only do you have to
  843. // descriminate with operating systems, but also with chip architectures
  844. // are well.
  845. //
  846. // DCC Pulsar+ define the following values:
  847. // ASSEMBLER
  848. // DCC
  849. // CONDITIONALEXPRESSIONS
  850. // NATIVECODE
  851. // UNICODE
  852. // MACOS
  853. // MACOS32
  854. // MACOS64
  855. // MSWINDOWS
  856. // WIN32
  857. // WIN64
  858. // LINUX
  859. // POSIX
  860. // POSIX32
  861. // CPU386
  862. // CPUX86
  863. // CPUX64
  864. //
  865. // Kylix defines the following values:
  866. // LINUX
  867. // (others??)
  868. //
  869. {$IFNDEF FPC}
  870. // TODO: We need to use ENDIAN_BIG for big endian chip architectures,
  871. // such as 680x0, PowerPC, Sparc, and MIPS, once DCC supports them,
  872. // provided it does not already define its own ENDIAN values by then...
  873. {$DEFINE ENDIAN_LITTLE}
  874. {$IFNDEF VCL_6_OR_ABOVE}
  875. {$DEFINE MSWINDOWS}
  876. {$ENDIF}
  877. {$IFDEF MSWINDOWS}
  878. {$DEFINE WINDOWS}
  879. {$ENDIF}
  880. // TODO: map Pulsar's non-Windows platform defines...
  881. {$IFDEF VCL_XE2_OR_ABOVE}
  882. {$IFDEF VCL_XE8_OR_ABOVE}
  883. {$IFDEF CPU32BITS}
  884. //any 32-bit CPU
  885. {$DEFINE CPU32}
  886. {$ENDIF}
  887. {$IFDEF CPU64BITS}
  888. {$DEFINE CPU64}
  889. {$ENDIF}
  890. {$ELSE}
  891. {$IFDEF CPU386}
  892. //any 32-bit CPU
  893. {$DEFINE CPU32}
  894. //Intel 386 compatible chip architecture
  895. {$DEFINE CPUI386}
  896. {$ENDIF}
  897. {$IFDEF CPUX86}
  898. {$DEFINE CPU32}
  899. {$ENDIF}
  900. {$IFDEF CPUX64}
  901. //any 64-bit CPU
  902. {$DEFINE CPU64}
  903. //AMD64 compatible chip architecture
  904. {$DEFINE CPUX86_64} //historical name for AMD64
  905. {$DEFINE CPUAMD64}
  906. {$ENDIF}
  907. {$ENDIF}
  908. {$ELSE}
  909. {$IFNDEF DOTNET}
  910. {$IFNDEF KYLIX}
  911. {$DEFINE I386}
  912. {$ENDIF}
  913. {$ENDIF}
  914. {$DEFINE CPU32}
  915. {$ENDIF}
  916. {$ENDIF}
  917. {$IFDEF DOTNET}
  918. //differences in DotNET Framework versions.
  919. {$IFDEF VCL_2007_OR_ABOVE}
  920. {$DEFINE DOTNET_2}
  921. {$DEFINE DOTNET_2_OR_ABOVE}
  922. {$ELSE}
  923. {$DEFINE DOTNET_1_1}
  924. {$ENDIF}
  925. {$DEFINE DOTNET_1_1_OR_ABOVE}
  926. // Extra include used in D7 for testing. Remove later when all comps are
  927. // ported. Used to selectively exclude non ported parts. Allowed in places
  928. // IFDEFs are otherwise not permitted.
  929. {$DEFINE DOTNET_EXCLUDE}
  930. {$ENDIF}
  931. // Check for available features
  932. {$IFDEF CBUILDER}
  933. // When generating a C++ HPP file, if a class has no explicit constructor
  934. // defined and contains compiler-managed members (xxxString, TDateTime,
  935. // Variant, DelphiInterface, etc), the HPP will contain a forwarding
  936. // inline constructor that implicitly initializes those managed members,
  937. // which will overwrite any non-default initializations performed inside
  938. // of InitComponent() overrides! In this situation, the workaround is to
  939. // define an explicit constructor that calls the base class constructor
  940. // manually, allowing those managed members to be initialized by the
  941. // compiler before InitComponent() overrides then re-assign them.
  942. {$DEFINE WORKAROUND_INLINE_CONSTRUCTORS}
  943. {$ENDIF}
  944. {$IFDEF VCL_5_OR_ABOVE}
  945. {$IFNDEF FPC}
  946. {$IFNDEF KYLIX}
  947. {$DEFINE HAS_RemoveFreeNotification}
  948. {$ENDIF}
  949. {$ENDIF}
  950. {$DEFINE HAS_GetObjectProp}
  951. {$DEFINE HAS_TObjectList}
  952. {$ENDIF}
  953. {$IFDEF VCL_6_OR_ABOVE}
  954. {$DEFINE HAS_PCardinal}
  955. {$DEFINE HAS_PByte}
  956. {$DEFINE HAS_PWord}
  957. {$DEFINE HAS_PPointer}
  958. {$DEFINE HAS_TList_Assign}
  959. {$DEFINE HAS_sLineBreak}
  960. {$DEFINE HAS_RaiseLastOSError}
  961. {$DEFINE HAS_SysUtils_IncludeExcludeTrailingPathDelimiter}
  962. {$DEFINE HAS_SysUtils_DirectoryExists}
  963. {$DEFINE HAS_UNIT_DateUtils}
  964. {$DEFINE HAS_UNIT_StrUtils}
  965. {$DEFINE HAS_UNIT_Types}
  966. {$DEFINE HAS_TryStrToInt}
  967. {$DEFINE HAS_TryStrToInt64}
  968. {$DEFINE HAS_TryEncodeDate}
  969. {$DEFINE HAS_TryEncodeTime}
  970. {$DEFINE HAS_ENUM_ELEMENT_VALUES}
  971. {$IFNDEF FPC}
  972. {$DEFINE HAS_IInterface}
  973. {$DEFINE HAS_TSelectionEditor}
  974. {$DEFINE HAS_TStringList_CaseSensitive}
  975. {$DEFINE HAS_AcquireExceptionObject}
  976. {$IFNDEF KYLIX}
  977. {$DEFINE HAS_DEPRECATED}
  978. {$DEFINE HAS_SYMBOL_PLATFORM}
  979. {$DEFINE HAS_UNIT_PLATFORM}
  980. {$IFNDEF VCL_8_OR_ABOVE}
  981. // Delphi 6 and 7 have an annoying bug that if a class method is declared as
  982. // deprecated, the compiler will emit a "symbol is deprecated" warning
  983. // on the method's implementation! So we will have to wrap implementations
  984. // of deprecated methods with {$WARN SYMBOL_DEPRECATED OFF} directives
  985. // to disable that warning.
  986. {$DEFINE DEPRECATED_IMPL_BUG}
  987. {$ENDIF}
  988. {$ENDIF}
  989. {$ENDIF}
  990. {$IFNDEF DOTNET}
  991. //Widget defines are omitted in .NET
  992. {$DEFINE VCL_60_PLUS}
  993. {$ENDIF}
  994. {$ENDIF}
  995. {$IFDEF VCL_7_OR_ABOVE}
  996. {$IFNDEF FPC}
  997. {$DEFINE HAS_UInt64} // Note: it was just an alias for Int64 until D2006!
  998. {$DEFINE HAS_NAMED_THREADS}
  999. {$DEFINE HAS_TStrings_NameValueSeparator}
  1000. {$DEFINE HAS_TStrings_ValueFromIndex}
  1001. {$ENDIF}
  1002. {$DEFINE HAS_TFormatSettings}
  1003. {$DEFINE HAS_PosEx}
  1004. {$IFNDEF VCL_70}
  1005. // not implemented in D7
  1006. {$DEFINE HAS_STATIC_TThread_Queue}
  1007. {$ENDIF}
  1008. {$IFNDEF CIL}
  1009. {$IFNDEF VCL_80}
  1010. // not implemented in D8 or .NET
  1011. {$DEFINE HAS_STATIC_TThread_Synchronize}
  1012. {$ENDIF}
  1013. {$ENDIF}
  1014. {$ELSE}
  1015. {$IFDEF CBUILDER_6}
  1016. {$DEFINE HAS_NAMED_THREADS}
  1017. {$ENDIF}
  1018. {$ENDIF}
  1019. {$IFNDEF VCL_2005_OR_ABOVE}
  1020. {$IFDEF DCC}
  1021. // InterlockedCompareExchange() was declared in the Windows unit using Pointer
  1022. // parameters until Delphi 2005, when it was switched to Longint parameters
  1023. // instead to match the actual Win32 API declaration.
  1024. {$DEFINE HAS_InterlockedCompareExchange_Pointers}
  1025. {$ENDIF}
  1026. {$ENDIF}
  1027. {$IFDEF VCL_2006_OR_ABOVE}
  1028. {$DEFINE USE_INLINE}
  1029. {$DEFINE HAS_2PARAM_FileAge}
  1030. {$IFDEF WINDOWS}
  1031. // System.RegisterExpectedMemoryLeak() is only available on Windows at this time
  1032. {$DEFINE HAS_System_RegisterExpectedMemoryLeak}
  1033. {$ENDIF}
  1034. // In C++Builder 2006 and 2007, UInt64 is emitted as signed __int64 in HPP
  1035. // files instead of as unsigned __int64. This causes conflicts in overloaded
  1036. // routines that have (U)Int64 parameters. This was fixed in C++Builder 2009...
  1037. {$IFDEF CBUILDER}
  1038. {$DEFINE BROKEN_UINT64_HPPEMIT}
  1039. {$ENDIF}
  1040. {$ENDIF}
  1041. {$IFDEF VCL_2007_OR_ABOVE}
  1042. {$IFNDEF CBUILDER_2007}
  1043. // class properties are broken in C++Builder 2007, causing AVs at compile-time
  1044. {$DEFINE HAS_CLASSPROPERTIES}
  1045. {$ENDIF}
  1046. // Native(U)Int exist but are buggy, so do not use them yet
  1047. {.$DEFINE HAS_NativeInt}
  1048. {.$DEFINE HAS_NativeUInt}
  1049. {$DEFINE HAS_StrToInt64Def}
  1050. {$DEFINE HAS_DWORD_PTR}
  1051. {$DEFINE HAS_ULONG_PTR}
  1052. {$DEFINE HAS_ULONGLONG}
  1053. {$DEFINE HAS_PGUID}
  1054. {$DEFINE HAS_PPAnsiChar}
  1055. {$DEFINE HAS_CurrentYear}
  1056. {$IFNDEF DOTNET}
  1057. {$DEFINE HAS_TIMEUNITS}
  1058. {$ENDIF}
  1059. {$ENDIF}
  1060. {$IFDEF VCL_2009_OR_ABOVE}
  1061. {$IFNDEF DOTNET}
  1062. {$DEFINE STRING_IS_UNICODE}
  1063. {$DEFINE HAS_UnicodeString}
  1064. {$DEFINE HAS_TEncoding}
  1065. {$DEFINE HAS_TCharacter}
  1066. {$DEFINE HAS_InterlockedCompareExchangePointer}
  1067. {$DEFINE HAS_WIDE_TCharArray}
  1068. {$DEFINE HAS_PUInt64}
  1069. {$IFDEF VCL_2009}
  1070. // TODO: need to differentiate between RTM and Update 1
  1071. // FmtStr() is broken in RTM but was fixed in Update 1
  1072. {$DEFINE BROKEN_FmtStr}
  1073. {$ENDIF}
  1074. {$ENDIF}
  1075. {$DEFINE HAS_CLASSVARS}
  1076. {$DEFINE HAS_DEPRECATED_MSG}
  1077. {$DEFINE HAS_TBytes}
  1078. // Native(U)Int are still buggy, so do not use them yet
  1079. {.$DEFINE HAS_NativeInt}
  1080. {.$DEFINE HAS_NativeUInt}
  1081. {$DEFINE HAS_Int8}
  1082. {$DEFINE HAS_UInt8}
  1083. {$DEFINE HAS_Int16}
  1084. {$DEFINE HAS_UInt16}
  1085. {$DEFINE HAS_Int32}
  1086. {$DEFINE HAS_UInt32}
  1087. // UInt64 is now emitted as unsigned __int64 in HPP files
  1088. {$IFDEF CBUILDER}
  1089. {$UNDEF BROKEN_UINT64_HPPEMIT}
  1090. {$ENDIF}
  1091. {$IFDEF DCC}
  1092. {$IFDEF WINDOWS}
  1093. // Exception.RaiseOuterException() is only available on Windows at this time
  1094. {$DEFINE HAS_Exception_RaiseOuterException}
  1095. {$ENDIF}
  1096. {$ENDIF}
  1097. {$DEFINE HAS_SetCodePage}
  1098. {$DEFINE HAS_PRawByteString}
  1099. {$DEFINE HAS_TThreadProcedure}
  1100. {$ENDIF}
  1101. {$IFDEF VCL_2010_OR_ABOVE}
  1102. {$DEFINE HAS_CLASSCONSTRUCTOR}
  1103. {$DEFINE HAS_CLASSDESTRUCTOR}
  1104. {$DEFINE HAS_DELAYLOAD}
  1105. {$DEFINE HAS_TThread_NameThreadForDebugging}
  1106. {$DEFINE DEPRECATED_TThread_SuspendResume}
  1107. // Native(U)Int are finally ok to use now
  1108. {$DEFINE HAS_NativeInt}
  1109. {$DEFINE HAS_NativeUInt}
  1110. {$DEFINE HAS_USHORT}
  1111. {$DEFINE HAS_IOUtils_TPath}
  1112. {$ENDIF}
  1113. {$IFDEF VCL_XE_OR_ABOVE}
  1114. {$DEFINE HAS_TFormatSettings_Object}
  1115. {$DEFINE HAS_LocaleCharsFromUnicode}
  1116. {$DEFINE HAS_UnicodeFromLocaleChars}
  1117. {$DEFINE HAS_PLongBool}
  1118. {$DEFINE HAS_PVOID}
  1119. {$DEFINE HAS_ULONG64}
  1120. {$DEFINE HAS_TEncoding_GetEncoding_ByEncodingName}
  1121. {$DEFINE HAS_DateUtils_TTimeZone}
  1122. {$IFDEF DCC}
  1123. // Exception.RaiseOuterException() is now available on all platforms
  1124. {$DEFINE HAS_Exception_RaiseOuterException}
  1125. {$ENDIF}
  1126. {$IFNDEF DOTNET}
  1127. {$DEFINE HAS_TInterlocked}
  1128. {$ENDIF}
  1129. {$ENDIF}
  1130. {$IFDEF VCL_XE2_OR_ABOVE}
  1131. {$DEFINE HAS_SIZE_T}
  1132. {$DEFINE HAS_PSIZE_T}
  1133. {$DEFINE HAS_SSIZE_T}
  1134. {$DEFINE HAS_PSSIZE_T}
  1135. {$DEFINE HAS_LONG}
  1136. {$DEFINE HAS_ComponentPlatformsAttribute}
  1137. {$DEFINE HAS_ComponentPlatformsAttribute_Win32}
  1138. {$DEFINE HAS_ComponentPlatformsAttribute_Win64}
  1139. {$DEFINE HAS_ComponentPlatformsAttribute_OSX32}
  1140. {$DEFINE HAS_System_ReturnAddress}
  1141. {$DEFINE HAS_DIRECTIVE_WARN_DEFAULT}
  1142. {$ENDIF}
  1143. {$IFDEF VCL_XE3_OR_ABOVE}
  1144. {$DEFINE HAS_DIRECTIVE_ZEROBASEDSTRINGS}
  1145. {$DEFINE HAS_SysUtils_TStringHelper}
  1146. {$IFDEF NEXTGEN}
  1147. {$DEFINE DCC_NEXTGEN}
  1148. {$DEFINE HAS_MarshaledAString}
  1149. {$DEFINE USE_MARSHALLED_PTRS}
  1150. {$IFDEF AUTOREFCOUNT}
  1151. {$DEFINE USE_OBJECT_ARC}
  1152. {$ENDIF}
  1153. {$ENDIF}
  1154. // technically, these are present in XE3, but they are not used yet
  1155. {.$DEFINE HAS_ComponentPlatformsAttribute_iOS_Simulator}
  1156. {.$DEFINE HAS_ComponentPlatformsAttribute_Android}
  1157. {.$DEFINE HAS_ComponentPlatformsAttribute_Linux32}
  1158. {.$DEFINE HAS_ComponentPlatformsAttribute_iOS_Device}
  1159. {.$DEFINE HAS_ComponentPlatformsAttribute_WinNX32}
  1160. {$ENDIF}
  1161. {$IFDEF VCL_XE4_OR_ABOVE}
  1162. {$DEFINE HAS_AnsiStrings_StrPLCopy}
  1163. {$DEFINE HAS_AnsiStrings_StrLen}
  1164. {$DEFINE HAS_Character_TCharHelper}
  1165. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Simulator}
  1166. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Device}
  1167. {$ENDIF}
  1168. {$IFDEF VCL_XE5_OR_ABOVE}
  1169. {$DEFINE HAS_ComponentPlatformsAttribute_Android}
  1170. {$ENDIF}
  1171. {$IFDEF VCL_XE5_UPDATE2_OR_ABOVE}
  1172. {$DEFINE HAS_DIRECTIVE_HPPEMIT_LINKUNIT}
  1173. {$ENDIF}
  1174. {$IFDEF VCL_XE7_OR_ABOVE}
  1175. {$DEFINE HAS_TNetEncoding}
  1176. {$ENDIF}
  1177. {$IFDEF VCL_XE8_OR_ABOVE}
  1178. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Device32}
  1179. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Device64}
  1180. // technically, these are present in XE8, but they are not used yet
  1181. {.$DEFINE HAS_ComponentPlatformsAttribute_Linux64}
  1182. {.$DEFINE HAS_ComponentPlatformsAttribute_WinIoT32}
  1183. {$ENDIF}
  1184. {$IFDEF VCL_10_0_OR_ABOVE}
  1185. {$IFDEF ANDROID}
  1186. {$DEFINE HAS_TAndroidHelper}
  1187. {$ENDIF}
  1188. // technically, these are present in 10.0 Seattle, but they are not used yet
  1189. {.$DEFINE HAS_ComponentPlatformsAttribute_WinARM}
  1190. {$ENDIF}
  1191. {$IFDEF VCL_10_1_OR_ABOVE}
  1192. {$DEFINE HAS_DIRECTIVE_HPPEMIT_LEGACYHPP}
  1193. {$DEFINE HAS_TStrings_AddPair}
  1194. // technically, these are present in 10.1 Berlin, but they are not used yet
  1195. {.$DEFINE HAS_ComponentPlatformsAttribute_OSX64}
  1196. {.$DEFINE HAS_ComponentPlatformsAttribute_OSXNX64}
  1197. {.$DEFINE HAS_ComponentPlatformsAttribute_Linux32Arm}
  1198. {.$DEFINE HAS_ComponentPlatformsAttribute_Linux64Arm}
  1199. {.$DEFINE HAS_ComponentPlatformsAttribute_Android64}
  1200. {$ENDIF}
  1201. {$IFDEF VCL_10_2_OR_ABOVE}
  1202. {.$WARN IMPLICIT_INTEGER_CAST_LOSS OFF}
  1203. {.$WARN IMPLICIT_CONVERSION_LOSS OFF}
  1204. {.$WARN COMBINING_SIGNED_UNSIGNED64 OFF}
  1205. {$DEFINE HAS_STATIC_TThread_ForceQueue}
  1206. // In Delphi 10.2 Tokyo, TThread.ForceQueue() is broken on Android, the
  1207. // passed in procedure is called immediately instead of being delayed!
  1208. {$IFDEF ANDROID}
  1209. {$DEFINE BROKEN_TThread_ForceQueue}
  1210. {$ENDIF}
  1211. {$ENDIF}
  1212. {$IFDEF VCL_10_3_OR_ABOVE}
  1213. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Simulator32}
  1214. {$DEFINE HAS_ComponentPlatformsAttribute_Android32Arm}
  1215. {$DEFINE HAS_ComponentPlatformsAttribute_WinARM32}
  1216. {$UNDEF HAS_ComponentPlatformsAttribute_OSXNX64} // removed in 10.3 Rio
  1217. // technically, these are present in 10.3 Rio, but they are not used yet
  1218. {.$DEFINE HAS_ComponentPlatformsAttribute_iOS_Simulator64}
  1219. {$IFDEF DCC}
  1220. {$IFDEF LINUX}
  1221. // RLebeau 9/25/2019: there is a bug in the IDE when debugging Linux projects
  1222. // where the EThreadNameException exception raised by TThread.NameThreadForDebugging()
  1223. // is not handled correctly.
  1224. {$UNDEF HAS_NAMED_THREADS}
  1225. {$ENDIF}
  1226. {$ENDIF}
  1227. {$IFDEF ANDROID}
  1228. {$UNDEF BROKEN_TThread_ForceQueue}
  1229. {$ENDIF}
  1230. {$ENDIF}
  1231. {$IFDEF VCL_10_3_UPDATE2_OR_ABOVE}
  1232. {$DEFINE HAS_ComponentPlatformsAttribute_OSX64}
  1233. {$ENDIF}
  1234. {$IFDEF VCL_10_4_OR_ABOVE}
  1235. // 0-based string indexing via '[]' is turned off by default in Delphi 10.4.
  1236. // TStringHelper is always 0-indexed, flat RTL functions are always 1-indexed,
  1237. // and now '[]' is 1-indexed again on all platforms - {$ZEROBASEDSTRINGS OFF}
  1238. // is the default.
  1239. {.$UNDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
  1240. {$ENDIF}
  1241. {$IFDEF VCL_11_0_OR_ABOVE}
  1242. {$DEFINE HAS_ComponentPlatformsAttribute_AndroidArm32}
  1243. {$DEFINE HAS_ComponentPlatformsAttribute_AndroidArm64}
  1244. {$DEFINE HAS_ComponentPlatformsAttribute_OSXArm64}
  1245. {$ENDIF}
  1246. // Delphi XE+ cross-compiling
  1247. {$IFNDEF FPC}
  1248. {$IFDEF POSIX}
  1249. {$IF RTLVersion >= 22.0}
  1250. {$DEFINE UNIX}
  1251. {$UNDEF USE_BASEUNIX}
  1252. {$DEFINE VCL_CROSS_COMPILE}
  1253. {$DEFINE USE_VCL_POSIX}
  1254. {$IFEND}
  1255. {$ENDIF}
  1256. {$IFDEF LINUX}
  1257. {$IFDEF CONDITIONALEXPRESSIONS}
  1258. {$IF RTLVersion >= 22.0}
  1259. {$DEFINE VCL_CROSS_COMPILE}
  1260. {$DEFINE USE_VCL_POSIX}
  1261. {$IFEND}
  1262. {$ENDIF}
  1263. {$ENDIF}
  1264. {$ENDIF}
  1265. {$IFDEF VCL_CROSS_COMPILE}
  1266. {$UNDEF KYLIXCOMPAT}
  1267. {$ELSE}
  1268. {$IFDEF KYLIXCOMPAT}
  1269. {$linklib c}
  1270. {$ENDIF}
  1271. {$ENDIF}
  1272. {$IFDEF FPC}
  1273. {$DEFINE USE_INLINE}
  1274. {$DEFINE USE_CLASSINLINE}
  1275. {$DEFINE USE_TBitBtn} //use Bit Buttons instead of Buttons
  1276. {$DEFINE FPC_REINTRODUCE_BUG}
  1277. {$DEFINE FPC_CIRCULAR_BUG}
  1278. {$DEFINE NO_REDECLARE}
  1279. {$DEFINE BYTE_COMPARE_SETS}
  1280. {$DEFINE HAS_QWord} // TODO: when was QWord introduced?
  1281. {$DEFINE HAS_PQWord} // TODO: when was PQWord introduced?
  1282. {$IFDEF FPC_2_1_5_OR_ABOVE}
  1283. {$DEFINE HAS_UInt64}
  1284. {.$DEFINE HAS_PUInt64} // TODO: is this defined?
  1285. {$ENDIF}
  1286. {$IFDEF FPC_2_2_0_OR_ABOVE}
  1287. {$DEFINE HAS_InterlockedCompareExchange_Pointers}
  1288. {$ENDIF}
  1289. {$IFDEF FPC_2_2_2_OR_ABOVE}
  1290. {$DEFINE HAS_SharedSuffix}
  1291. {$ENDIF}
  1292. {$IFDEF FPC_2_2_4_OR_ABOVE}
  1293. // these types are only available on Unix systems (FreeBSD, Linux, etc)
  1294. {$IFDEF UNIX}
  1295. {$DEFINE HAS_UNIT_UnixType}
  1296. {$DEFINE HAS_SIZE_T}
  1297. {$DEFINE HAS_PSIZE_T}
  1298. {$DEFINE HAS_SSIZE_T}
  1299. {$DEFINE HAS_PSSIZE_T}
  1300. {$DEFINE HAS_TIME_T}
  1301. {$DEFINE HAS_PTIME_T}
  1302. {$ENDIF}
  1303. {$ENDIF}
  1304. {$DEFINE HAS_PtrInt}
  1305. {$DEFINE HAS_PtrUInt}
  1306. {$DEFINE HAS_PGUID}
  1307. {$DEFINE HAS_LPGUID}
  1308. {$DEFINE HAS_PPAnsiChar}
  1309. {$DEFINE HAS_ENUM_ELEMENT_VALUES}
  1310. {$DEFINE HAS_AcquireExceptionObject} // TODO: when was AcquireExceptionObject introduced?
  1311. {$IFDEF WINDOWS}
  1312. {$DEFINE HAS_ULONG_PTR}
  1313. {.$DEFINE HAS_ULONGLONG} // TODO: is this defined?
  1314. {$ENDIF}
  1315. {$DEFINE HAS_UNIT_ctypes}
  1316. {$DEFINE HAS_sLineBreak}
  1317. {$IFDEF FPC_HAS_UNICODESTRING}
  1318. {$DEFINE HAS_UnicodeString}
  1319. {$ELSE}
  1320. {$IFDEF FPC_2_4_0_OR_ABOVE}
  1321. {$DEFINE HAS_UnicodeString}
  1322. {$ENDIF}
  1323. {$ENDIF}
  1324. {$IFDEF FPC_2_4_4_OR_ABOVE}
  1325. {$DEFINE DEPRECATED_TThread_SuspendResume}
  1326. {$DEFINE HAS_DEPRECATED} // TODO: when was deprecated introduced? Possibly 1.9.x
  1327. {$DEFINE HAS_DEPRECATED_MSG} // TODO: when was message support added? Possibly 2.4.x
  1328. {$DEFINE HAS_STATIC_TThread_Synchronize}
  1329. {$IFNDEF FPC_2_6_2_OR_ABOVE}
  1330. {$DEFINE USE_SEMICOLON_BEFORE_DEPRECATED} // TODO: which earlier versions require a semicolon?
  1331. {$ENDIF}
  1332. {$ENDIF}
  1333. {$IFDEF FPC_2_6_0_OR_ABOVE}
  1334. {$DEFINE HAS_NativeInt}
  1335. {$DEFINE HAS_NativeUInt}
  1336. {$ENDIF}
  1337. {$IFDEF FPC_2_6_2_OR_ABOVE}
  1338. {$DEFINE HAS_Int8}
  1339. {$DEFINE HAS_UInt8}
  1340. {$DEFINE HAS_Int16}
  1341. {$DEFINE HAS_UInt16}
  1342. {$DEFINE HAS_Int32}
  1343. {$DEFINE HAS_UInt32}
  1344. {$DEFINE HAS_GetLocalTimeOffset}
  1345. {$DEFINE HAS_UniversalTimeToLocal}
  1346. {$DEFINE HAS_LocalTimeToUniversal}
  1347. {$ENDIF}
  1348. {$IFDEF FPC_2_6_4_OR_ABOVE}
  1349. {$DEFINE HAS_PInt8}
  1350. {$DEFINE HAS_PUInt8}
  1351. {$DEFINE HAS_PInt16}
  1352. {$DEFINE HAS_PUInt16}
  1353. {$DEFINE HAS_PInt32}
  1354. {$DEFINE HAS_PUInt32}
  1355. {$ENDIF}
  1356. {$IFDEF FPC_3_0_0_OR_ABOVE}
  1357. {$DEFINE HAS_STATIC_TThread_Queue}
  1358. {$DEFINE HAS_SetCodePage}
  1359. {$ENDIF}
  1360. {$IFDEF FPC_UNICODESTRINGS}
  1361. {$DEFINE STRING_IS_UNICODE}
  1362. {$ENDIF}
  1363. {$IFDEF FPC_3_1_1_OR_ABOVE}
  1364. {$DEFINE HAS_STATIC_TThread_ForceQueue} // requires rev 37359+
  1365. {$DEFINE HAS_PRawByteString}
  1366. {$ENDIF}
  1367. {$ENDIF}
  1368. {$IFDEF DOTNET}
  1369. {$DEFINE WIDGET_WINFORMS}
  1370. {$ELSE}
  1371. {$DEFINE WIDGET_VCL_LIKE} // LCL included.
  1372. {$DEFINE WIDGET_VCL_LIKE_OR_KYLIX}
  1373. {$IFDEF FPC}
  1374. {$DEFINE WIDGET_LCL}
  1375. {$ELSE}
  1376. {$IFDEF KYLIX}
  1377. {$DEFINE WIDGET_KYLIX}
  1378. {$ELSE}
  1379. {$DEFINE WIDGET_VCL}
  1380. {$ENDIF}
  1381. {$ENDIF}
  1382. {$ENDIF}
  1383. // .NET and Delphi 2009+ support UNICODE strings natively!
  1384. //
  1385. // FreePascal 2.4.0+ supports UnicodeString, but does not map its
  1386. // native String type to UnicodeString except when {$MODE DelphiUnicode}
  1387. // or {$MODESWITCH UnicodeStrings} is enabled. However, UNICODE is not
  1388. // defined in that mode yet until its RTL has been updated to support
  1389. // UnicodeString. STRING_UNICODE_MISMATCH is defined when the native
  1390. // String/Char types do not map to the same types that APIs are expecting
  1391. // based on whether UNICODE is defined or not.
  1392. //
  1393. // NOTE: Do not define UNICODE here. The compiler defines
  1394. // the symbol automatically.
  1395. {$IFDEF STRING_IS_UNICODE}
  1396. {$IFNDEF UNICODE}
  1397. {$DEFINE STRING_UNICODE_MISMATCH}
  1398. {$ENDIF}
  1399. {$ELSE}
  1400. {$DEFINE STRING_IS_ANSI}
  1401. {$IFDEF UNICODE}
  1402. {$DEFINE STRING_UNICODE_MISMATCH}
  1403. {$ENDIF}
  1404. {$ENDIF}
  1405. {$IFDEF DCC_NEXTGEN}
  1406. {$DEFINE NO_ANSI_TYPES}
  1407. {.$DEFINE STRING_IS_IMMUTABLE} // Strings are NOT immutable in NEXTGEN yet
  1408. {$IFDEF USE_OBJECT_ARC}
  1409. // TODO: move these to an appropriate section. Not doing this yet because
  1410. // it is a major interface change to switch to Generics and we should
  1411. // maintain backwards compatibility with earlier compilers for the time
  1412. // being. Defining them only here for now because the non-Generic versions
  1413. // of these classes have become deprecated by ARC and so we need to start
  1414. // taking advantage of the Generics versions...
  1415. {$DEFINE HAS_UNIT_Generics_Collections}
  1416. {$DEFINE HAS_UNIT_Generics_Defaults}
  1417. {$DEFINE HAS_GENERICS_TDictionary}
  1418. {$DEFINE HAS_GENERICS_TList}
  1419. {$DEFINE HAS_GENERICS_TObjectList}
  1420. {$DEFINE HAS_GENERICS_TThreadList}
  1421. // TArray<T>.Copy() was introduced in XE7 but was buggy. It was fixed in XE8:
  1422. //
  1423. // RSP-9763 TArray.Copy<T> copies from destination to source for unmanaged types
  1424. // https://quality.embarcadero.com/browse/RSP-9763
  1425. //
  1426. {$IFDEF VCL_XE8_OR_ABOVE}
  1427. {$DEFINE HAS_GENERICS_TArray_Copy}
  1428. {$ENDIF}
  1429. {$ENDIF}
  1430. {$ENDIF}
  1431. // TODO: Ansi data types were disabled on mobile platforms in XE3, but
  1432. // UTF8String and RawByteString were re-enabled in 10.1 Berlin! What else,
  1433. // if anything, was re-enabled to facilitate that?
  1434. //
  1435. // UPDATE: In 10.4 Sydney, AnsiChar and AnsiString were re-enabled on
  1436. // mobile platforms! NEXTGEN is no longer defined in the mobile compilers.
  1437. {$IFDEF NO_ANSI_TYPES}
  1438. {$UNDEF HAS_AnsiString}
  1439. {$UNDEF HAS_AnsiChar}
  1440. {$UNDEF HAS_PAnsiChar}
  1441. {$UNDEF HAS_PPAnsiChar}
  1442. {$UNDEF HAS_AnsiStrings_StrPLCopy}
  1443. {$UNDEF HAS_AnsiStrings_StrLen}
  1444. {$ENDIF}
  1445. {$IFDEF WIN32}
  1446. {$DEFINE WIN32_OR_WIN64}
  1447. {$ENDIF}
  1448. {$IFDEF WIN64}
  1449. {$DEFINE WIN32_OR_WIN64}
  1450. {$ENDIF}
  1451. {$IFDEF WIN32_OR_WIN64}
  1452. {$DEFINE USE_ZLIB_UNIT}
  1453. {$IFNDEF DCC_NEXTGEN}
  1454. {$DEFINE USE_OPENSSL} // !!!·MOVED·HERE·BY·EMBT
  1455. {$DEFINE USE_SSPI}
  1456. {$IFDEF STRING_IS_UNICODE}
  1457. {$DEFINE SSPI_UNICODE}
  1458. {$ENDIF}
  1459. {$ENDIF}
  1460. {$ENDIF}
  1461. {$IFDEF WINCE}
  1462. {$DEFINE USE_OPENSSL}
  1463. // RLebeau: not sure if the above Win32/64 defines also apply to WinCE,
  1464. // so keeping them separate for now...
  1465. {$ENDIF}
  1466. // High-performance counters are not reliable on multi-core systems, and have
  1467. // been known to cause problems with TIdIOHandler.ReadLn() timeouts in Windows
  1468. // XP SP3, both 32-bit and 64-bit. Refer to these discussions for more info:
  1469. //
  1470. // http://www.virtualdub.org/blog/pivot/entry.php?id=106
  1471. // http://blogs.msdn.com/oldnewthing/archive/2008/09/08/8931563.aspx
  1472. //
  1473. // Do not enable thus unless you know it will work correctly on your systems!
  1474. {$IFDEF WINDOWS}
  1475. {.$DEFINE USE_HI_PERF_COUNTER_FOR_TICKS}
  1476. {$ENDIF}
  1477. {$IFDEF UNIX}
  1478. {$DEFINE USE_OPENSSL}
  1479. {$DEFINE USE_ZLIB_UNIT}
  1480. {$ENDIF}
  1481. {$IFDEF MACOS}
  1482. {$DEFINE HAS_getifaddrs}
  1483. {$ENDIF}
  1484. {$IFDEF LINUX}
  1485. {$DEFINE HAS_getifaddrs}
  1486. {$ENDIF}
  1487. {$IFDEF IOS}
  1488. {$DEFINE HAS_getifaddrs}
  1489. {$DEFINE USE_OPENSSL}
  1490. {$IFDEF CPUARM}
  1491. // RLebeau: For iOS devices, OpenSSL cannot be used as an external library,
  1492. // it must be statically linked into the app. For the iOS simulator, this
  1493. // is not true. Users who want to use OpenSSL in iOS device apps will need
  1494. // to add the static OpenSSL library to the project and then include the
  1495. // IdSSLOpenSSLHeaders_static unit in their uses clause. It hooks up the
  1496. // statically linked functions for the IdSSLOpenSSLHeaders unit to use...
  1497. {$DEFINE STATICLOAD_OPENSSL}
  1498. {$ENDIF}
  1499. {$ENDIF}
  1500. {$IFDEF FREEBSD}
  1501. {$DEFINE HAS_getifaddrs}
  1502. {$ENDIF}
  1503. {$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
  1504. {$DEFINE REQUIRES_PROPER_ALIGNMENT}
  1505. {$ENDIF}
  1506. //
  1507. //iconv defines section.
  1508. {$DEFINE USE_ICONV_UNIT}
  1509. {$DEFINE USE_ICONV_ENC}
  1510. {$IFDEF UNIX}
  1511. {$DEFINE USE_ICONV}
  1512. {$IFDEF USE_BASEUNIX}
  1513. {$IFDEF FPC}
  1514. {$UNDEF USE_ICONV_UNIT}
  1515. {$ELSE}
  1516. {$UNDEF USE_ICONV_ENC}
  1517. {$ENDIF}
  1518. {$ENDIF}
  1519. {$IFDEF KYLIXCOMPAT}
  1520. //important!! Iconv functions are defined in the libc.pas Kylix compatible unit.
  1521. {$UNDEF USE_ICONV_ENC}
  1522. {$UNDEF USE_ICONV_UNIT}
  1523. {$ENDIF}
  1524. {$ENDIF}
  1525. {$IFDEF NETWARELIBC}
  1526. {$DEFINE USE_ICONV}
  1527. //important!!! iconv functions are defined in the libc.pas Novell Netware header.
  1528. //Do not define USE_ICONV_UNIT
  1529. {$UNDEF USE_ICONV_UNIT}
  1530. {$UNDEF USE_ICONV_ENC}
  1531. {$ENDIF}
  1532. {$UNDEF USE_SAFELOADLIBRARY}
  1533. {$IFDEF WINDOWS}
  1534. {$UNDEF USE_ICONV_ENC}
  1535. {$DEFINE USE_SAFELOADLIBRARY}
  1536. {$ENDIF}
  1537. // Use here for all *nix systems that you do not want to use iconv library
  1538. {$IFDEF FPC}
  1539. {$IFDEF ANDROID}
  1540. {$UNDEF USE_ICONV}
  1541. {$DEFINE USE_LCONVENC}
  1542. {$ENDIF}
  1543. {$ENDIF}
  1544. {$UNDEF USE_INVALIDATE_MOD_CACHE}
  1545. {$UNDEF USE_SAFELOADLIBRARY}
  1546. //This must come after the iconv defines because this compiler targets a Unix-like
  1547. //operating system. One key difference is that it does have a TEncoding class.
  1548. //If this comes before the ICONV defines, it creates problems.
  1549. //This also must go before the THandle size calculations.
  1550. {$IFDEF VCL_CROSS_COMPILE}
  1551. {$IFDEF POSIX}
  1552. {$IFNDEF LINUX}
  1553. {$DEFINE BSD}
  1554. {$ENDIF}
  1555. {$DEFINE USE_SAFELOADLIBRARY}
  1556. {$DEFINE USE_INVALIDATE_MOD_CACHE}
  1557. {$ENDIF}
  1558. //important!!! iconv functions are defined in the libc.pas Novell Netware header.
  1559. //Do not define USE_ICONVUNIT
  1560. {$UNDEF USE_ICONV}
  1561. {$UNDEF USE_ICONV_UNIT}
  1562. {$UNDEF USE_ICONV_ENC}
  1563. {$DEFINE INT_THREAD_PRIORITY}
  1564. {$ENDIF}
  1565. {$IFNDEF USE_ICONV}
  1566. {$UNDEF USE_ICONV_UNIT}
  1567. {$UNDEF USE_ICONV_ENC}
  1568. {$ENDIF}
  1569. //IMPORTANT!!!!
  1570. //
  1571. //Do not remove this!!! This is to work around a conflict. In DCC, MACOS
  1572. //will mean OS X. In FreePascal, the DEFINE MACOS means MacIntosh System OS Classic.
  1573. {$IFDEF DCC}
  1574. // DCC defines MACOS for both iOS and OS X platforms, need to differentiate
  1575. {$IFDEF MACOS}
  1576. {$IFNDEF IOS}
  1577. {$DEFINE OSX}
  1578. {$DEFINE DARWIN}
  1579. {$ENDIF}
  1580. {$ENDIF}
  1581. {$ENDIF}
  1582. {$IFDEF FPC}
  1583. // FPC defines DARWIN for both OSX and iOS, need to differentiate
  1584. {$IFDEF DARWIN}
  1585. {$IFNDEF IOS}
  1586. {$DEFINE OSX}
  1587. {$ENDIF}
  1588. {$ENDIF}
  1589. {$IFDEF MACOS}
  1590. {$DEFINE MACOS_CLASSIC}
  1591. {$ENDIF}
  1592. {$ENDIF}
  1593. {
  1594. BSD 4.4 introduced a minor API change. sa_family was changed from a 16bit
  1595. word to an 8 bit byte and an 8 bit byte field named sa_len was added.
  1596. }
  1597. //Place this only after DARWIN has been defined for Delphi MACOS
  1598. {$IFDEF FREEBSD}
  1599. {$DEFINE SOCK_HAS_SINLEN}
  1600. {$ENDIF}
  1601. {$IFDEF DARWIN}
  1602. {$DEFINE SOCK_HAS_SINLEN}
  1603. {$ENDIF}
  1604. {$IFDEF HAIKU}
  1605. {$DEFINE SOCK_HAS_SINLEN}
  1606. {$ENDIF}
  1607. {$IFDEF MORPHOS}
  1608. {$DEFINE SOCK_HAS_SINLEN}
  1609. {$ENDIF}
  1610. // Do NOT remove these IFDEF's. They are here because InterlockedExchange
  1611. // only handles 32bit values. Some Operating Systems may have 64bit
  1612. // THandles. This is not always tied to the platform architecture.
  1613. {$IFDEF AMIGA}
  1614. {$DEFINE THANDLE_CPUBITS}
  1615. {$ENDIF}
  1616. {$IFDEF ATARI}
  1617. {$DEFINE THANDLE_32}
  1618. {$ENDIF}
  1619. {$IFDEF BEOS}
  1620. {$DEFINE THANDLE_32}
  1621. {$ENDIF}
  1622. {$IFDEF BSD}
  1623. //I think BSD might handle FreeBSD, NetBSD, OpenBSD, and Darwin
  1624. {$IFDEF IOS}
  1625. {$IFDEF CPUARM64}
  1626. {$DEFINE CPU64}
  1627. {$DEFINE THANDLE_64}
  1628. {$ELSE}
  1629. {$IFDEF CPUARM32}
  1630. {$DEFINE CPU32}
  1631. {$ENDIF}
  1632. {$DEFINE THANDLE_32}
  1633. {$ENDIF}
  1634. {$ENDIF}
  1635. {$IFDEF OSX}
  1636. {$IFDEF FPC}
  1637. {$DEFINE THANDLE_32}
  1638. {$ELSE}
  1639. {$DEFINE THANDLE_CPUBITS} // !!! ADDED OSX BY EMBT
  1640. {$ENDIF}
  1641. {$ENDIF}
  1642. {$ENDIF}
  1643. {$IFDEF EMBEDDED}
  1644. {$DEFINE THANDLE_CPUBITS}
  1645. {$ENDIF}
  1646. {$IFDEF EMX}
  1647. {$DEFINE THANDLE_32}
  1648. {$ENDIF}
  1649. {$IFDEF GBA}
  1650. {$DEFINE THANDLE_32}
  1651. {$ENDIF}
  1652. {$IFDEF GO32}
  1653. {$DEFINE THANDLE_32}
  1654. {$ENDIF}
  1655. {$IFDEF HAIKU}
  1656. {$DEFINE THANDLE_32}
  1657. {$ENDIF}
  1658. {$IFDEF LINUX}
  1659. {$IFDEF LINUX64}
  1660. {$DEFINE CPU64}
  1661. {$DEFINE THANDLE_64}
  1662. {$ELSE}
  1663. {$IFDEF LINUX32}
  1664. {$DEFINE CPU32}
  1665. {$ENDIF}
  1666. {$DEFINE THANDLE_32}
  1667. {$ENDIF}
  1668. {$ENDIF}
  1669. {$IFDEF MACOS_CLASSIC}
  1670. {$DEFINE THANDLE_CPUBITS}
  1671. {$ENDIF}
  1672. {$IFDEF MORPHOS}
  1673. {$DEFINE THANDLE_CPUBITS}
  1674. {$ENDIF}
  1675. {$IFDEF NATIVENT} //Native NT for kernel level drivers
  1676. {$DEFINE THANDLE_CPUBITS}
  1677. {$ENDIF}
  1678. {$IFDEF NDS}
  1679. {$DEFINE THANDLE_32}
  1680. {$ENDIF}
  1681. {$IFDEF NETWARE}
  1682. {$DEFINE THANDLE_32}
  1683. {$ENDIF}
  1684. {$IFDEF NETWARELIBC}
  1685. {$DEFINE THANDLE_32}
  1686. {$ENDIF}
  1687. {$IFDEF OS2}
  1688. {$DEFINE THANDLE_32}
  1689. {$ENDIF}
  1690. {$IFDEF PALMOS}
  1691. {$DEFINE THANDLE_32}
  1692. {$ENDIF}
  1693. {$IFDEF SOLARIS}
  1694. {$DEFINE THANDLE_32}
  1695. {$ENDIF}
  1696. {$IFDEF SYMBIAN}
  1697. {$DEFINE THANDLE_32}
  1698. {$ENDIF}
  1699. {$IFDEF WII}
  1700. {$DEFINE THANDLE_32}
  1701. {$ENDIF}
  1702. {$IFDEF WATCOM}
  1703. {$DEFINE THANDLE_32}
  1704. {$ENDIF}
  1705. {$IFDEF WINDOWS}
  1706. {$DEFINE THANDLE_CPUBITS}
  1707. {$ENDIF}
  1708. // end platform specific stuff for THandle size
  1709. {$IFDEF THANDLE_CPUBITS}
  1710. {$IFDEF CPU64}
  1711. {$DEFINE THANDLE_64}
  1712. {$ELSE}
  1713. {$DEFINE THANDLE_32}
  1714. {$ENDIF}
  1715. {$ENDIF}
  1716. {$IFDEF DOTNET}
  1717. {$DEFINE DOTNET_OR_ICONV}
  1718. {$ENDIF}
  1719. {$IFDEF USE_ICONV}
  1720. {$DEFINE DOTNET_OR_ICONV}
  1721. {$ENDIF}
  1722. {$UNDEF STREAM_SIZE_64}
  1723. {$IFDEF FPC}
  1724. {$DEFINE STREAM_SIZE_64}
  1725. {$ELSE}
  1726. {$IFDEF VCL_6_OR_ABOVE}
  1727. {$DEFINE STREAM_SIZE_64}
  1728. {$ENDIF}
  1729. {$ENDIF}
  1730. {$IFNDEF FREE_ON_FINAL}
  1731. {$IFNDEF DOTNET}
  1732. {$IFDEF HAS_System_RegisterExpectedMemoryLeak}
  1733. {$DEFINE REGISTER_EXPECTED_MEMORY_LEAK}
  1734. {$ENDIF}
  1735. {$IFDEF USE_FASTMM4}
  1736. {$DEFINE REGISTER_EXPECTED_MEMORY_LEAK}
  1737. {$ENDIF}
  1738. {$IFDEF USE_MADEXCEPT}
  1739. {$DEFINE REGISTER_EXPECTED_MEMORY_LEAK}
  1740. {$ENDIF}
  1741. {$IFDEF USE_LEAKCHECK}
  1742. {$DEFINE REGISTER_EXPECTED_MEMORY_LEAK}
  1743. {$ENDIF}
  1744. {$ENDIF}
  1745. {$ENDIF}
  1746. {
  1747. We must determine what the SocketType parameter is for the Socket function.
  1748. In DotNET, it's SocketType. In Kylix and the libc.pas Kylix-compatibility
  1749. library, it's a __socket_type. In BaseUnix, it's a C-type Integer. In Windows,
  1750. it's a LongInt.
  1751. }
  1752. {$UNDEF SOCKETTYPE_IS_SOCKETTYPE}
  1753. {$UNDEF SOCKETTYPE_IS_CINT}
  1754. {$UNDEF SOCKETTYPE_IS___SOCKETTYPE}
  1755. {$UNDEF SOCKETTYPE_IS_LONGINT}
  1756. {$UNDEF SOCKETTYPE_IS_NUMERIC}
  1757. {$UNDEF SOCKET_LEN_IS_socklen_t}
  1758. {$IFDEF DOTNET}
  1759. {$DEFINE SOCKETTYPE_IS_SOCKETTYPE}
  1760. {$ENDIF}
  1761. {$IFDEF USE_BASEUNIX}
  1762. {$DEFINE SOCKETTYPE_IS_CINT}
  1763. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1764. {$ENDIF}
  1765. {$IFDEF KYLIXCOMPAT}
  1766. {$DEFINE SOCKETTYPE_IS___SOCKETTYPE}
  1767. {$ENDIF}
  1768. {$IFDEF USE_VCL_POSIX}
  1769. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1770. {$DEFINE SOCKETTYPE_IS_LONGINT}
  1771. {$DEFINE SOCKET_LEN_IS_socklen_t}
  1772. {$ENDIF}
  1773. {$IFDEF WINDOWS}
  1774. {$DEFINE SOCKETTYPE_IS_LONGINT}
  1775. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1776. {$ENDIF}
  1777. {$IFDEF OS2}
  1778. {$DEFINE SOCKETTYPE_IS_LONGINT}
  1779. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1780. {$ENDIF}
  1781. {$IFDEF NETWARE}
  1782. {$DEFINE SOCKETTYPE_IS_LONGINT}
  1783. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1784. {$ENDIF}
  1785. {Take advantage of some TCP features specific to some stacks.
  1786. They work somewhat similarly but there's a key difference.
  1787. In Linux, TCP_CORK is turned on to send fixed packet sizes and
  1788. when turned-off (uncorked), any remaining data is sent. With
  1789. TCP_NOPUSH, this might not happen and remaining data is only sent
  1790. before disconnect. TCP_KEEPIDLE and TCP_KEEPINTVL so the IFDEF LINUX and IFDEF
  1791. SOLARIS instead of IFDEF UNIX is not an error, it's deliberate.}
  1792. {$UNDEF HAS_TCP_NOPUSH}
  1793. {$UNDEF HAS_TCP_CORK}
  1794. {$UNDEF HAS_TCP_KEEPIDLE}
  1795. {$UNDEF HAS_TCP_KEEPINTVL}
  1796. {$UNDEF HAS_SOCKET_NOSIGPIPE}
  1797. {$IFDEF BSD}
  1798. {$DEFINE HAS_TCP_NOPUSH}
  1799. {$ENDIF}
  1800. {$IFDEF HAIKU}
  1801. {$DEFINE HAS_TCP_NOPUSH}
  1802. {$ENDIF}
  1803. {$IFDEF LINUX}
  1804. {$DEFINE HAS_TCP_CORK}
  1805. {$DEFINE HAS_TCP_KEEPIDLE}
  1806. {$DEFINE HAS_TCP_KEEPINTVL}
  1807. {$ENDIF}
  1808. {$IFDEF SOLARIS}
  1809. {$DEFINE HAS_TCP_CORK}
  1810. {$ENDIF}
  1811. {$IFDEF NETBSD}
  1812. {$DEFINE HAS_TCP_CORK}
  1813. {$DEFINE HAS_TCP_KEEPIDLE}
  1814. {$DEFINE HAS_TCP_KEEPINTVL}
  1815. {$ENDIF}
  1816. {$IFDEF USE_VCL_POSIX}
  1817. // TODO: which platforms actually have SO_NOSIGPIPE available?
  1818. {$DEFINE HAS_SOCKET_NOSIGPIPE}
  1819. {$IFDEF ANDROID}
  1820. {$UNDEF HAS_SOCKET_NOSIGPIPE}
  1821. {$ENDIF}
  1822. {$IFDEF LINUX}
  1823. {$UNDEF HAS_SOCKET_NOSIGPIPE}
  1824. {$ENDIF}
  1825. {$ENDIF}
  1826. {end Unix OS specific stuff}
  1827. {$IFDEF DEBUG}
  1828. {$UNDEF USE_INLINE}
  1829. {$ENDIF}
  1830. // RLebeau 5/24/2015: In C++Builder 2006 and 2007, UInt64 is emitted as
  1831. // signed __int64 in HPP files instead of as unsigned __int64. This causes
  1832. // conflicts in overloaded routines that have (U)Int64 parameters. This
  1833. // was fixed in C++Builder 2009. For compilers that do not have a native
  1834. // UInt64 type, or for C++Builder 2006/2007, let's define a record type
  1835. // that can hold UInt64 values...
  1836. {$IFDEF HAS_UInt64}
  1837. {$IFDEF BROKEN_UINT64_HPPEMIT}
  1838. {$DEFINE TIdUInt64_HAS_QuadPart}
  1839. {$ENDIF}
  1840. {$ELSE}
  1841. {$IFNDEF HAS_QWord}
  1842. {$DEFINE TIdUInt64_HAS_QuadPart}
  1843. {$ENDIF}
  1844. {$ENDIF}
  1845. // RLebeau 9/5/2013: it would take a lot of work to re-write Indy to support
  1846. // both 0-based and 1-based string indexing, so we'll just turn off 0-based
  1847. // indexing for now...
  1848. {$IFDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
  1849. {$ZEROBASEDSTRINGS OFF}
  1850. {$ENDIF}