* Allow vcl-compat to be compiled for webassembly

This commit is contained in:
Michaël Van Canneyt 2024-04-24 14:19:16 +02:00
parent 9f812855bb
commit 1b0a1254ad
2 changed files with 15 additions and 14 deletions

View File

@ -19,7 +19,7 @@ begin
P.HomepageURL := 'www.freepascal.org';
P.Email := '';
P.Description := 'Various non-visual VCL compatibility units.';
P.OSes := [beos,haiku,freebsd,darwin,iphonesim,ios,solaris,netbsd,openbsd,linux,win32,win64,wince,aix,amiga,aros,morphos,dragonfly,android];
P.OSes := [beos,haiku,freebsd,darwin,iphonesim,ios,solaris,netbsd,openbsd,linux,win32,win64,wince,aix,amiga,aros,morphos,dragonfly,android,wasi];
if Defaults.CPU=jvm then
P.OSes := P.OSes - [java,android];

View File

@ -444,7 +444,7 @@ begin
if Length(DriveSeparator)>0 then
begin
{$ifdef UNIX}
{$if defined(UNIX) or defined(WASI)}
FVolumeSeparatorChar := DriveSeparator[1]
{$else}
FVolumeSeparatorChar := DriveSeparator
@ -906,19 +906,20 @@ begin
Result:=Combine([Path1,Path2,Path3,Path4],ValidateParams);
end;
function AppendPathDelim(const Path: string): string;
begin
if (Path = '') or (Path[Length(Path)] in AllowDirectorySeparators)
{$ifdef mswindows}
//don't add a PathDelim to e.g. 'C:'
or ((Length(Path) = 2) and (Path[2] = ':') and (UpCase(Path[1]) in ['A'..'Z']))
{$endif}
then
Result:=Path
else
Result:=Path + DirectorySeparator;
end;
class function TPath.Combine(const Paths: array of string; const ValidateParams: Boolean = True): string;
function AppendPathDelim(const Path: string): string;
begin
if (Path = '') or (Path[Length(Path)] in AllowDirectorySeparators)
{$ifdef mswindows}
//don't add a PathDelim to e.g. 'C:'
or ((Length(Path) = 2) and (Path[2] = ':') and (UpCase(Path[1]) in ['A'..'Z']))
{$endif}
then
Result:=Path
else
Result:=Path + DirectorySeparator;
end;
var
i: Integer;
Path: String;