compproc.inc 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Run time library.
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  5. This file contains the declarations of internal compiler helper
  6. routines. That means you can *NOT* call these directly, as they may
  7. be changed or even removed at any time. The only reason they are
  8. included in the interface of the system unit, is so that the
  9. compiler doesn't need special code to access their parameter
  10. list information etc.
  11. Note that due to the "compilerproc" directive, it isn't even possible
  12. to use these routines in your programs.
  13. See the File COPYING.FPC, included in this distribution,
  14. for details about the copyright.
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. **********************************************************************}
  19. { some dummy types necessary to have generic resulttypes for certain compilerprocs }
  20. type
  21. { normally the array shall be maxlongint big, but that will confuse
  22. the debugger }
  23. fpc_big_chararray = array[0..1023] of char;
  24. fpc_small_set = longint;
  25. fpc_normal_set = array[0..7] of longint;
  26. {$ifdef hascompilerproc}
  27. { Needed to solve overloading problem with call from assembler (PFV) }
  28. {$ifdef valuegetmem}
  29. Function fpc_getmem(size:ptrint):pointer;compilerproc;
  30. {$endif}
  31. {$ifdef valuefreemem}
  32. Procedure fpc_freemem(p:pointer);compilerproc;
  33. {$endif valuefreemem}
  34. procedure fpc_Shortstr_SetLength(var s:shortstring;len:SizeInt); compilerproc;
  35. function fpc_shortstr_to_shortstr(len:longint; const sstr: shortstring): shortstring; compilerproc;
  36. function fpc_shortstr_concat(const s1,s2:shortstring): shortstring; compilerproc;
  37. procedure fpc_shortstr_append_shortstr(var s1:shortstring;const s2:shortstring); compilerproc;
  38. function fpc_shortstr_compare(const left,right:shortstring) : longint; compilerproc;
  39. function fpc_pchar_to_shortstr(p:pchar):shortstring; compilerproc;
  40. function fpc_pchar_length(p:pchar):longint; compilerproc;
  41. function fpc_pwidechar_length(p:pwidechar):longint; compilerproc;
  42. function fpc_chararray_to_shortstr(const arr: array of char):shortstring; compilerproc;
  43. function fpc_shortstr_to_chararray(arraysize: longint; const src: ShortString): fpc_big_chararray; compilerproc;
  44. Function fpc_shortstr_Copy(const s:shortstring;index:SizeInt;count:SizeInt):shortstring;compilerproc;
  45. Function fpc_ansistr_Copy (Const S : AnsiString; Index,Size : SizeInt) : AnsiString;compilerproc;
  46. Function fpc_widestr_Copy (Const S : WideString; Index,Size : SizeInt) : WideString;compilerproc;
  47. function fpc_char_copy(c:char;index : SizeInt;count : SizeInt): shortstring;compilerproc;
  48. procedure fpc_dynarray_copy(var pdest : pointer;psrc : pointer;ti : pointer;lowidx,count:tdynarrayindex);compilerproc;
  49. function fpc_dynarray_length(p : pointer) : tdynarrayindex; compilerproc;
  50. function fpc_dynarray_high(p : pointer) : tdynarrayindex; compilerproc;
  51. procedure fpc_dynarray_clear(var p : pointer;ti : pointer); compilerproc;
  52. procedure fpc_dynarray_decr_ref(var p : pointer;ti : pointer); compilerproc;
  53. procedure fpc_dynarray_incr_ref(p : pointer); compilerproc;
  54. procedure fpc_dynarray_setlength(var p : pointer;pti : pointer; dimcount : dword;dims : pdynarrayindex); compilerproc;
  55. { Str() support }
  56. {$ifdef STR_USES_VALINT}
  57. procedure fpc_ShortStr_sint(v : valsint;len : SizeInt;var s : shortstring); compilerproc;
  58. procedure fpc_shortstr_uint(v : valuint;len : SizeInt;var s : shortstring); compilerproc;
  59. procedure fpc_chararray_sint(v : valsint;len : SizeInt;var a : array of char); compilerproc;
  60. procedure fpc_chararray_uint(v : valuint;len : SizeInt;var a : array of char); compilerproc;
  61. procedure fpc_AnsiStr_sint(v : valsint; Len : SizeInt; Var S : AnsiString); compilerproc;
  62. procedure fpc_AnsiStr_uint(v : valuint;Len : SizeInt; Var S : AnsiString); compilerproc;
  63. procedure fpc_WideStr_sint(v : valsint; Len : SizeInt; Var S : WideString); compilerproc;
  64. procedure fpc_WideStr_uint(v : valuint;Len : SizeInt; Var S : WideString); compilerproc;
  65. {$else}
  66. procedure fpc_ShortStr_Longint(v : longint;len : longint;var s : shortstring); compilerproc;
  67. procedure fpc_shortstr_longword(v : longword;len : longint;var s : shortstring); compilerproc;
  68. procedure fpc_chararray_Longint(v : longint;len : longint;var a : array of char); compilerproc;
  69. procedure fpc_chararray_longword(v : longword;len : longint;var a : array of char); compilerproc;
  70. procedure fpc_AnsiStr_Longint(v : Longint; Len : Longint; Var S : AnsiString); compilerproc;
  71. procedure fpc_AnsiStr_Longword(v : Longword;Len : Longint; Var S : AnsiString); compilerproc;
  72. procedure fpc_WideStr_Longint(v : Longint; Len : Longint; Var S : WideString); compilerproc;
  73. procedure fpc_WideStr_Longword(v : Longword;Len : Longint; Var S : WideString); compilerproc;
  74. {$endif}
  75. {$ifndef CPU64}
  76. procedure fpc_shortstr_qword(v : qword;len : SizeInt;var s : shortstring); compilerproc;
  77. procedure fpc_shortstr_int64(v : int64;len : SizeInt;var s : shortstring); compilerproc;
  78. procedure fpc_chararray_qword(v : qword;len : SizeInt;var a : array of char); compilerproc;
  79. procedure fpc_chararray_int64(v : int64;len : SizeInt;var a : array of char); compilerproc;
  80. procedure fpc_ansistr_qword(v : qword;len : SizeInt;var s : ansistring); compilerproc;
  81. procedure fpc_ansistr_int64(v : int64;len : SizeInt;var s : ansistring); compilerproc;
  82. procedure fpc_widestr_qword(v : qword;len : SizeInt;var s : widestring); compilerproc;
  83. procedure fpc_widestr_int64(v : int64;len : SizeInt;var s : widestring); compilerproc;
  84. {$endif CPU64}
  85. procedure fpc_ShortStr_Float(d : ValReal;len,fr,rt : SizeInt;var s : shortstring); compilerproc;
  86. procedure fpc_chararray_Float(d : ValReal;len,fr,rt : SizeInt;var a : array of char); compilerproc;
  87. procedure fpc_AnsiStr_Float(d : ValReal;len,fr,rt : SizeInt;var s : ansistring); compilerproc;
  88. procedure fpc_WideStr_Float(d : ValReal;len,fr,rt : SizeInt;var s : WideString); compilerproc;
  89. { Val() support }
  90. Function fpc_Val_Real_ShortStr(const s : shortstring; var code : ValSInt): ValReal; compilerproc;
  91. Function fpc_Val_Real_AnsiStr(Const S : AnsiString; Var Code : ValSInt): ValReal; compilerproc;
  92. Function fpc_Val_Real_WideStr(Const S : WideString; Var Code : ValSInt): ValReal; compilerproc;
  93. Function fpc_Val_SInt_ShortStr(DestSize: SizeInt; Const S: ShortString; var Code: ValSInt): ValSInt; compilerproc;
  94. Function fpc_Val_UInt_Shortstr(Const S: ShortString; var Code: ValSInt): ValUInt; compilerproc;
  95. Function fpc_Val_UInt_AnsiStr (Const S : AnsiString; Var Code : ValSInt): ValUInt; compilerproc;
  96. Function fpc_Val_SInt_AnsiStr (DestSize: SizeInt; Const S : AnsiString; Var Code : ValSInt): ValSInt; compilerproc;
  97. Function fpc_Val_UInt_WideStr (Const S : WideString; Var Code : ValSInt): ValUInt; compilerproc;
  98. Function fpc_Val_SInt_WideStr (DestSize: SizeInt; Const S : WideString; Var Code : ValSInt): ValSInt; compilerproc;
  99. {$ifndef CPU64}
  100. Function fpc_val_int64_shortstr(Const S: ShortString; var Code: ValSInt): Int64; compilerproc;
  101. Function fpc_val_qword_shortstr(Const S: ShortString; var Code: ValSInt): QWord; compilerproc;
  102. Function fpc_Val_qword_AnsiStr (Const S : AnsiString; Var Code : ValSInt): qword;compilerproc;
  103. Function fpc_Val_int64_AnsiStr (Const S : AnsiString; Var Code : ValSInt): Int64; compilerproc;
  104. Function fpc_Val_qword_WideStr (Const S : WideString; Var Code : ValSInt): qword; compilerproc;
  105. Function fpc_Val_int64_WideStr (Const S : WideString; Var Code : ValSInt): Int64; compilerproc;
  106. {$endif CPU64}
  107. Procedure fpc_AnsiStr_Decr_Ref (Var S : Pointer); compilerproc;
  108. Procedure fpc_AnsiStr_Incr_Ref (S : Pointer); compilerproc;
  109. Procedure fpc_AnsiStr_Assign (Var S1 : Pointer;S2 : Pointer); compilerproc;
  110. function fpc_AnsiStr_Concat (const S1,S2 : AnsiString): AnsiString; compilerproc;
  111. Procedure fpc_ansistr_append_char(Var S : AnsiString;c : char); compilerproc;
  112. Procedure fpc_ansistr_append_shortstring(Var S : AnsiString;Str : ShortString); compilerproc;
  113. Procedure fpc_ansistr_append_ansistring(Var S : AnsiString;Str : AnsiString); compilerproc;
  114. {$ifdef EXTRAANSISHORT}
  115. Procedure fpc_AnsiStr_ShortStr_Concat (Var S1: AnsiString; Var S2 : ShortString); compilerproc;
  116. {$endif EXTRAANSISHORT}
  117. function fpc_AnsiStr_To_ShortStr (high_of_res: SizeInt;const S2 : Ansistring): shortstring; compilerproc;
  118. Function fpc_ShortStr_To_AnsiStr (Const S2 : ShortString): ansistring; compilerproc;
  119. Function fpc_Char_To_AnsiStr(const c : Char): AnsiString; compilerproc;
  120. Function fpc_PChar_To_AnsiStr(const p : pchar): ansistring; compilerproc;
  121. Function fpc_CharArray_To_AnsiStr(const arr: array of char): ansistring; compilerproc;
  122. function fpc_ansistr_to_chararray(arraysize: SizeInt; const src: ansistring): fpc_big_chararray; compilerproc;
  123. Function fpc_AnsiStr_Compare(const S1,S2 : AnsiString): SizeInt; compilerproc;
  124. Procedure fpc_AnsiStr_CheckZero(p : pointer); compilerproc;
  125. Procedure fpc_AnsiStr_CheckRange(len,index : SizeInt); compilerproc;
  126. Procedure fpc_AnsiStr_SetLength (Var S : AnsiString; l : SizeInt); compilerproc;
  127. {$ifdef EXTRAANSISHORT}
  128. Function fpc_AnsiStr_ShortStr_Compare (Var S1 : Pointer; Var S2 : ShortString): SizeInt; compilerproc;
  129. {$endif EXTRAANSISHORT}
  130. { pointer argument because otherwise when calling this, we get }
  131. { an endless loop since a 'var s: ansistring' must be made }
  132. { unique as well }
  133. Function fpc_ansistr_Unique(Var S : Pointer): Pointer; compilerproc;
  134. Procedure fpc_WideStr_Decr_Ref (Var S : Pointer); compilerproc;
  135. Procedure fpc_WideStr_Incr_Ref (S : Pointer); compilerproc;
  136. function fpc_WideStr_To_ShortStr (high_of_res: SizeInt;const S2 : WideString): shortstring; compilerproc;
  137. Function fpc_ShortStr_To_WideStr (Const S2 : ShortString): WideString; compilerproc;
  138. Function fpc_WideStr_To_AnsiStr (const S2 : WideString): AnsiString; compilerproc;
  139. Function fpc_AnsiStr_To_WideStr (Const S2 : AnsiString): WideString; compilerproc;
  140. Procedure fpc_WideStr_Assign (Var S1 : Pointer;S2 : Pointer); compilerproc;
  141. Function fpc_WideStr_Concat (const S1,S2 : WideString) : WideString; compilerproc;
  142. Function fpc_Char_To_WideStr(const c : WideChar): WideString; compilerproc;
  143. Function fpc_PChar_To_WideStr(const p : pchar): WideString; compilerproc;
  144. Function fpc_CharArray_To_WideStr(const arr: array of char): WideString; compilerproc;
  145. function fpc_widestr_to_chararray(arraysize: SizeInt; const src: WideString): fpc_big_chararray; compilerproc;
  146. Function fpc_WideStr_Compare(const S1,S2 : WideString): SizeInt; compilerproc;
  147. Procedure fpc_WideStr_CheckZero(p : pointer); compilerproc;
  148. Procedure fpc_WideStr_CheckRange(len,index : SizeInt); compilerproc;
  149. Procedure fpc_WideStr_SetLength (Var S : WideString; l : SizeInt); compilerproc;
  150. function fpc_widestr_Unique(Var S : Pointer): Pointer; compilerproc;
  151. {$ifdef HASWIDECHAR}
  152. Function fpc_PWideChar_To_AnsiStr(const p : pwidechar): ansistring; compilerproc;
  153. Function fpc_PWideChar_To_WideStr(const p : pwidechar): widestring; compilerproc;
  154. Function fpc_PWideChar_To_ShortStr(const p : pwidechar): shortstring; compilerproc;
  155. {$endif HASWIDECHAR}
  156. { from text.inc }
  157. Function fpc_get_input:PText;{$ifdef hascompilerproc}compilerproc;{$endif}
  158. Function fpc_get_output:PText;{$ifdef hascompilerproc}compilerproc;{$endif}
  159. Procedure fpc_Write_End(var f:Text); compilerproc;
  160. Procedure fpc_Writeln_End(var f:Text); compilerproc;
  161. Procedure fpc_Write_Text_ShortStr(Len : Longint;var f : Text;const s : String); compilerproc;
  162. Procedure fpc_Write_Text_Pchar_as_Array(Len : Longint;var f : Text;const s : array of char); compilerproc;
  163. Procedure fpc_Write_Text_PChar_As_Pointer(Len : Longint;var f : Text;p : PChar); compilerproc;
  164. Procedure fpc_Write_Text_AnsiStr (Len : Longint; Var f : Text; S : AnsiString); compilerproc;
  165. {$ifdef HASWIDESTRING}
  166. Procedure fpc_Write_Text_WideStr (Len : Longint; Var f : Text; S : WideString); compilerproc;
  167. {$endif HASWIDESTRING}
  168. Procedure fpc_Write_Text_SInt(Len : Longint;var t : Text;l : ValSInt); compilerproc;
  169. Procedure fpc_Write_Text_UInt(Len : Longint;var t : Text;l : ValUInt); compilerproc;
  170. {$ifndef CPU64}
  171. procedure fpc_write_text_qword(len : longint;var t : text;q : qword); compilerproc;
  172. procedure fpc_write_text_int64(len : longint;var t : text;i : int64); compilerproc;
  173. {$endif CPU64}
  174. Procedure fpc_Write_Text_Float(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); compilerproc;
  175. Procedure fpc_Write_Text_Boolean(Len : Longint;var t : Text;b : Boolean); compilerproc;
  176. Procedure fpc_Write_Text_Char(Len : Longint;var t : Text;c : Char); compilerproc;
  177. {$ifdef HASWIDECHAR}
  178. Procedure fpc_Write_Text_WideChar(Len : Longint;var t : Text;c : WideChar); compilerproc;
  179. {$endif HASWIDECHAR}
  180. {$ifdef HASVARIANT}
  181. procedure fpc_write_text_variant(Len : Longint;var f : Text;const v : variant); compilerproc;
  182. function fpc_variant_to_dynarray(const v : variant;typeinfo : pointer) : pointer;compilerproc;
  183. function fpc_dynarray_to_variant(dynarr : pointer;typeinfo : pointer) : variant;compilerproc;
  184. {$endif HASVARIANT}
  185. Procedure fpc_Read_End(var f:Text); compilerproc;
  186. Procedure fpc_ReadLn_End(var f : Text); compilerproc;
  187. Procedure fpc_Read_Text_ShortStr(var f : Text;var s : String); compilerproc;
  188. Procedure fpc_Read_Text_PChar_As_Pointer(var f : Text;var s : PChar); compilerproc;
  189. Procedure fpc_Read_Text_PChar_As_Array(var f : Text;var s : array of char); compilerproc;
  190. Procedure fpc_Read_Text_AnsiStr(var f : Text;var s : AnsiString); compilerproc;
  191. Procedure fpc_Read_Text_Char(var f : Text; var c : char); compilerproc;
  192. Procedure fpc_Read_Text_SInt(var f : Text; var l :ValSInt); compilerproc;
  193. Procedure fpc_Read_Text_UInt(var f : Text; var u :ValUInt); compilerproc;
  194. Procedure fpc_Read_Text_Float(var f : Text; var v :ValReal); compilerproc;
  195. {$ifndef CPU64}
  196. Procedure fpc_Read_Text_QWord(var f : text; var q : qword); compilerproc;
  197. Procedure fpc_Read_Text_Int64(var f : text; var i : int64); compilerproc;
  198. {$endif CPU64}
  199. {$ifdef FPC_INCLUDE_SOFTWARE_MOD_DIV}
  200. function fpc_div_dword(n,z : dword) : dword; compilerproc;
  201. function fpc_mod_dword(n,z : dword) : dword; compilerproc;
  202. function fpc_div_longint(n,z : longint) : longint; compilerproc;
  203. function fpc_mod_longint(n,z : longint) : longint; compilerproc;
  204. {$endif FPC_INCLUDE_SOFTWARE_MOD_DIV}
  205. { from int64.inc }
  206. function fpc_div_qword(n,z : qword) : qword; compilerproc;
  207. function fpc_mod_qword(n,z : qword) : qword; compilerproc;
  208. function fpc_div_int64(n,z : int64) : int64; compilerproc;
  209. function fpc_mod_int64(n,z : int64) : int64; compilerproc;
  210. function fpc_mul_qword(f1,f2 : qword;checkoverflow : longbool) : qword; compilerproc;
  211. function fpc_mul_int64(f1,f2 : int64;checkoverflow : longbool) : int64; compilerproc;
  212. {$ifdef FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
  213. function fpc_shl_qword(value,shift : qword) : qword; compilerproc;
  214. function fpc_shr_qword(value,shift : qword) : qword; compilerproc;
  215. function fpc_shl_int64(value,shift : int64) : int64; compilerproc;
  216. function fpc_shr_int64(value,shift : int64) : int64; compilerproc;
  217. {$endif FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
  218. {$ifdef INTERNCONSTINTF}
  219. function fpc_abs_real(d : ValReal) : ValReal;compilerproc;
  220. function fpc_arctan_real(d : ValReal) : ValReal;compilerproc;{$ifdef MATHINLINE}inline;{$endif}
  221. function fpc_cos_real(d : ValReal) : ValReal;compilerproc;{$ifdef MATHINLINE}inline;{$endif}
  222. function fpc_exp_real(d : ValReal) : ValReal;compilerproc;{$ifdef MATHINLINE}inline;{$endif}
  223. function fpc_frac_real(d : ValReal) : ValReal;compilerproc;
  224. function fpc_int_real(d : ValReal) : ValReal;compilerproc;{$ifdef MATHINLINE}inline;{$endif}
  225. function fpc_ln_real(d : ValReal) : ValReal;compilerproc;{$ifdef MATHINLINE}inline;{$endif}
  226. function fpc_pi_real : ValReal;compilerproc;
  227. function fpc_sin_real(d : ValReal) : ValReal;compilerproc;{$ifdef MATHINLINE}inline;{$endif}
  228. function fpc_sqr_real(d : ValReal) : ValReal;compilerproc;
  229. function fpc_sqrt_real(d : ValReal) : ValReal;compilerproc;{$ifdef MATHINLINE}inline;{$endif}
  230. function fpc_round_real(d : ValReal) : int64;compilerproc;
  231. function fpc_trunc_real(d : ValReal) : int64;compilerproc;
  232. {$else INTERNCONSTINTF}
  233. function fpc_round(d : ValReal) : int64;compilerproc;
  234. {$endif INTERNCONSTINTF}
  235. function fpc_do_is(aclass : tclass;aobject : tobject) : boolean; compilerproc;
  236. function fpc_do_as(aclass : tclass;aobject : tobject): tobject; compilerproc;
  237. procedure fpc_intf_decr_ref(var i: pointer); compilerproc;
  238. procedure fpc_intf_incr_ref(i: pointer); compilerproc;
  239. procedure fpc_intf_assign(var D: pointer; const S: pointer); compilerproc;
  240. function fpc_intf_as(const S: pointer; const iid: TGUID): pointer; compilerproc;
  241. function fpc_class_as_intf(const S: pointer; const iid: TGUID): pointer; compilerproc;
  242. Function fpc_PushExceptAddr (Ft: Longint;_buf,_newaddr : pointer): PJmp_buf ; compilerproc;
  243. Procedure fpc_PushExceptObj (Obj : TObject; AnAddr,AFrame : Pointer); compilerproc;
  244. Function fpc_Raiseexception (Obj : TObject; AnAddr,AFrame : Pointer) : TObject; compilerproc;
  245. Procedure fpc_PopAddrStack; compilerproc;
  246. function fpc_PopObjectStack : TObject; compilerproc;
  247. function fpc_PopSecondObjectStack : TObject; compilerproc;
  248. Procedure fpc_ReRaise; compilerproc;
  249. Function fpc_Catches(Objtype : TClass) : TObject; compilerproc;
  250. function fpc_help_constructor(_self:pointer;var _vmt:pointer;_vmt_pos:cardinal):pointer;compilerproc;
  251. procedure fpc_help_destructor(_self,_vmt:pointer;vmt_pos:cardinal);compilerproc;
  252. procedure fpc_help_fail(_self:pointer;var _vmt:pointer;vmt_pos:cardinal);compilerproc;
  253. {$ifdef dummy}
  254. Procedure fpc_DestroyException(o : TObject); compilerproc;
  255. procedure fpc_check_object(obj:pointer); compilerproc;
  256. procedure fpc_check_object_ext(vmt,expvmt:pointer);compilerproc;
  257. {$endif dummy}
  258. Procedure fpc_Initialize (Data,TypeInfo : pointer); compilerproc;
  259. Procedure fpc_finalize (Data,TypeInfo: Pointer); compilerproc;
  260. Procedure fpc_Addref (Data,TypeInfo : Pointer); compilerproc;
  261. Procedure fpc_DecRef (Data,TypeInfo : Pointer); compilerproc;
  262. procedure fpc_finalize_array(data,typeinfo : pointer;count,size : longint); compilerproc;
  263. function fpc_set_load_small(l: fpc_small_set): fpc_normal_set; compilerproc;
  264. function fpc_set_create_element(b : byte): fpc_normal_set; compilerproc;
  265. function fpc_set_set_byte(const source: fpc_normal_set; b : byte): fpc_normal_set; compilerproc;
  266. function fpc_set_unset_byte(const source: fpc_normal_set; b : byte): fpc_normal_set; compilerproc;
  267. function fpc_set_set_range(const orgset: fpc_normal_set; l,h : byte): fpc_normal_set; compilerproc;
  268. function fpc_set_in_byte(const p: fpc_normal_set; b: byte): boolean; compilerproc;
  269. function fpc_set_add_sets(const set1,set2: fpc_normal_set): fpc_normal_set; compilerproc;
  270. function fpc_set_mul_sets(const set1,set2: fpc_normal_set): fpc_normal_set; compilerproc;
  271. function fpc_set_sub_sets(const set1,set2: fpc_normal_set): fpc_normal_set; compilerproc;
  272. function fpc_set_symdif_sets(const set1,set2: fpc_normal_set): fpc_normal_set; compilerproc;
  273. function fpc_set_comp_sets(const set1,set2: fpc_normal_set): boolean; compilerproc;
  274. function fpc_set_contains_sets(const set1,set2: fpc_normal_set): boolean; compilerproc;
  275. {$ifdef LARGESETS}
  276. procedure fpc_largeset_set_word(p : pointer;b : word); compilerproc;
  277. procedure fpc_largeset_in_word(p : pointer;b : word); compilerproc;
  278. procedure fpc_largeset_add_sets(set1,set2,dest : pointer;size : longint); compilerproc;
  279. procedure fpc_largeset_sets(set1,set2,dest : pointer;size : longint); compilerproc;
  280. procedure fpc_largeset_sub_sets(set1,set2,dest : pointer;size : longint); compilerproc;
  281. procedure fpc_largeset_symdif_sets(set1,set2,dest : pointer;size : longint); compilerproc;
  282. procedure fpc_largeset_comp_sets(set1,set2 : pointer;size : longint); compilerproc;
  283. procedure fpc_largeset_contains_sets(set1,set2 : pointer; size: longint); compilerproc;
  284. {$endif LARGESETS}
  285. procedure fpc_rangeerror; compilerproc;
  286. procedure fpc_divbyzero; compilerproc;
  287. procedure fpc_overflow; compilerproc;
  288. //procedure fpc_iocheck(addr : longint); compilerproc;
  289. procedure fpc_iocheck; compilerproc;
  290. procedure fpc_InitializeUnits; compilerproc;
  291. // not generated by compiler, called directly in system unit
  292. // procedure fpc_FinalizeUnits; compilerproc;
  293. {
  294. Procedure fpc_do_exit; compilerproc;
  295. Procedure fpc_lib_exit; compilerproc;
  296. Procedure fpc_HandleErrorAddrFrame (Errno : longint;addr,frame : pointer); compilerproc;
  297. Procedure fpc_HandleError (Errno : longint); compilerproc;
  298. }
  299. procedure fpc_AbstractErrorIntern;compilerproc;
  300. procedure fpc_assert(Const Msg,FName:Shortstring;LineNo:Longint;ErrorAddr:Pointer); compilerproc;
  301. Procedure fpc_reset_typed(var f : TypedFile;Size : Longint); compilerproc;
  302. Procedure fpc_rewrite_typed(var f : TypedFile;Size : Longint); compilerproc;
  303. Procedure fpc_typed_write(TypeSize : Longint;var f : TypedFile;const Buf); compilerproc;
  304. Procedure fpc_typed_read(TypeSize : Longint;var f : TypedFile;var Buf); compilerproc;
  305. {$ifdef FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
  306. function fpc_int64_to_double(i: int64): double; compilerproc;
  307. function fpc_qword_to_double(q: qword): double; compilerproc;
  308. {$endif FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
  309. {$endif hascompilerproc}
  310. {
  311. $Log$
  312. Revision 1.62 2004-12-05 11:49:06 florian
  313. * implemented helper for variant<->dyn. array type cast
  314. Revision 1.61 2004/11/21 16:14:59 jonas
  315. * fixed remaining compilation problems
  316. Revision 1.60 2004/11/21 15:35:23 peter
  317. * float routines all use internproc and compilerproc helpers
  318. Revision 1.59 2004/11/09 23:10:22 peter
  319. * use helper call to retrieve address of input/output to reduce
  320. code that is generated in the main program for loading the
  321. threadvar
  322. Revision 1.58 2004/09/29 14:55:49 mazen
  323. * widestring conversion routines takes a widechar so no
  324. information is lost
  325. Revision 1.57 2004/05/31 14:31:57 peter
  326. * remove comment warnings
  327. Revision 1.56 2004/05/01 23:55:18 peter
  328. * replace strlenint with sizeint
  329. Revision 1.55 2004/05/01 20:52:50 peter
  330. * ValSInt fixed for 64 bit
  331. Revision 1.54 2004/04/29 19:50:13 peter
  332. * x86-64 fixes
  333. Revision 1.53 2004/04/29 18:59:43 peter
  334. * str() helpers now also use valint/valuint
  335. * int64/qword helpers disabled for cpu64
  336. Revision 1.52 2004/04/12 18:51:02 florian
  337. * fixed getmem prototype for 64 bit systems
  338. Revision 1.51 2004/01/01 17:58:16 jonas
  339. + integer division-by-zero detection support for ppc
  340. + compilerproc FPC_DIVBYZERO
  341. Revision 1.50 2003/10/25 22:52:07 florian
  342. * fixed copy(<dynarray>, ...)
  343. Revision 1.49 2003/10/04 23:40:42 florian
  344. * write helper comproc for variants fixed
  345. Revision 1.48 2003/09/02 13:04:08 florian
  346. * ifdef'd some helpers
  347. Revision 1.47 2003/09/01 20:47:23 peter
  348. * pcomp added for sparc
  349. Revision 1.46 2003/08/21 22:07:43 olle
  350. - removed parameter from fpc_iocheck
  351. Revision 1.45 2003/06/17 19:24:08 jonas
  352. * fixed conversion of fpc_*str_unique to compilerproc
  353. Revision 1.44 2003/06/17 16:38:53 jonas
  354. * fpc_ansistr|widestr_unique is now a function so it can be used as
  355. compilerproc
  356. Revision 1.43 2003/05/26 19:36:46 peter
  357. * fpc_shortstr_concat is now the same for all targets
  358. * fpc_shortstr_append_shortstr added for optimized code generation
  359. Revision 1.42 2003/05/16 22:40:11 florian
  360. * fixed generic shortstr_compare
  361. Revision 1.41 2003/05/13 19:18:08 peter
  362. * fpc_help_fail compilerproc
  363. * fpc_new_class, fpc_dispose_class not needed by latest compiler
  364. Revision 1.40 2003/05/11 21:39:14 peter
  365. * constructor helper added
  366. Revision 1.39 2003/04/25 21:15:20 peter
  367. * fpc_big_array changed to 1k only. using maxlongint will crash gdb
  368. Revision 1.38 2003/04/23 21:28:21 peter
  369. * fpc_round added, needed for int64 currency
  370. Revision 1.37 2003/04/02 14:07:30 peter
  371. * class helpers compilerprocs are not needed yet, changed
  372. ifndef i386 to ifdef dummy
  373. Revision 1.36 2003/03/17 14:30:11 peter
  374. * changed address parameter/return values to pointer instead
  375. of longint
  376. Revision 1.35 2003/01/11 00:17:29 florian
  377. * uncommented the variant<->dyn. array stuff
  378. Revision 1.34 2003/01/09 20:14:20 florian
  379. * fixed helper declarations
  380. Revision 1.33 2003/01/06 23:04:21 mazen
  381. * functions headers modified in generic.inc to make it possible compiling sparc
  382. RTL based on generic code
  383. Revision 1.32 2003/01/06 08:25:47 michael
  384. + PAtch from peter fixing daily build
  385. Revision 1.31 2003/01/05 21:32:35 mazen
  386. * fixing several bugs compiling the RTL
  387. Revision 1.30 2002/12/29 16:59:17 peter
  388. * implemented some more conversions
  389. Revision 1.29 2002/11/26 23:02:07 peter
  390. * fixed dynarray copy
  391. Revision 1.28 2002/10/17 12:43:00 florian
  392. + ansistring_append* implemented
  393. Revision 1.27 2002/10/10 19:24:28 florian
  394. + write(ln) support for variants added
  395. Revision 1.26 2002/10/10 16:08:50 florian
  396. + several widestring/pwidechar related helpers added
  397. Revision 1.25 2002/10/05 14:20:16 peter
  398. * fpc_pchar_length compilerproc and strlen alias
  399. Revision 1.24 2002/10/02 18:21:51 peter
  400. * Copy() changed to internal function calling compilerprocs
  401. * FPC_SHORTSTR_COPY renamed to FPC_SHORTSTR_ASSIGN because of the
  402. new copy functions
  403. Revision 1.23 2002/09/27 21:10:40 carl
  404. * fix 2GB limit problem
  405. Revision 1.22 2002/09/07 21:12:04 carl
  406. * cardinal -> longword
  407. - remove some unused routines
  408. Revision 1.21 2002/09/07 15:07:45 peter
  409. * old logs removed and tabs fixed
  410. Revision 1.20 2002/09/02 19:24:41 peter
  411. * array of char support for Str()
  412. Revision 1.19 2002/08/20 18:24:05 jonas
  413. * interface "as" helpers converted from procedures to functions
  414. Revision 1.18 2002/07/31 16:58:12 jonas
  415. * fixed conversion from int64/qword to double errors
  416. Revision 1.17 2002/07/28 20:43:47 florian
  417. * several fixes for linux/powerpc
  418. * several fixes to MT
  419. Revision 1.16 2002/04/25 20:14:56 peter
  420. * updated compilerprocs
  421. * incr ref count has now a value argument instead of var
  422. Revision 1.15 2002/04/24 16:15:35 peter
  423. * fpc_finalize_array renamed
  424. Revision 1.14 2002/04/21 18:56:59 peter
  425. * fpc_freemem and fpc_getmem compilerproc
  426. Revision 1.13 2002/01/21 20:16:08 peter
  427. * updated for dynarr:=nil
  428. }