2
0

globtype.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
  3. Global types
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit globtype;
  18. {$i fpcdefs.inc}
  19. interface
  20. const
  21. maxidlen = 127;
  22. type
  23. { TCmdStr is used to pass command line parameters to an external program to be
  24. executed from the FPC application. In some circomstances, this can be more
  25. than 255 characters. That's why using Ansi Strings}
  26. TCmdStr = AnsiString;
  27. TPathStr = AnsiString;
  28. {$ifdef symansistr}
  29. TSymStr = AnsiString;
  30. {$else symansistr}
  31. TSymStr = ShortString;
  32. {$endif symansistr}
  33. PSymStr = ^TSymStr;
  34. { Integer type corresponding to pointer size }
  35. {$ifdef cpu64bitaddr}
  36. PUint = qword;
  37. PInt = int64;
  38. {$endif cpu64bitaddr}
  39. {$ifdef cpu32bitaddr}
  40. PUint = cardinal;
  41. PInt = longint;
  42. {$endif cpu32bitaddr}
  43. {$ifdef cpu16bitaddr}
  44. PUint = word;
  45. PInt = Smallint;
  46. {$endif cpu16bitaddr}
  47. { Natural integer register type and size for the target machine }
  48. {$ifdef cpu64bitalu}
  49. AWord = qword;
  50. AInt = Int64;
  51. Const
  52. AIntBits = 64;
  53. {$endif cpu64bitalu}
  54. {$ifdef cpu32bitalu}
  55. AWord = longword;
  56. AInt = longint;
  57. Const
  58. AIntBits = 32;
  59. {$endif cpu32bitalu}
  60. {$ifdef cpu16bitalu}
  61. AWord = Word;
  62. AInt = Smallint;
  63. Const
  64. AIntBits = 16;
  65. {$endif cpu16bitalu}
  66. {$ifdef cpu8bitalu}
  67. AWord = Byte;
  68. AInt = Shortint;
  69. Const
  70. AIntBits = 8;
  71. {$endif cpu8bitalu}
  72. Type
  73. PAWord = ^AWord;
  74. PAInt = ^AInt;
  75. { target cpu specific type used to store data sizes }
  76. ASizeInt = PInt;
  77. ASizeUInt = PUInt;
  78. { type used for handling constants etc. in the code generator }
  79. TCGInt = Int64;
  80. { This must be an ordinal type with the same size as a pointer
  81. Note: Must be unsigned! Otherwise, ugly code like
  82. pointer(-1) will result in a pointer with the value
  83. $fffffffffffffff on a 32bit machine if the compiler uses
  84. int64 constants internally (JM) }
  85. TConstPtrUInt = AWord;
  86. { Use a variant record to be sure that the array if aligned correctly }
  87. tdoublerec=record
  88. case byte of
  89. 0 : (bytes:array[0..7] of byte);
  90. 1 : (value:double);
  91. end;
  92. textendedrec=record
  93. case byte of
  94. 0 : (bytes:array[0..9] of byte);
  95. 1 : (value:extended);
  96. end;
  97. pconstset = ^tconstset;
  98. tconstset = set of 0..255;
  99. { Switches which can be changed locally }
  100. tlocalswitch = (cs_localnone,
  101. { codegen }
  102. cs_check_overflow,cs_check_range,cs_check_object,
  103. cs_check_io,cs_check_stack,
  104. cs_checkpointer,cs_check_ordinal_size,
  105. cs_generate_stackframes,cs_do_assertion,cs_generate_rtti,
  106. cs_full_boolean_eval,cs_typed_const_writable,cs_allow_enum_calc,
  107. cs_do_inline,cs_fpu_fwait,cs_ieee_errors,
  108. cs_check_low_addr_load,
  109. { mmx }
  110. cs_mmx,cs_mmx_saturation,
  111. { parser }
  112. cs_typed_addresses,cs_strict_var_strings,cs_refcountedstrings,
  113. cs_bitpacking,cs_varpropsetter,cs_scopedenums,cs_pointermath,
  114. { macpas specific}
  115. cs_external_var, cs_externally_visible,
  116. { jvm specific }
  117. cs_check_var_copyout
  118. );
  119. tlocalswitches = set of tlocalswitch;
  120. { Switches which can be changed only at the beginning of a new module }
  121. tmoduleswitch = (cs_modulenone,
  122. { parser }
  123. cs_fp_emulation,cs_extsyntax,cs_openstring,
  124. { support }
  125. cs_support_goto,cs_support_macro,
  126. cs_support_c_operators,
  127. { generation }
  128. cs_profile,cs_debuginfo,cs_compilesystem,
  129. cs_lineinfo,cs_implicit_exceptions,cs_explicit_codepage,
  130. { linking }
  131. cs_create_smart,cs_create_dynamic,cs_create_pic,
  132. { browser switches are back }
  133. cs_browser,cs_local_browser,
  134. { target specific }
  135. cs_executable_stack
  136. );
  137. tmoduleswitches = set of tmoduleswitch;
  138. { Switches which can be changed only for a whole program/compilation,
  139. mostly set with commandline }
  140. tglobalswitch = (cs_globalnone,
  141. { parameter switches }
  142. cs_check_unit_name,cs_constructor_name,cs_support_exceptions,
  143. cs_support_c_objectivepas,
  144. { units }
  145. cs_load_objpas_unit,
  146. cs_load_gpc_unit,
  147. cs_load_fpcylix_unit,
  148. cs_support_vectors,
  149. { debuginfo }
  150. cs_use_heaptrc,cs_use_lineinfo,
  151. cs_gdb_valgrind,cs_no_regalloc,cs_stabs_preservecase,
  152. { assembling }
  153. cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
  154. cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes,
  155. { linking }
  156. cs_link_nolink,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
  157. cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_extern,cs_link_opt_vtable,
  158. cs_link_opt_used_sections,cs_link_separate_dbg_file,
  159. cs_link_map,cs_link_pthread,cs_link_no_default_lib_order,
  160. cs_link_native
  161. );
  162. tglobalswitches = set of tglobalswitch;
  163. { global switches specific to debug information }
  164. tdebugswitch = (ds_none,
  165. { enable set support in dwarf debug info, breaks gdb versions }
  166. { without support for that tag (they refuse to parse the rest }
  167. { of the debug information) }
  168. ds_dwarf_sets,
  169. { use absolute paths for include files in stabs. Pro: gdb }
  170. { always knows full path to file. Con: doesn't work anymore }
  171. { if the include file is moved (otherwise, things still work }
  172. { if your source hierarchy is the same, but has a different }
  173. { base path) }
  174. ds_stabs_abs_include_files,
  175. { prefix method names by "classname__" in DWARF (like is done }
  176. { for Stabs); not enabled by default, because otherwise once }
  177. { support for calling methods has been added to gdb, you'd }
  178. { always have to type classinstance.classname__methodname() }
  179. ds_dwarf_method_class_prefix
  180. );
  181. tdebugswitches = set of tdebugswitch;
  182. { global target-specific switches }
  183. ttargetswitch = (ts_none,
  184. { generate code that results in smaller TOCs than normal (AIX) }
  185. ts_small_toc,
  186. { for the JVM target: generate integer array initializations via string
  187. constants in order to reduce the generated code size (Java routines
  188. are limited to 64kb of bytecode) }
  189. ts_compact_int_array_init,
  190. { for the JVM target: intialize enum fields in constructors with the
  191. enum class instance corresponding to ordinal value 0 (not done by
  192. default because this initialization can only be performed after the
  193. inherited constructors have run, and if they call a virtual method
  194. of the current class, then this virtual method may already have
  195. initialized that field with another value and the constructor
  196. initialization will result in data loss }
  197. ts_jvm_enum_field_init
  198. );
  199. ttargetswitches = set of ttargetswitch;
  200. { adding a new entry here requires also adding the appropriate define in
  201. systemh.inc (FK)
  202. }
  203. tfeature = (
  204. f_heap,f_init_final,f_rtti,f_classes,f_exceptions,f_exitcode,
  205. f_ansistrings,f_widestrings,f_textio,f_consoleio,f_fileio,
  206. f_random,f_variants,f_objects,f_dynarrays,f_threading,f_commandargs,
  207. f_processes,f_stackcheck,f_dynlibs,f_softfpu,f_objectivec1,f_resources
  208. );
  209. tfeatures = set of tfeature;
  210. type
  211. { optimizer }
  212. toptimizerswitch = (cs_opt_none,
  213. cs_opt_level1,cs_opt_level2,cs_opt_level3,
  214. cs_opt_regvar,cs_opt_uncertain,cs_opt_size,cs_opt_stackframe,
  215. cs_opt_peephole,cs_opt_asmcse,cs_opt_loopunroll,cs_opt_tailrecursion,cs_opt_nodecse,
  216. cs_opt_nodedfa,cs_opt_loopstrength,cs_opt_scheduler,cs_opt_autoinline,cs_useebp,
  217. cs_opt_reorder_fields,cs_opt_fastmath,
  218. { Allow removing expressions whose result is not used, even when this
  219. can change program behaviour (range check errors disappear,
  220. access violations due to invalid pointer derefences disappear, ...).
  221. Note: it does not (and must not) remove expressions that have
  222. explicit side-effects, only implicit side-effects (like the ones
  223. mentioned before) can disappear.
  224. }
  225. cs_opt_dead_values
  226. );
  227. toptimizerswitches = set of toptimizerswitch;
  228. { whole program optimizer }
  229. twpoptimizerswitch = (
  230. cs_wpo_devirtualize_calls,cs_wpo_optimize_vmts,
  231. cs_wpo_symbol_liveness
  232. );
  233. twpoptimizerswitches = set of twpoptimizerswitch;
  234. type
  235. { Used by ARM / AVR to differentiate between specific microcontrollers }
  236. tcontrollerdatatype = record
  237. controllertypestr, controllerunitstr: string[20];
  238. interruptvectors:integer;
  239. flashbase, flashsize, srambase, sramsize, eeprombase, eepromsize: dword;
  240. end;
  241. const
  242. OptimizerSwitchStr : array[toptimizerswitch] of string[11] = ('',
  243. 'LEVEL1','LEVEL2','LEVEL3',
  244. 'REGVAR','UNCERTAIN','SIZE','STACKFRAME',
  245. 'PEEPHOLE','ASMCSE','LOOPUNROLL','TAILREC','CSE',
  246. 'DFA','STRENGTH','SCHEDULE','AUTOINLINE','USEEBP',
  247. 'ORDERFIELDS','FASTMATH','DEADVALUES'
  248. );
  249. WPOptimizerSwitchStr : array [twpoptimizerswitch] of string[14] = (
  250. 'DEVIRTCALLS','OPTVMTS','SYMBOLLIVENESS'
  251. );
  252. DebugSwitchStr : array[tdebugswitch] of string[22] = ('',
  253. 'DWARFSETS','STABSABSINCLUDES','DWARFMETHODCLASSPREFIX');
  254. TargetSwitchStr : array[ttargetswitch] of string[19] = ('',
  255. 'SMALLTOC',
  256. 'COMPACTINTARRAYINIT',
  257. 'ENUMFIELDINIT');
  258. { switches being applied to all CPUs at the given level }
  259. genericlevel1optimizerswitches = [cs_opt_level1];
  260. genericlevel2optimizerswitches = [cs_opt_level2];
  261. genericlevel3optimizerswitches = [cs_opt_level3];
  262. genericlevel4optimizerswitches = [cs_opt_reorder_fields,cs_opt_dead_values,cs_opt_fastmath];
  263. { whole program optimizations whose information generation requires
  264. information from all loaded units
  265. }
  266. WPOptimizationsNeedingAllUnitInfo = [cs_wpo_devirtualize_calls,cs_wpo_optimize_vmts];
  267. featurestr : array[tfeature] of string[12] = (
  268. 'HEAP','INITFINAL','RTTI','CLASSES','EXCEPTIONS','EXITCODE',
  269. 'ANSISTRINGS','WIDESTRINGS','TEXTIO','CONSOLEIO','FILEIO',
  270. 'RANDOM','VARIANTS','OBJECTS','DYNARRAYS','THREADING','COMMANDARGS',
  271. 'PROCESSES','STACKCHECK','DYNLIBS','SOFTFPU','OBJECTIVEC1','RESOURCES'
  272. );
  273. type
  274. { Switches which can be changed by a mode (fpc,tp7,delphi) }
  275. tmodeswitch = (m_none,
  276. { generic }
  277. m_fpc,m_objfpc,m_delphi,m_tp7,m_mac,m_iso,
  278. {$ifdef fpc_mode}m_gpc,{$endif}
  279. { more specific }
  280. m_class, { delphi class model }
  281. m_objpas, { load objpas unit }
  282. m_result, { result in functions }
  283. m_string_pchar, { pchar 2 string conversion }
  284. m_cvar_support, { cvar variable directive }
  285. m_nested_comment, { nested comments }
  286. m_tp_procvar, { tp style procvars (no @ needed) }
  287. m_mac_procvar, { macpas style procvars }
  288. m_repeat_forward, { repeating forward declarations is needed }
  289. m_pointer_2_procedure, { allows the assignement of pointers to
  290. procedure variables }
  291. m_autoderef, { does auto dereferencing of struct. vars }
  292. m_initfinal, { initialization/finalization for units }
  293. m_default_ansistring, { ansistring turned on by default }
  294. m_out, { support the calling convention OUT }
  295. m_default_para, { support default parameters }
  296. m_hintdirective, { support hint directives }
  297. m_duplicate_names, { allow locals/paras to have duplicate names of globals }
  298. m_property, { allow properties }
  299. m_default_inline, { allow inline proc directive }
  300. m_except, { allow exception-related keywords }
  301. m_objectivec1, { support interfacing with Objective-C (1.0) }
  302. m_objectivec2, { support interfacing with Objective-C (2.0) }
  303. m_nested_procvars, { support nested procedural variables }
  304. m_non_local_goto, { support non local gotos (like iso pascal) }
  305. m_advanced_records, { advanced record syntax with visibility sections, methods and properties }
  306. m_isolike_unary_minus, { unary minus like in iso pascal: same precedence level as binary minus/plus }
  307. m_systemcodepage, { use system codepage as compiler codepage by default, emit ansistrings with system codepage }
  308. m_final_fields, { allows declaring fields as "final", which means they must be initialised
  309. in the (class) constructor and are constant from then on (same as final
  310. fields in Java) }
  311. m_default_unicodestring { makes the default string type in $h+ mode unicodestring rather than
  312. ansistring; similarly, char becomes unicodechar rather than ansichar }
  313. );
  314. tmodeswitches = set of tmodeswitch;
  315. const
  316. alllanguagemodes = [m_fpc,m_objfpc,m_delphi,m_tp7,m_mac,m_iso];
  317. type
  318. { Win32, OS/2 & MacOS application types }
  319. tapptype = (
  320. app_none,
  321. app_native,
  322. app_gui, { graphic user-interface application}
  323. app_cui, { console application}
  324. app_fs, { full-screen type application (OS/2 and EMX only) }
  325. app_tool, { tool application, (MPW tool for MacOS, MacOS only)}
  326. app_arm7,
  327. app_arm9,
  328. app_bundle { dynamically loadable bundle, Darwin only }
  329. );
  330. { interface types }
  331. tinterfacetypes = (
  332. it_interfacecom,
  333. it_interfacecorba,
  334. it_interfacejava
  335. );
  336. { currently parsed block type }
  337. tblock_type = (
  338. bt_none, { not assigned }
  339. bt_general, { default }
  340. bt_type, { type section }
  341. bt_const, { const section }
  342. bt_const_type, { const part of type. e.g.: ": Integer = 1" }
  343. bt_var, { variable declaration }
  344. bt_var_type, { type of variable }
  345. bt_except, { except section }
  346. bt_body { procedure body }
  347. );
  348. { Temp types }
  349. ttemptype = (tt_none,
  350. { free temp location, can be reused for something else }
  351. tt_free,
  352. { temp location that will be freed when ttgobj.UnGetTemp/
  353. ttgobj.UnGetIfTemp is called on it }
  354. tt_normal,
  355. { temp location that will not be freed; if it has to be
  356. freed, first ttgobj.changetemptype() it to tt_normal,
  357. or call ttgobj.UnGetLocal() instead (for local variables,
  358. since they are also persistent temps) }
  359. tt_persistent,
  360. { temp location that can never be reused anymore, even
  361. after it has been freed }
  362. tt_noreuse,
  363. { freed version of the above }
  364. tt_freenoreuse,
  365. { temp location that has been allocated by the register
  366. allocator and that can be reallocated only by the
  367. register allocator }
  368. tt_regallocator,
  369. { freed version of the above }
  370. tt_freeregallocator);
  371. ttemptypeset = set of ttemptype;
  372. { calling convention for tprocdef and tprocvardef }
  373. tproccalloption=(pocall_none,
  374. { procedure uses C styled calling }
  375. pocall_cdecl,
  376. { C++ calling conventions }
  377. pocall_cppdecl,
  378. { Far16 for OS/2 }
  379. pocall_far16,
  380. { Old style FPC default calling }
  381. pocall_oldfpccall,
  382. { Procedure has compiler magic}
  383. pocall_internproc,
  384. { procedure is a system call, applies e.g. to MorphOS and PalmOS }
  385. pocall_syscall,
  386. { pascal standard left to right }
  387. pocall_pascal,
  388. { procedure uses register (fastcall) calling }
  389. pocall_register,
  390. { safe call calling conventions }
  391. pocall_safecall,
  392. { procedure uses stdcall call }
  393. pocall_stdcall,
  394. { Special calling convention for cpus without a floating point
  395. unit. Floating point numbers are passed in integer registers
  396. instead of floating point registers. Depending on the other
  397. available calling conventions available for the cpu
  398. this replaces either pocall_fastcall or pocall_stdcall.
  399. }
  400. pocall_softfloat,
  401. { Metrowerks Pascal. Special case on Mac OS (X): passes all }
  402. { constant records by reference. }
  403. pocall_mwpascal,
  404. { Special interrupt handler for embedded systems }
  405. pocall_interrupt
  406. );
  407. tproccalloptions = set of tproccalloption;
  408. const
  409. proccalloptionStr : array[tproccalloption] of string[14]=('',
  410. 'CDecl',
  411. 'CPPDecl',
  412. 'Far16',
  413. 'OldFPCCall',
  414. 'InternProc',
  415. 'SysCall',
  416. 'Pascal',
  417. 'Register',
  418. 'SafeCall',
  419. 'StdCall',
  420. 'SoftFloat',
  421. 'MWPascal',
  422. 'Interrupt'
  423. );
  424. { Default calling convention }
  425. {$ifdef x86}
  426. pocall_default = pocall_register;
  427. {$else}
  428. pocall_default = pocall_stdcall;
  429. {$endif}
  430. cstylearrayofconst = [pocall_cdecl,pocall_cppdecl,pocall_mwpascal];
  431. modeswitchstr : array[tmodeswitch] of string[18] = ('',
  432. '','','','','','',
  433. {$ifdef fpc_mode}'',{$endif}
  434. { more specific }
  435. 'CLASS',
  436. 'OBJPAS',
  437. 'RESULT',
  438. 'PCHARTOSTRING',
  439. 'CVAR',
  440. 'NESTEDCOMMENTS',
  441. 'CLASSICPROCVARS',
  442. 'MACPROCVARS',
  443. 'REPEATFORWARD',
  444. 'POINTERTOPROCVAR',
  445. 'AUTODEREF',
  446. 'INITFINAL',
  447. 'ANSISTRINGS',
  448. 'OUT',
  449. 'DEFAULTPARAMETERS',
  450. 'HINTDIRECTIVE',
  451. 'DUPLICATELOCALS',
  452. 'PROPERTIES',
  453. 'ALLOWINLINE',
  454. 'EXCEPTIONS',
  455. 'OBJECTIVEC1',
  456. 'OBJECTIVEC2',
  457. 'NESTEDPROCVARS',
  458. 'NONLOCALGOTO',
  459. 'ADVANCEDRECORDS',
  460. 'ISOUNARYMINUS',
  461. 'SYSTEMCODEPAGE',
  462. 'FINALFIELDS',
  463. 'UNICODESTRINGS');
  464. type
  465. tprocinfoflag=(
  466. { procedure has at least one assembler block }
  467. pi_has_assembler_block,
  468. { procedure does a call }
  469. pi_do_call,
  470. { procedure has a try statement = no register optimization }
  471. pi_uses_exceptions,
  472. { procedure is declared as @var(assembler), don't optimize}
  473. pi_is_assembler,
  474. { procedure contains data which needs to be finalized }
  475. pi_needs_implicit_finally,
  476. { procedure has the implicit try..finally generated }
  477. pi_has_implicit_finally,
  478. { procedure uses fpu}
  479. pi_uses_fpu,
  480. { procedure uses GOT for PIC code }
  481. pi_needs_got,
  482. { references var/proc/type/const in static symtable,
  483. i.e. not allowed for inlining from other units }
  484. pi_uses_static_symtable,
  485. { set if the procedure has to push parameters onto the stack }
  486. pi_has_stackparameter,
  487. { set if the procedure has at least one label }
  488. pi_has_label,
  489. { calls itself recursive }
  490. pi_is_recursive,
  491. { stack frame optimization not possible (only on x86 probably) }
  492. pi_needs_stackframe,
  493. { set if the procedure has at least one register saved on the stack }
  494. pi_has_saved_regs,
  495. { dfa was generated for this proc }
  496. pi_dfaavailable,
  497. { subroutine contains interprocedural used labels }
  498. pi_has_interproclabel,
  499. { subroutine has unwind info (win64) }
  500. pi_has_unwind_info,
  501. { subroutine contains interprocedural gotos }
  502. pi_has_global_goto,
  503. { subroutine contains inherited call }
  504. pi_has_inherited
  505. );
  506. tprocinfoflags=set of tprocinfoflag;
  507. type
  508. { float types -- warning, this enum/order is used internally by the RTL
  509. as well in rtl/inc/real2str.inc }
  510. tfloattype = (
  511. s32real,s64real,s80real,sc80real { the C "long double" type on x86 },
  512. s64comp,s64currency,s128real
  513. );
  514. type
  515. { register allocator live range extension direction }
  516. TRADirection = (rad_forward, rad_backwards, rad_backwards_reinit);
  517. type
  518. TIDString = string[maxidlen];
  519. tnormalset = set of byte; { 256 elements set }
  520. pnormalset = ^tnormalset;
  521. pboolean = ^boolean;
  522. pdouble = ^double;
  523. pbyte = ^byte;
  524. pword = ^word;
  525. plongint = ^longint;
  526. plongintarray = plongint;
  527. pfileposinfo = ^tfileposinfo;
  528. tfileposinfo = record
  529. { if types of column or fileindex are changed, modify tcompilerppufile.putposinfo }
  530. line : longint;
  531. column : word;
  532. fileindex : word;
  533. moduleindex : word;
  534. end;
  535. {$ifndef xFPC}
  536. type
  537. pguid = ^tguid;
  538. tguid = packed record
  539. D1: LongWord;
  540. D2: Word;
  541. D3: Word;
  542. D4: array[0..7] of Byte;
  543. end;
  544. {$endif}
  545. tstringencoding = Word;
  546. tcodepagestring = string[20];
  547. const
  548. { link options }
  549. link_none = $0;
  550. link_always = $1;
  551. link_static = $2;
  552. link_smart = $4;
  553. link_shared = $8;
  554. type
  555. { a message state }
  556. tmsgstate = (
  557. ms_on := 1,
  558. ms_off := 2,
  559. ms_error := 3,
  560. ms_on_global := $11, // turn on output
  561. ms_off_global := $22, // turn off output
  562. ms_error_global := $33 // cast to error
  563. );
  564. const
  565. { Mask for current value of message state }
  566. ms_local_mask = $0f;
  567. { Mask for global value of message state
  568. that needs to be restored when changing units }
  569. ms_global_mask = $f0;
  570. { Shift used to convert global to local message state }
  571. ms_shift = 4;
  572. type
  573. pmessagestaterecord = ^tmessagestaterecord;
  574. tmessagestaterecord = record
  575. next : pmessagestaterecord;
  576. value : longint;
  577. state : tmsgstate;
  578. end;
  579. { hide Sysutils.ExecuteProcess in units using this one after SysUtils}
  580. const
  581. ExecuteProcess = 'Do not use' deprecated 'Use cfileutil.RequotedExecuteProcess instead, ExecuteProcess cannot deal with single quotes as used by Unix command lines';
  582. implementation
  583. end.