platform.inc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  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. { FPC 32 BIT COMPILER changes ASM, 32 bits etc - Updated 27Aug98 LdB }
  128. {---------------------------------------------------------------------------}
  129. {$IFDEF FPC}
  130. {$UNDEF PROC_Real}
  131. {$DEFINE PROC_Protected}
  132. {$UNDEF BIT_16}
  133. {$DEFINE BIT_32}
  134. {$UNDEF PPC_BP}
  135. {$DEFINE PPC_FPC}
  136. {$UNDEF ASM_BP}
  137. {$DEFINE ASM_FPC}
  138. {$UNDEF BP_VMTLink}
  139. {$DEFINE Use_API}
  140. {$DEFINE NO_WINDOW}
  141. {$ENDIF}
  142. {---------------------------------------------------------------------------}
  143. { FPC LINUX COMPILER changes operating system - Updated 27Aug98 LdB }
  144. { Note: Other linux compilers would need to change other details }
  145. {---------------------------------------------------------------------------}
  146. {$IFDEF LINUX}
  147. {$UNDEF OS_DOS}
  148. {$DEFINE OS_LINUX}
  149. {$DEFINE OS_UNIX}
  150. {$ENDIF}
  151. {$IFDEF FreeBSD}
  152. {$UNDEF OS_DOS}
  153. {$DEFINE OS_FREEBSD}
  154. {$DEFINE OS_UNIX}
  155. {$ENDIF}
  156. {$IFDEF NETBSD}
  157. {$UNDEF OS_DOS}
  158. {$DEFINE OS_NETBSD}
  159. {$DEFINE OS_UNIX}
  160. {$ENDIF}
  161. {$IFDEF Darwin}
  162. {$UNDEF OS_DOS}
  163. {$DEFINE OS_DARWIN}
  164. {$DEFINE OS_UNIX}
  165. {$ENDIF}
  166. {------------------------------------------------}
  167. { FPC Netware COMPILER changes operating system }
  168. {------------------------------------------------}
  169. {$IFDEF Netware}
  170. {$UNDEF OS_DOS}
  171. {$DEFINE OS_NETWARE}
  172. {$IFDEF NETWARE_LIBC}
  173. {$DEFINE OS_NETWARE_LIBC}
  174. {$ELSE}
  175. {$DEFINE OS_NETWARE_CLIB}
  176. {$ENDIF}
  177. {$DEFINE HasSysMsgUnit}
  178. {$ENDIF}
  179. {---------------------------------------------------------------------------}
  180. { FPC GO32V2 COMPILER changes operating system - Updated 27Aug98 LdB }
  181. {---------------------------------------------------------------------------}
  182. {$IFDEF GO32V2}
  183. {$DEFINE OS_GO32}
  184. {$ENDIF}
  185. {---------------------------------------------------------------------------}
  186. { 32 BIT WINDOWS COMPILERS changes bit size - Updated 27Aug98 LdB }
  187. {---------------------------------------------------------------------------}
  188. {$IFDEF WIN32}
  189. {$IFNDEF WINDOWS}
  190. {$DEFINE WINDOWS}
  191. {$ENDIF}
  192. {$UNDEF BIT_16}
  193. {$DEFINE BIT_32}
  194. {$ENDIF}
  195. {---------------------------------------------------------------------------}
  196. { WINDOWS COMPILERS change op system and proc mode - Updated 03Nov99 LdB }
  197. {---------------------------------------------------------------------------}
  198. {$IFDEF WINDOWS}
  199. {$UNDEF OS_DOS}
  200. {$DEFINE OS_WINDOWS}
  201. {$UNDEF PROC_Real}
  202. {$DEFINE PROC_Protected}
  203. {$IFDEF FPC}
  204. {$DEFINE WIN32}
  205. {$ENDIF}
  206. {$ENDIF}
  207. {---------------------------------------------------------------------------}
  208. { DELPHI1 COMPILER changes compiler type - Updated 27Aug98 LdB }
  209. {---------------------------------------------------------------------------}
  210. {$IFDEF VER80}
  211. {$UNDEF PPC_BP}
  212. {$DEFINE PPC_DELPHI}
  213. {$ENDIF}
  214. {---------------------------------------------------------------------------}
  215. { DELPHI2 COMPILER changes compiler type - Updated 27Aug98 LdB }
  216. {---------------------------------------------------------------------------}
  217. {$IFDEF VER90}
  218. {$UNDEF PPC_BP}
  219. {$DEFINE PPC_DELPHI}
  220. {$DEFINE PPC_DELPHI2}
  221. {$ENDIF}
  222. {---------------------------------------------------------------------------}
  223. { DELPHI3 COMPILER changes compiler type - Updated 27Aug98 LdB }
  224. {---------------------------------------------------------------------------}
  225. {$IFDEF VER100}
  226. {$UNDEF PPC_BP}
  227. {$DEFINE PPC_DELPHI}
  228. {$DEFINE PPC_DELPHI3}
  229. {$UNDEF BP_VMTLink}
  230. {$ENDIF}
  231. {---------------------------------------------------------------------------}
  232. { DELPHI4 COMPILER changes compiler type - Updated 25Oct98 pfv }
  233. {---------------------------------------------------------------------------}
  234. {$IFDEF VER120}
  235. {$UNDEF PPC_BP}
  236. {$DEFINE PPC_DELPHI}
  237. {$DEFINE PPC_DELPHI3}
  238. {$DEFINE PPC_DELPHI4}
  239. {$UNDEF BP_VMTLink}
  240. {$ENDIF}
  241. {---------------------------------------------------------------------------}
  242. { DELPHI5 COMPILER changes compiler type - Updated 04Nov99 pfv }
  243. {---------------------------------------------------------------------------}
  244. {$IFDEF VER130}
  245. {$UNDEF PPC_BP}
  246. {$DEFINE PPC_DELPHI}
  247. {$DEFINE PPC_DELPHI3}
  248. {$DEFINE PPC_DELPHI4}
  249. {$DEFINE PPC_DELPHI5}
  250. {$UNDEF BP_VMTLink
  251. }
  252. {$ENDIF}
  253. {---------------------------------------------------------------------------}
  254. { OS2 COMPILERS change compiler type and mode - Updated 27Aug98 LdB }
  255. { Note: Assumes BPOS2 16BIT OS2 patch except for FPC which undefines this }
  256. {---------------------------------------------------------------------------}
  257. {$IFDEF OS2}
  258. {$UNDEF OS_DOS}
  259. {$DEFINE OS_OS2}
  260. {$UNDEF PROC_Real}
  261. {$DEFINE PROC_Protected}
  262. {$UNDEF PPC_BP}
  263. {$DEFINE PPC_BPOS2}
  264. {$IFDEF FPC}
  265. {$UNDEF PPC_BPOS2}
  266. {$ENDIF}
  267. {$ENDIF}
  268. {---------------------------------------------------------------------------}
  269. { VIRTUAL PASCAL changes compiler type/32 bit - Updated 27Aug98 LdB }
  270. { Note: VP2 can compile win 32 code so changes op system as needed }
  271. {---------------------------------------------------------------------------}
  272. {$IFDEF VirtualPascal}
  273. {$UNDEF BIT_16}
  274. {$DEFINE BIT_32}
  275. {$IFDEF PPC_BPOS2}
  276. {$UNDEF PPC_BPOS2}
  277. {$ENDIF}
  278. {$DEFINE PPC_VIRTUAL}
  279. {$IFDEF WIN32}
  280. {$UNDEF PPC_BP}
  281. {$UNDEF OS_OS2}
  282. {$DEFINE OS_WINDOWS}
  283. {$ENDIF}
  284. {$ENDIF}
  285. {---------------------------------------------------------------------------}
  286. { SPEED COMPILER changes compiler type/32 bit - Updated 27Aug98 LdB }
  287. {---------------------------------------------------------------------------}
  288. {$IFDEF Speed}
  289. {$UNDEF BIT_16}
  290. {$DEFINE BIT_32}
  291. {$UNDEF PPC_BPOS2}
  292. {$DEFINE PPC_SPEED}
  293. {$UNDEF BP_VMTLink}
  294. {$ENDIF}
  295. {---------------------------------------------------------------------------}
  296. { FPC AMIGA COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  297. {---------------------------------------------------------------------------}
  298. {$IFDEF AMIGA}
  299. {$UNDEF OS_DOS}
  300. {$DEFINE OS_AMIGA}
  301. {$IFDEF CPU86}
  302. {$UNDEF CPU86}
  303. {$ENDIF}
  304. {$IFNDEF CPU68}
  305. {$DEFINE CPU68}
  306. {$ENDIF}
  307. {$ENDIF}
  308. {---------------------------------------------------------------------------}
  309. { FPC ATARI COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  310. {---------------------------------------------------------------------------}
  311. {$IFDEF ATARI}
  312. {$UNDEF OS_DOS}
  313. {$DEFINE OS_ATARI}
  314. {$IFDEF CPU86}
  315. {$UNDEF CPU86}
  316. {$ENDIF}
  317. {$IFNDEF CPU68}
  318. {$DEFINE CPU68}
  319. {$ENDIF}
  320. {$ENDIF}
  321. {---------------------------------------------------------------------------}
  322. { FPC MAC COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  323. {---------------------------------------------------------------------------}
  324. {$IFDEF MACOS}
  325. {$UNDEF OS_DOS}
  326. {$DEFINE OS_MAC}
  327. {$IFDEF CPU86}
  328. {$UNDEF CPU86}
  329. {$ENDIF}
  330. {$IFNDEF CPU68}
  331. {$DEFINE CPU68}
  332. {$ENDIF}
  333. {$ENDIF}
  334. {$IFDEF OS_DOS}
  335. {$DEFINE NO_WINDOW}
  336. {$ENDIF}
  337. {---------------------------------------------------------------------------}
  338. { WIN16 AND WIN32 set if in windows - Updated 16Oct2000 LdB }
  339. {---------------------------------------------------------------------------}
  340. {$IFDEF OS_WINDOWS} { WINDOWS SYSTEM }
  341. {$IFDEF BIT_16}
  342. {$DEFINE WIN16} { 16 BIT WINDOWS }
  343. {$ENDIF}
  344. {$IFDEF BIT_32}
  345. {$DEFINE WIN32} { 32 BIT WINDOWS }
  346. {$ENDIF}
  347. {$ENDIF}
  348. {
  349. $Log$
  350. Revision 1.14 2004-11-06 19:19:31 armin
  351. * added targets netware and netwlibc
  352. Revision 1.13 2004/11/04 20:57:58 peter
  353. sysmsgs is always available
  354. Revision 1.12 2004/11/03 20:33:05 peter
  355. * removed unnecesasry graphfv stuff
  356. Revision 1.11 2004/02/06 20:59:29 jonas
  357. + darwin support
  358. Revision 1.10 2002/09/07 15:06:38 peter
  359. * old logs removed and tabs fixed
  360. Revision 1.9 2002/06/07 14:15:10 pierre
  361. * add window resizing support for unix
  362. Revision 1.8 2002/06/02 08:32:51 marco
  363. * renamefest
  364. Revision 1.7 2002/05/21 12:02:02 pierre
  365. define HASSYSMSGUNIT for go32v2 and win32
  366. }