فهرست منبع

* fixed some bootstrapping problems as well as some 64 bit stuff

florian 21 سال پیش
والد
کامیت
6427a54c3d
5فایلهای تغییر یافته به همراه59 افزوده شده و 34 حذف شده
  1. 7 4
      rtl/i386/strings.inc
  2. 6 3
      rtl/objpas/sysutils/sysansi.inc
  3. 22 15
      rtl/objpas/sysutils/sysstr.inc
  4. 18 9
      rtl/objpas/sysutils/sysstrh.inc
  5. 6 3
      rtl/win32/sysutils.pp

+ 7 - 4
rtl/i386/strings.inc

@@ -132,7 +132,7 @@ end;
 
 {$ifndef FPC_UNIT_HAS_STRLCOPY}
 {$define FPC_UNIT_HAS_STRLCOPY}
-function strlcopy(dest,source : pchar;maxlen : longint) : pchar;assembler;
+function strlcopy(dest,source : pchar;maxlen : sizeint) : pchar;assembler;
 var
   saveesi,saveedi : longint;
 asm
@@ -235,7 +235,7 @@ end;
 
 {$ifndef FPC_UNIT_HAS_STRLCOMP}
 {$define FPC_UNIT_HAS_STRLCOMP}
-function strlcomp(str1,str2 : pchar;l : longint) : longint;assembler;
+function strlcomp(str1,str2 : pchar;l : sizeint) : longint;assembler;
 var
   saveeax,saveedx,saveecx,saveesi,saveedi : longint;
 asm
@@ -336,7 +336,7 @@ end;
 
 {$ifndef FPC_UNIT_HAS_STRLICOMP}
 {$define FPC_UNIT_HAS_STRLICOMP}
-function strlicomp(str1,str2 : pchar;l : longint) : longint;assembler;
+function strlicomp(str1,str2 : pchar;l : sizeint) : longint;assembler;
 var
   saveeax,saveedx,saveecx,saveesi,saveedi : longint;
 asm
@@ -633,7 +633,10 @@ end;
 
 {
   $Log$
-  Revision 1.14  2004-05-01 15:26:33  jonas
+  Revision 1.15  2004-06-13 10:49:50  florian
+    * fixed some bootstrapping problems as well as some 64 bit stuff
+
+  Revision 1.14  2004/05/01 15:26:33  jonas
     * use some more string routines from libc if FPC_USE_LIBC is used
 
   Revision 1.13  2003/12/19 09:28:00  michael

+ 6 - 3
rtl/objpas/sysutils/sysansi.inc

@@ -19,12 +19,12 @@
     *********************************************************************
 }
 
-Function AnsiCompareFileName(const S1, S2: string): Integer;
+Function AnsiCompareFileName(const S1, S2: string): SizeInt;
 
 begin
   If FileNameCaseSensitive then
     Result:=AnsiCompareStr(S1,S2) // Compare case sensitive
-  else  
+  else
     Result:=AnsiCompareText(S1,S2); // Compare case insensitive. No MBCS yet.
 end;
 
@@ -72,7 +72,10 @@ end;
 
 {
   $Log$
-  Revision 1.2  2003-11-26 22:17:42  michael
+  Revision 1.3  2004-06-13 10:49:50  florian
+    * fixed some bootstrapping problems as well as some 64 bit stuff
+
+  Revision 1.2  2003/11/26 22:17:42  michael
   + Merged fixbranch fixes, missing in main branch
 
   Revision 1.1  2003/10/06 21:01:06  peter

+ 22 - 15
rtl/objpas/sysutils/sysstr.inc

@@ -147,7 +147,7 @@ begin
   I:=0;
   If (P1)<>(P2) then
     While Result and (i<Length) do
-      begin 
+      begin
       Result:=PByte(P1)^=PByte(P2)^;
       Inc(I);
       Inc(pchar(P1));
@@ -566,7 +566,7 @@ begin
              Dest[j]:=#10;
              Inc(J);
              Inc(I);
-             if Source[I]=#10 then 
+             if Source[I]=#10 then
                Inc(I);
              end;
       else
@@ -659,7 +659,7 @@ end ;
     if S does not represent a valid integer value EConvertError is raised  }
 
 function StrToInt(const S: string): integer;
