Changeset 423 for trunk/Platform.pas


Ignore:
Timestamp:
Apr 25, 2022, 6:01:01 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Do not use explicit mode delphi directive as it is already set in project.
  • Modified: Use UNIX instead of LINUX for conditional code to work also on FreeBSD.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Platform.pas

    r290 r423  
    11unit Platform;
    2 
    3 {$mode delphi}{$H+}
    42
    53interface
    64
    75uses
    8   {$IFDEF Windows}Windows,{$ENDIF}
    9   {$IFDEF Linux}Unix,{$ENDIF}
     6  {$IFDEF WINDOWS}Windows,{$ENDIF}
     7  {$IFDEF UNIX}Unix,{$ENDIF}
    108  Classes, SysUtils, DateUtils, SyncObjs;
    119
     
    1412implementation
    1513
    16 {$IFDEF Windows}
     14{$IFDEF WINDOWS}
    1715var
    1816  PerformanceFrequency: Int64;
     
    2422function NowPrecise: TDateTime;
    2523var
    26   {$IFDEF Linux}T: TimeVal;{$ENDIF}
    27   {$IFDEF Windows}TimerValue: Int64;{$ENDIF}
     24  {$IFDEF UNIX}T: TimeVal;{$ENDIF}
     25  {$IFDEF WINDOWS}TimerValue: Int64;{$ENDIF}
    2826begin
    2927//  Result := Now;
    3028  //try
    3129    //NowPreciseLock.Acquire;
    32     {$IFDEF Windows}
     30    {$IFDEF WINDOWS}
    3331    QueryPerformanceCounter(TimerValue);
    3432    //Result := Int64(TimeStampToMSecs(DateTimeToTimeStamp(Now)) * 1000) // an alternative Win32 timebase
     
    3634    {$ENDIF}
    3735
    38     {$IFDEF Linux}
     36    {$IFDEF UNIX}
    3937    fpgettimeofday(@t, nil);
    4038     // Build a 64 bit microsecond tick from the seconds and microsecond longints
     
    5149initialization
    5250
    53 {$IFDEF Windows}
     51{$IFDEF WINDOWS}
    5452QueryPerformanceFrequency(PerformanceFrequency);
    5553{$ENDIF}
Note: See TracChangeset for help on using the changeset viewer.