mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:19:24 +02:00
Rewrites the GetTickCount interfaces to preserve backwards compatibility, to more closely resamble the WinAPI and also avoid confusion
git-svn-id: trunk@33563 -
This commit is contained in:
parent
965ae5eba4
commit
027d11ac6a
@ -8,7 +8,7 @@ uses
|
|||||||
SysUtils;
|
SysUtils;
|
||||||
|
|
||||||
function NowUTC: TDateTime;
|
function NowUTC: TDateTime;
|
||||||
function GetTickCount: Int64;
|
function GetTickCount64: QWord;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -31,9 +31,9 @@ begin
|
|||||||
result := systemTimeToDateTime(SystemTime);
|
result := systemTimeToDateTime(SystemTime);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// GetTickCount64 is better, but we need to check the Windows version to use it
|
function GetTickCount64: QWord;
|
||||||
function GetTickCount: Int64;
|
|
||||||
begin
|
begin
|
||||||
|
// GetTickCount64 is better, but we need to check the Windows version to use it
|
||||||
Result := Windows.GetTickCount();
|
Result := Windows.GetTickCount();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ begin
|
|||||||
result := systemTimeToDateTime(SystemTime);
|
result := systemTimeToDateTime(SystemTime);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetTickCount: Int64;
|
function GetTickCount64: QWord;
|
||||||
var
|
var
|
||||||
tp: TTimeVal;
|
tp: TTimeVal;
|
||||||
begin
|
begin
|
||||||
@ -111,7 +111,7 @@ begin
|
|||||||
Result := Now;
|
Result := Now;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetTickCount: Int64;
|
function GetTickCount64: QWord;
|
||||||
begin
|
begin
|
||||||
Result := Trunc(Now * 24 * 60 * 60 * 1000);
|
Result := Trunc(Now * 24 * 60 * 60 * 1000);
|
||||||
end;
|
end;
|
||||||
|
@ -71,7 +71,8 @@ function PredefinedClipboardFormat(
|
|||||||
|
|
||||||
function MsgKeyDataToShiftState(KeyData: PtrInt): TShiftState;
|
function MsgKeyDataToShiftState(KeyData: PtrInt): TShiftState;
|
||||||
|
|
||||||
function GetTickCount(): Int64;
|
function GetTickCount(): DWord;
|
||||||
|
function GetTickCount64(): QWord;
|
||||||
|
|
||||||
{$IFDEF DebugLCL}
|
{$IFDEF DebugLCL}
|
||||||
function GetTickStep: DWord;
|
function GetTickStep: DWord;
|
||||||
@ -136,9 +137,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetTickCount(): Int64;
|
function GetTickCount(): DWord;
|
||||||
begin
|
begin
|
||||||
Result := lazutf8sysutils.GetTickCount();
|
Result := DWord(lazutf8sysutils.GetTickCount64());
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetTickCount64(): QWord;
|
||||||
|
begin
|
||||||
|
Result := lazutf8sysutils.GetTickCount64();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF DebugLCL}
|
{$IFDEF DebugLCL}
|
||||||
|
Loading…
Reference in New Issue
Block a user