-{$IFDEF VIRTUALPASCAL} 
+{$IFDEF VIRTUALPASCAL}
 var Error: longint;
 {$ELSE}
 var Error: word;
@@ -671,7 +671,7 @@ end ;
 
 
 function StrToInt64(const S: string): int64;
-{$IFDEF VIRTUALPASCAL} 
+{$IFDEF VIRTUALPASCAL}
 var Error: longint;
 {$ELSE}
 var Error: word;
@@ -687,7 +687,7 @@ end ;
     Default is returned in case S does not represent a valid integer value  }
 
 function StrToIntDef(const S: string; Default: integer): integer;
-{$IFDEF VIRTUALPASCAL} 
+{$IFDEF VIRTUALPASCAL}
 var Error: longint;
 {$ELSE}
 var Error: word;
@@ -701,7 +701,7 @@ end ;
     Default is returned in case S does not represent a valid integer value  }
 
 function StrToInt64Def(const S: string; Default: int64): int64;
-{$IFDEF VIRTUALPASCAL} 
+{$IFDEF VIRTUALPASCAL}
 var Error: longint;
 {$ELSE}
 var Error: word;
@@ -775,7 +775,7 @@ Var ChPos,OldPos,ArgPos,DoArg,Len : Longint;
 
     Procedure ReadInteger;
 
-{$IFDEF VIRTUALPASCAL} 
+{$IFDEF VIRTUALPASCAL}
 var Code: longint;
 {$ELSE}
 var Code: word;
@@ -956,7 +956,7 @@ begin
         'D' : begin
               if Checkarg(vtinteger,false) then
                 Str(Args[Doarg].VInteger,ToAdd)
-  	      {$IFNDEF VIRTUALPASCAL} 
+  	      {$IFNDEF VIRTUALPASCAL}
               else if CheckArg(vtInt64,true) then
                 Str(Args[DoArg].VInt64^,toadd)
 	      {$ENDIF}
@@ -1325,18 +1325,22 @@ end;
 function TryFloatToCurr(const Value: Extended; var AResult: Currency): Boolean;
 
 begin
+{$ifndef VER1_0}
   Result:=(Value>=MinCurrency) and (Value<=MaxCurrency);
   if Result then
     AResult := Value;
+{$else VER1_0}
+  Result:=false;
+{$endif VER1_0}
 end;
-        
+
 function FloatToCurr(const Value: Extended): Currency;
 
 begin
   if not TryFloatToCurr(Value, Result) then
     Raise EConvertError.CreateFmt(SInvalidCurrency, [FloatToStr(Value)]);
 end;
-              
+
 
 Function CurrToStr(Value: Currency): string;
 
@@ -1361,7 +1365,7 @@ function StrToBool(const S: string): Boolean;
 Var
   Temp : String;
   D : Double;
-{$IFDEF VIRTUALPASCAL} 
+{$IFDEF VIRTUALPASCAL}
   Code: longint;
 {$ELSE}
   Code: word;
@@ -2075,10 +2079,10 @@ end;
 
 Function FindCmdLineSwitch(const Switch: string; const Chars: TSysCharSet;IgnoreCase: Boolean): Boolean;
 
-Var 
+Var
   I,L : Integer;
   S,T : String;
-  
+
 begin
   Result:=False;
   S:=Switch;
@@ -2095,7 +2099,7 @@ begin
         T:=UpperCase(T);
       Result:=S=T;
       end;
-    Dec(i);  
+    Dec(i);
     end;
 end;
 
