IdCompilerDefines.inc 55 KB

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