globtype.pas 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl, Pierre Muller
  4. Global types
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit globtype;
  19. interface
  20. const
  21. maxidlen = 64;
  22. type
  23. { Compiler dependent types }
  24. {$ifdef TP}
  25. TSearchPathString = string;
  26. {$endif}
  27. {$ifdef FPC}
  28. TSearchPathString = ansistring;
  29. {$endif}
  30. {$ifdef Delphi}
  31. TSearchPathString = ansistring;
  32. {$endif}
  33. type
  34. { System independent float names }
  35. {$ifdef i386}
  36. bestreal = extended;
  37. ts32real = single;
  38. ts64real = double;
  39. ts80real = extended;
  40. ts64comp = extended;
  41. {$endif}
  42. {$ifdef m68k}
  43. bestreal = real;
  44. ts32real = single;
  45. ts64real = double;
  46. ts80real = extended;
  47. ts64comp = comp;
  48. {$endif}
  49. {$ifdef alpha}
  50. bestreal = extended;
  51. ts32real = single;
  52. ts64real = double;
  53. ts80real = extended;
  54. ts64comp = comp;
  55. {$endif}
  56. {$ifdef powerpc}
  57. bestreal = double;
  58. ts32real = single;
  59. ts64real = double;
  60. ts80real = extended;
  61. ts64comp = comp;
  62. {$endif powerpc}
  63. pbestreal=^bestreal;
  64. { Switches which can be changed locally }
  65. tlocalswitch = (cs_localnone,
  66. { codegen }
  67. cs_check_overflow,cs_check_range,cs_check_io,cs_check_stack,
  68. cs_omitstackframe,cs_do_assertion,cs_generate_rtti,
  69. { mmx }
  70. cs_mmx,cs_mmx_saturation,
  71. { parser }
  72. cs_typed_addresses,cs_strict_var_strings,cs_ansistrings
  73. );
  74. tlocalswitches = set of tlocalswitch;
  75. { Switches which can be changed only at the beginning of a new module }
  76. tmoduleswitch = (cs_modulenone,
  77. { parser }
  78. cs_fp_emulation,cs_extsyntax,cs_openstring,
  79. { support }
  80. cs_support_inline,cs_support_goto,cs_support_macro,
  81. cs_support_c_operators,cs_static_keyword,
  82. cs_typed_const_not_changeable,
  83. { generation }
  84. cs_profile,cs_debuginfo,cs_browser,cs_local_browser,cs_compilesystem,
  85. cs_lineinfo,
  86. { linking }
  87. cs_create_smart,cs_create_dynamic
  88. );
  89. tmoduleswitches = set of tmoduleswitch;
  90. { Switches which can be changed only for a whole program/compilation,
  91. mostly set with commandline }
  92. tglobalswitch = (cs_globalnone,
  93. { parameter switches }
  94. cs_check_unit_name,cs_constructor_name,
  95. { units }
  96. cs_load_objpas_unit,
  97. cs_load_gpc_unit,
  98. { optimizer }
  99. cs_regalloc,cs_uncertainopts,cs_littlesize,cs_optimize,
  100. cs_fastoptimize, cs_slowoptimize,
  101. { browser }
  102. cs_browser_log,
  103. { debugger }
  104. cs_gdb_dbx,cs_gdb_gsym,cs_gdb_heaptrc,cs_checkpointer,
  105. { assembling }
  106. cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
  107. cs_asm_regalloc,cs_asm_tempalloc,
  108. { linking }
  109. cs_link_extern,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
  110. cs_link_strip,cs_link_toc
  111. );
  112. tglobalswitches = set of tglobalswitch;
  113. { Switches which can be changed by a mode (fpc,tp7,delphi) }
  114. tmodeswitch = (m_none,m_all, { needed for keyword }
  115. { generic }
  116. m_fpc,m_delphi,m_tp,m_gpc,
  117. { more specific }
  118. m_class, { delphi class model }
  119. m_objpas, { load objpas unit }
  120. m_result, { result in functions }
  121. m_string_pchar, { pchar 2 string conversion }
  122. m_cvar_support, { cvar variable directive }
  123. m_nested_comment, { nested comments }
  124. m_tp_procvar, { tp style procvars (no @ needed) }
  125. m_repeat_forward, { repeating forward declarations is needed }
  126. m_pointer_2_procedure, { allows the assignement of pointers to
  127. procedure variables }
  128. m_autoderef, { does auto dereferencing of struct. vars }
  129. m_initfinal, { initialization/finalization for units }
  130. m_add_pointer { allow pointer add/sub operations }
  131. );
  132. tmodeswitches = set of tmodeswitch;
  133. { win32 sub system }
  134. tapptype = (at_none,
  135. at_gui,at_cui
  136. );
  137. { currently parsed block type }
  138. tblock_type = (bt_none,
  139. bt_general,bt_type,bt_const,bt_except
  140. );
  141. { packrecords types }
  142. tpackrecords = (packrecord_none,
  143. packrecord_1,packrecord_2,packrecord_4,
  144. packrecord_8,packrecord_16,packrecord_32,
  145. packrecord_C
  146. );
  147. const
  148. packrecordalignment : array[tpackrecords] of byte=(0,
  149. 1,2,4,8,16,32,1
  150. );
  151. type
  152. stringid = string[maxidlen];
  153. tnormalset = set of byte; { 256 elements set }
  154. pnormalset = ^tnormalset;
  155. pdouble = ^double;
  156. pbyte = ^byte;
  157. pword = ^word;
  158. plongint = ^longint;
  159. const
  160. { link options }
  161. link_none = $0;
  162. link_allways = $1;
  163. link_static = $2;
  164. link_smart = $4;
  165. link_shared = $8;
  166. implementation
  167. begin
  168. end.
  169. {
  170. $Log$
  171. Revision 1.22 1999-11-06 14:34:21 peter
  172. * truncated log to 20 revs
  173. Revision 1.21 1999/11/04 10:55:31 peter
  174. * TSearchPathString for the string type of the searchpaths, which is
  175. ansistring under FPC/Delphi
  176. Revision 1.20 1999/10/22 10:39:34 peter
  177. * split type reading from pdecl to ptype unit
  178. * parameter_dec routine is now used for procedure and procvars
  179. Revision 1.19 1999/09/20 16:38:54 peter
  180. * cs_create_smart instead of cs_smartlink
  181. * -CX is create smartlink
  182. * -CD is create dynamic, but does nothing atm.
  183. Revision 1.18 1999/09/08 16:05:32 peter
  184. * pointer add/sub is now as expected and the same results as inc/dec
  185. Revision 1.17 1999/08/13 15:44:58 peter
  186. * first things to include lineinfo in the executable
  187. Revision 1.16 1999/08/11 17:26:33 peter
  188. * tlinker object is now inherited for win32 and dos
  189. * postprocessexecutable is now a method of tlinker
  190. Revision 1.15 1999/08/04 13:02:42 jonas
  191. * all tokens now start with an underscore
  192. * PowerPC compiles!!
  193. Revision 1.14 1999/08/01 23:04:48 michael
  194. + Changes for Alpha
  195. Revision 1.13 1999/07/23 16:05:21 peter
  196. * alignment is now saved in the symtable
  197. * C alignment added for records
  198. * PPU version increased to solve .12 <-> .13 probs
  199. Revision 1.12 1999/07/10 10:26:19 peter
  200. * merged
  201. Revision 1.11 1999/07/03 00:29:49 peter
  202. * new link writing to the ppu, one .ppu is needed for all link types,
  203. static (.o) is now always created also when smartlinking is used
  204. Revision 1.10.2.1 1999/07/10 10:03:06 peter
  205. * fixed initialization/finalization in fpc mode
  206. * allow $TARGET also in search paths
  207. Revision 1.10 1999/05/17 14:30:39 pierre
  208. + cs_checkpointer
  209. Revision 1.9 1999/05/12 00:19:49 peter
  210. * removed R_DEFAULT_SEG
  211. * uniform float names
  212. Revision 1.8 1999/04/26 13:31:33 peter
  213. * release storenumber,double_checksum
  214. Revision 1.7 1999/04/25 22:34:58 pierre
  215. + cs_typed_const_not_changeable added but not implemented yet !
  216. Revision 1.6 1999/04/16 11:49:42 peter
  217. + tempalloc
  218. + -at to show temp alloc info in .s file
  219. Revision 1.5 1999/04/10 16:15:01 peter
  220. * fixed browcol
  221. + -ar to show regalloc info in .s file
  222. Revision 1.4 1999/03/26 00:05:30 peter
  223. * released valintern
  224. + deffile is now removed when compiling is finished
  225. * ^( compiles now correct
  226. + static directive
  227. * shrd fixed
  228. Revision 1.3 1999/01/27 13:51:44 pierre
  229. * dos end of line problem
  230. }