platform.inc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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. {$IFDEF Darwin}
  181. {$UNDEF OS_DOS}
  182. {$DEFINE OS_DARWIN}
  183. {$DEFINE OS_UNIX}
  184. {$DEFINE HasSysMsgUnit}
  185. {$ENDIF}
  186. {---------------------------------------------------------------------------}
  187. { FPC GO32V2 COMPILER changes operating system - Updated 27Aug98 LdB }
  188. {---------------------------------------------------------------------------}
  189. {$IFDEF GO32V2}
  190. {$DEFINE OS_GO32}
  191. {$DEFINE HasSysMsgUnit}
  192. {$ENDIF}
  193. {---------------------------------------------------------------------------}
  194. { 32 BIT WINDOWS COMPILERS changes bit size - Updated 27Aug98 LdB }
  195. {---------------------------------------------------------------------------}
  196. {$IFDEF WIN32}
  197. {$IFNDEF WINDOWS}
  198. {$DEFINE WINDOWS}
  199. {$ENDIF}
  200. {$UNDEF BIT_16}
  201. {$DEFINE BIT_32}
  202. {$DEFINE HasSysMsgUnit}
  203. {$ENDIF}
  204. {---------------------------------------------------------------------------}
  205. { WINDOWS COMPILERS change op system and proc mode - Updated 03Nov99 LdB }
  206. {---------------------------------------------------------------------------}
  207. {$IFDEF WINDOWS}
  208. {$UNDEF OS_DOS}
  209. {$DEFINE OS_WINDOWS}
  210. {$UNDEF PROC_Real}
  211. {$DEFINE PROC_Protected}
  212. {$IFDEF FPC}
  213. {$DEFINE WIN32}
  214. {$ENDIF}
  215. {$ENDIF}
  216. {---------------------------------------------------------------------------}
  217. { DELPHI1 COMPILER changes compiler type - Updated 27Aug98 LdB }
  218. {---------------------------------------------------------------------------}
  219. {$IFDEF VER80}
  220. {$UNDEF PPC_BP}
  221. {$DEFINE PPC_DELPHI}
  222. {$ENDIF}
  223. {---------------------------------------------------------------------------}
  224. { DELPHI2 COMPILER changes compiler type - Updated 27Aug98 LdB }
  225. {---------------------------------------------------------------------------}
  226. {$IFDEF VER90}
  227. {$UNDEF PPC_BP}
  228. {$DEFINE PPC_DELPHI}
  229. {$DEFINE PPC_DELPHI2}
  230. {$ENDIF}
  231. {---------------------------------------------------------------------------}
  232. { DELPHI3 COMPILER changes compiler type - Updated 27Aug98 LdB }
  233. {---------------------------------------------------------------------------}
  234. {$IFDEF VER100}
  235. {$UNDEF PPC_BP}
  236. {$DEFINE PPC_DELPHI}
  237. {$DEFINE PPC_DELPHI3}
  238. {$UNDEF BP_VMTLink}
  239. {$ENDIF}
  240. {---------------------------------------------------------------------------}
  241. { DELPHI4 COMPILER changes compiler type - Updated 25Oct98 pfv }
  242. {---------------------------------------------------------------------------}
  243. {$IFDEF VER120}
  244. {$UNDEF PPC_BP}
  245. {$DEFINE PPC_DELPHI}
  246. {$DEFINE PPC_DELPHI3}
  247. {$DEFINE PPC_DELPHI4}
  248. {$UNDEF BP_VMTLink}
  249. {$ENDIF}
  250. {---------------------------------------------------------------------------}
  251. { DELPHI5 COMPILER changes compiler type - Updated 04Nov99 pfv }
  252. {---------------------------------------------------------------------------}
  253. {$IFDEF VER130}
  254. {$UNDEF PPC_BP}
  255. {$DEFINE PPC_DELPHI}
  256. {$DEFINE PPC_DELPHI3}
  257. {$DEFINE PPC_DELPHI4}
  258. {$DEFINE PPC_DELPHI5}
  259. {$UNDEF BP_VMTLink}
  260. {$ENDIF}
  261. {---------------------------------------------------------------------------}
  262. { OS2 COMPILERS change compiler type and mode - Updated 27Aug98 LdB }
  263. { Note: Assumes BPOS2 16BIT OS2 patch except for FPC which undefines this }
  264. {---------------------------------------------------------------------------}
  265. {$IFDEF OS2}
  266. {$UNDEF OS_DOS}
  267. {$DEFINE OS_OS2}
  268. {$UNDEF PROC_Real}
  269. {$DEFINE PROC_Protected}
  270. {$UNDEF PPC_BP}
  271. {$DEFINE PPC_BPOS2}
  272. {$IFDEF FPC}
  273. {$UNDEF PPC_BPOS2}
  274. {$ENDIF}
  275. {$ENDIF}
  276. {---------------------------------------------------------------------------}
  277. { VIRTUAL PASCAL changes compiler type/32 bit - Updated 27Aug98 LdB }
  278. { Note: VP2 can compile win 32 code so changes op system as needed }
  279. {---------------------------------------------------------------------------}
  280. {$IFDEF VirtualPascal}
  281. {$UNDEF BIT_16}
  282. {$DEFINE BIT_32}
  283. {$IFDEF PPC_BPOS2}
  284. {$UNDEF PPC_BPOS2}
  285. {$ENDIF}
  286. {$DEFINE PPC_VIRTUAL}
  287. {$IFDEF WIN32}
  288. {$UNDEF PPC_BP}
  289. {$UNDEF OS_OS2}
  290. {$DEFINE OS_WINDOWS}
  291. {$ENDIF}
  292. {$ENDIF}
  293. {---------------------------------------------------------------------------}
  294. { SPEED COMPILER changes compiler type/32 bit - Updated 27Aug98 LdB }
  295. {---------------------------------------------------------------------------}
  296. {$IFDEF Speed}
  297. {$UNDEF BIT_16}
  298. {$DEFINE BIT_32}
  299. {$UNDEF PPC_BPOS2}
  300. {$DEFINE PPC_SPEED}
  301. {$UNDEF BP_VMTLink}
  302. {$ENDIF}
  303. {---------------------------------------------------------------------------}
  304. { FPC AMIGA COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  305. {---------------------------------------------------------------------------}
  306. {$IFDEF AMIGA}
  307. {$UNDEF OS_DOS}
  308. {$DEFINE OS_AMIGA}
  309. {$IFDEF CPU86}
  310. {$UNDEF CPU86}
  311. {$ENDIF}
  312. {$IFNDEF CPU68}
  313. {$DEFINE CPU68}
  314. {$ENDIF}
  315. {$ENDIF}
  316. {---------------------------------------------------------------------------}
  317. { FPC ATARI COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  318. {---------------------------------------------------------------------------}
  319. {$IFDEF ATARI}
  320. {$UNDEF OS_DOS}
  321. {$DEFINE OS_ATARI}
  322. {$IFDEF CPU86}
  323. {$UNDEF CPU86}
  324. {$ENDIF}
  325. {$IFNDEF CPU68}
  326. {$DEFINE CPU68}
  327. {$ENDIF}
  328. {$ENDIF}
  329. {---------------------------------------------------------------------------}
  330. { FPC MAC COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  331. {---------------------------------------------------------------------------}
  332. {$IFDEF MACOS}
  333. {$UNDEF OS_DOS}
  334. {$DEFINE OS_MAC}
  335. {$IFDEF CPU86}
  336. {$UNDEF CPU86}
  337. {$ENDIF}
  338. {$IFNDEF CPU68}
  339. {$DEFINE CPU68}
  340. {$ENDIF}
  341. {$ENDIF}
  342. {$IFDEF OS_DOS}
  343. {$DEFINE NO_WINDOW}
  344. {$ENDIF}
  345. {---------------------------------------------------------------------------}
  346. { WIN16 AND WIN32 set if in windows - Updated 16Oct2000 LdB }
  347. {---------------------------------------------------------------------------}
  348. {$IFDEF OS_WINDOWS} { WINDOWS SYSTEM }
  349. {$IFDEF BIT_16}
  350. {$DEFINE WIN16} { 16 BIT WINDOWS }
  351. {$ENDIF}
  352. {$IFDEF BIT_32}
  353. {$DEFINE WIN32} { 32 BIT WINDOWS }
  354. {$ENDIF}
  355. {$ENDIF}
  356. {
  357. $Log$
  358. Revision 1.11 2004-02-06 20:59:29 jonas
  359. + darwin support
  360. Revision 1.10 2002/09/07 15:06:38 peter
  361. * old logs removed and tabs fixed
  362. Revision 1.9 2002/06/07 14:15:10 pierre
  363. * add window resizing support for unix
  364. Revision 1.8 2002/06/02 08:32:51 marco
  365. * renamefest
  366. Revision 1.7 2002/05/21 12:02:02 pierre
  367. define HASSYSMSGUNIT for go32v2 and win32
  368. }