IdCompilerDefines.inc 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031
  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 Alexandria (Olympus)
  382. {$IFDEF VER350}
  383. {$DEFINE VCL_11}
  384. {$IFDEF CBUILDER}
  385. {$DEFINE CBUILDER_11}
  386. {$ELSE}
  387. {$DEFINE DELPHI_11}
  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}
  662. {$DEFINE VCL_11_OR_ABOVE}
  663. {$ENDIF}
  664. {$IFDEF VCL_11_OR_ABOVE}
  665. {$DEFINE VCL_10_4_OR_ABOVE}
  666. {$DEFINE VCL_10_4_UPDATE2_OR_ABOVE}
  667. {$ELSE}
  668. {$IFDEF VCL_10_4}
  669. {$DEFINE VCL_10_4_OR_ABOVE}
  670. // TODO: figure out how to detect this version
  671. {.$DEFINE VCL_10_4_UPDATE2_OR_ABOVE}
  672. {$ENDIF}
  673. {$ENDIF}
  674. {$IFDEF VCL_10_4_OR_ABOVE}
  675. {$DEFINE VCL_10_3_OR_ABOVE}
  676. {$DEFINE VCL_10_3_UPDATE2_OR_ABOVE}
  677. {$ELSE}
  678. {$IFDEF VCL_10_3}
  679. {$DEFINE VCL_10_3_OR_ABOVE}
  680. // TODO: figure out how to detect this version
  681. {.$DEFINE VCL_10_3_UPDATE2_OR_ABOVE}
  682. {$ENDIF}
  683. {$ENDIF}
  684. {$IFDEF VCL_10_3_OR_ABOVE}
  685. {$DEFINE VCL_10_2_OR_ABOVE}
  686. {$ELSE}
  687. {$IFDEF VCL_10_2}
  688. {$DEFINE VCL_10_2_OR_ABOVE}
  689. {$ENDIF}
  690. {$ENDIF}
  691. {$IFDEF VCL_10_2_OR_ABOVE}
  692. {$DEFINE VCL_10_1_OR_ABOVE}
  693. {$ELSE}
  694. {$IFDEF VCL_10_1}
  695. {$DEFINE VCL_10_1_OR_ABOVE}
  696. {$ENDIF}
  697. {$ENDIF}
  698. {$IFDEF VCL_10_1_OR_ABOVE}
  699. {$DEFINE VCL_10_0_OR_ABOVE}
  700. {$ELSE}
  701. {$IFDEF VCL_10_0}
  702. {$DEFINE VCL_10_0_OR_ABOVE}
  703. {$ENDIF}
  704. {$ENDIF}
  705. {$IFDEF VCL_10_0_OR_ABOVE}
  706. {$DEFINE VCL_XE8_OR_ABOVE}
  707. {$ELSE}
  708. {$IFDEF VCL_XE8}
  709. {$DEFINE VCL_XE8_OR_ABOVE}
  710. {$ENDIF}
  711. {$ENDIF}
  712. {$IFDEF VCL_XE8_OR_ABOVE}
  713. {$DEFINE VCL_XE7_OR_ABOVE}
  714. {$ELSE}
  715. {$IFDEF VCL_XE7}
  716. {$DEFINE VCL_XE7_OR_ABOVE}
  717. {$ENDIF}
  718. {$ENDIF}
  719. {$IFDEF VCL_XE7_OR_ABOVE}
  720. {$DEFINE VCL_XE6_OR_ABOVE}
  721. {$ELSE}
  722. {$IFDEF VCL_XE6}
  723. {$DEFINE VCL_XE6_OR_ABOVE}
  724. {$ENDIF}
  725. {$ENDIF}
  726. {$IFDEF VCL_XE6_OR_ABOVE}
  727. {$DEFINE VCL_XE5_OR_ABOVE}
  728. {$DEFINE VCL_XE5_UPDATE2_OR_ABOVE}
  729. {$ELSE}
  730. {$IFDEF VCL_XE5}
  731. {$DEFINE VCL_XE5_OR_ABOVE}
  732. // TODO: figure out how to detect this version
  733. {.$DEFINE VCL_XE5_UPDATE2_OR_ABOVE}
  734. {$ENDIF}
  735. {$ENDIF}
  736. {$IFDEF VCL_XE5_OR_ABOVE}
  737. {$DEFINE VCL_XE4_OR_ABOVE}
  738. {$ELSE}
  739. {$IFDEF VCL_XE4}
  740. {$DEFINE VCL_XE4_OR_ABOVE}
  741. {$ENDIF}
  742. {$ENDIF}
  743. {$IFDEF VCL_XE4_OR_ABOVE}
  744. {$DEFINE VCL_XE3_OR_ABOVE}
  745. {$ELSE}
  746. {$IFDEF VCL_XE3}
  747. {$DEFINE VCL_XE3_OR_ABOVE}
  748. {$ENDIF}
  749. {$ENDIF}
  750. {$IFDEF VCL_XE3_OR_ABOVE}
  751. {$DEFINE VCL_XE2_OR_ABOVE}
  752. {$ELSE}
  753. {$IFDEF VCL_XE2}
  754. {$DEFINE VCL_XE2_OR_ABOVE}
  755. {$ENDIF}
  756. {$ENDIF}
  757. {$IFDEF VCL_XE2_OR_ABOVE}
  758. {$DEFINE VCL_XE_OR_ABOVE}
  759. {$ELSE}
  760. {$IFDEF VCL_XE}
  761. {$DEFINE VCL_XE_OR_ABOVE}
  762. {$ENDIF}
  763. {$ENDIF}
  764. {$IFDEF VCL_XE_OR_ABOVE}
  765. {$DEFINE VCL_2010_OR_ABOVE}
  766. {$ELSE}
  767. {$IFDEF VCL_2010}
  768. {$DEFINE VCL_2010_OR_ABOVE}
  769. {$ENDIF}
  770. {$ENDIF}
  771. {$IFDEF VCL_2010_OR_ABOVE}
  772. {$DEFINE VCL_2009_OR_ABOVE}
  773. {$ELSE}
  774. {$IFDEF VCL_2009}
  775. {$DEFINE VCL_2009_OR_ABOVE}
  776. {$ENDIF}
  777. {$ENDIF}
  778. {$IFDEF VCL_2009_OR_ABOVE}
  779. {$DEFINE VCL_2007_OR_ABOVE}
  780. {$ELSE}
  781. {$IFDEF VCL_2007}
  782. {$DEFINE VCL_2007_OR_ABOVE}
  783. {$ENDIF}
  784. {$ENDIF}
  785. {$IFDEF VCL_2007_OR_ABOVE}
  786. {$DEFINE VCL_2006_OR_ABOVE}
  787. {$ELSE}
  788. {$IFDEF VCL_2006}
  789. {$DEFINE VCL_2006_OR_ABOVE}
  790. {$ENDIF}
  791. {$ENDIF}
  792. {$IFDEF VCL_2006_OR_ABOVE}
  793. {$DEFINE VCL_2005_OR_ABOVE}
  794. {$ELSE}
  795. {$IFDEF VCL_2005}
  796. {$DEFINE VCL_2005_OR_ABOVE}
  797. {$ENDIF}
  798. {$ENDIF}
  799. {$IFDEF VCL_2005_OR_ABOVE}
  800. {$DEFINE VCL_8_OR_ABOVE}
  801. {$ELSE}
  802. {$IFDEF VCL_80}
  803. {$DEFINE VCL_8_OR_ABOVE}
  804. {$ENDIF}
  805. {$ENDIF}
  806. {$IFDEF VCL_8_OR_ABOVE}
  807. {$DEFINE VCL_7_OR_ABOVE}
  808. {$ELSE}
  809. {$IFDEF VCL_70}
  810. {$DEFINE VCL_7_OR_ABOVE}
  811. {$ENDIF}
  812. {$ENDIF}
  813. {$IFDEF VCL_7_OR_ABOVE}
  814. {$DEFINE VCL_6_OR_ABOVE}
  815. {$ELSE}
  816. {$IFDEF VCL_60}
  817. {$DEFINE VCL_6_OR_ABOVE}
  818. {$ENDIF}
  819. {$ENDIF}
  820. {$IFDEF VCL_6_OR_ABOVE}
  821. {$DEFINE VCL_5_OR_ABOVE}
  822. {$ELSE}
  823. {$IFDEF VCL_50}
  824. {$DEFINE VCL_5_OR_ABOVE}
  825. {$ENDIF}
  826. {$ENDIF}
  827. {$IFDEF VCL_5_OR_ABOVE}
  828. {$DEFINE VCL_4_OR_ABOVE}
  829. {$ELSE}
  830. {$IFDEF VCL_40}
  831. {$DEFINE VCL_4_OR_ABOVE}
  832. {$ENDIF}
  833. {$ENDIF}
  834. // Normalize Delphi compiler defines to match FPC for consistency:
  835. //
  836. // CPU32 - any 32-bit CPU
  837. // CPU64 - any 64-bit CPU
  838. // WINDOWS - any Windows platform (32-bit, 64-bit, CE)
  839. // WIN32 - Windows 32-bit
  840. // WIN64 - Windows 64-bit
  841. // WINCE - Windows CE
  842. //
  843. // Consult the "Free Pascal Programmer's Guide", Appendix G for the complete
  844. // list of defines that are used. Do not work on this unless you understand
  845. // what the FreePascal developers are doing. Not only do you have to
  846. // descriminate with operating systems, but also with chip architectures
  847. // are well.
  848. //
  849. // DCC Pulsar+ define the following values:
  850. // ASSEMBLER
  851. // DCC
  852. // CONDITIONALEXPRESSIONS
  853. // NATIVECODE
  854. // UNICODE
  855. // MACOS
  856. // MACOS32
  857. // MACOS64
  858. // MSWINDOWS
  859. // WIN32
  860. // WIN64
  861. // LINUX
  862. // POSIX
  863. // POSIX32
  864. // CPU386
  865. // CPUX86
  866. // CPUX64
  867. //
  868. // Kylix defines the following values:
  869. // LINUX
  870. // (others??)
  871. //
  872. {$IFNDEF FPC}
  873. // TODO: We need to use ENDIAN_BIG for big endian chip architectures,
  874. // such as 680x0, PowerPC, Sparc, and MIPS, once DCC supports them,
  875. // provided it does not already define its own ENDIAN values by then...
  876. {$DEFINE ENDIAN_LITTLE}
  877. {$IFNDEF VCL_6_OR_ABOVE}
  878. {$DEFINE MSWINDOWS}
  879. {$ENDIF}
  880. {$IFDEF MSWINDOWS}
  881. {$DEFINE WINDOWS}
  882. {$ENDIF}
  883. // TODO: map Pulsar's non-Windows platform defines...
  884. {$IFDEF VCL_XE2_OR_ABOVE}
  885. {$IFDEF VCL_XE8_OR_ABOVE}
  886. {$IFDEF CPU32BITS}
  887. //any 32-bit CPU
  888. {$DEFINE CPU32}
  889. {$ENDIF}
  890. {$IFDEF CPU64BITS}
  891. {$DEFINE CPU64}
  892. {$ENDIF}
  893. {$ELSE}
  894. {$IFDEF CPU386}
  895. //any 32-bit CPU
  896. {$DEFINE CPU32}
  897. //Intel 386 compatible chip architecture
  898. {$DEFINE CPUI386}
  899. {$ENDIF}
  900. {$IFDEF CPUX86}
  901. {$DEFINE CPU32}
  902. {$ENDIF}
  903. {$IFDEF CPUX64}
  904. //any 64-bit CPU
  905. {$DEFINE CPU64}
  906. //AMD64 compatible chip architecture
  907. {$DEFINE CPUX86_64} //historical name for AMD64
  908. {$DEFINE CPUAMD64}
  909. {$ENDIF}
  910. {$ENDIF}
  911. {$ELSE}
  912. {$IFNDEF DOTNET}
  913. {$IFNDEF KYLIX}
  914. {$DEFINE I386}
  915. {$ENDIF}
  916. {$ENDIF}
  917. {$DEFINE CPU32}
  918. {$ENDIF}
  919. {$ENDIF}
  920. {$IFDEF DOTNET}
  921. //differences in DotNET Framework versions.
  922. {$IFDEF VCL_2007_OR_ABOVE}
  923. {$DEFINE DOTNET_2}
  924. {$DEFINE DOTNET_2_OR_ABOVE}
  925. {$ELSE}
  926. {$DEFINE DOTNET_1_1}
  927. {$ENDIF}
  928. {$DEFINE DOTNET_1_1_OR_ABOVE}
  929. // Extra include used in D7 for testing. Remove later when all comps are
  930. // ported. Used to selectively exclude non ported parts. Allowed in places
  931. // IFDEFs are otherwise not permitted.
  932. {$DEFINE DOTNET_EXCLUDE}
  933. {$ENDIF}
  934. // Check for available features
  935. {$IFDEF CBUILDER}
  936. // When generating a C++ HPP file, if a class has no explicit constructor
  937. // defined and contains compiler-managed members (xxxString, TDateTime,
  938. // Variant, DelphiInterface, etc), the HPP will contain a forwarding
  939. // inline constructor that implicitly initializes those managed members,
  940. // which will overwrite any non-default initializations performed inside
  941. // of InitComponent() overrides! In this situation, the workaround is to
  942. // define an explicit constructor that calls the base class constructor
  943. // manually, allowing those managed members to be initialized by the
  944. // compiler before InitComponent() overrides then re-assign them.
  945. {$DEFINE WORKAROUND_INLINE_CONSTRUCTORS}
  946. {$ENDIF}
  947. {$IFDEF VCL_5_OR_ABOVE}
  948. {$IFNDEF FPC}
  949. {$IFNDEF KYLIX}
  950. {$DEFINE HAS_RemoveFreeNotification}
  951. {$ENDIF}
  952. {$ENDIF}
  953. {$DEFINE HAS_GetObjectProp}
  954. {$DEFINE HAS_TObjectList}
  955. {$ENDIF}
  956. {$IFDEF VCL_6_OR_ABOVE}
  957. {$DEFINE HAS_PCardinal}
  958. {$DEFINE HAS_PByte}
  959. {$DEFINE HAS_PWord}
  960. {$DEFINE HAS_PPointer}
  961. {$DEFINE HAS_TList_Assign}
  962. {$DEFINE HAS_sLineBreak}
  963. {$DEFINE HAS_RaiseLastOSError}
  964. {$DEFINE HAS_SysUtils_IncludeExcludeTrailingPathDelimiter}
  965. {$DEFINE HAS_SysUtils_DirectoryExists}
  966. {$DEFINE HAS_UNIT_DateUtils}
  967. {$DEFINE HAS_UNIT_StrUtils}
  968. {$DEFINE HAS_UNIT_Types}
  969. {$DEFINE HAS_TryStrToInt}
  970. {$DEFINE HAS_TryStrToInt64}
  971. {$DEFINE HAS_TryEncodeDate}
  972. {$DEFINE HAS_TryEncodeTime}
  973. {$DEFINE HAS_ENUM_ELEMENT_VALUES}
  974. {$IFNDEF FPC}
  975. {$DEFINE HAS_IInterface}
  976. {$DEFINE HAS_TSelectionEditor}
  977. {$DEFINE HAS_TStringList_CaseSensitive}
  978. {$DEFINE HAS_AcquireExceptionObject}
  979. {$IFNDEF KYLIX}
  980. {$DEFINE HAS_DEPRECATED}
  981. {$DEFINE HAS_SYMBOL_PLATFORM}
  982. {$DEFINE HAS_UNIT_PLATFORM}
  983. {$IFNDEF VCL_8_OR_ABOVE}
  984. // Delphi 6 and 7 have an annoying bug that if a class method is declared as
  985. // deprecated, the compiler will emit a "symbol is deprecated" warning
  986. // on the method's implementation! So we will have to wrap implementations
  987. // of deprecated methods with {$WARN SYMBOL_DEPRECATED OFF} directives
  988. // to disable that warning.
  989. {$DEFINE DEPRECATED_IMPL_BUG}
  990. {$ENDIF}
  991. {$ENDIF}
  992. {$ENDIF}
  993. {$IFNDEF DOTNET}
  994. //Widget defines are omitted in .NET
  995. {$DEFINE VCL_60_PLUS}
  996. {$ENDIF}
  997. {$ENDIF}
  998. {$IFDEF VCL_7_OR_ABOVE}
  999. {$IFNDEF FPC}
  1000. {$DEFINE HAS_UInt64} // Note: it was just an alias for Int64 until D2006!
  1001. {$DEFINE HAS_NAMED_THREADS}
  1002. {$DEFINE HAS_TStrings_NameValueSeparator}
  1003. {$DEFINE HAS_TStrings_ValueFromIndex}
  1004. {$ENDIF}
  1005. {$DEFINE HAS_TFormatSettings}
  1006. {$DEFINE HAS_PosEx}
  1007. {$IFNDEF VCL_70}
  1008. // not implemented in D7
  1009. {$DEFINE HAS_STATIC_TThread_Queue}
  1010. {$ENDIF}
  1011. {$IFNDEF CIL}
  1012. {$IFNDEF VCL_80}
  1013. // not implemented in D8 or .NET
  1014. {$DEFINE HAS_STATIC_TThread_Synchronize}
  1015. {$ENDIF}
  1016. {$ENDIF}
  1017. {$ELSE}
  1018. {$IFDEF CBUILDER_6}
  1019. {$DEFINE HAS_NAMED_THREADS}
  1020. {$ENDIF}
  1021. {$ENDIF}
  1022. {$IFNDEF VCL_2005_OR_ABOVE}
  1023. {$IFDEF DCC}
  1024. // InterlockedCompareExchange() was declared in the Windows unit using Pointer
  1025. // parameters until Delphi 2005, when it was switched to Longint parameters
  1026. // instead to match the actual Win32 API declaration.
  1027. {$DEFINE HAS_InterlockedCompareExchange_Pointers}
  1028. {$ENDIF}
  1029. {$ENDIF}
  1030. {$IFDEF VCL_2006_OR_ABOVE}
  1031. {$DEFINE USE_INLINE}
  1032. {$DEFINE HAS_2PARAM_FileAge}
  1033. {$IFDEF WINDOWS}
  1034. // System.RegisterExpectedMemoryLeak() is only available on Windows at this time
  1035. {$DEFINE HAS_System_RegisterExpectedMemoryLeak}
  1036. {$ENDIF}
  1037. // In C++Builder 2006 and 2007, UInt64 is emitted as signed __int64 in HPP
  1038. // files instead of as unsigned __int64. This causes conflicts in overloaded
  1039. // routines that have (U)Int64 parameters. This was fixed in C++Builder 2009...
  1040. {$IFDEF CBUILDER}
  1041. {$DEFINE BROKEN_UINT64_HPPEMIT}
  1042. {$ENDIF}
  1043. {$ENDIF}
  1044. {$IFDEF VCL_2007_OR_ABOVE}
  1045. {$IFNDEF CBUILDER_2007}
  1046. // class properties are broken in C++Builder 2007, causing AVs at compile-time
  1047. {$DEFINE HAS_CLASSPROPERTIES}
  1048. {$ENDIF}
  1049. // Native(U)Int exist but are buggy, so do not use them yet
  1050. {.$DEFINE HAS_NativeInt}
  1051. {.$DEFINE HAS_NativeUInt}
  1052. {$DEFINE HAS_StrToInt64Def}
  1053. {$DEFINE HAS_DWORD_PTR}
  1054. {$DEFINE HAS_ULONG_PTR}
  1055. {$DEFINE HAS_ULONGLONG}
  1056. {$DEFINE HAS_PGUID}
  1057. {$DEFINE HAS_PPAnsiChar}
  1058. {$DEFINE HAS_CurrentYear}
  1059. {$IFNDEF DOTNET}
  1060. {$DEFINE HAS_TIMEUNITS}
  1061. {$ENDIF}
  1062. {$ENDIF}
  1063. {$IFDEF VCL_2009_OR_ABOVE}
  1064. {$IFNDEF DOTNET}
  1065. {$DEFINE STRING_IS_UNICODE}
  1066. {$DEFINE HAS_UnicodeString}
  1067. {$DEFINE HAS_TEncoding}
  1068. {$DEFINE HAS_TCharacter}
  1069. {$DEFINE HAS_InterlockedCompareExchangePointer}
  1070. {$DEFINE HAS_WIDE_TCharArray}
  1071. {$DEFINE HAS_PUInt64}
  1072. {$IFDEF VCL_2009}
  1073. // TODO: need to differentiate between RTM and Update 1
  1074. // FmtStr() is broken in RTM but was fixed in Update 1
  1075. {$DEFINE BROKEN_FmtStr}
  1076. {$ENDIF}
  1077. {$ENDIF}
  1078. {$DEFINE HAS_CLASSVARS}
  1079. {$DEFINE HAS_DEPRECATED_MSG}
  1080. {$DEFINE HAS_TBytes}
  1081. // Native(U)Int are still buggy, so do not use them yet
  1082. {.$DEFINE HAS_NativeInt}
  1083. {.$DEFINE HAS_NativeUInt}
  1084. {$DEFINE HAS_Int8}
  1085. {$DEFINE HAS_UInt8}
  1086. {$DEFINE HAS_Int16}
  1087. {$DEFINE HAS_UInt16}
  1088. {$DEFINE HAS_Int32}
  1089. {$DEFINE HAS_UInt32}
  1090. // UInt64 is now emitted as unsigned __int64 in HPP files
  1091. {$IFDEF CBUILDER}
  1092. {$UNDEF BROKEN_UINT64_HPPEMIT}
  1093. {$ENDIF}
  1094. {$IFDEF DCC}
  1095. {$IFDEF WINDOWS}
  1096. // Exception.RaiseOuterException() is only available on Windows at this time
  1097. {$DEFINE HAS_Exception_RaiseOuterException}
  1098. {$ENDIF}
  1099. {$ENDIF}
  1100. {$DEFINE HAS_SetCodePage}
  1101. {$DEFINE HAS_PRawByteString}
  1102. {$DEFINE HAS_TThreadProcedure}
  1103. {$ENDIF}
  1104. {$IFDEF VCL_2010_OR_ABOVE}
  1105. {$DEFINE HAS_CLASSCONSTRUCTOR}
  1106. {$DEFINE HAS_CLASSDESTRUCTOR}
  1107. {$DEFINE HAS_DELAYLOAD}
  1108. {$DEFINE HAS_TThread_NameThreadForDebugging}
  1109. {$DEFINE DEPRECATED_TThread_SuspendResume}
  1110. // Native(U)Int are finally ok to use now
  1111. {$DEFINE HAS_NativeInt}
  1112. {$DEFINE HAS_NativeUInt}
  1113. {$DEFINE HAS_USHORT}
  1114. {$DEFINE HAS_IOUtils_TPath}
  1115. {$ENDIF}
  1116. {$IFDEF VCL_XE_OR_ABOVE}
  1117. {$DEFINE HAS_TFormatSettings_Object}
  1118. {$DEFINE HAS_LocaleCharsFromUnicode}
  1119. {$DEFINE HAS_UnicodeFromLocaleChars}
  1120. {$DEFINE HAS_PLongBool}
  1121. {$DEFINE HAS_PVOID}
  1122. {$DEFINE HAS_ULONG64}
  1123. {$DEFINE HAS_TEncoding_GetEncoding_ByEncodingName}
  1124. {$DEFINE HAS_DateUtils_TTimeZone}
  1125. {$IFDEF DCC}
  1126. // Exception.RaiseOuterException() is now available on all platforms
  1127. {$DEFINE HAS_Exception_RaiseOuterException}
  1128. {$ENDIF}
  1129. {$IFNDEF DOTNET}
  1130. {$DEFINE HAS_TInterlocked}
  1131. {$ENDIF}
  1132. {$ENDIF}
  1133. {$IFDEF VCL_XE2_OR_ABOVE}
  1134. {$DEFINE HAS_SIZE_T}
  1135. {$DEFINE HAS_PSIZE_T}
  1136. {$DEFINE HAS_SSIZE_T}
  1137. {$DEFINE HAS_PSSIZE_T}
  1138. {$DEFINE HAS_LONG}
  1139. {$DEFINE HAS_ComponentPlatformsAttribute}
  1140. {$DEFINE HAS_ComponentPlatformsAttribute_Win32}
  1141. {$DEFINE HAS_ComponentPlatformsAttribute_Win64}
  1142. {$DEFINE HAS_ComponentPlatformsAttribute_OSX32}
  1143. {$DEFINE HAS_System_ReturnAddress}
  1144. {$DEFINE HAS_DIRECTIVE_WARN_DEFAULT}
  1145. {$ENDIF}
  1146. {$IFDEF VCL_XE3_OR_ABOVE}
  1147. {$DEFINE HAS_DIRECTIVE_ZEROBASEDSTRINGS}
  1148. {$DEFINE HAS_SysUtils_TStringHelper}
  1149. {$IFDEF NEXTGEN}
  1150. {$DEFINE DCC_NEXTGEN}
  1151. {$DEFINE HAS_MarshaledAString}
  1152. {$DEFINE USE_MARSHALLED_PTRS}
  1153. {$IFDEF AUTOREFCOUNT}
  1154. {$DEFINE USE_OBJECT_ARC}
  1155. {$ENDIF}
  1156. {$ENDIF}
  1157. // technically, these are present in XE3, but they are not used yet
  1158. {.$DEFINE HAS_ComponentPlatformsAttribute_iOS_Simulator}
  1159. {.$DEFINE HAS_ComponentPlatformsAttribute_Android}
  1160. {.$DEFINE HAS_ComponentPlatformsAttribute_Linux32}
  1161. {.$DEFINE HAS_ComponentPlatformsAttribute_iOS_Device}
  1162. {.$DEFINE HAS_ComponentPlatformsAttribute_WinNX32}
  1163. {$ENDIF}
  1164. {$IFDEF VCL_XE4_OR_ABOVE}
  1165. {$DEFINE HAS_AnsiStrings_StrPLCopy}
  1166. {$DEFINE HAS_AnsiStrings_StrLen}
  1167. {$DEFINE HAS_Character_TCharHelper}
  1168. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Simulator}
  1169. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Device}
  1170. {$ENDIF}
  1171. {$IFDEF VCL_XE5_OR_ABOVE}
  1172. {$DEFINE HAS_ComponentPlatformsAttribute_Android}
  1173. {$ENDIF}
  1174. {$IFDEF VCL_XE5_UPDATE2_OR_ABOVE}
  1175. {$DEFINE HAS_DIRECTIVE_HPPEMIT_LINKUNIT}
  1176. {$DEFINE HAS_DIRECTIVE_HPPEMIT_NAMESPACE}
  1177. {$ENDIF}
  1178. {$IFDEF VCL_XE7_OR_ABOVE}
  1179. {$DEFINE HAS_TNetEncoding}
  1180. {$ENDIF}
  1181. {$IFDEF VCL_XE8_OR_ABOVE}
  1182. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Device32}
  1183. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Device64}
  1184. // technically, these are present in XE8, but they are not used yet
  1185. {.$DEFINE HAS_ComponentPlatformsAttribute_Linux64}
  1186. {.$DEFINE HAS_ComponentPlatformsAttribute_WinIoT32}
  1187. {$ENDIF}
  1188. {$IFDEF VCL_10_0_OR_ABOVE}
  1189. {$IFDEF ANDROID}
  1190. {$DEFINE HAS_TAndroidHelper}
  1191. {$ENDIF}
  1192. // technically, these are present in 10.0 Seattle, but they are not used yet
  1193. {.$DEFINE HAS_ComponentPlatformsAttribute_WinARM}
  1194. {$ENDIF}
  1195. {$IFDEF VCL_10_1_OR_ABOVE}
  1196. {$DEFINE HAS_DIRECTIVE_HPPEMIT_LEGACYHPP}
  1197. {$DEFINE HAS_TStrings_AddPair}
  1198. // technically, these are present in 10.1 Berlin, but they are not used yet
  1199. {.$DEFINE HAS_ComponentPlatformsAttribute_OSX64}
  1200. {.$DEFINE HAS_ComponentPlatformsAttribute_OSXNX64}
  1201. {.$DEFINE HAS_ComponentPlatformsAttribute_Linux32Arm}
  1202. {.$DEFINE HAS_ComponentPlatformsAttribute_Linux64Arm}
  1203. {.$DEFINE HAS_ComponentPlatformsAttribute_Android64}
  1204. {$ENDIF}
  1205. {$IFDEF VCL_10_2_OR_ABOVE}
  1206. {.$WARN IMPLICIT_INTEGER_CAST_LOSS OFF}
  1207. {.$WARN IMPLICIT_CONVERSION_LOSS OFF}
  1208. {.$WARN COMBINING_SIGNED_UNSIGNED64 OFF}
  1209. {$DEFINE HAS_STATIC_TThread_ForceQueue}
  1210. // In Delphi 10.2 Tokyo, TThread.ForceQueue() is broken on Android, the
  1211. // passed in procedure is called immediately instead of being delayed!
  1212. {$IFDEF ANDROID}
  1213. {$DEFINE BROKEN_TThread_ForceQueue}
  1214. {$ENDIF}
  1215. {$ENDIF}
  1216. {$IFDEF VCL_10_3_OR_ABOVE}
  1217. {$DEFINE HAS_ComponentPlatformsAttribute_iOS_Simulator32}
  1218. {$DEFINE HAS_ComponentPlatformsAttribute_Android32Arm}
  1219. {$DEFINE HAS_ComponentPlatformsAttribute_WinARM32}
  1220. {$UNDEF HAS_ComponentPlatformsAttribute_OSXNX64} // removed in 10.3 Rio
  1221. // technically, these are present in 10.3 Rio, but they are not used yet
  1222. {.$DEFINE HAS_ComponentPlatformsAttribute_iOS_Simulator64}
  1223. {$IFDEF DCC}
  1224. {$IFDEF LINUX}
  1225. // RLebeau 9/25/2019: there is a bug in the IDE when debugging Linux projects
  1226. // where the EThreadNameException exception raised by TThread.NameThreadForDebugging()
  1227. // is not handled correctly.
  1228. {$UNDEF HAS_NAMED_THREADS}
  1229. {$ENDIF}
  1230. {$ENDIF}
  1231. {$IFDEF ANDROID}
  1232. {$UNDEF BROKEN_TThread_ForceQueue}
  1233. {$ENDIF}
  1234. {$ENDIF}
  1235. {$IFDEF VCL_10_3_UPDATE2_OR_ABOVE}
  1236. {$DEFINE HAS_ComponentPlatformsAttribute_AllPlatforms}
  1237. {$DEFINE HAS_ComponentPlatformsAttribute_OSX64}
  1238. {$ENDIF}
  1239. {$IFDEF VCL_10_4_OR_ABOVE}
  1240. // 0-based string indexing via '[]' is turned off by default in Delphi 10.4.
  1241. // TStringHelper is always 0-indexed, flat RTL functions are always 1-indexed,
  1242. // and now '[]' is 1-indexed again on all platforms - {$ZEROBASEDSTRINGS OFF}
  1243. // is the default.
  1244. {.$UNDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
  1245. {$ENDIF}
  1246. {$IFDEF VCL_11_OR_ABOVE}
  1247. {$DEFINE HAS_ComponentPlatformsAttribute_AndroidArm32}
  1248. {$DEFINE HAS_ComponentPlatformsAttribute_AndroidArm64}
  1249. {$DEFINE HAS_ComponentPlatformsAttribute_OSXArm64}
  1250. {$ENDIF}
  1251. // Delphi XE+ cross-compiling
  1252. {$IFNDEF FPC}
  1253. {$IFDEF POSIX}
  1254. {$IF RTLVersion >= 22.0}
  1255. {$DEFINE UNIX}
  1256. {$UNDEF USE_BASEUNIX}
  1257. {$DEFINE VCL_CROSS_COMPILE}
  1258. {$DEFINE USE_VCL_POSIX}
  1259. {$IFEND}
  1260. {$ENDIF}
  1261. {$IFDEF LINUX}
  1262. {$IFDEF CONDITIONALEXPRESSIONS}
  1263. {$IF RTLVersion >= 22.0}
  1264. {$DEFINE VCL_CROSS_COMPILE}
  1265. {$DEFINE USE_VCL_POSIX}
  1266. {$IFEND}
  1267. {$ENDIF}
  1268. {$ENDIF}
  1269. {$ENDIF}
  1270. {$IFDEF VCL_CROSS_COMPILE}
  1271. {$UNDEF KYLIXCOMPAT}
  1272. {$ELSE}
  1273. {$IFDEF KYLIXCOMPAT}
  1274. {$linklib c}
  1275. {$ENDIF}
  1276. {$ENDIF}
  1277. {$IFDEF FPC}
  1278. {$DEFINE USE_INLINE}
  1279. {$DEFINE USE_CLASSINLINE}
  1280. {$DEFINE USE_TBitBtn} //use Bit Buttons instead of Buttons
  1281. {$DEFINE FPC_REINTRODUCE_BUG}
  1282. {$DEFINE FPC_CIRCULAR_BUG}
  1283. {$DEFINE NO_REDECLARE}
  1284. {$DEFINE BYTE_COMPARE_SETS}
  1285. {$DEFINE HAS_QWord} // TODO: when was QWord introduced?
  1286. {$DEFINE HAS_PQWord} // TODO: when was PQWord introduced?
  1287. {$IFDEF FPC_2_1_5_OR_ABOVE}
  1288. {$DEFINE HAS_UInt64}
  1289. {.$DEFINE HAS_PUInt64} // TODO: is this defined?
  1290. {$ENDIF}
  1291. {$IFDEF FPC_2_2_0_OR_ABOVE}
  1292. {$DEFINE HAS_InterlockedCompareExchange_Pointers}
  1293. {$ENDIF}
  1294. {$IFDEF FPC_2_2_2_OR_ABOVE}
  1295. {$DEFINE HAS_SharedSuffix}
  1296. {$ENDIF}
  1297. {$IFDEF FPC_2_2_4_OR_ABOVE}
  1298. // these types are only available on Unix systems (FreeBSD, Linux, etc)
  1299. {$IFDEF UNIX}
  1300. {$DEFINE HAS_UNIT_UnixType}
  1301. {$DEFINE HAS_SIZE_T}
  1302. {$DEFINE HAS_PSIZE_T}
  1303. {$DEFINE HAS_SSIZE_T}
  1304. {$DEFINE HAS_PSSIZE_T}
  1305. {$DEFINE HAS_TIME_T}
  1306. {$DEFINE HAS_PTIME_T}
  1307. {$ENDIF}
  1308. {$ENDIF}
  1309. {$DEFINE HAS_PtrInt}
  1310. {$DEFINE HAS_PtrUInt}
  1311. {$DEFINE HAS_PGUID}
  1312. {$DEFINE HAS_LPGUID}
  1313. {$DEFINE HAS_PPAnsiChar}
  1314. {$DEFINE HAS_ENUM_ELEMENT_VALUES}
  1315. {$DEFINE HAS_AcquireExceptionObject} // TODO: when was AcquireExceptionObject introduced?
  1316. {$IFDEF WINDOWS}
  1317. {$DEFINE HAS_ULONG_PTR}
  1318. {.$DEFINE HAS_ULONGLONG} // TODO: is this defined?
  1319. {$ENDIF}
  1320. {$DEFINE HAS_UNIT_ctypes}
  1321. {$DEFINE HAS_sLineBreak}
  1322. {$IFDEF FPC_HAS_UNICODESTRING}
  1323. {$DEFINE HAS_UnicodeString}
  1324. {$ELSE}
  1325. {$IFDEF FPC_2_4_0_OR_ABOVE}
  1326. {$DEFINE HAS_UnicodeString}
  1327. {$ENDIF}
  1328. {$ENDIF}
  1329. {$IFDEF FPC_2_4_4_OR_ABOVE}
  1330. {$DEFINE DEPRECATED_TThread_SuspendResume}
  1331. {$DEFINE HAS_DEPRECATED} // TODO: when was deprecated introduced? Possibly 1.9.x
  1332. {$DEFINE HAS_DEPRECATED_MSG} // TODO: when was message support added? Possibly 2.4.x
  1333. {$DEFINE HAS_STATIC_TThread_Synchronize}
  1334. {$IFNDEF FPC_2_6_2_OR_ABOVE}
  1335. {$DEFINE USE_SEMICOLON_BEFORE_DEPRECATED} // TODO: which earlier versions require a semicolon?
  1336. {$ENDIF}
  1337. {$ENDIF}
  1338. {$IFDEF FPC_2_6_0_OR_ABOVE}
  1339. {$DEFINE HAS_NativeInt}
  1340. {$DEFINE HAS_NativeUInt}
  1341. {$ENDIF}
  1342. {$IFDEF FPC_2_6_2_OR_ABOVE}
  1343. {$DEFINE HAS_Int8}
  1344. {$DEFINE HAS_UInt8}
  1345. {$DEFINE HAS_Int16}
  1346. {$DEFINE HAS_UInt16}
  1347. {$DEFINE HAS_Int32}
  1348. {$DEFINE HAS_UInt32}
  1349. {$DEFINE HAS_GetLocalTimeOffset}
  1350. {$DEFINE HAS_UniversalTimeToLocal}
  1351. {$DEFINE HAS_LocalTimeToUniversal}
  1352. {$ENDIF}
  1353. {$IFDEF FPC_2_6_4_OR_ABOVE}
  1354. {$DEFINE HAS_PInt8}
  1355. {$DEFINE HAS_PUInt8}
  1356. {$DEFINE HAS_PInt16}
  1357. {$DEFINE HAS_PUInt16}
  1358. {$DEFINE HAS_PInt32}
  1359. {$DEFINE HAS_PUInt32}
  1360. {$ENDIF}
  1361. {$IFDEF FPC_3_0_0_OR_ABOVE}
  1362. {$DEFINE HAS_STATIC_TThread_Queue}
  1363. {$DEFINE HAS_SetCodePage}
  1364. {$ENDIF}
  1365. {$IFDEF FPC_UNICODESTRINGS}
  1366. {$DEFINE STRING_IS_UNICODE}
  1367. {$ENDIF}
  1368. {$IFDEF FPC_3_1_1_OR_ABOVE}
  1369. {$DEFINE HAS_STATIC_TThread_ForceQueue} // requires rev 37359+
  1370. {$DEFINE HAS_PRawByteString}
  1371. {$ENDIF}
  1372. {$ENDIF}
  1373. {$IFDEF DOTNET}
  1374. {$DEFINE WIDGET_WINFORMS}
  1375. {$ELSE}
  1376. {$DEFINE WIDGET_VCL_LIKE} // LCL included.
  1377. {$DEFINE WIDGET_VCL_LIKE_OR_KYLIX}
  1378. {$IFDEF FPC}
  1379. {$DEFINE WIDGET_LCL}
  1380. {$ELSE}
  1381. {$IFDEF KYLIX}
  1382. {$DEFINE WIDGET_KYLIX}
  1383. {$ELSE}
  1384. {$DEFINE WIDGET_VCL}
  1385. {$ENDIF}
  1386. {$ENDIF}
  1387. {$ENDIF}
  1388. // .NET and Delphi 2009+ support UNICODE strings natively!
  1389. //
  1390. // FreePascal 2.4.0+ supports UnicodeString, but does not map its
  1391. // native String type to UnicodeString except when {$MODE DelphiUnicode}
  1392. // or {$MODESWITCH UnicodeStrings} is enabled. However, UNICODE is not
  1393. // defined in that mode yet until its RTL has been updated to support
  1394. // UnicodeString. STRING_UNICODE_MISMATCH is defined when the native
  1395. // String/Char types do not map to the same types that APIs are expecting
  1396. // based on whether UNICODE is defined or not.
  1397. //
  1398. // NOTE: Do not define UNICODE here. The compiler defines
  1399. // the symbol automatically.
  1400. {$IFDEF STRING_IS_UNICODE}
  1401. {$IFNDEF UNICODE}
  1402. {$DEFINE STRING_UNICODE_MISMATCH}
  1403. {$ENDIF}
  1404. {$ELSE}
  1405. {$DEFINE STRING_IS_ANSI}
  1406. {$IFDEF UNICODE}
  1407. {$DEFINE STRING_UNICODE_MISMATCH}
  1408. {$ENDIF}
  1409. {$ENDIF}
  1410. {$IFDEF DCC_NEXTGEN}
  1411. {$DEFINE NO_ANSI_TYPES}
  1412. {.$DEFINE STRING_IS_IMMUTABLE} // Strings are NOT immutable in NEXTGEN yet
  1413. {$IFDEF USE_OBJECT_ARC}
  1414. // TODO: move these to an appropriate section. Not doing this yet because
  1415. // it is a major interface change to switch to Generics and we should
  1416. // maintain backwards compatibility with earlier compilers for the time
  1417. // being. Defining them only here for now because the non-Generic versions
  1418. // of these classes have become deprecated by ARC and so we need to start
  1419. // taking advantage of the Generics versions...
  1420. {$DEFINE HAS_UNIT_Generics_Collections}
  1421. {$DEFINE HAS_UNIT_Generics_Defaults}
  1422. {$DEFINE HAS_GENERICS_TDictionary}
  1423. {$DEFINE HAS_GENERICS_TList}
  1424. {$DEFINE HAS_GENERICS_TObjectList}
  1425. {$DEFINE HAS_GENERICS_TThreadList}
  1426. // TArray<T>.Copy() was introduced in XE7 but was buggy. It was fixed in XE8:
  1427. //
  1428. // RSP-9763 TArray.Copy<T> copies from destination to source for unmanaged types
  1429. // https://quality.embarcadero.com/browse/RSP-9763
  1430. //
  1431. {$IFDEF VCL_XE8_OR_ABOVE}
  1432. {$DEFINE HAS_GENERICS_TArray_Copy}
  1433. {$ENDIF}
  1434. {$ENDIF}
  1435. {$ENDIF}
  1436. // TODO: Ansi data types were disabled on mobile platforms in XE3, but
  1437. // UTF8String and RawByteString were re-enabled in 10.1 Berlin! What else,
  1438. // if anything, was re-enabled to facilitate that?
  1439. //
  1440. // UPDATE: In 10.4 Sydney, AnsiChar and AnsiString were re-enabled on
  1441. // mobile platforms! NEXTGEN is no longer defined in the mobile compilers.
  1442. {$IFDEF NO_ANSI_TYPES}
  1443. {$UNDEF HAS_AnsiString}
  1444. {$UNDEF HAS_AnsiChar}
  1445. {$UNDEF HAS_PAnsiChar}
  1446. {$UNDEF HAS_PPAnsiChar}
  1447. {$UNDEF HAS_AnsiStrings_StrPLCopy}
  1448. {$UNDEF HAS_AnsiStrings_StrLen}
  1449. {$ENDIF}
  1450. {$IFDEF WIN32}
  1451. {$DEFINE WIN32_OR_WIN64}
  1452. {$ENDIF}
  1453. {$IFDEF WIN64}
  1454. {$DEFINE WIN32_OR_WIN64}
  1455. {$ENDIF}
  1456. {$IFDEF WIN32_OR_WIN64}
  1457. {$DEFINE USE_ZLIB_UNIT}
  1458. {$IFNDEF DCC_NEXTGEN}
  1459. {$DEFINE USE_OPENSSL} // !!!·MOVED·HERE·BY·EMBT
  1460. {$DEFINE USE_SSPI}
  1461. {$IFDEF STRING_IS_UNICODE}
  1462. {$DEFINE SSPI_UNICODE}
  1463. {$ENDIF}
  1464. {$ENDIF}
  1465. {$ENDIF}
  1466. {$IFDEF WINCE}
  1467. {$DEFINE USE_OPENSSL}
  1468. // RLebeau: not sure if the above Win32/64 defines also apply to WinCE,
  1469. // so keeping them separate for now...
  1470. {$ENDIF}
  1471. // High-performance counters are not reliable on multi-core systems, and have
  1472. // been known to cause problems with TIdIOHandler.ReadLn() timeouts in Windows
  1473. // XP SP3, both 32-bit and 64-bit. Refer to these discussions for more info:
  1474. //
  1475. // http://www.virtualdub.org/blog/pivot/entry.php?id=106
  1476. // http://blogs.msdn.com/oldnewthing/archive/2008/09/08/8931563.aspx
  1477. //
  1478. // Do not enable thus unless you know it will work correctly on your systems!
  1479. {$IFDEF WINDOWS}
  1480. {.$DEFINE USE_HI_PERF_COUNTER_FOR_TICKS}
  1481. {$ENDIF}
  1482. {$IFDEF UNIX}
  1483. {$DEFINE USE_OPENSSL}
  1484. {$DEFINE USE_ZLIB_UNIT}
  1485. {$DEFINE HAS_getifaddrs}
  1486. {$ENDIF}
  1487. {$IFDEF MACOS}
  1488. {$DEFINE HAS_getifaddrs}
  1489. {$ENDIF}
  1490. {$IFDEF DARWIN}
  1491. {$DEFINE HAS_getifaddrs}
  1492. {$ENDIF}
  1493. {$IFDEF LINUX}
  1494. {$DEFINE HAS_getifaddrs}
  1495. {$ENDIF}
  1496. {$IFDEF IOS}
  1497. {$DEFINE HAS_getifaddrs}
  1498. {$DEFINE USE_OPENSSL}
  1499. // Support for 64-bit ARM iOS Simulator was added in Delphi 11.2
  1500. // TODO: how to detect iOS Simulator in FPC? Does it support 64-bit ARM?
  1501. {$IFDEF CPUARM}
  1502. {$IFNDEF IOSSIMULATOR}
  1503. // RLebeau: For iOS devices, OpenSSL cannot be used as an external library,
  1504. // it must be statically linked into the app. For the iOS simulator, this
  1505. // is not true. Users who want to use OpenSSL in iOS device apps will need
  1506. // to add the static OpenSSL library to the project and then include the
  1507. // IdSSLOpenSSLHeaders_static unit in their uses clause. It hooks up the
  1508. // statically linked functions for the IdSSLOpenSSLHeaders unit to use...
  1509. {$DEFINE STATICLOAD_OPENSSL}
  1510. {$ENDIF}
  1511. {$ENDIF}
  1512. {$ENDIF}
  1513. {$IFDEF FREEBSD}
  1514. {$DEFINE HAS_getifaddrs}
  1515. {$ENDIF}
  1516. {$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
  1517. {$DEFINE REQUIRES_PROPER_ALIGNMENT}
  1518. {$ENDIF}
  1519. //
  1520. //iconv defines section.
  1521. {$DEFINE USE_ICONV_UNIT}
  1522. {$DEFINE USE_ICONV_ENC}
  1523. {$IFDEF UNIX}
  1524. {$DEFINE USE_ICONV}
  1525. {$IFDEF USE_BASEUNIX}
  1526. {$IFDEF FPC}
  1527. {$UNDEF USE_ICONV_UNIT}
  1528. {$ELSE}
  1529. {$UNDEF USE_ICONV_ENC}
  1530. {$ENDIF}
  1531. {$ENDIF}
  1532. {$IFDEF KYLIXCOMPAT}
  1533. //important!! Iconv functions are defined in the libc.pas Kylix compatible unit.
  1534. {$UNDEF USE_ICONV_ENC}
  1535. {$UNDEF USE_ICONV_UNIT}
  1536. {$ENDIF}
  1537. {$ENDIF}
  1538. {$IFDEF NETWARELIBC}
  1539. {$DEFINE USE_ICONV}
  1540. //important!!! iconv functions are defined in the libc.pas Novell Netware header.
  1541. //Do not define USE_ICONV_UNIT
  1542. {$UNDEF USE_ICONV_UNIT}
  1543. {$UNDEF USE_ICONV_ENC}
  1544. {$ENDIF}
  1545. {$UNDEF USE_SAFELOADLIBRARY}
  1546. {$IFDEF WINDOWS}
  1547. {$UNDEF USE_ICONV_ENC}
  1548. {$DEFINE USE_SAFELOADLIBRARY}
  1549. {$ENDIF}
  1550. // Use here for all *nix systems that you do not want to use iconv library
  1551. {$IFDEF FPC}
  1552. {$IFDEF ANDROID}
  1553. {$UNDEF USE_ICONV}
  1554. {$DEFINE USE_LCONVENC}
  1555. {$ENDIF}
  1556. {$ENDIF}
  1557. {$UNDEF USE_INVALIDATE_MOD_CACHE}
  1558. {$UNDEF USE_SAFELOADLIBRARY}
  1559. //This must come after the iconv defines because this compiler targets a Unix-like
  1560. //operating system. One key difference is that it does have a TEncoding class.
  1561. //If this comes before the ICONV defines, it creates problems.
  1562. //This also must go before the THandle size calculations.
  1563. {$IFDEF VCL_CROSS_COMPILE}
  1564. {$IFDEF POSIX}
  1565. {$IFNDEF LINUX}
  1566. {$DEFINE BSD}
  1567. {$ENDIF}
  1568. {$DEFINE USE_SAFELOADLIBRARY}
  1569. {$DEFINE USE_INVALIDATE_MOD_CACHE}
  1570. {$ENDIF}
  1571. //important!!! iconv functions are defined in the libc.pas Novell Netware header.
  1572. //Do not define USE_ICONVUNIT
  1573. {$UNDEF USE_ICONV}
  1574. {$UNDEF USE_ICONV_UNIT}
  1575. {$UNDEF USE_ICONV_ENC}
  1576. {$DEFINE INT_THREAD_PRIORITY}
  1577. {$ENDIF}
  1578. {$IFNDEF USE_ICONV}
  1579. {$UNDEF USE_ICONV_UNIT}
  1580. {$UNDEF USE_ICONV_ENC}
  1581. {$ENDIF}
  1582. //IMPORTANT!!!!
  1583. //
  1584. //Do not remove this!!! This is to work around a conflict. In DCC, MACOS
  1585. //will mean OS X. In FreePascal, the DEFINE MACOS means MacIntosh System OS Classic.
  1586. {$IFDEF DCC}
  1587. // DCC defines MACOS for both iOS and OS X platforms, need to differentiate
  1588. {$IFDEF MACOS}
  1589. {$IFNDEF IOS}
  1590. {$DEFINE OSX}
  1591. {$DEFINE DARWIN}
  1592. {$ENDIF}
  1593. {$ENDIF}
  1594. {$ENDIF}
  1595. {$IFDEF FPC}
  1596. // FPC defines DARWIN for both OSX and iOS, need to differentiate
  1597. {$IFDEF DARWIN}
  1598. {$IFNDEF IOS}
  1599. {$DEFINE OSX}
  1600. {$ENDIF}
  1601. {$ENDIF}
  1602. {$IFDEF MACOS}
  1603. {$DEFINE MACOS_CLASSIC}
  1604. {$ENDIF}
  1605. {$ENDIF}
  1606. {
  1607. BSD 4.4 introduced a minor API change. sa_family was changed from a 16bit
  1608. word to an 8 bit byte and an 8 bit byte field named sa_len was added.
  1609. }
  1610. //Place this only after DARWIN has been defined for Delphi MACOS
  1611. {$IFDEF FREEBSD}
  1612. {$DEFINE SOCK_HAS_SINLEN}
  1613. {$ENDIF}
  1614. {$IFDEF DARWIN}
  1615. {$DEFINE SOCK_HAS_SINLEN}
  1616. {$ENDIF}
  1617. {$IFDEF HAIKU}
  1618. {$DEFINE SOCK_HAS_SINLEN}
  1619. {$ENDIF}
  1620. {$IFDEF MORPHOS}
  1621. {$DEFINE SOCK_HAS_SINLEN}
  1622. {$ENDIF}
  1623. // Do NOT remove these IFDEF's. They are here because InterlockedExchange
  1624. // only handles 32bit values. Some Operating Systems may have 64bit
  1625. // THandles. This is not always tied to the platform architecture.
  1626. {$IFDEF AMIGA}
  1627. {$DEFINE THANDLE_CPUBITS}
  1628. {$ENDIF}
  1629. {$IFDEF ATARI}
  1630. {$DEFINE THANDLE_32}
  1631. {$ENDIF}
  1632. {$IFDEF BEOS}
  1633. {$DEFINE THANDLE_32}
  1634. {$ENDIF}
  1635. {$IFDEF BSD}
  1636. //I think BSD might handle FreeBSD, NetBSD, OpenBSD, and Darwin
  1637. {$IFDEF IOS}
  1638. {$IFDEF CPUARM64}
  1639. {$DEFINE CPU64}
  1640. {$DEFINE THANDLE_64}
  1641. {$ELSE}
  1642. {$IFDEF CPUARM32}
  1643. {$DEFINE CPU32}
  1644. {$ENDIF}
  1645. {$DEFINE THANDLE_32}
  1646. {$ENDIF}
  1647. {$ENDIF}
  1648. {$IFDEF OSX}
  1649. {$IFDEF FPC}
  1650. {$DEFINE THANDLE_32}
  1651. {$ELSE}
  1652. {$DEFINE THANDLE_CPUBITS} // !!! ADDED OSX BY EMBT
  1653. {$ENDIF}
  1654. {$ENDIF}
  1655. {$ENDIF}
  1656. {$IFDEF EMBEDDED}
  1657. {$DEFINE THANDLE_CPUBITS}
  1658. {$ENDIF}
  1659. {$IFDEF EMX}
  1660. {$DEFINE THANDLE_32}
  1661. {$ENDIF}
  1662. {$IFDEF GBA}
  1663. {$DEFINE THANDLE_32}
  1664. {$ENDIF}
  1665. {$IFDEF GO32}
  1666. {$DEFINE THANDLE_32}
  1667. {$ENDIF}
  1668. {$IFDEF HAIKU}
  1669. {$DEFINE THANDLE_32}
  1670. {$ENDIF}
  1671. {$IFDEF LINUX}
  1672. {$IFDEF LINUX64}
  1673. {$DEFINE CPU64}
  1674. {$DEFINE THANDLE_64}
  1675. {$ELSE}
  1676. {$IFDEF LINUX32}
  1677. {$DEFINE CPU32}
  1678. {$ENDIF}
  1679. {$DEFINE THANDLE_32}
  1680. {$ENDIF}
  1681. {$ENDIF}
  1682. {$IFDEF MACOS_CLASSIC}
  1683. {$DEFINE THANDLE_CPUBITS}
  1684. {$ENDIF}
  1685. {$IFDEF MORPHOS}
  1686. {$DEFINE THANDLE_CPUBITS}
  1687. {$ENDIF}
  1688. {$IFDEF NATIVENT} //Native NT for kernel level drivers
  1689. {$DEFINE THANDLE_CPUBITS}
  1690. {$ENDIF}
  1691. {$IFDEF NDS}
  1692. {$DEFINE THANDLE_32}
  1693. {$ENDIF}
  1694. {$IFDEF NETWARE}
  1695. {$DEFINE THANDLE_32}
  1696. {$ENDIF}
  1697. {$IFDEF NETWARELIBC}
  1698. {$DEFINE THANDLE_32}
  1699. {$ENDIF}
  1700. {$IFDEF OS2}
  1701. {$DEFINE THANDLE_32}
  1702. {$ENDIF}
  1703. {$IFDEF PALMOS}
  1704. {$DEFINE THANDLE_32}
  1705. {$ENDIF}
  1706. {$IFDEF SOLARIS}
  1707. {$DEFINE THANDLE_32}
  1708. {$ENDIF}
  1709. {$IFDEF SYMBIAN}
  1710. {$DEFINE THANDLE_32}
  1711. {$ENDIF}
  1712. {$IFDEF WII}
  1713. {$DEFINE THANDLE_32}
  1714. {$ENDIF}
  1715. {$IFDEF WATCOM}
  1716. {$DEFINE THANDLE_32}
  1717. {$ENDIF}
  1718. {$IFDEF WINDOWS}
  1719. {$DEFINE THANDLE_CPUBITS}
  1720. {$ENDIF}
  1721. // end platform specific stuff for THandle size
  1722. {$IFDEF THANDLE_CPUBITS}
  1723. {$IFDEF CPU64}
  1724. {$DEFINE THANDLE_64}
  1725. {$ELSE}
  1726. {$DEFINE THANDLE_32}
  1727. {$ENDIF}
  1728. {$ENDIF}
  1729. {$IFDEF DOTNET}
  1730. {$DEFINE DOTNET_OR_ICONV}
  1731. {$ENDIF}
  1732. {$IFDEF USE_ICONV}
  1733. {$DEFINE DOTNET_OR_ICONV}
  1734. {$ENDIF}
  1735. {$UNDEF STREAM_SIZE_64}
  1736. {$IFDEF FPC}
  1737. {$DEFINE STREAM_SIZE_64}
  1738. {$ELSE}
  1739. {$IFDEF VCL_6_OR_ABOVE}
  1740. {$DEFINE STREAM_SIZE_64}
  1741. {$ENDIF}
  1742. {$ENDIF}
  1743. {$IFNDEF FREE_ON_FINAL}
  1744. {$IFNDEF DOTNET}
  1745. {$IFDEF HAS_System_RegisterExpectedMemoryLeak}
  1746. {$DEFINE REGISTER_EXPECTED_MEMORY_LEAK}
  1747. {$ENDIF}
  1748. {$IFDEF USE_FASTMM4}
  1749. {$DEFINE REGISTER_EXPECTED_MEMORY_LEAK}
  1750. {$ENDIF}
  1751. {$IFDEF USE_MADEXCEPT}
  1752. {$DEFINE REGISTER_EXPECTED_MEMORY_LEAK}
  1753. {$ENDIF}
  1754. {$IFDEF USE_LEAKCHECK}
  1755. {$DEFINE REGISTER_EXPECTED_MEMORY_LEAK}
  1756. {$ENDIF}
  1757. {$ENDIF}
  1758. {$ENDIF}
  1759. {
  1760. We must determine what the SocketType parameter is for the Socket function.
  1761. In DotNET, it's SocketType. In Kylix and the libc.pas Kylix-compatibility
  1762. library, it's a __socket_type. In BaseUnix, it's a C-type Integer. In Windows,
  1763. it's a LongInt.
  1764. }
  1765. {$UNDEF SOCKETTYPE_IS_SOCKETTYPE}
  1766. {$UNDEF SOCKETTYPE_IS_CINT}
  1767. {$UNDEF SOCKETTYPE_IS___SOCKETTYPE}
  1768. {$UNDEF SOCKETTYPE_IS_LONGINT}
  1769. {$UNDEF SOCKETTYPE_IS_NUMERIC}
  1770. {$UNDEF SOCKET_LEN_IS_socklen_t}
  1771. {$IFDEF DOTNET}
  1772. {$DEFINE SOCKETTYPE_IS_SOCKETTYPE}
  1773. {$ENDIF}
  1774. {$IFDEF USE_BASEUNIX}
  1775. {$DEFINE SOCKETTYPE_IS_CINT}
  1776. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1777. {$ENDIF}
  1778. {$IFDEF KYLIXCOMPAT}
  1779. {$DEFINE SOCKETTYPE_IS___SOCKETTYPE}
  1780. {$ENDIF}
  1781. {$IFDEF USE_VCL_POSIX}
  1782. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1783. {$DEFINE SOCKETTYPE_IS_LONGINT}
  1784. {$DEFINE SOCKET_LEN_IS_socklen_t}
  1785. {$ENDIF}
  1786. {$IFDEF WINDOWS}
  1787. {$DEFINE SOCKETTYPE_IS_LONGINT}
  1788. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1789. {$ENDIF}
  1790. {$IFDEF OS2}
  1791. {$DEFINE SOCKETTYPE_IS_LONGINT}
  1792. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1793. {$ENDIF}
  1794. {$IFDEF NETWARE}
  1795. {$DEFINE SOCKETTYPE_IS_LONGINT}
  1796. {$DEFINE SOCKETTYPE_IS_NUMERIC}
  1797. {$ENDIF}
  1798. {Take advantage of some TCP features specific to some stacks.
  1799. They work somewhat similarly but there's a key difference.
  1800. In Linux, TCP_CORK is turned on to send fixed packet sizes and
  1801. when turned-off (uncorked), any remaining data is sent. With
  1802. TCP_NOPUSH, this might not happen and remaining data is only sent
  1803. before disconnect. TCP_KEEPIDLE and TCP_KEEPINTVL so the IFDEF LINUX and IFDEF
  1804. SOLARIS instead of IFDEF UNIX is not an error, it's deliberate.}
  1805. {$UNDEF HAS_TCP_NOPUSH}
  1806. {$UNDEF HAS_TCP_CORK}
  1807. {$UNDEF HAS_TCP_KEEPIDLE}
  1808. {$UNDEF HAS_TCP_KEEPINTVL}
  1809. {$UNDEF HAS_SOCKET_NOSIGPIPE}
  1810. {$IFDEF BSD}
  1811. {$DEFINE HAS_TCP_NOPUSH}
  1812. {$ENDIF}
  1813. {$IFDEF HAIKU}
  1814. {$DEFINE HAS_TCP_NOPUSH}
  1815. {$ENDIF}
  1816. {$IFDEF LINUX}
  1817. {$DEFINE HAS_TCP_CORK}
  1818. {$DEFINE HAS_TCP_KEEPIDLE}
  1819. {$DEFINE HAS_TCP_KEEPINTVL}
  1820. {$ENDIF}
  1821. {$IFDEF SOLARIS}
  1822. {$DEFINE HAS_TCP_CORK}
  1823. {$ENDIF}
  1824. {$IFDEF NETBSD}
  1825. {$DEFINE HAS_TCP_CORK}
  1826. {$DEFINE HAS_TCP_KEEPIDLE}
  1827. {$DEFINE HAS_TCP_KEEPINTVL}
  1828. {$ENDIF}
  1829. {$IFDEF USE_VCL_POSIX}
  1830. // TODO: which platforms actually have SO_NOSIGPIPE available?
  1831. {$DEFINE HAS_SOCKET_NOSIGPIPE}
  1832. {$IFDEF ANDROID}
  1833. {$UNDEF HAS_SOCKET_NOSIGPIPE}
  1834. {$ENDIF}
  1835. {$IFDEF LINUX}
  1836. {$UNDEF HAS_SOCKET_NOSIGPIPE}
  1837. {$ENDIF}
  1838. {$ENDIF}
  1839. {end Unix OS specific stuff}
  1840. {$IFDEF DEBUG}
  1841. {$UNDEF USE_INLINE}
  1842. {$ENDIF}
  1843. // RLebeau 5/24/2015: In C++Builder 2006 and 2007, UInt64 is emitted as
  1844. // signed __int64 in HPP files instead of as unsigned __int64. This causes
  1845. // conflicts in overloaded routines that have (U)Int64 parameters. This
  1846. // was fixed in C++Builder 2009. For compilers that do not have a native
  1847. // UInt64 type, or for C++Builder 2006/2007, let's define a record type
  1848. // that can hold UInt64 values...
  1849. {$IFDEF HAS_UInt64}
  1850. {$IFDEF BROKEN_UINT64_HPPEMIT}
  1851. {$DEFINE TIdUInt64_HAS_QuadPart}
  1852. {$ENDIF}
  1853. {$ELSE}
  1854. {$IFNDEF HAS_QWord}
  1855. {$DEFINE TIdUInt64_HAS_QuadPart}
  1856. {$ENDIF}
  1857. {$ENDIF}
  1858. // RLebeau 9/5/2013: it would take a lot of work to re-write Indy to support
  1859. // both 0-based and 1-based string indexing, so we'll just turn off 0-based
  1860. // indexing for now...
  1861. {$IFDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
  1862. {$ZEROBASEDSTRINGS OFF}
  1863. {$ENDIF}