浏览代码

+ slightly modified patch by lelekx to implement plugable file routines for the embedded target, resolves issue #22918

git-svn-id: trunk@30759 -
florian 10 年之前
父节点
当前提交
c2c87828e9
共有 2 个文件被更改,包括 33 次插入5 次删除
  1. 28 0
      rtl/embedded/system.pp
  2. 5 5
      rtl/objpas/sysutils/sysstrh.inc

+ 28 - 0
rtl/embedded/system.pp

@@ -80,6 +80,34 @@ const
   DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCrLF;
 {$endif FPC_HAS_FEATURE_TEXTIO}
 
+type
+  trtl_do_close = procedure (handle : longint);
+  trtl_do_erase = procedure (p : pchar);
+  trtl_do_rename = procedure (p1,p2 : pchar);
+  trtl_do_write = function (h: longint; addr: pointer; len: longint) : longint;
+  trtl_do_read = function (h: longint; addr: pointer; len: longint) : longint;
+  trtl_do_filepos = function (handle: longint) : longint;
+  trtl_do_seek = procedure (handle, pos: longint);
+  trtl_do_seekend = function (handle: longint):longint;
+  trtl_do_filesize = function (handle : longint) : longint;
+  trtl_do_truncate = procedure (handle, pos: longint);
+  trtl_do_open = procedure (var f;p:pchar;flags:longint);
+  trtl_do_isdevice = function (handle: longint): boolean;
+
+var
+  rtl_do_close : trtl_do_close = nil;
+  rtl_do_erase : trtl_do_erase = nil;
+  rtl_do_rename : trtl_do_rename  = nil;
+  rtl_do_write : trtl_do_write = nil;
+  rtl_do_read : trtl_do_read = nil;
+  rtl_do_filepos : trtl_do_filepos = nil;
+  rtl_do_seek : trtl_do_seek = nil;
+  rtl_do_seekend : trtl_do_seekend = nil;
+  rtl_do_filesize : trtl_do_filesize = nil;
+  rtl_do_truncate : trtl_do_truncate = nil;
+  rtl_do_open : trtl_do_open = nil;
+  rtl_do_isdevice : trtl_do_isdevice = nil;
+
 {$ifdef FPC_HAS_FEATURE_COMMANDARGS}
 var
   argc: LongInt = 0;

+ 5 - 5
rtl/objpas/sysutils/sysstrh.inc

@@ -46,8 +46,8 @@ const
   MaxCurrency: Currency =  922337203685477.0000;
 {$endif}
 {$else}
-  MinCurrency: Currency = -9223372036854775807;
-  MaxCurrency: Currency =  9223372036854775807;
+  MinCurrency: Currency = -922337203685477;
+  MaxCurrency: Currency =  922337203685477;
 {$endif}
 
 Const
@@ -191,11 +191,11 @@ function TryFloatToCurr(const Value: Extended; var AResult: Currency): Boolean;
 Function CurrToStr(Value: Currency): string;
 Function CurrToStr(Value: Currency; Const FormatSettings: TFormatSettings): string;
 function StrToCurr(const S: string): Currency;
-function StrToCurr(const S: string; Const FormatSettings: TFormatSettings): Currency;  
+function StrToCurr(const S: string; Const FormatSettings: TFormatSettings): Currency;
 function TryStrToCurr(const S: string;Out Value : Currency): Boolean;
-function TryStrToCurr(const S: string;Out Value : Currency; Const FormatSettings: TFormatSettings): Boolean;       
+function TryStrToCurr(const S: string;Out Value : Currency; Const FormatSettings: TFormatSettings): Boolean;
 function StrToCurrDef(const S: string; Default : Currency): Currency;
-function StrToCurrDef(const S: string; Default : Currency; Const FormatSettings: TFormatSettings): Currency;  
+function StrToCurrDef(const S: string; Default : Currency; Const FormatSettings: TFormatSettings): Currency;
 
 Function FloatToTextFmt(Buffer: PChar; Value: Extended; format: PChar; FormatSettings : TFormatSettings): Integer;
 Function FloatToTextFmt(Buffer: PChar; Value: Extended; format: PChar): Integer;