jedi-sdl.inc 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. {
  2. $Id: jedi-sdl.inc,v 1.15 2007/05/29 21:30:48 savage Exp $
  3. }
  4. {******************************************************************************}
  5. { }
  6. { Borland Delphi SDL - Simple DirectMedia Layer }
  7. { Global Conditional Definitions for JEDI-SDL cross-compilation }
  8. { }
  9. { }
  10. { The initial developer of this Pascal code was : }
  11. { Prof. Abimbola Olowofoyeku <http://www.bigfoot.com/~African_Chief/> }
  12. { }
  13. { Portions created by Prof. Abimbola Olowofoyeku are }
  14. { Copyright (C) 2000 - 2100 Prof. Abimbola Olowofoyeku. }
  15. { }
  16. { }
  17. { Contributor(s) }
  18. { -------------- }
  19. { Prof. Abimbola Olowofoyeku <http://www.bigfoot.com/~African_Chief/> }
  20. { Dominqiue Louis <[email protected]> }
  21. { }
  22. { Obtained through: }
  23. { Joint Endeavour of Delphi Innovators ( Project JEDI ) }
  24. { }
  25. { You may retrieve the latest version of this file at the Project }
  26. { JEDI home page, located at http://delphi-jedi.org }
  27. { }
  28. { The contents of this file are used with permission, subject to }
  29. { the Mozilla Public License Version 1.1 (the "License"); you may }
  30. { not use this file except in compliance with the License. You may }
  31. { obtain a copy of the License at }
  32. { http://www.mozilla.org/MPL/MPL-1.1.html }
  33. { }
  34. { Software distributed under the License is distributed on an }
  35. { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or }
  36. { implied. See the License for the specific language governing }
  37. { rights and limitations under the License. }
  38. { }
  39. { Description }
  40. { ----------- }
  41. { This code has been copied from... }
  42. { Global Conditional Definitions for Chief's UNZIP package }
  43. { By Prof. Abimbola Olowofoyeku (The African Chief) }
  44. { http://www.bigfoot.com/~African_Chief/ }
  45. { }
  46. { }
  47. { Requires }
  48. { -------- }
  49. { The SDL Runtime libraris on Win32 : SDL.dll on Linux : libSDL.so }
  50. { They are available from... }
  51. { http://www.libsdl.org . }
  52. { }
  53. { Programming Notes }
  54. { ----------------- }
  55. { }
  56. { }
  57. { }
  58. { }
  59. { Revision History }
  60. { ---------------- }
  61. { 2003-04-03 DL - Initial addition }
  62. { }
  63. { 2003-04-07 DL - Added Macro ON derective for FPC and OpenGL and removed }
  64. { WEAKPACKAGE derective. WEAKPACKAGE should be set when }
  65. { appropriate. }
  66. { }
  67. { 2003-04-23 - DL : under instruction from Alexey Barkovoy I have added }
  68. { better TMT Pascal support and under instruction }
  69. { from Prof. Abimbola Olowofoyeku (The African Chief) }
  70. { I have added better Gnu Pascal support }
  71. { }
  72. { 2004-01-19 - DL : Under instruction from Marco van de Voort, I have added }
  73. { Better FPC support for FreeBSD. }
  74. { }
  75. (*
  76. $Log: jedi-sdl.inc,v $
  77. Revision 1.15 2007/05/29 21:30:48 savage
  78. Changes as suggested by Almindor for 64bit compatibility.
  79. Revision 1.14 2007/05/20 20:29:11 savage
  80. Initial Changes to Handle 64 Bits
  81. Revision 1.13 2007/01/21 15:51:45 savage
  82. Added Delphi 2006 support
  83. Revision 1.12 2006/11/19 18:41:01 savage
  84. removed THREADING ON flag as it is no longer needed in latest versions of FPC.
  85. Revision 1.11 2006/01/04 00:52:41 drellis
  86. Updated to include defined for ENDIAN values, SDL_BYTEORDER should now be correctly defined depending onthe platform. Code taken from sdl_mixer
  87. Revision 1.10 2005/05/22 18:42:31 savage
  88. Changes as suggested by Michalis Kamburelis. Thanks again.
  89. Revision 1.9 2004/12/23 23:42:17 savage
  90. Applied Patches supplied by Michalis Kamburelis ( THANKS! ), for greater FreePascal compatability.
  91. Revision 1.8 2004/10/20 22:43:04 savage
  92. Ensure that UNSAFE type warning are off in D9 as well
  93. Revision 1.7 2004/04/05 09:59:51 savage
  94. Changes for FreePacal as suggested by Marco
  95. Revision 1.6 2004/03/31 22:18:15 savage
  96. Small comment for turning off warning under GnuPascal
  97. Revision 1.5 2004/03/30 22:41:02 savage
  98. Added extra commenting due to previous compiler directive
  99. Revision 1.4 2004/03/30 22:08:33 savage
  100. Added Kylix Define
  101. Revision 1.3 2004/03/30 21:34:40 savage
  102. {$H+} needed for FPC compatiblity
  103. Revision 1.2 2004/02/14 00:23:39 savage
  104. As UNIX is defined in jedi-sdl.inc this will be used to check linux compatability as well. Units have been changed to reflect this change.
  105. *)
  106. {******************************************************************************}
  107. {.$define Debug} { uncomment for debugging }
  108. {$IFNDEF FPC}
  109. {$IFDEF __GPC__}
  110. {$I-}
  111. {$W-} // turn off GPC warnings
  112. {$X+}
  113. {$ELSE} {__GPC__}
  114. {$IFDEF Debug}
  115. {$F+,D+,Q-,L+,R+,I-,S+,Y+,A+}
  116. {$ELSE}
  117. {$F+,Q-,R-,S-,I-,A+}
  118. {$ENDIF}
  119. {$ENDIF} {__GPC__}
  120. {$ELSE} {FPC}
  121. //{$M+}
  122. {$ENDIF} {FPC}
  123. {$IFDEF LINUX}
  124. {$DEFINE UNIX}
  125. {$ENDIF}
  126. {$IFDEF ver70}
  127. {$IFDEF Windows}
  128. {$DEFINE Win16}
  129. {$ENDIF Windows}
  130. {$IFDEF MSDOS}
  131. {$DEFINE NO_EXPORTS}
  132. {$ENDIF MSDOS}
  133. {$IFDEF DPMI}
  134. {$DEFINE BP_DPMI}
  135. {$ENDIF}
  136. {$DEFINE OS_16_BIT}
  137. {$DEFINE __OS_DOS__}
  138. {$ENDIF ver70}
  139. {$IFDEF ver80}
  140. {$DEFINE Delphi} {Delphi 1.x}
  141. {$DEFINE Delphi16}
  142. {$DEFINE Win16}
  143. {$DEFINE OS_16_BIT}
  144. {$DEFINE __OS_DOS__}
  145. {$ENDIF ver80}
  146. {$IFDEF ver90}
  147. {$DEFINE Delphi} {Delphi 2.x}
  148. {$DEFINE Delphi32}
  149. {$DEFINE WIN32}
  150. {$DEFINE WINDOWS}
  151. {$ENDIF ver90}
  152. {$IFDEF ver100}
  153. {$DEFINE Delphi} {Delphi 3.x}
  154. {$DEFINE Delphi32}
  155. {$DEFINE WIN32}
  156. {$DEFINE WINDOWS}
  157. {$ENDIF ver100}
  158. {$IFDEF ver93}
  159. {$DEFINE Delphi} {C++ Builder 1.x}
  160. {$DEFINE Delphi32}
  161. {$DEFINE WINDOWS}
  162. {$ENDIF ver93}
  163. {$IFDEF ver110}
  164. {$DEFINE Delphi} {C++ Builder 3.x}
  165. {$DEFINE Delphi32}
  166. {$DEFINE WINDOWS}
  167. {$ENDIF ver110}
  168. {$IFDEF ver120}
  169. {$DEFINE Delphi} {Delphi 4.x}
  170. {$DEFINE Delphi32}
  171. {$DEFINE Delphi4UP}
  172. {$DEFINE Has_Int64}
  173. {$DEFINE WINDOWS}
  174. {$ENDIF ver120}
  175. {$IFDEF ver130}
  176. {$DEFINE Delphi} {Delphi 5.x}
  177. {$DEFINE Delphi32}
  178. {$DEFINE Delphi4UP}
  179. {$DEFINE Delphi5UP}
  180. {$DEFINE Has_Int64}
  181. {$DEFINE WINDOWS}
  182. {$ENDIF ver130}
  183. {$IFDEF ver140}
  184. {$DEFINE Delphi} {Delphi 6.x}
  185. {$DEFINE Delphi32}
  186. {$DEFINE Delphi4UP}
  187. {$DEFINE Delphi5UP}
  188. {$DEFINE Delphi6UP}
  189. {$DEFINE Has_Int64}
  190. {$DEFINE HAS_TYPES}
  191. {$ENDIF ver140}
  192. {$IFDEF ver150}
  193. {$DEFINE Delphi} {Delphi 7.x}
  194. {$DEFINE Delphi32}
  195. {$DEFINE Delphi4UP}
  196. {$DEFINE Delphi5UP}
  197. {$DEFINE Delphi6UP}
  198. {$DEFINE Delphi7UP}
  199. {$WARN UNSAFE_TYPE OFF} {Disable warning for unsafe types in Delphi 7}
  200. {$DEFINE Has_Int64}
  201. {$DEFINE HAS_TYPES}
  202. {$ENDIF ver150}
  203. {$IFDEF ver160}
  204. {$DEFINE Delphi} {Delphi 8}
  205. {$DEFINE Delphi32}
  206. {$DEFINE Delphi4UP}
  207. {$DEFINE Delphi5UP}
  208. {$DEFINE Delphi6UP}
  209. {$DEFINE Delphi7UP}
  210. {$DEFINE Delphi8UP}
  211. {$DEFINE Has_Int64}
  212. {$DEFINE HAS_TYPES}
  213. {$ENDIF ver160}
  214. {$IFDEF ver170}
  215. {$DEFINE Delphi} {Delphi 2005}
  216. {$DEFINE Delphi32}
  217. {$DEFINE Delphi4UP}
  218. {$DEFINE Delphi5UP}
  219. {$DEFINE Delphi6UP}
  220. {$DEFINE Delphi7UP}
  221. {$DEFINE Delphi8UP}
  222. {$DEFINE Delphi9UP}
  223. {$WARN UNSAFE_TYPE OFF} {Disable warning for unsafe types in Delphi 7}
  224. {$DEFINE Has_Int64}
  225. {$DEFINE HAS_TYPES}
  226. {$ENDIF ver170}
  227. {$IFDEF ver180}
  228. {$DEFINE Delphi} {Delphi 2006}
  229. {$DEFINE Delphi32}
  230. {$DEFINE Delphi4UP}
  231. {$DEFINE Delphi5UP}
  232. {$DEFINE Delphi6UP}
  233. {$DEFINE Delphi7UP}
  234. {$DEFINE Delphi8UP}
  235. {$DEFINE Delphi9UP}
  236. {$DEFINE Delphi10UP}
  237. {$WARN UNSAFE_TYPE OFF} {Disable warning for unsafe types in Delphi 7}
  238. {$DEFINE Has_Int64}
  239. {$DEFINE HAS_TYPES}
  240. {$ENDIF ver180}
  241. {$IFDEF ver185}
  242. {$DEFINE Delphi} {Delphi 2007}
  243. {$DEFINE Delphi32}
  244. {$DEFINE Delphi4UP}
  245. {$DEFINE Delphi5UP}
  246. {$DEFINE Delphi6UP}
  247. {$DEFINE Delphi7UP}
  248. {$DEFINE Delphi8UP}
  249. {$DEFINE Delphi9UP}
  250. {$DEFINE Delphi10UP}
  251. {$WARN UNSAFE_TYPE OFF} {Disable warning for unsafe types in Delphi 7}
  252. {$DEFINE Has_Int64}
  253. {$DEFINE HAS_TYPES}
  254. {$ENDIF ver180}
  255. {$IFDEF UNIX}
  256. {$ifdef VER140} // Kylix 1 & 2
  257. {$DEFINE KYLIX}
  258. {$DEFINE KYLIX1UP}
  259. {$DEFINE KYLIX2UP}
  260. {$DEFINE HAS_TYPES}
  261. {$endif}
  262. {$ifdef VER150} // Kylix 3
  263. {$DEFINE KYLIX}
  264. {$DEFINE KYLIX1UP}
  265. {$DEFINE KYLIX2UP}
  266. {$DEFINE KYLIX3UP}
  267. {$DEFINE HAS_TYPES}
  268. {$endif}
  269. {$ENDIF UNIX}
  270. {$IFDEF VirtualPascal} { Virtual Pascal 2.x }
  271. {$DEFINE Delphi} { Use Delphi Syntax }
  272. {$DEFINE VP2}
  273. {&Delphi+}
  274. {$ENDIF VirtualPascal}
  275. {$IFDEF Delphi}
  276. {$DEFINE Windows}
  277. {$DEFINE USE_STDCALL}
  278. //{$ALIGN ON}
  279. {$ENDIF Delphi}
  280. {$IFDEF FPC}
  281. {$MODE Delphi} { use Delphi compatibility mode }
  282. {$H+}
  283. {$PACKRECORDS C} // Added for record
  284. {$MACRO ON} // Added For OpenGL
  285. {$DEFINE Delphi}
  286. {$DEFINE UseAT}
  287. {$UNDEF USE_STDCALL}
  288. {$DEFINE OS_BigMem}
  289. {$DEFINE NO_EXPORTS}
  290. {$DEFINE Has_Int64}
  291. {$DEFINE NOCRT}
  292. {$IFDEF UNIX}
  293. {$DEFINE fpc_unix}
  294. {$ELSE}
  295. {$DEFINE __OS_DOS__}
  296. {$ENDIF}
  297. {$IFDEF WIN32}
  298. {$DEFINE UseWin}
  299. {$ENDIF}
  300. {$DEFINE HAS_TYPES}
  301. {$ENDIF FPC}
  302. {$IFDEF Win16}
  303. {$K+} {smart callbacks}
  304. {$ENDIF Win16}
  305. {$IFDEF OS2}
  306. {$UNDEF Windows}
  307. {$DEFINE UseWin}
  308. {$DEFINE OS_BigMem}
  309. {$ENDIF OS2}
  310. {$IFDEF __GPC__}
  311. {$UNDEF UseWin}
  312. {$UNDEF USE_STDCALL}
  313. {$DEFINE OS_BigMem}
  314. {$DEFINE NO_EXPORTS}
  315. {$DEFINE NOCRT}
  316. {$DEFINE cdecl attribute(cdecl)}
  317. {$ENDIF}
  318. {$IFDEF __TMT__}
  319. {$DEFINE OS_BigMem}
  320. {$DEFINE NO_EXPORTS}
  321. {$DEFINE __OS_DOS__}
  322. {$DEFINE UseAT}
  323. {$IFNDEF MSDOS}
  324. {$DEFINE USE_STDCALL}
  325. {$ENDIF}
  326. {$IFDEF __WIN32__}
  327. {$DEFINE Win32}
  328. {$DEFINE UseWin}
  329. {$DEFINE NOCRT}
  330. {$DEFINE Win32}
  331. {$IFNDEF __CON__}
  332. {$DEFINE Windows}
  333. {$ENDIF}
  334. {$ENDIF}
  335. {$A+} // Word alignment data
  336. {$OA+} // Objects and structures align
  337. {$ENDIF}
  338. {$IFDEF Win32}
  339. {$DEFINE OS_BigMem}
  340. {$ELSE Win32}
  341. {$IFDEF ver70}
  342. {$DEFINE assembler}
  343. {$ENDIF} { use 16-bit assembler! }
  344. {$ENDIF Win32}
  345. { ************************** dos/dos-like platforms **************}
  346. {$IFDEF Windows}
  347. {$DEFINE __OS_DOS__}
  348. {$DEFINE UseWin}
  349. {$DEFINE MSWINDOWS}
  350. {$ENDIF Delphi}
  351. {$IFDEF OS2}
  352. {$DEFINE __OS_DOS__}
  353. {$DEFINE Can_Use_DLL}
  354. {$ENDIF Delphi}
  355. {$IFDEF UseWin}
  356. {$DEFINE Can_Use_DLL}
  357. {$ENDIF}
  358. {$IFDEF Win16}
  359. {$DEFINE Can_Use_DLL}
  360. {$ENDIF}
  361. {$IFDEF BP_DPMI}
  362. {$DEFINE Can_Use_DLL}
  363. {$ENDIF}
  364. {$IFDEF USE_STDCALL}
  365. {$IFNDEF __TMT__}
  366. {$DEFINE BY_NAME}
  367. {$ENDIF}
  368. {$ENDIF}
  369. {$IFNDEF ver70}
  370. {$UNDEF assembler}
  371. {$ENDIF}
  372. {*************** define LITTLE ENDIAN platforms ********************}
  373. {$IFDEF Delphi}
  374. {$DEFINE IA32}
  375. {$ENDIF}
  376. {$IFDEF KYLIX}
  377. {$DEFINE IA32}
  378. {$ENDIF}
  379. {$IFDEF FPC}
  380. {$IFDEF FPC_LITTLE_ENDIAN}
  381. {$DEFINE IA32}
  382. {$ENDIF}
  383. {$ENDIF}