mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 10:45:08 +02:00
* fix linux build
git-svn-id: trunk@3626 -
This commit is contained in:
parent
a57708e63d
commit
da85b3db8c
@ -67,7 +67,7 @@ end;
|
||||
|
||||
{$IFDEF FPC_FEXPAND_VOLUMES}
|
||||
{$IFNDEF FPC_FEXPAND_NO_DEFAULT_PATHS}
|
||||
procedure GetDirIO (const VolumeName: OpenString; var Dir: OpenString);
|
||||
procedure GetDirIO (const VolumeName: OpenString; var Dir: PathStr);
|
||||
|
||||
var
|
||||
OldInOutRes: word;
|
||||
|
@ -94,11 +94,21 @@ else Result := '';
|
||||
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
|
||||
PathStr=string;
|
||||
{$i fexpand.inc}
|
||||
{$endif}
|
||||
{$I fexpand.inc}
|
||||
|
||||
{$ifdef Unix}
|
||||
{$UNDEF FPC_FEXPAND_GETENVPCHAR}
|
||||
{$UNDEF FPC_FEXPAND_TILDE}
|
||||
{$endif}
|
||||
|
||||
function ExpandFileName (Const FileName : string): String;
|
||||
|
||||
|
@ -86,24 +86,6 @@ procedure UnhookSignal(RtlSigNum: Integer; OnlyIfHooked: Boolean = True);
|
||||
|
||||
{$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 }
|
||||
{$i sysutils.inc}
|
||||
|
||||
@ -341,7 +323,7 @@ Function Dirname(Const path:pathstr):pathstr;
|
||||
a slash.
|
||||
}
|
||||
var
|
||||
Dir : PathStr;
|
||||
Dir : DirStr;
|
||||
Name : NameStr;
|
||||
Ext : ExtStr;
|
||||
begin
|
||||
@ -358,7 +340,7 @@ Function Basename(Const path:pathstr;Const suf:pathstr):pathstr;
|
||||
supplied, it is cut off the filename.
|
||||
}
|
||||
var
|
||||
Dir : PathStr;
|
||||
Dir : DirStr;
|
||||
Name : NameStr;
|
||||
Ext : ExtStr;
|
||||
begin
|
||||
@ -1090,14 +1072,14 @@ begin
|
||||
Result:=IncludeTrailingPathDelimiter(Result);
|
||||
end;
|
||||
|
||||
{ Follows base-dir spec,
|
||||
{ Follows base-dir spec,
|
||||
see [http://freedesktop.org/Standards/basedir-spec].
|
||||
Always ends with PathDelim. }
|
||||
Function XdgConfigHome : String;
|
||||
begin
|
||||
Result:=GetEnvironmentVariable('XDG_CONFIG_HOME');
|
||||
if (Result='') then
|
||||
Result:=GetHomeDir + '.config/'
|
||||
Result:=GetHomeDir + '.config/'
|
||||
else
|
||||
Result:=IncludeTrailingPathDelimiter(Result);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user