platform.inc 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  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. { 1.34 02 May 02 MvdV FreeBSD, NetBSD, OS_UNIX }
  59. {**********************************************************}
  60. { ****************************************************************************
  61. This include file defines some conditional defines to allow us to select
  62. the compiler/platform/target in a consequent way.
  63. OS_XXXX The operating system used (XXXX may be one of:
  64. DOS, OS2, Linux, Windows, Go32)
  65. PPC_XXXX The compiler used: BP, FPK, Virtual, Speed
  66. BIT_XX The number of bits of the target platform: 16 or 32
  67. PROC_XXXX The mode of the target processor (Real or Protected)
  68. This shouldn't be used, except for i386 specific parts.
  69. ASM_XXXX This is the assembler type: BP, ISO-ANSI, FPK
  70. ****************************************************************************
  71. This is how the IFDEF and UNDEF statements below should translate.
  72. PLATFORM SYSTEM COMPILER COMP ID CPU MODE BITS ASSEMBLER
  73. -------- ------ -------- ------- -------- ---- ---------
  74. DOS OS_DOS BP/TP7 PPC_BP PROC_Real BIT_16 ASM_BP
  75. DPMI OS_DOS BP/TP7 PPC_BP PROC_Protected BIT_16 ASM_BP
  76. FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  77. LINUX OS_LINUX FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  78. OS_UNIX
  79. FREEBSD OS_FREEBSD FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  80. OS_UNIX
  81. NETBSD OS_NETBSD FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  82. OS_UNIX
  83. WINDOWS OS_WINDOWS BP/TP7 PPC_BP PROC_Protected BIT_16 ASM_BP
  84. DELPHI PPC_DELPHI PROC_Protected BIT_16 ASM_BP
  85. DELPHI2 PPC_DELPHI2 PROC_Protected BIT_16 ASM_BP
  86. WIN95/NT OS_WINDOWS DELPHI2 PPC_DELPHI2 PROC_Protected BIT_32 ASM_BP
  87. DELPHI3 PPC_DELPHI3 PROC_Protected BIT_32 ASM_BP
  88. DELPHI4 PPC_DELPHI3 PROC_Protected BIT_32 ASM_BP
  89. DELPHI5 PPC_DELPHI3 PROC_Protected BIT_32 ASM_BP
  90. VIRTUAL PPC_VIRTUAL PROC_Protected BIT 32 ASM_BP
  91. SYBIL2 PPC_SPEED PROC_Protected BIT_32 ASM_BP
  92. FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  93. OS2 OS_OS2 BPOS2 PPC_BPOS2 PROC_Protected BIT_16 ASM_BP
  94. VIRTUAL PPC_VIRTUAL PROC_Protected BIT_32 ASM_BP
  95. SPEED PPC_SPEED PROC_Protected BIT_32 ASM_BP
  96. SYBIL2 PPC_SPEED PROC_Protected BIT_32 ASM_BP
  97. FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  98. ****************************************************************************}
  99. {****************************************************************************
  100. FOR ALL COMPILERS BP_VMTLink defined but FPC and Delphi3/Delphi4 undefine it
  101. ****************************************************************************}
  102. {****************************************************************************
  103. FOR FPC THESE ARE THE TRANSLATIONS
  104. PLATFORM SYSTEM COMPILER HANDLE SIZE ASM CPU
  105. -------- ------ -------- ----------- ---- ---
  106. DOS OS_DOS,OS_GO32 FPC 32-bit AT&T CPU86
  107. WIN32 OS_WINDOWS FPC 32-bit AT&T ----
  108. LINUX OS_LINUX,OS_UNIX FPC 32-bit AT&T ----
  109. FREEBSD OS_NETBSD,OS_UNIX FPC 32-bit AT&T ----
  110. NETBSD OS_FREEBSD,OS_UNIX FPC 32-bit AT&T ----
  111. OS2 OS_OS2 FPC ????? AT&T CPU86
  112. ATARI OS_ATARI FPC 32-bit Internal CPU68
  113. MACOS OS_MAC FPC ????? Internal CPU68
  114. AMIGA OS_AMIGA FPC 32-bit Internal CPU68
  115. ****************************************************************************}
  116. {---------------------------------------------------------------------------}
  117. { Initial assume BORLAND 16 BIT DOS COMPILER - Updated 27Aug98 LdB }
  118. {---------------------------------------------------------------------------}
  119. {$DEFINE OS_DOS}
  120. {$DEFINE PROC_Real}
  121. {$DEFINE BIT_16}
  122. {$DEFINE PPC_BP}
  123. {$DEFINE ASM_BP}
  124. {$DEFINE BP_VMTLink}
  125. {$DEFINE CPU86}
  126. {---------------------------------------------------------------------------}
  127. { BORLAND 16 BIT DPMI changes protected mode - Updated 27Aug98 LdB }
  128. {---------------------------------------------------------------------------}
  129. {$IFDEF DPMI}
  130. {$UNDEF PROC_Real}
  131. {$DEFINE PROC_Protected}
  132. {$ENDIF}
  133. {---------------------------------------------------------------------------}
  134. { FPC 32 BIT COMPILER changes ASM, 32 bits etc - Updated 27Aug98 LdB }
  135. {---------------------------------------------------------------------------}
  136. {$IFDEF FPC}
  137. {$UNDEF PROC_Real}
  138. {$DEFINE PROC_Protected}
  139. {$UNDEF BIT_16}
  140. {$DEFINE BIT_32}
  141. {$UNDEF PPC_BP}
  142. {$DEFINE PPC_FPC}
  143. {$UNDEF ASM_BP}
  144. {$DEFINE ASM_FPC}
  145. {$UNDEF BP_VMTLink}
  146. {$DEFINE Use_API}
  147. {$DEFINE Use_Video_API}
  148. {$DEFINE NO_WINDOW}
  149. {$ENDIF}
  150. {$IFDEF NoAPI}
  151. {$UNDEF Use_API}
  152. {$UNDEF Use_Video_API}
  153. {$UNDEF NO_WINDOW}
  154. {$ENDIF UseAPI}
  155. {$ifdef GRAPH_API}
  156. {undef Use_Video_API}
  157. {$endif GRAPH_API}
  158. {---------------------------------------------------------------------------}
  159. { FPC LINUX COMPILER changes operating system - Updated 27Aug98 LdB }
  160. { Note: Other linux compilers would need to change other details }
  161. {---------------------------------------------------------------------------}
  162. {$IFDEF LINUX}
  163. {$UNDEF OS_DOS}
  164. {$DEFINE OS_LINUX}
  165. {$DEFINE OS_UNIX}
  166. {$DEFINE HasSysMsgUnit}
  167. {$ENDIF}
  168. {$IFDEF FreeBSD}
  169. {$UNDEF OS_DOS}
  170. {$DEFINE OS_FREEBSD}
  171. {$DEFINE OS_UNIX}
  172. {$DEFINE HasSysMsgUnit}
  173. {$ENDIF}
  174. {$IFDEF NETBSD}
  175. {$UNDEF OS_DOS}
  176. {$DEFINE OS_NETBSD}
  177. {$DEFINE OS_UNIX}
  178. {$DEFINE HasSysMsgUnit}
  179. {$ENDIF}
  180. {---------------------------------------------------------------------------}
  181. { FPC GO32V2 COMPILER changes operating system - Updated 27Aug98 LdB }
  182. {---------------------------------------------------------------------------}
  183. {$IFDEF GO32V2}
  184. {$DEFINE OS_GO32}
  185. {$DEFINE HasSysMsgUnit}
  186. {$ENDIF}
  187. {---------------------------------------------------------------------------}
  188. { 32 BIT WINDOWS COMPILERS changes bit size - Updated 27Aug98 LdB }
  189. {---------------------------------------------------------------------------}
  190. {$IFDEF WIN32}
  191. {$IFNDEF WINDOWS}
  192. {$DEFINE WINDOWS}
  193. {$ENDIF}
  194. {$UNDEF BIT_16}
  195. {$DEFINE BIT_32}
  196. {$DEFINE HasSysMsgUnit}
  197. {$ENDIF}
  198. {---------------------------------------------------------------------------}
  199. { WINDOWS COMPILERS change op system and proc mode - Updated 03Nov99 LdB }
  200. {---------------------------------------------------------------------------}
  201. {$IFDEF WINDOWS}
  202. {$UNDEF OS_DOS}
  203. {$DEFINE OS_WINDOWS}
  204. {$UNDEF PROC_Real}
  205. {$DEFINE PROC_Protected}
  206. {$IFDEF FPC}
  207. {$DEFINE WIN32}
  208. {$ENDIF}
  209. {$ENDIF}
  210. {---------------------------------------------------------------------------}
  211. { DELPHI1 COMPILER changes compiler type - Updated 27Aug98 LdB }
  212. {---------------------------------------------------------------------------}
  213. {$IFDEF VER80}
  214. {$UNDEF PPC_BP}
  215. {$DEFINE PPC_DELPHI}
  216. {$ENDIF}
  217. {---------------------------------------------------------------------------}
  218. { DELPHI2 COMPILER changes compiler type - Updated 27Aug98 LdB }
  219. {---------------------------------------------------------------------------}
  220. {$IFDEF VER90}
  221. {$UNDEF PPC_BP}
  222. {$DEFINE PPC_DELPHI}
  223. {$DEFINE PPC_DELPHI2}
  224. {$ENDIF}
  225. {---------------------------------------------------------------------------}
  226. { DELPHI3 COMPILER changes compiler type - Updated 27Aug98 LdB }
  227. {---------------------------------------------------------------------------}
  228. {$IFDEF VER100}
  229. {$UNDEF PPC_BP}
  230. {$DEFINE PPC_DELPHI}
  231. {$DEFINE PPC_DELPHI3}
  232. {$UNDEF BP_VMTLink}
  233. {$ENDIF}
  234. {---------------------------------------------------------------------------}
  235. { DELPHI4 COMPILER changes compiler type - Updated 25Oct98 pfv }
  236. {---------------------------------------------------------------------------}
  237. {$IFDEF VER120}
  238. {$UNDEF PPC_BP}
  239. {$DEFINE PPC_DELPHI}
  240. {$DEFINE PPC_DELPHI3}
  241. {$DEFINE PPC_DELPHI4}
  242. {$UNDEF BP_VMTLink}
  243. {$ENDIF}
  244. {---------------------------------------------------------------------------}
  245. { DELPHI5 COMPILER changes compiler type - Updated 04Nov99 pfv }
  246. {---------------------------------------------------------------------------}
  247. {$IFDEF VER130}
  248. {$UNDEF PPC_BP}
  249. {$DEFINE PPC_DELPHI}
  250. {$DEFINE PPC_DELPHI3}
  251. {$DEFINE PPC_DELPHI4}
  252. {$DEFINE PPC_DELPHI5}
  253. {$UNDEF BP_VMTLink}
  254. {$ENDIF}
  255. {---------------------------------------------------------------------------}
  256. { OS2 COMPILERS change compiler type and mode - Updated 27Aug98 LdB }
  257. { Note: Assumes BPOS2 16BIT OS2 patch except for FPC which undefines this }
  258. {---------------------------------------------------------------------------}
  259. {$IFDEF OS2}
  260. {$UNDEF OS_DOS}
  261. {$DEFINE OS_OS2}
  262. {$UNDEF PROC_Real}
  263. {$DEFINE PROC_Protected}
  264. {$UNDEF PPC_BP}
  265. {$DEFINE PPC_BPOS2}
  266. {$IFDEF FPC}
  267. {$UNDEF PPC_BPOS2}
  268. {$ENDIF}
  269. {$ENDIF}
  270. {---------------------------------------------------------------------------}
  271. { VIRTUAL PASCAL changes compiler type/32 bit - Updated 27Aug98 LdB }
  272. { Note: VP2 can compile win 32 code so changes op system as needed }
  273. {---------------------------------------------------------------------------}
  274. {$IFDEF VirtualPascal}
  275. {$UNDEF BIT_16}
  276. {$DEFINE BIT_32}
  277. {$IFDEF PPC_BPOS2}
  278. {$UNDEF PPC_BPOS2}
  279. {$ENDIF}
  280. {$DEFINE PPC_VIRTUAL}
  281. {$IFDEF WIN32}
  282. {$UNDEF PPC_BP}
  283. {$UNDEF OS_OS2}
  284. {$DEFINE OS_WINDOWS}
  285. {$ENDIF}
  286. {$ENDIF}
  287. {---------------------------------------------------------------------------}
  288. { SPEED COMPILER changes compiler type/32 bit - Updated 27Aug98 LdB }
  289. {---------------------------------------------------------------------------}
  290. {$IFDEF Speed}
  291. {$UNDEF BIT_16}
  292. {$DEFINE BIT_32}
  293. {$UNDEF PPC_BPOS2}
  294. {$DEFINE PPC_SPEED}
  295. {$UNDEF BP_VMTLink}
  296. {$ENDIF}
  297. {---------------------------------------------------------------------------}
  298. { FPC AMIGA COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  299. {---------------------------------------------------------------------------}
  300. {$IFDEF AMIGA}
  301. {$UNDEF OS_DOS}
  302. {$DEFINE OS_AMIGA}
  303. {$IFDEF CPU86}
  304. {$UNDEF CPU86}
  305. {$ENDIF}
  306. {$IFNDEF CPU68}
  307. {$DEFINE CPU68}
  308. {$ENDIF}
  309. {$ENDIF}
  310. {---------------------------------------------------------------------------}
  311. { FPC ATARI COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  312. {---------------------------------------------------------------------------}
  313. {$IFDEF ATARI}
  314. {$UNDEF OS_DOS}
  315. {$DEFINE OS_ATARI}
  316. {$IFDEF CPU86}
  317. {$UNDEF CPU86}
  318. {$ENDIF}
  319. {$IFNDEF CPU68}
  320. {$DEFINE CPU68}
  321. {$ENDIF}
  322. {$ENDIF}
  323. {---------------------------------------------------------------------------}
  324. { FPC MAC COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  325. {---------------------------------------------------------------------------}
  326. {$IFDEF MACOS}
  327. {$UNDEF OS_DOS}
  328. {$DEFINE OS_MAC}
  329. {$IFDEF CPU86}
  330. {$UNDEF CPU86}
  331. {$ENDIF}
  332. {$IFNDEF CPU68}
  333. {$DEFINE CPU68}
  334. {$ENDIF}
  335. {$ENDIF}
  336. {$IFDEF OS_DOS}
  337. {$DEFINE NO_WINDOW}
  338. {$ENDIF}
  339. {---------------------------------------------------------------------------}
  340. { WIN16 AND WIN32 set if in windows - Updated 16Oct2000 LdB }
  341. {---------------------------------------------------------------------------}
  342. {$IFDEF OS_WINDOWS} { WINDOWS SYSTEM }
  343. {$IFDEF BIT_16}
  344. {$DEFINE WIN16} { 16 BIT WINDOWS }
  345. {$ENDIF}
  346. {$IFDEF BIT_32}
  347. {$DEFINE WIN32} { 32 BIT WINDOWS }
  348. {$ENDIF}
  349. {$ENDIF}
  350. {
  351. $Log$
  352. Revision 1.10 2002-09-07 15:06:38 peter
  353. * old logs removed and tabs fixed
  354. Revision 1.9 2002/06/07 14:15:10 pierre
  355. * add window resizing support for unix
  356. Revision 1.8 2002/06/02 08:32:51 marco
  357. * renamefest
  358. Revision 1.7 2002/05/21 12:02:02 pierre
  359. define HASSYSMSGUNIT for go32v2 and win32
  360. }