From 4401ddfaa20d87492442cb7656c37d13b75995d7 Mon Sep 17 00:00:00 2001 From: tobigun Date: Mon, 16 Jun 2008 15:00:46 +0000 Subject: Delphi 7 compatibility fix: - "in"-operator does not work with WideChar operands, e.g. "mychar in ['a..z'] - FPC_VERSION/RELEASE/PATCH (e.g. {$IF FPC_VERSION > 2}) must be defined as constants because delphi 7 does not care about {$IFDEF FPC} sections and complains about undefined constant expressions. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1150 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UPlatformLinux.pas | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Game/Code/Classes/UPlatformLinux.pas') diff --git a/Game/Code/Classes/UPlatformLinux.pas b/Game/Code/Classes/UPlatformLinux.pas index fabca659..f9b83f2c 100644 --- a/Game/Code/Classes/UPlatformLinux.pas +++ b/Game/Code/Classes/UPlatformLinux.pas @@ -10,7 +10,8 @@ interface uses Classes, - UPlatform; + UPlatform, + UConfig; type @@ -34,12 +35,11 @@ implementation uses UCommandLine, BaseUnix, - {$IFDEF FPC_VERSION_2_2_2_PLUS} + {$IF FPC_VERSION_INT >= 2002002} pwd, - {$ENDIF} + {$IFEND} SysUtils, - ULog, - UConfig; + ULog; function TPlatformLinux.DirectoryFindFiles(Dir, Filter : WideString; ReturnAllSubDirs : Boolean) : TDirectoryEntryArray; var @@ -134,19 +134,19 @@ end; * Returns the user's home directory terminated by a path delimiter *) function TPlatformLinux.GetHomeDir(): string; -{$IFDEF FPC_VERSION_2_2_2_PLUS} +{$IF FPC_VERSION_INT >= 2002002} var PasswdEntry: PPasswd; -{$ENDIF} +{$IFEND} begin Result := ''; - {$IFDEF FPC_VERSION_2_2_2_PLUS} + {$IF FPC_VERSION_INT >= 2002002} // try to retrieve the info from passwd PasswdEntry := FpGetpwuid(FpGetuid()); if (PasswdEntry <> nil) then Result := PasswdEntry.pw_dir; - {$ENDIF} + {$IFEND} // fallback if passwd does not contain the path if (Result = '') then Result := GetEnvironmentVariable('HOME'); @@ -154,11 +154,11 @@ begin if (Result <> '') then Result := IncludeTrailingPathDelimiter(Result); - {$IFDEF FPC_VERSION_2_2_2_PLUS} + {$IF FPC_VERSION_INT >= 2002002} // GetUserDir() is another function that returns a user path. // It uses env-var HOME or a fallback to a temp-dir. //Result := GetUserDir(); - {$ENDIF} + {$IFEND} end; // FIXME: Maybe this should be TPlatformBase.Halt() for all platforms -- cgit v1.2.3