Selaa lähdekoodia

* fix linux build

git-svn-id: trunk@3626 -
peter 19 vuotta sitten
vanhempi
commit
da85b3db8c
3 muutettua tiedostoa jossa 18 lisäystä ja 26 poistoa
  1. 1 1
      rtl/inc/fexpand.inc
  2. 13 3
      rtl/objpas/sysutils/fina.inc
  3. 4 22
      rtl/unix/sysutils.pp

+ 1 - 1
rtl/inc/fexpand.inc

@@ -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;

+ 13 - 3
rtl/objpas/sysutils/fina.inc

@@ -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;
 

+ 4 - 22
rtl/unix/sysutils.pp

@@ -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;