mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 08:51:10 +02:00
* Fixed INt() proble. Defined THandle, included Filemode constants
This commit is contained in:
parent
641d6e3304
commit
d541279136
@ -83,9 +83,13 @@ end ;
|
|||||||
{ DateTimeToTimeStamp converts DateTime to a TTimeStamp }
|
{ DateTimeToTimeStamp converts DateTime to a TTimeStamp }
|
||||||
|
|
||||||
function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp;
|
function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp;
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
result.Time := Trunc(Frac(DateTime) * MSecsPerDay);
|
result.Time := Trunc(Frac(DateTime) * MSecsPerDay);
|
||||||
result.Date := 1 + DateDelta + Trunc(Int(DateTime));
|
result.Date := 1
|
||||||
|
+ DateDelta
|
||||||
|
+ Trunc(System.Int(DateTime));
|
||||||
end ;
|
end ;
|
||||||
|
|
||||||
{ TimeStampToDateTime converts TimeStamp to a TDateTime value }
|
{ TimeStampToDateTime converts TimeStamp to a TDateTime value }
|
||||||
@ -140,7 +144,7 @@ var
|
|||||||
l:longint;
|
l:longint;
|
||||||
ly:boolean;
|
ly:boolean;
|
||||||
begin
|
begin
|
||||||
l := Trunc(Int(Date)) + DateDelta;
|
l := Trunc(System.Int(Date)) + DateDelta;
|
||||||
year := 1 + 400 * (l div D400); l := (l mod D400);
|
year := 1 + 400 * (l div D400); l := (l mod D400);
|
||||||
year := year + 100 * (l div D100);l := (l mod D100);
|
year := year + 100 * (l div D100);l := (l mod D100);
|
||||||
year := year + 4 * (l div D4);l := (l mod D4);
|
year := year + 4 * (l div D4);l := (l mod D4);
|
||||||
@ -621,7 +625,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
Changes from Gretjan Schouten
|
||||||
|
|
||||||
Revision 1.4 1998/10/11 13:40:52 michael
|
Revision 1.4 1998/10/11 13:40:52 michael
|
||||||
|
@ -14,10 +14,8 @@
|
|||||||
|
|
||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
|
|
||||||
{$ifndef win32}
|
|
||||||
Type
|
Type
|
||||||
THandle = Longint; // Needed for TSearchRec
|
THandle = Longint;
|
||||||
{$endif}
|
|
||||||
|
|
||||||
Type
|
Type
|
||||||
TSearchRec = Record
|
TSearchRec = Record
|
||||||
@ -39,6 +37,11 @@ Const
|
|||||||
faArchive = $00000020;
|
faArchive = $00000020;
|
||||||
faAnyFile = $0000003f;
|
faAnyFile = $0000003f;
|
||||||
|
|
||||||
|
fmOpenRead = $0000;
|
||||||
|
fmOpenWrite = $0001;
|
||||||
|
fmOpenReadWrite = $0002;
|
||||||
|
|
||||||
|
|
||||||
Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
|
Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
|
||||||
Function FileCreate (Const FileName : String) : Longint;
|
Function FileCreate (Const FileName : String) : Longint;
|
||||||
Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
|
Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
|
||||||
@ -62,7 +65,10 @@ Function FileSearch (Const Name, DirList : String) : String;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
+ Added filetruncate
|
||||||
|
|
||||||
Revision 1.2 1998/10/11 13:47:45 michael
|
Revision 1.2 1998/10/11 13:47:45 michael
|
||||||
|
@ -22,12 +22,12 @@ interface
|
|||||||
linux
|
linux
|
||||||
{$else}
|
{$else}
|
||||||
{$ifdef win32}
|
{$ifdef win32}
|
||||||
windows,
|
dos,windows
|
||||||
{$endif}
|
{$else}
|
||||||
dos
|
|
||||||
{$ifdef go32v2}
|
{$ifdef go32v2}
|
||||||
,go32
|
go32
|
||||||
{$endif go32v2}
|
{$endif go32v2}
|
||||||
|
{$endif win32}
|
||||||
{$endif linux}
|
{$endif linux}
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -271,7 +271,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
+ Uses Windows on win32 platform
|
||||||
|
|
||||||
Revision 1.18 1998/12/15 22:43:12 peter
|
Revision 1.18 1998/12/15 22:43:12 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user