globtype.pas 6.6 KB

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