platform.inc 14 KB

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