@@ -2171,7 +2175,10 @@ const
 
 {
   $Log$
-  Revision 1.12  2004-06-12 13:57:18  michael
+  Revision 1.13  2004-06-13 10:49:50  florian
+    * fixed some bootstrapping problems as well as some 64 bit stuff
+
+  Revision 1.12  2004/06/12 13:57:18  michael
   + Enhanced FloatToStrF to 18 digits (Delphi compatibility, bug 3106
 
   Revision 1.11  2004/06/12 13:23:17  michael

+ 18 - 9
rtl/objpas/sysutils/sysstrh.inc

@@ -44,9 +44,15 @@ const
   MinDateTime: TDateTime = -657434.0;      { 01/01/0100 12:00:00.000 AM }
   MaxDateTime: TDateTime =  2958465.99999; { 12/31/9999 11:59:59.999 PM }
 
-  MinCurrency: Currency = -922337203685477.5807;  
-  MaxCurrency: Currency =  922337203685477.5807; 
-    
+{$ifndef VER1_0}
+{$if defined(FPC_HAS_TYPE_EXTENDED) or defined(FPC_HAS_TYPE_FLOAT)}
+  MinCurrency: Currency = -922337203685477.5807;
+  MaxCurrency: Currency =  922337203685477.5807;
+{$else}
+  MinCurrency: Currency = -922337203685477.0000;
+  MaxCurrency: Currency =  922337203685477.0000;
+{$endif}
+{$endif VER1_0}
 
 Type
   TTextLineBreakStyle = (tlbsLF, tlbsCRLF);   // Must move to system unit, and add Mac tlbsCR too ?
@@ -54,7 +60,7 @@ Type
 Const
   DefaultTextLineBreakStyle: TTextLineBreakStyle = {$ifdef unix} tlbsLF {$else} tlbsCRLF {$endif};
 
-               
+
 Const
   LeadBytes: set of Char = [];
   EmptyStr : string = '';
@@ -160,7 +166,7 @@ Function ByteToCharIndex(const S: string; Index: Integer): Integer;
 
 const
 {$ifndef unix}
-  SwitchChars = ['/','-']; 
+  SwitchChars = ['/','-'];
 {$else}
   SwitchChars = ['-'];
 {$endif}
@@ -171,8 +177,8 @@ Type
 Function FindCmdLineSwitch(const Switch: string; const Chars: TSysCharSet;IgnoreCase: Boolean): Boolean;
 Function FindCmdLineSwitch(const Switch: string; IgnoreCase: Boolean): Boolean;
 Function FindCmdLineSwitch(const Switch: string): Boolean;
-                          
-                          
+
+
 
 {==============================================================================}
 {   extra functions                                                            }
@@ -184,7 +190,10 @@ function BCDToInt(Value: integer): integer;
 
 {
   $Log$
-  Revision 1.5  2004-06-12 13:23:17  michael
+  Revision 1.6  2004-06-13 10:49:50  florian
+    * fixed some bootstrapping problems as well as some 64 bit stuff
+
+  Revision 1.5  2004/06/12 13:23:17  michael
   + Fixed currency<->string conversion support
 
   Revision 1.4  2004/02/26 08:46:21  michael
@@ -243,4 +252,4 @@ function BCDToInt(Value: integer): integer;
       instead of direct comparisons of low/high values of orddefs because
       qword is a special case
 
-}
+}

+ 6 - 3
rtl/win32/sysutils.pp

@@ -101,7 +101,7 @@ begin
 end;
 
 
-Function FileCreate (Const FileName : String; Mode:longint) : Longint;
+Function FileCreate (Const FileName : String; Mode:longint) : SizeInt;
 begin
   FileCreate:=FileCreate(FileName);
 end;
@@ -729,7 +729,7 @@ end;
 
 function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array of AnsiString):integer;
 
-Var 
+Var
   CommandLine : AnsiString;
   i : Integer;
 
@@ -813,7 +813,10 @@ Finalization
 end.
 {
   $Log$
-  Revision 1.33  2004-02-13 10:50:23  marco
+  Revision 1.34  2004-06-13 10:49:50  florian
+    * fixed some bootstrapping problems as well as some 64 bit stuff
+
+  Revision 1.33  2004/02/13 10:50:23  marco
    * Hopefully last large changes to fpexec and friends.
   	- naming conventions changes from Michael.
   	- shell functions get alternative under ifdef.