globtype.pas 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 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. {$ifdef FPC}
  21. {$ifdef PACKENUMFIXED}
  22. {$PACKENUM 1}
  23. {$endif}
  24. {$endif}
  25. const
  26. maxidlen = 64;
  27. type
  28. { System independent float names }
  29. {$ifdef i386}
  30. bestreal = extended;
  31. ts32real = single;
  32. ts64real = double;
  33. ts80real = extended;
  34. ts64comp = extended;
  35. {$endif}
  36. {$ifdef m68k}
  37. bestreal = real;
  38. ts32real = single;
  39. ts64real = double;
  40. ts80real = extended;
  41. ts64comp = comp;
  42. {$endif}
  43. {$ifdef alpha}
  44. bestreal = extended;
  45. ts32real = single;
  46. ts64real = double;
  47. ts80real = extended;
  48. ts64comp = comp;
  49. {$endif}
  50. {$ifdef powerpc}
  51. bestreal = double;
  52. ts32real = single;
  53. ts64real = double;
  54. ts80real = extended;
  55. ts64comp = comp;
  56. {$endif powerpc}
  57. pbestreal=^bestreal;
  58. { Switches which can be changed locally }
  59. tlocalswitch = (cs_localnone,
  60. { codegen }
  61. cs_check_overflow,cs_check_range,cs_check_object_ext,
  62. cs_check_io,cs_check_stack,
  63. cs_omitstackframe,cs_do_assertion,cs_generate_rtti,
  64. { mmx }
  65. cs_mmx,cs_mmx_saturation,
  66. { parser }
  67. cs_typed_addresses,cs_strict_var_strings,cs_ansistrings
  68. );
  69. tlocalswitches = set of tlocalswitch;
  70. { Switches which can be changed only at the beginning of a new module }
  71. tmoduleswitch = (cs_modulenone,
  72. { parser }
  73. cs_fp_emulation,cs_extsyntax,cs_openstring,
  74. { support }
  75. cs_support_inline,cs_support_goto,cs_support_macro,
  76. cs_support_c_operators,cs_static_keyword,
  77. cs_typed_const_not_changeable,
  78. { generation }
  79. cs_profile,cs_debuginfo,cs_browser,cs_local_browser,cs_compilesystem,
  80. cs_lineinfo,
  81. { linking }
  82. cs_create_smart,cs_create_dynamic
  83. );
  84. tmoduleswitches = set of tmoduleswitch;
  85. { Switches which can be changed only for a whole program/compilation,
  86. mostly set with commandline }
  87. tglobalswitch = (cs_globalnone,
  88. { parameter switches }
  89. cs_check_unit_name,cs_constructor_name,
  90. { units }
  91. cs_load_objpas_unit,
  92. cs_load_gpc_unit,
  93. { optimizer }
  94. cs_regalloc,cs_uncertainopts,cs_littlesize,cs_optimize,
  95. cs_fastoptimize, cs_slowoptimize,cs_align,
  96. { browser }
  97. cs_browser_log,
  98. { debugger }
  99. cs_gdb_dbx,cs_gdb_gsym,cs_gdb_heaptrc,cs_gdb_lineinfo,cs_checkpointer,
  100. { assembling }
  101. cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
  102. cs_asm_regalloc,cs_asm_tempalloc,
  103. { linking }
  104. cs_link_extern,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
  105. cs_link_strip,cs_link_toc,cs_link_staticflag
  106. );
  107. tglobalswitches = set of tglobalswitch;
  108. { Switches which can be changed by a mode (fpc,tp7,delphi) }
  109. tmodeswitch = (m_none,m_all, { needed for keyword }
  110. { generic }
  111. m_fpc,m_objfpc,m_delphi,m_tp,m_tp7,m_gpc,
  112. { more specific }
  113. m_class, { delphi class model }
  114. m_objpas, { load objpas unit }
  115. m_result, { result in functions }
  116. m_string_pchar, { pchar 2 string conversion }
  117. m_cvar_support, { cvar variable directive }
  118. m_nested_comment, { nested comments }
  119. m_tp_procvar, { tp style procvars (no @ needed) }
  120. m_repeat_forward, { repeating forward declarations is needed }
  121. m_pointer_2_procedure, { allows the assignement of pointers to
  122. procedure variables }
  123. m_autoderef, { does auto dereferencing of struct. vars }
  124. m_initfinal, { initialization/finalization for units }
  125. m_add_pointer, { allow pointer add/sub operations }
  126. m_default_ansistring, { ansistring turned on by default }
  127. m_out, { support the calling convention OUT }
  128. m_default_para { support default parameters }
  129. );
  130. tmodeswitches = set of tmodeswitch;
  131. { win32 sub system }
  132. tapptype = (at_none,
  133. at_gui,at_cui
  134. );
  135. { currently parsed block type }
  136. tblock_type = (bt_none,
  137. bt_general,bt_type,bt_const,bt_except
  138. );
  139. { packrecords types }
  140. tpackrecords = (packrecord_none,
  141. packrecord_1,packrecord_2,packrecord_4,
  142. packrecord_8,packrecord_16,packrecord_32,
  143. packrecord_C
  144. );
  145. const
  146. packrecordalignment : array[tpackrecords] of byte=(0,
  147. 1,2,4,8,16,32,1
  148. );
  149. type
  150. stringid = string[maxidlen];
  151. tnormalset = set of byte; { 256 elements set }
  152. pnormalset = ^tnormalset;
  153. pdouble = ^double;
  154. pbyte = ^byte;
  155. pword = ^word;
  156. plongint = ^longint;
  157. {$IFDEF TP}
  158. Tconstant=record
  159. case signed:boolean of
  160. false:
  161. (valueu:longint);
  162. true:
  163. (values:longint);
  164. end;
  165. {$ELSE}
  166. Tconstant=record
  167. case signed:boolean of
  168. false:
  169. (valueu:cardinal);
  170. true:
  171. (values:longint);
  172. end;
  173. {$ENDIF}
  174. const
  175. { link options }
  176. link_none = $0;
  177. link_allways = $1;
  178. link_static = $2;
  179. link_smart = $4;
  180. link_shared = $8;
  181. implementation
  182. begin
  183. end.
  184. {
  185. $Log$
  186. Revision 1.5 2000-08-05 13:25:06 peter
  187. * packenum 1 fixes (merged)
  188. Revision 1.4 2000/08/02 19:49:59 peter
  189. * first things for default parameters
  190. Revision 1.3 2000/07/13 12:08:25 michael
  191. + patched to 1.1.0 with former 1.09patch from peter
  192. Revision 1.2 2000/07/13 11:32:41 michael
  193. + removed logs
  194. }