IdCompilerDefines.inc 56 KB

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