* fix linux build

git-svn-id: trunk@3626 -
This commit is contained in:
peter 2006-05-22 06:57:41 +00:00
parent a57708e63d
commit da85b3db8c
3 changed files with 18 additions and 26 deletions

View File

@ -67,7 +67,7 @@ end;
{$IFDEF FPC_FEXPAND_VOLUMES} {$IFDEF FPC_FEXPAND_VOLUMES}
{$IFNDEF FPC_FEXPAND_NO_DEFAULT_PATHS} {$IFNDEF FPC_FEXPAND_NO_DEFAULT_PATHS}
procedure GetDirIO (const VolumeName: OpenString; var Dir: OpenString); procedure GetDirIO (const VolumeName: OpenString; var Dir: PathStr);
var var
OldInOutRes: word; OldInOutRes: word;

View File

@ -94,11 +94,21 @@ else Result := '';
end; end;
{$ifndef HasUnix} {$ifdef Unix}
Function getenv(name:shortstring):Pchar; external name 'FPC_SYSC_FPGETENV';
{$DEFINE FPC_FEXPAND_TILDE} { Tilde is expanded to home }
{$DEFINE FPC_FEXPAND_GETENVPCHAR} { GetEnv result is a PChar }
{$endif}
type type
PathStr=string; PathStr=string;
{$i fexpand.inc} {$I fexpand.inc}
{$endif}
{$ifdef Unix}
{$UNDEF FPC_FEXPAND_GETENVPCHAR}
{$UNDEF FPC_FEXPAND_TILDE}
{$endif}
function ExpandFileName (Const FileName : string): String; function ExpandFileName (Const FileName : string): String;

View File

@ -86,24 +86,6 @@ procedure UnhookSignal(RtlSigNum: Integer; OnlyIfHooked: Boolean = True);
{$Define OS_FILEISREADONLY} // Specific implementation for Unix. {$Define OS_FILEISREADONLY} // Specific implementation for Unix.
Function getenv(name:shortstring):Pchar; external name 'FPC_SYSC_FPGETENV';
Type
ComStr = String[255];
PathStr = String[255];
DirStr = String[255];
NameStr = String[255];
ExtStr = String[255];
{$DEFINE FPC_FEXPAND_TILDE} { Tilde is expanded to home }
{$DEFINE FPC_FEXPAND_GETENVPCHAR} { GetEnv result is a PChar }
{$I fexpand.inc}
{$UNDEF FPC_FEXPAND_GETENVPCHAR}
{$UNDEF FPC_FEXPAND_TILDE}
{ Include platform independent implementation part } { Include platform independent implementation part }
{$i sysutils.inc} {$i sysutils.inc}
@ -341,7 +323,7 @@ Function Dirname(Const path:pathstr):pathstr;
a slash. a slash.
} }
var var
Dir : PathStr; Dir : DirStr;
Name : NameStr; Name : NameStr;
Ext : ExtStr; Ext : ExtStr;
begin begin
@ -358,7 +340,7 @@ Function Basename(Const path:pathstr;Const suf:pathstr):pathstr;
supplied, it is cut off the filename. supplied, it is cut off the filename.
} }
var var
Dir : PathStr; Dir : DirStr;
Name : NameStr; Name : NameStr;
Ext : ExtStr; Ext : ExtStr;
begin begin
@ -1090,14 +1072,14 @@ begin
Result:=IncludeTrailingPathDelimiter(Result); Result:=IncludeTrailingPathDelimiter(Result);
end; end;
{ Follows base-dir spec, { Follows base-dir spec,
see [http://freedesktop.org/Standards/basedir-spec]. see [http://freedesktop.org/Standards/basedir-spec].
Always ends with PathDelim. } Always ends with PathDelim. }
Function XdgConfigHome : String; Function XdgConfigHome : String;
begin begin
Result:=GetEnvironmentVariable('XDG_CONFIG_HOME'); Result:=GetEnvironmentVariable('XDG_CONFIG_HOME');
if (Result='') then if (Result='') then
Result:=GetHomeDir + '.config/' Result:=GetHomeDir + '.config/'
else else
Result:=IncludeTrailingPathDelimiter(Result); Result:=IncludeTrailingPathDelimiter(Result);
end; end;