Ignore:
Timestamp:
Apr 25, 2022, 6:01:01 PM (2 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/Packages/Common/UCommon.pas

    r420 r423  
    11unit UCommon;
    22
    3 {$mode delphi}
    4 
    53interface
    64
    75uses
    8   {$ifdef Windows}Windows,{$endif}
    9   {$ifdef Linux}baseunix,{$endif}
     6  {$IFDEF WINDOWS}Windows,{$ENDIF}
     7  {$IFDEF UNIX}baseunix,{$ENDIF}
    108  Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf,
    119  FileUtil; //, ShFolder, ShellAPI;
     
    3533  DLLHandle1: HModule;
    3634
    37 {$IFDEF Windows}
     35{$IFDEF WINDOWS}
    3836  GetUserNameEx: procedure (NameFormat: DWORD;
    3937    lpNameBuffer: LPSTR; nSize: PULONG); stdcall;
     
    302300end;
    303301
    304 {$IFDEF Windows}
     302{$IFDEF WINDOWS}
    305303function GetUserName: string;
    306304const
     
    323321  end;
    324322end;
    325 {$endif}
     323{$ENDIF}
    326324
    327325function ComputerName: string;
    328 {$ifdef mswindows}
     326{$IFDEF WINDOWS}
    329327const
    330328 INFO_BUFFER_SIZE = 32767;
     
    341339  end;
    342340end;
    343 {$endif}
    344 {$ifdef unix}
     341{$ENDIF}
     342{$IFDEF UNIX}
    345343var
    346344  Name: UtsName;
     
    349347  Result := Name.Nodename;
    350348end;
    351 {$endif}
    352 
    353 {$ifdef windows}
     349{$ENDIF}
     350
     351{$IFDEF WINDOWS}
    354352function LoggedOnUserNameEx(Format: TUserNameFormat): string;
    355353const
     
    429427procedure LoadLibraries;
    430428begin
    431   {$IFDEF Windows}
     429  {$IFDEF WINDOWS}
    432430  DLLHandle1 := LoadLibrary('secur32.dll');
    433431  if DLLHandle1 <> 0 then
     
    440438procedure FreeLibraries;
    441439begin
    442   {$IFDEF Windows}
     440  {$IFDEF WINDOWS}
    443441  if DLLHandle1 <> 0 then FreeLibrary(DLLHandle1);
    444442  {$ENDIF}
Note: See TracChangeset for help on using the changeset viewer.