Compilers.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. //----------------------------------------------------------------------------------------------------------------------
  2. // Include file to determine which compiler is currently being used to build the project/component.
  3. // This file uses ideas from Brad Stowers DFS.inc file (www.delphifreestuff.com).
  4. //
  5. // Portions created by Mike Lischke are Copyright
  6. // (C) 1999-2003 Dipl. Ing. Mike Lischke. All Rights Reserved.
  7. //----------------------------------------------------------------------------------------------------------------------
  8. // The following symbols are defined:
  9. //
  10. // - COMPILER_1 : Kylix/Delphi/BCB 1.x is the compiler.
  11. // - COMPILER_1_UP : Kylix/Delphi/BCB 1.x or higher is the compiler.
  12. // - COMPILER_2 : Kylix/Delphi 2.x or BCB 1.x is the compiler.
  13. // - COMPILER_2_UP : Kylix/Delphi 2.x or higher, or BCB 1.x or higher is the compiler.
  14. // - COMPILER_3 : Kylix/Delphi/BCB 3.x is the compiler.
  15. // - COMPILER_3_UP : Kylix/Delphi/BCB 3.x or higher is the compiler.
  16. // - COMPILER_4 : Kylix/Delphi/BCB 4.x is the compiler.
  17. // - COMPILER_4_UP : Kylix/Delphi/BCB 4.x or higher is the compiler.
  18. // - COMPILER_5 : Kylix/Delphi/BCB 5.x is the compiler.
  19. // - COMPILER_5_UP : Kylix/Delphi/BCB 5.x or higher is the compiler.
  20. // - COMPILER_6 : Kylix/Delphi/BCB 6.x is the compiler.
  21. // - COMPILER_6_UP : Kylix/Delphi/BCB 6.x or higher is the compiler.
  22. // - COMPILER_7 : Kylix/Delphi/BCB 7.x is the compiler.
  23. // - COMPILER_7_UP : Kylix/Delphi/BCB 7.x or higher is the compiler.
  24. // - COMPILER_8 : Kylix/Delphi/BCB 8.x is the compiler.
  25. // - COMPILER_8_UP : Kylix/Delphi/BCB 8.x or higher is the compiler.
  26. // - COMPILER_9 : Kylix/Delphi/BCB 9.x is the compiler.
  27. // - COMPILER_9_UP : Kylix/Delphi/BCB 9.x or higher is the compiler.
  28. //
  29. // Only defined if Windows is the target:
  30. // - CPPB : Any version of BCB is being used.
  31. // - CPPB_1 : BCB v1.x is being used.
  32. // - CPPB_3 : BCB v3.x is being used.
  33. // - CPPB_3_UP : BCB v3.x or higher is being used.
  34. // - CPPB_4 : BCB v4.x is being used.
  35. // - CPPB_4_UP : BCB v4.x or higher is being used.
  36. // - CPPB_5 : BCB v5.x is being used.
  37. // - CPPB_5_UP : BCB v5.x or higher is being used.
  38. // - CPPB_6 : BCB v6.x is being used.
  39. // - CPPB_6_UP : BCB v6.x or higher is being used.
  40. //
  41. // Only defined if Windows is the target:
  42. // - DELPHI : Any version of Delphi is being used.
  43. // - DELPHI_1 : Delphi v1.x is being used.
  44. // - DELPHI_2 : Delphi v2.x is being used.
  45. // - DELPHI_2_UP : Delphi v2.x or higher is being used.
  46. // - DELPHI_3 : Delphi v3.x is being used.
  47. // - DELPHI_3_UP : Delphi v3.x or higher is being used.
  48. // - DELPHI_4 : Delphi v4.x is being used.
  49. // - DELPHI_4_UP : Delphi v4.x or higher is being used.
  50. // - DELPHI_5 : Delphi v5.x is being used.
  51. // - DELPHI_5_UP : Delphi v5.x or higher is being used.
  52. // - DELPHI_6 : Delphi v6.x is being used.
  53. // - DELPHI_6_UP : Delphi v6.x or higher is being used.
  54. // - DELPHI_7 : Delphi v7.x is being used.
  55. // - DELPHI_7_UP : Delphi v7.x or higher is being used.
  56. // - DELPHI_8 : Delphi v8.x is being used.
  57. // - DELPHI_8_UP : Delphi v8.x or higher is being used.
  58. // - DELPHI_9 : Delphi v9.x is being used.
  59. // - DELPHI_9_UP : Delphi v9.x or higher is being used.
  60. //
  61. // Only defined if Linux is the target:
  62. // - KYLIX : Any version of Kylix is being used.
  63. // - KYLIX_1 : Kylix 1.x is being used.
  64. // - KYLIX_1_UP : Kylix 1.x or higher is being used.
  65. // - KYLIX_2 : Kylix 2.x is being used.
  66. // - KYLIX_2_UP : Kylix 2.x or higher is being used.
  67. // - KYLIX_3 : Kylix 3.x is being used.
  68. // - KYLIX_3_UP : Kylix 3.x or higher is being used.
  69. //
  70. // Only defined if Linux is the target:
  71. // - QT_CLX : Trolltech's QT library is being used.
  72. //
  73. // Only defined if Delphi.NET is the target:
  74. // - DELPHI.NET : Any version of Delphi.NET is being used.
  75. // - DELPHI.NET_1 : Delphi.NET version 1.x is being used.
  76. // - DELPHI.NET_1_UP : Delphi.NET version 1.x is being used.
  77. //----------------------------------------------------------------------------------------------------------------------
  78. {$ifdef CLR} // The common language runtime symbol is only defined for the .NET platform.
  79. {$define DELPHI.NET}
  80. {$ifdef VER160}
  81. {$define DELPHI.NET_1}
  82. {$endif VER160}
  83. // Compiler defines common to all .NET versions.
  84. {$ifdef DELPHI.NET_1}
  85. {$define DELHI.NET_1_UP}
  86. {$endif DELPHI.NET_1}
  87. {$endif CLR}
  88. {$ifdef Win32}
  89. {$ifdef VER170}
  90. {$define COMPILER_9}
  91. {$define DELPHI}
  92. {$define DELPHI_9}
  93. {$endif VER170}
  94. {$ifdef VER160}
  95. {$define COMPILER_8}
  96. {$define DELPHI}
  97. {$define DELPHI_8}
  98. {$endif VER160}
  99. {$ifdef VER150}
  100. {$define COMPILER_7}
  101. {$define DELPHI}
  102. {$define DELPHI_7}
  103. {$endif}
  104. {$ifdef VER140}
  105. {$define COMPILER_6}
  106. {$ifdef BCB}
  107. {$define CPPB}
  108. {$define CPPB_6}
  109. {$else}
  110. {$define DELPHI}
  111. {$define DELPHI_6}
  112. {$endif}
  113. {$endif}
  114. {$ifdef VER130}
  115. {$define COMPILER_5}
  116. {$ifdef BCB}
  117. {$define CPPB}
  118. {$define CPPB_5}
  119. {$else}
  120. {$define DELPHI}
  121. {$define DELPHI_5}
  122. {$endif}
  123. {$endif}
  124. {$ifdef VER125}
  125. {$define COMPILER_4}
  126. {$define CPPB}
  127. {$define CPPB_4}
  128. {$endif}
  129. {$ifdef VER120}
  130. {$define COMPILER_4}
  131. {$define DELPHI}
  132. {$define DELPHI_4}
  133. {$endif}
  134. {$ifdef VER110}
  135. {$define COMPILER_3}
  136. {$define CPPB}
  137. {$define CPPB_3}
  138. {$endif}
  139. {$ifdef VER100}
  140. {$define COMPILER_3}
  141. {$define DELPHI}
  142. {$define DELPHI_3}
  143. {$endif}
  144. {$ifdef VER93}
  145. {$define COMPILER_2} // C++ Builder v1 compiler is really v2
  146. {$define CPPB}
  147. {$define CPPB_1}
  148. {$endif}
  149. {$ifdef VER90}
  150. {$define COMPILER_2}
  151. {$define DELPHI}
  152. {$define DELPHI_2}
  153. {$endif}
  154. {$ifdef VER80}
  155. {$define COMPILER_1}
  156. {$define DELPHI}
  157. {$define DELPHI_1}
  158. {$endif}
  159. {$ifdef DELPHI_2}
  160. {$define DELPHI_2_UP}
  161. {$endif}
  162. {$ifdef DELPHI_3}
  163. {$define DELPHI_2_UP}
  164. {$define DELPHI_3_UP}
  165. {$endif}
  166. {$ifdef DELPHI_4}
  167. {$define DELPHI_2_UP}
  168. {$define DELPHI_3_UP}
  169. {$define DELPHI_4_UP}
  170. {$endif}
  171. {$ifdef DELPHI_5}
  172. {$define DELPHI_2_UP}
  173. {$define DELPHI_3_UP}
  174. {$define DELPHI_4_UP}
  175. {$define DELPHI_5_UP}
  176. {$endif}
  177. {$ifdef DELPHI_6}
  178. {$define DELPHI_2_UP}
  179. {$define DELPHI_3_UP}
  180. {$define DELPHI_4_UP}
  181. {$define DELPHI_5_UP}
  182. {$define DELPHI_6_UP}
  183. {$endif}
  184. {$ifdef DELPHI_7}
  185. {$define DELPHI_2_UP}
  186. {$define DELPHI_3_UP}
  187. {$define DELPHI_4_UP}
  188. {$define DELPHI_5_UP}
  189. {$define DELPHI_6_UP}
  190. {$define DELPHI_7_UP}
  191. {$endif}
  192. {$ifdef DELPHI_8}
  193. {$define DELPHI_2_UP}
  194. {$define DELPHI_3_UP}
  195. {$define DELPHI_4_UP}
  196. {$define DELPHI_5_UP}
  197. {$define DELPHI_6_UP}
  198. {$define DELPHI_7_UP}
  199. {$define DELPHI_8_UP}
  200. {$endif}
  201. {$ifdef DELPHI_9}
  202. {$define DELPHI_2_UP}
  203. {$define DELPHI_3_UP}
  204. {$define DELPHI_4_UP}
  205. {$define DELPHI_5_UP}
  206. {$define DELPHI_6_UP}
  207. {$define DELPHI_7_UP}
  208. {$define DELPHI_8_UP}
  209. {$define DELPHI_9_UP}
  210. {$endif}
  211. {$ifdef CPPB_3}
  212. {$define CPPB_3_UP}
  213. {$endif}
  214. {$ifdef CPPB_4}
  215. {$define CPPB_3_UP}
  216. {$define CPPB_4_UP}
  217. {$endif}
  218. {$ifdef CPPB_5}
  219. {$define CPPB_3_UP}
  220. {$define CPPB_4_UP}
  221. {$define CPPB_5_UP}
  222. {$endif}
  223. {$ifdef CPPB_6}
  224. {$define CPPB_3_UP}
  225. {$define CPPB_4_UP}
  226. {$define CPPB_5_UP}
  227. {$define CPPB_6_UP}
  228. {$endif}
  229. {$ifdef CPPB_3_UP}
  230. // C++ Builder requires this if you use Delphi components in run-time packages.
  231. {$ObjExportAll On}
  232. {$endif}
  233. {$else (not Windows)}
  234. // Linux is the target
  235. {$define QT_CLX}
  236. {$define KYLIX}
  237. {$ifdef VER140}
  238. {$define COMPILER_6}
  239. {$ifdef conditionalexpressions}
  240. {$if Declared(RTLVersion) and (RTLVersion = 14)}
  241. {$define KYLIX_1}
  242. {$ifend}
  243. {$if Declared(RTLVersion) and (RTLVersion = 14.2)}
  244. {$define KYLIX_2}
  245. {$ifend}
  246. {$if Declared(RTLVersion) and (RTLVersion = 14.5)}
  247. {$define KYLIX_3}
  248. {$ifend}
  249. {$endif}
  250. {$endif}
  251. {$ifdef VER150}
  252. {$define COMPILER_7}
  253. {$define KYLIX_3}
  254. {$endif}
  255. {$ifdef VER140}
  256. {$define COMPILER_6}
  257. {$define KYLIX_2}
  258. {$endif}
  259. {$ifdef KYLIX_1}
  260. {$define KYLIX_1_UP}
  261. {$endif}
  262. {$ifdef KYLIX_2}
  263. {$define KYLIX_2_UP}
  264. {$endif}
  265. {$ifdef KYLIX_3}
  266. {$define KYLIX_2_UP}
  267. {$define KYLIX_3_UP}
  268. {$endif}
  269. {$endif Win32}
  270. // Compiler defines not specific to a particlular platform.
  271. {$ifdef COMPILER_1}
  272. {$define COMPILER_1_UP}
  273. {$endif}
  274. {$ifdef COMPILER_2}
  275. {$define COMPILER_1_UP}
  276. {$define COMPILER_2_UP}
  277. {$endif}
  278. {$ifdef COMPILER_3}
  279. {$define COMPILER_1_UP}
  280. {$define COMPILER_2_UP}
  281. {$define COMPILER_3_UP}
  282. {$endif}
  283. {$ifdef COMPILER_4}
  284. {$define COMPILER_1_UP}
  285. {$define COMPILER_2_UP}
  286. {$define COMPILER_3_UP}
  287. {$define COMPILER_4_UP}
  288. {$endif}
  289. {$ifdef COMPILER_5}
  290. {$define COMPILER_1_UP}
  291. {$define COMPILER_2_UP}
  292. {$define COMPILER_3_UP}
  293. {$define COMPILER_4_UP}
  294. {$define COMPILER_5_UP}
  295. {$endif}
  296. {$ifdef COMPILER_6}
  297. {$define COMPILER_1_UP}
  298. {$define COMPILER_2_UP}
  299. {$define COMPILER_3_UP}
  300. {$define COMPILER_4_UP}
  301. {$define COMPILER_5_UP}
  302. {$define COMPILER_6_UP}
  303. {$endif}
  304. {$ifdef COMPILER_7}
  305. {$define COMPILER_1_UP}
  306. {$define COMPILER_2_UP}
  307. {$define COMPILER_3_UP}
  308. {$define COMPILER_4_UP}
  309. {$define COMPILER_5_UP}
  310. {$define COMPILER_6_UP}
  311. {$define COMPILER_7_UP}
  312. {$endif}
  313. {$ifdef COMPILER_8}
  314. {$define COMPILER_1_UP}
  315. {$define COMPILER_2_UP}
  316. {$define COMPILER_3_UP}
  317. {$define COMPILER_4_UP}
  318. {$define COMPILER_5_UP}
  319. {$define COMPILER_6_UP}
  320. {$define COMPILER_7_UP}
  321. {$define COMPILER_8_UP}
  322. {$endif}
  323. {$ifdef COMPILER_9}
  324. {$define COMPILER_1_UP}
  325. {$define COMPILER_2_UP}
  326. {$define COMPILER_3_UP}
  327. {$define COMPILER_4_UP}
  328. {$define COMPILER_5_UP}
  329. {$define COMPILER_6_UP}
  330. {$define COMPILER_7_UP}
  331. {$define COMPILER_8_UP}
  332. {$define COMPILER_9_UP}
  333. {$endif}
  334. //----------------------------------------------------------------------------------------------------------------------