IdCompilerDefines.inc 54 KB

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