mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 23:59:10 +02:00
+ added expand defines for all OSes, hopefully no OS forgotten
git-svn-id: trunk@3708 -
This commit is contained in:
parent
7694d8374d
commit
2a62055580
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6864,6 +6864,7 @@ tests/webtbs/tw6735.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw6742.pp svneol=native#text/plain
|
tests/webtbs/tw6742.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw6767.pp svneol=native#text/plain
|
tests/webtbs/tw6767.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw6960.pp svneol=native#text/plain
|
tests/webtbs/tw6960.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw6980.pp svneol=native#text/plain
|
||||||
tests/webtbs/ub1873.pp svneol=native#text/plain
|
tests/webtbs/ub1873.pp svneol=native#text/plain
|
||||||
tests/webtbs/ub1883.pp svneol=native#text/plain
|
tests/webtbs/ub1883.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw0555.pp svneol=native#text/plain
|
tests/webtbs/uw0555.pp svneol=native#text/plain
|
||||||
|
@ -96,11 +96,47 @@ end;
|
|||||||
|
|
||||||
{$ifdef Unix}
|
{$ifdef Unix}
|
||||||
Function getenv(name:shortstring):Pchar; external name 'FPC_SYSC_FPGETENV';
|
Function getenv(name:shortstring):Pchar; external name 'FPC_SYSC_FPGETENV';
|
||||||
|
|
||||||
{$DEFINE FPC_FEXPAND_TILDE} { Tilde is expanded to home }
|
{$DEFINE FPC_FEXPAND_TILDE} { Tilde is expanded to home }
|
||||||
{$DEFINE FPC_FEXPAND_GETENVPCHAR} { GetEnv result is a PChar }
|
{$DEFINE FPC_FEXPAND_GETENVPCHAR} { GetEnv result is a PChar }
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(win32) or defined(win64)) or defined(go32v2) or defined(wdosx)}
|
||||||
|
{$DEFINE FPC_FEXPAND_UNC} (* UNC paths are supported *)
|
||||||
|
{$DEFINE FPC_FEXPAND_DRIVES} (* Full paths begin with drive specification *)
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(wince)}
|
||||||
|
{$DEFINE FPC_FEXPAND_NO_DEFAULT_PATHS}
|
||||||
|
{$DEFINE FPC_FEXPAND_UNC} (* UNC paths are supported *)
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(morphos) or defined(amiga)}
|
||||||
|
{$DEFINE FPC_FEXPAND_VOLUMES} (* Full paths begin with drive specification *)
|
||||||
|
{$DEFINE FPC_FEXPAND_DRIVESEP_IS_ROOT}
|
||||||
|
{$DEFINE FPC_FEXPAND_NO_DEFAULT_PATHS}
|
||||||
|
{$endif }
|
||||||
|
|
||||||
|
{$if defined(OS2)}
|
||||||
|
{$DEFINE FPC_FEXPAND_UNC} (* UNC paths are supported *)
|
||||||
|
{$DEFINE FPC_FEXPAND_DRIVES} (* Full paths begin with drive specification *)
|
||||||
|
{$DEFINE FPC_FEXPAND_GETENV_PCHAR}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(MACOS)}
|
||||||
|
{$DEFINE FPC_FEXPAND_VOLUMES}
|
||||||
|
{$DEFINE FPC_FEXPAND_NO_DEFAULT_PATHS}
|
||||||
|
{$DEFINE FPC_FEXPAND_DRIVESEP_IS_ROOT}
|
||||||
|
{$DEFINE FPC_FEXPAND_NO_DOTS_UPDIR}
|
||||||
|
{$DEFINE FPC_FEXPAND_NO_CURDIR}
|
||||||
|
{$endif defined(MACOS)}
|
||||||
|
|
||||||
|
{$if defined(NETWARE)}
|
||||||
|
{$DEFINE FPC_FEXPAND_DRIVES}
|
||||||
|
{$DEFINE FPC_FEXPAND_VOLUMES}
|
||||||
|
{$DEFINE FPC_FEXPAND_NO_DEFAULT_PATHS}
|
||||||
|
{$endif defined(NETWARE)}
|
||||||
|
|
||||||
type
|
type
|
||||||
PathStr=string;
|
PathStr=string;
|
||||||
{$I fexpand.inc}
|
{$I fexpand.inc}
|
||||||
@ -108,7 +144,45 @@ end;
|
|||||||
{$ifdef Unix}
|
{$ifdef Unix}
|
||||||
{$UNDEF FPC_FEXPAND_GETENVPCHAR}
|
{$UNDEF FPC_FEXPAND_GETENVPCHAR}
|
||||||
{$UNDEF FPC_FEXPAND_TILDE}
|
{$UNDEF FPC_FEXPAND_TILDE}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(win32) or defined(win64)) or defined(go32v2) or defined(wdosx)}
|
||||||
|
{$UNDEF FPC_FEXPAND_UNC} (* UNC paths are supported *)
|
||||||
|
{$UNDEF FPC_FEXPAND_DRIVES} (* Full paths begin with drive specification *)
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(wince)}
|
||||||
|
{$UNDEF FPC_FEXPAND_NO_DEFAULT_PATHS}
|
||||||
|
{$UNDEF FPC_FEXPAND_UNC} (* UNC paths are supported *)
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(morphos) or defined(amiga)}
|
||||||
|
{$UNDEF FPC_FEXPAND_VOLUMES} (* Full paths begin with drive specification *)
|
||||||
|
{$UNDEF FPC_FEXPAND_DRIVESEP_IS_ROOT}
|
||||||
|
{$UNDEF FPC_FEXPAND_NO_DEFAULT_PATHS}
|
||||||
|
{$endif }
|
||||||
|
|
||||||
|
{$if defined(OS2)}
|
||||||
|
{$UNDEF FPC_FEXPAND_UNC} (* UNC paths are supported *)
|
||||||
|
{$UNDEF FPC_FEXPAND_DRIVES} (* Full paths begin with drive specification *)
|
||||||
|
{$UNDEF FPC_FEXPAND_GETENV_PCHAR}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(MACOS)}
|
||||||
|
{$UNDEF FPC_FEXPAND_VOLUMES}
|
||||||
|
{$UNDEF FPC_FEXPAND_NO_DEFAULT_PATHS}
|
||||||
|
{$UNDEF FPC_FEXPAND_DRIVESEP_IS_ROOT}
|
||||||
|
{$UNDEF FPC_FEXPAND_NO_DOTS_UPDIR}
|
||||||
|
{$UNDEF FPC_FEXPAND_NO_CURDIR}
|
||||||
|
{$endif defined(MACOS)}
|
||||||
|
|
||||||
|
|
||||||
|
{$if defined(NETWARE)}
|
||||||
|
{$UNDEF FPC_FEXPAND_DRIVES}
|
||||||
|
{$UNDEF FPC_FEXPAND_VOLUMES}
|
||||||
|
{$UNDEF FPC_FEXPAND_NO_DEFAULT_PATHS}
|
||||||
|
{$endif defined(NETWARE)}
|
||||||
|
|
||||||
|
|
||||||
function ExpandFileName (Const FileName : string): String;
|
function ExpandFileName (Const FileName : string): String;
|
||||||
|
|
||||||
|
19
tests/webtbs/tw6980.pp
Normal file
19
tests/webtbs/tw6980.pp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{ %target=win32,go32v2,win64 }
|
||||||
|
program Project1;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils
|
||||||
|
{ add your units here };
|
||||||
|
|
||||||
|
var
|
||||||
|
p: string;
|
||||||
|
e: string;
|
||||||
|
begin
|
||||||
|
p := 'C:\test';
|
||||||
|
e := ExpandFileName('c:\test');
|
||||||
|
writeln('Expanded: ',e);
|
||||||
|
if (p<>e) then halt(1);
|
||||||
|
writeln('ok');
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user