From d541279136b3fba6691fd96ee3568dc964a2dbea Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 9 Feb 1999 12:38:42 +0000 Subject: [PATCH] * Fixed INt() proble. Defined THandle, included Filemode constants --- rtl/objpas/dati.inc | 13 ++++++++++--- rtl/objpas/filutilh.inc | 14 ++++++++++---- rtl/objpas/sysutils.pp | 17 ++++++++++------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/rtl/objpas/dati.inc b/rtl/objpas/dati.inc index d45303bce7..913c8567a7 100644 --- a/rtl/objpas/dati.inc +++ b/rtl/objpas/dati.inc @@ -83,9 +83,13 @@ end ; { DateTimeToTimeStamp converts DateTime to a TTimeStamp } function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp; + + begin result.Time := Trunc(Frac(DateTime) * MSecsPerDay); -result.Date := 1 + DateDelta + Trunc(Int(DateTime)); +result.Date := 1 + + DateDelta + + Trunc(System.Int(DateTime)); end ; { TimeStampToDateTime converts TimeStamp to a TDateTime value } @@ -140,7 +144,7 @@ var l:longint; ly:boolean; begin -l := Trunc(Int(Date)) + DateDelta; +l := Trunc(System.Int(Date)) + DateDelta; year := 1 + 400 * (l div D400); l := (l mod D400); year := year + 100 * (l div D100);l := (l mod D100); year := year + 4 * (l div D4);l := (l mod D4); @@ -621,7 +625,10 @@ end; { $Log$ - Revision 1.5 1998-10-15 09:39:12 michael + Revision 1.6 1999-02-09 12:38:42 michael + * Fixed INt() proble. Defined THandle, included Filemode constants + + Revision 1.5 1998/10/15 09:39:12 michael Changes from Gretjan Schouten Revision 1.4 1998/10/11 13:40:52 michael diff --git a/rtl/objpas/filutilh.inc b/rtl/objpas/filutilh.inc index f459e9fea9..8d5b39f744 100644 --- a/rtl/objpas/filutilh.inc +++ b/rtl/objpas/filutilh.inc @@ -14,10 +14,8 @@ **********************************************************************} -{$ifndef win32} Type - THandle = Longint; // Needed for TSearchRec -{$endif} + THandle = Longint; Type TSearchRec = Record @@ -38,6 +36,11 @@ Const faDirectory = $00000010; faArchive = $00000020; faAnyFile = $0000003f; + + fmOpenRead = $0000; + fmOpenWrite = $0001; + fmOpenReadWrite = $0002; + Function FileOpen (Const FileName : string; Mode : Integer) : Longint; Function FileCreate (Const FileName : String) : Longint; @@ -62,7 +65,10 @@ Function FileSearch (Const Name, DirList : String) : String; { $Log$ - Revision 1.3 1999-02-02 21:21:37 michael + Revision 1.4 1999-02-09 12:38:43 michael + * Fixed INt() proble. Defined THandle, included Filemode constants + + Revision 1.3 1999/02/02 21:21:37 michael + Added filetruncate Revision 1.2 1998/10/11 13:47:45 michael diff --git a/rtl/objpas/sysutils.pp b/rtl/objpas/sysutils.pp index ae3cd74cd3..5dcbe29b19 100644 --- a/rtl/objpas/sysutils.pp +++ b/rtl/objpas/sysutils.pp @@ -22,12 +22,12 @@ interface linux {$else} {$ifdef win32} - windows, - {$endif} - dos - {$ifdef go32v2} - ,go32 - {$endif go32v2} + dos,windows + {$else} + {$ifdef go32v2} + go32 + {$endif go32v2} + {$endif win32} {$endif linux} ; @@ -271,7 +271,10 @@ begin end. { $Log$ - Revision 1.19 1999-02-03 16:18:58 michael + Revision 1.20 1999-02-09 12:38:44 michael + * Fixed INt() proble. Defined THandle, included Filemode constants + + Revision 1.19 1999/02/03 16:18:58 michael + Uses Windows on win32 platform Revision 1.18 1998/12/15 22:43:12 peter