platform.inc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. {***************[ PLATFORM INCLUDE UNIT ]******************}
  2. { }
  3. { System independent INCLUDE file to sort PLATFORMS }
  4. { }
  5. { Parts Copyright (c) 1997 by Balazs Scheidler }
  6. { [email protected] }
  7. { }
  8. { Parts Copyright (c) 1999, 2000 by Leon de Boer }
  9. { [email protected] - primary e-mail address }
  10. { [email protected] - backup e-mail address }
  11. { }
  12. {****************[ THIS CODE IS FREEWARE ]*****************}
  13. { }
  14. { This sourcecode is released for the purpose to }
  15. { promote the pascal language on all platforms. You may }
  16. { redistribute it and/or modify with the following }
  17. { DISCLAIMER. }
  18. { }
  19. { This SOURCE CODE is distributed "AS IS" WITHOUT }
  20. { WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR }
  21. { ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. }
  22. { }
  23. {*****************[ SUPPORTED PLATFORMS ]******************}
  24. { 16 and 32 Bit compilers }
  25. { DOS - Turbo Pascal 7.0 + (16 Bit) }
  26. { DPMI - Turbo Pascal 7.0 + (16 Bit) }
  27. { - FPC 0.9912+ (GO32V2) (32 Bit) }
  28. { WINDOWS - Turbo Pascal 7.0 + (16 Bit) }
  29. { - Delphi 1.0+ (16 Bit) }
  30. { WIN95/NT - Delphi 2.0+ (32 Bit) }
  31. { - Virtual Pascal 2.0+ (32 Bit) }
  32. { - Speedsoft Sybil 2.0+ (32 Bit) }
  33. { - FPC 0.9912+ (32 Bit) }
  34. { OS2 - Virtual Pascal 1.0+ (32 Bit) }
  35. { - C'T patch to BP (16 Bit) }
  36. { LINUX - FPC 0.9912+ (32 Bit) }
  37. { }
  38. {******************[ REVISION HISTORY ]********************}
  39. { Version Date Who Fix }
  40. { ------- -------- --- ---------------------------- }
  41. { 0.1 02 Jul 97 Bazsi Initial implementation }
  42. { 0.2 28 Aug 97 LdB Fixed OS2 platform sort }
  43. { 0.3 29 Aug 97 LdB Added assembler type changes }
  44. { 0.4 29 Aug 97 LdB OS_DOS removed from WINDOWS }
  45. { 0.5 23 Oct 97 LdB Delphi & speed compilers }
  46. { 0.6 05 May 98 LdB Virtual Pascal 2.0 added }
  47. { 0.7 19 May 98 LdB Delphi 2/3 definitions added }
  48. { 0.8 06 Aug 98 CEC FPC only support fixed WIN32 }
  49. { 0.9 10 Aug 98 LdB BP_VMTLink def/Undef added }
  50. { 1.0 27 Aug 98 LdB Atari, Mac etc not undef dos }
  51. { 1.1 25 Oct 98 PfV Delphi 4 definitions added }
  52. { 1.2 06 Jun 99 LdB Sybil 2.0 support added }
  53. { 1.3 13 Jun 99 LdB Sybil 2.0 undef BP_VMT link }
  54. { 1.31 03 Nov 99 LdB FPC windows defines WIN32 }
  55. { 1.32 04 Nov 99 LdB Delphi 5 definitions added }
  56. { 1.33 16 Oct 00 LdB WIN32/WIN16 defines added }
  57. {**********************************************************}
  58. { ****************************************************************************
  59. This include file defines some conditional defines to allow us to select
  60. the compiler/platform/target in a consequent way.
  61. OS_XXXX The operating system used (XXXX may be one of:
  62. DOS, OS2, Linux, Windows, Go32)
  63. PPC_XXXX The compiler used: BP, FPK, Virtual, Speed
  64. BIT_XX The number of bits of the target platform: 16 or 32
  65. PROC_XXXX The mode of the target processor (Real or Protected)
  66. This shouldn't be used, except for i386 specific parts.
  67. ASM_XXXX This is the assembler type: BP, ISO-ANSI, FPK
  68. ****************************************************************************
  69. This is how the IFDEF and UNDEF statements below should translate.
  70. PLATFORM SYSTEM COMPILER COMP ID CPU MODE BITS ASSEMBLER
  71. -------- ------ -------- ------- -------- ---- ---------
  72. DOS OS_DOS BP/TP7 PPC_BP PROC_Real BIT_16 ASM_BP
  73. DPMI OS_DOS BP/TP7 PPC_BP PROC_Protected BIT_16 ASM_BP
  74. FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  75. LINUX OS_LINUX FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  76. WINDOWS OS_WINDOWS BP/TP7 PPC_BP PROC_Protected BIT_16 ASM_BP
  77. DELPHI PPC_DELPHI PROC_Protected BIT_16 ASM_BP
  78. DELPHI2 PPC_DELPHI2 PROC_Protected BIT_16 ASM_BP
  79. WIN95/NT OS_WINDOWS DELPHI2 PPC_DELPHI2 PROC_Protected BIT_32 ASM_BP
  80. DELPHI3 PPC_DELPHI3 PROC_Protected BIT_32 ASM_BP
  81. DELPHI4 PPC_DELPHI3 PROC_Protected BIT_32 ASM_BP
  82. DELPHI5 PPC_DELPHI3 PROC_Protected BIT_32 ASM_BP
  83. VIRTUAL PPC_VIRTUAL PROC_Protected BIT 32 ASM_BP
  84. SYBIL2 PPC_SPEED PROC_Protected BIT_32 ASM_BP
  85. FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  86. OS2 OS_OS2 BPOS2 PPC_BPOS2 PROC_Protected BIT_16 ASM_BP
  87. VIRTUAL PPC_VIRTUAL PROC_Protected BIT_32 ASM_BP
  88. SPEED PPC_SPEED PROC_Protected BIT_32 ASM_BP
  89. SYBIL2 PPC_SPEED PROC_Protected BIT_32 ASM_BP
  90. FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  91. ****************************************************************************}
  92. {****************************************************************************
  93. FOR ALL COMPILERS BP_VMTLink defined but FPC and Delphi3/Delphi4 undefine it
  94. ****************************************************************************}
  95. {****************************************************************************
  96. FOR FPC THESE ARE THE TRANSLATIONS
  97. PLATFORM SYSTEM COMPILER HANDLE SIZE ASM CPU
  98. -------- ------ -------- ----------- ---- ---
  99. DOS OS_DOS,OS_GO32 FPC 32-bit AT&T CPU86
  100. WIN32 OS_WINDOWS FPC 32-bit AT&T ----
  101. LINUX OS_LINUX FPC 32-bit AT&T ----
  102. OS2 OS_OS2 FPC ????? AT&T CPU86
  103. ATARI OS_ATARI FPC 32-bit Internal CPU68
  104. MACOS OS_MAC FPC ????? Internal CPU68
  105. AMIGA OS_AMIGA FPC 32-bit Internal CPU68
  106. ****************************************************************************}
  107. {---------------------------------------------------------------------------}
  108. { Initial assume BORLAND 16 BIT DOS COMPILER - Updated 27Aug98 LdB }
  109. {---------------------------------------------------------------------------}
  110. {$DEFINE OS_DOS}
  111. {$DEFINE PROC_Real}
  112. {$DEFINE BIT_16}
  113. {$DEFINE PPC_BP}
  114. {$DEFINE ASM_BP}
  115. {$DEFINE BP_VMTLink}
  116. {$DEFINE CPU86}
  117. {---------------------------------------------------------------------------}
  118. { BORLAND 16 BIT DPMI changes protected mode - Updated 27Aug98 LdB }
  119. {---------------------------------------------------------------------------}
  120. {$IFDEF DPMI}
  121. {$UNDEF PROC_Real}
  122. {$DEFINE PROC_Protected}
  123. {$ENDIF}
  124. {---------------------------------------------------------------------------}
  125. { FPC 32 BIT COMPILER changes ASM, 32 bits etc - Updated 27Aug98 LdB }
  126. {---------------------------------------------------------------------------}
  127. {$IFDEF FPC}
  128. {$UNDEF PROC_Real}
  129. {$DEFINE PROC_Protected}
  130. {$UNDEF BIT_16}
  131. {$DEFINE BIT_32}
  132. {$UNDEF PPC_BP}
  133. {$DEFINE PPC_FPC}
  134. {$UNDEF ASM_BP}
  135. {$DEFINE ASM_FPC}
  136. {$UNDEF BP_VMTLink}
  137. {$DEFINE Use_API}
  138. {$DEFINE NO_WINDOW}
  139. {$ENDIF}
  140. {$IFDEF NoAPI}
  141. {$UNDEF Use_API}
  142. {$UNDEF NO_WINDOW}
  143. {$ENDIF UseAPI}
  144. {---------------------------------------------------------------------------}
  145. { FPC LINUX COMPILER changes operating system - Updated 27Aug98 LdB }
  146. { Note: Other linux compilers would need to change other details }
  147. {---------------------------------------------------------------------------}
  148. {$IFDEF LINUX}
  149. {$UNDEF OS_DOS}
  150. {$DEFINE OS_LINUX}
  151. {$ENDIF}
  152. {---------------------------------------------------------------------------}
  153. { FPC GO32V2 COMPILER changes operating system - Updated 27Aug98 LdB }
  154. {---------------------------------------------------------------------------}
  155. {$IFDEF GO32V2}
  156. {$DEFINE OS_GO32}
  157. {$ENDIF}
  158. {---------------------------------------------------------------------------}
  159. { 32 BIT WINDOWS COMPILERS changes bit size - Updated 27Aug98 LdB }
  160. {---------------------------------------------------------------------------}
  161. {$IFDEF WIN32}
  162. {$IFNDEF WINDOWS}
  163. {$DEFINE WINDOWS}
  164. {$ENDIF}
  165. {$UNDEF BIT_16}
  166. {$DEFINE BIT_32}
  167. {$ENDIF}
  168. {---------------------------------------------------------------------------}
  169. { WINDOWS COMPILERS change op system and proc mode - Updated 03Nov99 LdB }
  170. {---------------------------------------------------------------------------}
  171. {$IFDEF WINDOWS}
  172. {$UNDEF OS_DOS}
  173. {$DEFINE OS_WINDOWS}
  174. {$UNDEF PROC_Real}
  175. {$DEFINE PROC_Protected}
  176. {$IFDEF FPC}
  177. {$DEFINE WIN32}
  178. {$ENDIF}
  179. {$ENDIF}
  180. {---------------------------------------------------------------------------}
  181. { DELPHI1 COMPILER changes compiler type - Updated 27Aug98 LdB }
  182. {---------------------------------------------------------------------------}
  183. {$IFDEF VER80}
  184. {$UNDEF PPC_BP}
  185. {$DEFINE PPC_DELPHI}
  186. {$ENDIF}
  187. {---------------------------------------------------------------------------}
  188. { DELPHI2 COMPILER changes compiler type - Updated 27Aug98 LdB }
  189. {---------------------------------------------------------------------------}
  190. {$IFDEF VER90}
  191. {$UNDEF PPC_BP}
  192. {$DEFINE PPC_DELPHI}
  193. {$DEFINE PPC_DELPHI2}
  194. {$ENDIF}
  195. {---------------------------------------------------------------------------}
  196. { DELPHI3 COMPILER changes compiler type - Updated 27Aug98 LdB }
  197. {---------------------------------------------------------------------------}
  198. {$IFDEF VER100}
  199. {$UNDEF PPC_BP}
  200. {$DEFINE PPC_DELPHI}
  201. {$DEFINE PPC_DELPHI3}
  202. {$UNDEF BP_VMTLink}
  203. {$ENDIF}
  204. {---------------------------------------------------------------------------}
  205. { DELPHI4 COMPILER changes compiler type - Updated 25Oct98 pfv }
  206. {---------------------------------------------------------------------------}
  207. {$IFDEF VER120}
  208. {$UNDEF PPC_BP}
  209. {$DEFINE PPC_DELPHI}
  210. {$DEFINE PPC_DELPHI3}
  211. {$DEFINE PPC_DELPHI4}
  212. {$UNDEF BP_VMTLink}
  213. {$ENDIF}
  214. {---------------------------------------------------------------------------}
  215. { DELPHI5 COMPILER changes compiler type - Updated 04Nov99 pfv }
  216. {---------------------------------------------------------------------------}
  217. {$IFDEF VER130}
  218. {$UNDEF PPC_BP}
  219. {$DEFINE PPC_DELPHI}
  220. {$DEFINE PPC_DELPHI3}
  221. {$DEFINE PPC_DELPHI4}
  222. {$DEFINE PPC_DELPHI5}
  223. {$UNDEF BP_VMTLink}
  224. {$ENDIF}
  225. {---------------------------------------------------------------------------}
  226. { OS2 COMPILERS change compiler type and mode - Updated 27Aug98 LdB }
  227. { Note: Assumes BPOS2 16BIT OS2 patch except for FPC which undefines this }
  228. {---------------------------------------------------------------------------}
  229. {$IFDEF OS2}
  230. {$UNDEF OS_DOS}
  231. {$DEFINE OS_OS2}
  232. {$UNDEF PROC_Real}
  233. {$DEFINE PROC_Protected}
  234. {$UNDEF PPC_BP}
  235. {$DEFINE PPC_BPOS2}
  236. {$IFDEF FPC}
  237. {$UNDEF PPC_BPOS2}
  238. {$ENDIF}
  239. {$ENDIF}
  240. {---------------------------------------------------------------------------}
  241. { VIRTUAL PASCAL changes compiler type/32 bit - Updated 27Aug98 LdB }
  242. { Note: VP2 can compile win 32 code so changes op system as needed }
  243. {---------------------------------------------------------------------------}
  244. {$IFDEF VirtualPascal}
  245. {$UNDEF BIT_16}
  246. {$DEFINE BIT_32}
  247. {$IFDEF PPC_BPOS2}
  248. {$UNDEF PPC_BPOS2}
  249. {$ENDIF}
  250. {$DEFINE PPC_VIRTUAL}
  251. {$IFDEF WIN32}
  252. {$UNDEF PPC_BP}
  253. {$UNDEF OS_OS2}
  254. {$DEFINE OS_WINDOWS}
  255. {$ENDIF}
  256. {$ENDIF}
  257. {---------------------------------------------------------------------------}
  258. { SPEED COMPILER changes compiler type/32 bit - Updated 27Aug98 LdB }
  259. {---------------------------------------------------------------------------}
  260. {$IFDEF Speed}
  261. {$UNDEF BIT_16}
  262. {$DEFINE BIT_32}
  263. {$UNDEF PPC_BPOS2}
  264. {$DEFINE PPC_SPEED}
  265. {$UNDEF BP_VMTLink}
  266. {$ENDIF}
  267. {---------------------------------------------------------------------------}
  268. { FPC AMIGA COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  269. {---------------------------------------------------------------------------}
  270. {$IFDEF AMIGA}
  271. {$UNDEF OS_DOS}
  272. {$DEFINE OS_AMIGA}
  273. {$IFDEF CPU86}
  274. {$UNDEF CPU86}
  275. {$ENDIF}
  276. {$IFNDEF CPU68}
  277. {$DEFINE CPU68}
  278. {$ENDIF}
  279. {$ENDIF}
  280. {---------------------------------------------------------------------------}
  281. { FPC ATARI COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  282. {---------------------------------------------------------------------------}
  283. {$IFDEF ATARI}
  284. {$UNDEF OS_DOS}
  285. {$DEFINE OS_ATARI}
  286. {$IFDEF CPU86}
  287. {$UNDEF CPU86}
  288. {$ENDIF}
  289. {$IFNDEF CPU68}
  290. {$DEFINE CPU68}
  291. {$ENDIF}
  292. {$ENDIF}
  293. {---------------------------------------------------------------------------}
  294. { FPC MAC COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  295. {---------------------------------------------------------------------------}
  296. {$IFDEF MACOS}
  297. {$UNDEF OS_DOS}
  298. {$DEFINE OS_MAC}
  299. {$IFDEF CPU86}
  300. {$UNDEF CPU86}
  301. {$ENDIF}
  302. {$IFNDEF CPU68}
  303. {$DEFINE CPU68}
  304. {$ENDIF}
  305. {$ENDIF}
  306. {$IFDEF OS_DOS}
  307. {$DEFINE NO_WINDOW}
  308. {$ENDIF}
  309. {---------------------------------------------------------------------------}
  310. { WIN16 AND WIN32 set if in windows - Updated 16Oct2000 LdB }
  311. {---------------------------------------------------------------------------}
  312. {$IFDEF OS_WINDOWS} { WINDOWS SYSTEM }
  313. {$IFDEF BIT_16}
  314. {$DEFINE WIN16} { 16 BIT WINDOWS }
  315. {$ENDIF}
  316. {$IFDEF BIT_32}
  317. {$DEFINE WIN32} { 32 BIT WINDOWS }
  318. {$ENDIF}
  319. {$ENDIF}