diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-06-16 15:00:46 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-06-16 15:00:46 +0000 |
commit | 4401ddfaa20d87492442cb7656c37d13b75995d7 (patch) | |
tree | 9caf2c1a46daf42f4ad8c5e7e2d3e59369ea3c73 /Game/Code/Classes/UPlatformLinux.pas | |
parent | f01995d31ad202ccbbe8f79213303e479923cd81 (diff) | |
download | usdx-4401ddfaa20d87492442cb7656c37d13b75995d7.tar.gz usdx-4401ddfaa20d87492442cb7656c37d13b75995d7.tar.xz usdx-4401ddfaa20d87492442cb7656c37d13b75995d7.zip |
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
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/UPlatformLinux.pas | 22 |
1 files changed, 11 insertions, 11 deletions
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 |