Browse Source

* Char -> AnsiChar

Michael VAN CANNEYT 2 years ago
parent
commit
2ca6f178fb
7 changed files with 64 additions and 64 deletions
  1. 9 9
      rtl/atari/dos.pp
  2. 16 16
      rtl/atari/gemdos.inc
  3. 5 5
      rtl/atari/sysdir.inc
  4. 6 6
      rtl/atari/sysfile.inc
  5. 5 5
      rtl/atari/syspara.inc
  6. 6 6
      rtl/atari/system.pp
  7. 17 17
      rtl/atari/sysutils.pp

+ 9 - 9
rtl/atari/dos.pp

@@ -158,7 +158,7 @@ begin
 
 
   { the zero offset for cmdline is actually correct here. pexec() expects
   { the zero offset for cmdline is actually correct here. pexec() expects
     pascal formatted string for cmdline, so length in first byte }
     pascal formatted string for cmdline, so length in first byte }
-  dosResult:=gemdos_pexec(0,PChar(@tmpPath[1]),@ComLine[0],nil);
+  dosResult:=gemdos_pexec(0,PAnsiChar(@tmpPath[1]),@ComLine[0],nil);
   if dosResult < 0 then
   if dosResult < 0 then
     Error2DosError(dosResult);
     Error2DosError(dosResult);
 end;
 end;
@@ -215,7 +215,7 @@ begin
   gemdos_setdta(@IFD^.dta_search);
   gemdos_setdta(@IFD^.dta_search);
 
 
   f.IFD:=IFD;
   f.IFD:=IFD;
-  dosResult:=gemdos_fsfirst(pchar(r), Attr and AnyFile);
+  dosResult:=gemdos_fsfirst(PAnsiChar(r), Attr and AnyFile);
   if dosResult < 0 then
   if dosResult < 0 then
     begin
     begin
       Error2DosError(dosResult);
       Error2DosError(dosResult);
@@ -326,7 +326,7 @@ end;
 procedure GetFAttr(var f; var Attr : word);
 procedure GetFAttr(var f; var Attr : word);
 var
 var
   dosResult: LongInt;
   dosResult: LongInt;
-  path: PChar;
+  path: PAnsiChar;
 {$ifndef FPC_ANSI_TEXTFILEREC}
 {$ifndef FPC_ANSI_TEXTFILEREC}
   r: rawbytestring;
   r: rawbytestring;
 {$endif not FPC_ANSI_TEXTFILEREC}
 {$endif not FPC_ANSI_TEXTFILEREC}
@@ -335,7 +335,7 @@ begin
   path:=@filerec(f).Name;
   path:=@filerec(f).Name;
 {$else}
 {$else}
   r:=ToSingleByteFileSystemEncodedFileName(filerec(f).Name);
   r:=ToSingleByteFileSystemEncodedFileName(filerec(f).Name);
-  path:=pchar(r);
+  path:=PAnsiChar(r);
 {$endif}
 {$endif}
 
 
   Attr:=0;
   Attr:=0;
@@ -357,7 +357,7 @@ end;
 procedure SetFAttr(var f; attr : word);
 procedure SetFAttr(var f; attr : word);
 var
 var
   dosResult: LongInt;
   dosResult: LongInt;
-  path: PChar;
+  path: PAnsiChar;
 {$ifndef FPC_ANSI_TEXTFILEREC}
 {$ifndef FPC_ANSI_TEXTFILEREC}
   r: rawbytestring;
   r: rawbytestring;
 {$endif not FPC_ANSI_TEXTFILEREC}
 {$endif not FPC_ANSI_TEXTFILEREC}
@@ -366,10 +366,10 @@ begin
   path:=@filerec(f).Name;
   path:=@filerec(f).Name;
 {$else}
 {$else}
   r:=ToSingleByteFileSystemEncodedFileName(filerec(f).Name);
   r:=ToSingleByteFileSystemEncodedFileName(filerec(f).Name);
-  path:=pchar(r);
+  path:=PAnsiChar(r);
 {$endif}
 {$endif}
 
 
-  dosResult:=gemdos_fattrib(pchar(@FileRec(f).name),1,Attr);
+  dosResult:=gemdos_fattrib(PAnsiChar(@FileRec(f).name),1,Attr);
   if dosResult < 0 then
   if dosResult < 0 then
     Error2DosError(dosResult)
     Error2DosError(dosResult)
 end;
 end;
@@ -386,7 +386,7 @@ end;
 
 
 function EnvCount: Longint;
 function EnvCount: Longint;
 var
 var
-  hp : pchar;
+  hp : PAnsiChar;
 begin
 begin
   EnvCount:=0;
   EnvCount:=0;
   hp:=basepage^.p_env;
   hp:=basepage^.p_env;
@@ -400,7 +400,7 @@ end;
 
 
 function EnvStr(Index: LongInt): String;
 function EnvStr(Index: LongInt): String;
 var
 var
-  hp : pchar;
+  hp : PAnsiChar;
 begin
 begin
   EnvStr:='';
   EnvStr:='';
   hp:=basepage^.p_env;
   hp:=basepage^.p_env;

+ 16 - 16
rtl/atari/gemdos.inc

@@ -79,7 +79,7 @@ type
         d_time: word;                         {* Time                *}
         d_time: word;                         {* Time                *}
         d_date: word;                         {* Date                *}
         d_date: word;                         {* Date                *}
         d_length: dword;                      {* File length         *}
         d_length: dword;                      {* File length         *}
-        d_fname: array[0..13] of char;        {* Filename            *}
+        d_fname: array[0..13] of AnsiChar;        {* Filename            *}
     end;
     end;
 
 
 type
 type
@@ -115,15 +115,15 @@ type
       p_parent: PPD;          {* Pointer to the basepage of the      *}
       p_parent: PPD;          {* Pointer to the basepage of the      *}
                               {* calling processes                   *}
                               {* calling processes                   *}
       p_resrvd0: longint;     {* Reserved                            *}
       p_resrvd0: longint;     {* Reserved                            *}
-      p_env: pchar;           {* Address of the environment string   *}
-      p_resrvd1: array[0..79] of char;   {* Reserved                            *}
-      p_cmdlin: array[0..127] of char;   {* Command line                        *}
+      p_env: PAnsiChar;           {* Address of the environment string   *}
+      p_resrvd1: array[0..79] of AnsiChar;   {* Reserved                            *}
+      p_cmdlin: array[0..127] of AnsiChar;   {* Command line                        *}
   end;
   end;
   TBASEPAGE = TPD; {* alias types... *}
   TBASEPAGE = TPD; {* alias types... *}
   PBASEPAGE = ^TBASEPAGE;
   PBASEPAGE = ^TBASEPAGE;
 
 
 
 
-procedure gemdos_cconws(p: pchar); syscall 1 9;
+procedure gemdos_cconws(p: PAnsiChar); syscall 1 9;
 
 
 function gemdos_dsetdrv(drv: smallint): longint; syscall 1 14;
 function gemdos_dsetdrv(drv: smallint): longint; syscall 1 14;
 
 
@@ -140,27 +140,27 @@ function gemdos_sversion: smallint; syscall 1 48;
 
 
 function gemdos_dfree(buf: PDISKINFO; driveno: smallint): smallint; syscall 1 54;
 function gemdos_dfree(buf: PDISKINFO; driveno: smallint): smallint; syscall 1 54;
 
 
-function gemdos_dcreate(const path: pchar): longint; syscall 1 57;
-function gemdos_ddelete(const path: pchar): longint; syscall 1 58;
-function gemdos_dsetpath(path: pchar): smallint; syscall 1 59;
-function gemdos_fcreate(fname: pchar; attr: smallint): smallint; syscall 1 60;
-function gemdos_fopen(fname: pchar; mode: smallint): longint; syscall 1 61;
+function gemdos_dcreate(const path: PAnsiChar): longint; syscall 1 57;
+function gemdos_ddelete(const path: PAnsiChar): longint; syscall 1 58;
+function gemdos_dsetpath(path: PAnsiChar): smallint; syscall 1 59;
+function gemdos_fcreate(fname: PAnsiChar; attr: smallint): smallint; syscall 1 60;
+function gemdos_fopen(fname: PAnsiChar; mode: smallint): longint; syscall 1 61;
 function gemdos_fclose(handle: smallint): smallint; syscall 1 62;
 function gemdos_fclose(handle: smallint): smallint; syscall 1 62;
 function gemdos_fread(handle: smallint; count: longint; buf: pointer): longint; syscall 1 63;
 function gemdos_fread(handle: smallint; count: longint; buf: pointer): longint; syscall 1 63;
 function gemdos_fwrite(handle: smallint; count: longint; buf: pointer): longint; syscall 1 64;
 function gemdos_fwrite(handle: smallint; count: longint; buf: pointer): longint; syscall 1 64;
-function gemdos_fdelete(fname: pchar): smallint; syscall 1 65;
+function gemdos_fdelete(fname: PAnsiChar): smallint; syscall 1 65;
 function gemdos_fseek(offset: longint; handle: smallint; seekmode: smallint): longint; syscall 1 66;
 function gemdos_fseek(offset: longint; handle: smallint; seekmode: smallint): longint; syscall 1 66;
-function gemdos_fattrib(filename: pchar; wflag: smallint; attrib: smallint): smallint; syscall 1 67;
+function gemdos_fattrib(filename: PAnsiChar; wflag: smallint; attrib: smallint): smallint; syscall 1 67;
 
 
-function gemdos_dgetpath(path: pchar; driveno: smallint): smallint; syscall 1 71;
+function gemdos_dgetpath(path: PAnsiChar; driveno: smallint): smallint; syscall 1 71;
 function gemdos_malloc(number: dword): pointer; syscall 1 72;
 function gemdos_malloc(number: dword): pointer; syscall 1 72;
 function gemdos_mfree(block: pointer): dword; syscall 1 73;
 function gemdos_mfree(block: pointer): dword; syscall 1 73;
 function gemdos_mshrink(zero: word; block: pointer; newsiz: longint): longint; syscall 1 74;
 function gemdos_mshrink(zero: word; block: pointer; newsiz: longint): longint; syscall 1 74;
-function gemdos_pexec(mode: word; name: pchar; cmdline: pchar; env: pchar): longint; syscall 1 75;
+function gemdos_pexec(mode: word; name: PAnsiChar; cmdline: PAnsiChar; env: PAnsiChar): longint; syscall 1 75;
 procedure gemdos_pterm(returncode: smallint); syscall 1 76;
 procedure gemdos_pterm(returncode: smallint); syscall 1 76;
 
 
-function gemdos_fsfirst(filename: pchar; attr: smallint): longint; syscall 1 78;
+function gemdos_fsfirst(filename: PAnsiChar; attr: smallint): longint; syscall 1 78;
 function gemdos_fsnext: smallint; syscall 1 79;
 function gemdos_fsnext: smallint; syscall 1 79;
 
 
-function gemdos_frename(zero: word; oldname: pchar; newname: pchar): longint; syscall 1 86;
+function gemdos_frename(zero: word; oldname: PAnsiChar; newname: PAnsiChar): longint; syscall 1 86;
 procedure gemdos_fdatime(timeptr: PDOSTIME; handle: smallint; wflag: smallint); syscall 1 87;
 procedure gemdos_fdatime(timeptr: PDOSTIME; handle: smallint; wflag: smallint); syscall 1 87;

+ 5 - 5
rtl/atari/sysdir.inc

@@ -24,7 +24,7 @@ var
 begin
 begin
   ps:=s;
   ps:=s;
   DoDirSeparators(ps);
   DoDirSeparators(ps);
-  dosResult:=gemdos_dcreate(pchar(ps));
+  dosResult:=gemdos_dcreate(PAnsiChar(ps));
   if dosResult < 0 then
   if dosResult < 0 then
     Error2InOutRes(dosResult);
     Error2InOutRes(dosResult);
 end;
 end;
@@ -43,7 +43,7 @@ begin
       exit;
       exit;
     end;
     end;
 
 
-  dosResult:=gemdos_ddelete(pchar(ps));
+  dosResult:=gemdos_ddelete(PAnsiChar(ps));
   if dosResult < 0 then
   if dosResult < 0 then
     Error2InOutRes(dosResult);
     Error2InOutRes(dosResult);
 end;
 end;
@@ -84,7 +84,7 @@ begin
         exit;
         exit;
     end;
     end;
   { do normal setpath }
   { do normal setpath }
-  dosResult:=gemdos_dsetpath(pchar(ps));
+  dosResult:=gemdos_dsetpath(PAnsiChar(ps));
   if dosResult < 0 then
   if dosResult < 0 then
     Error2InOutRes(dosResult);
     Error2InOutRes(dosResult);
 end;
 end;
@@ -93,7 +93,7 @@ end;
 procedure do_GetDir (DriveNr: byte; var Dir: RawByteString);
 procedure do_GetDir (DriveNr: byte; var Dir: RawByteString);
 var
 var
   dosResult: longint;
   dosResult: longint;
-  pathbuf: array[0..259] of char;
+  pathbuf: array[0..259] of AnsiChar;
 begin
 begin
   Dir := '';
   Dir := '';
 
 
@@ -108,7 +108,7 @@ begin
     DriveNr := gemdos_dgetdrv + 1;
     DriveNr := gemdos_dgetdrv + 1;
 
 
   { return a full path, including drive }
   { return a full path, including drive }
-  pathbuf[0]:=char(ord('A') + DriveNr - 1);
+  pathbuf[0]:=AnsiChar(ord('A') + DriveNr - 1);
   pathbuf[1]:=DriveSeparator;
   pathbuf[1]:=DriveSeparator;
 
 
   Dir:=pathbuf;
   Dir:=pathbuf;

+ 6 - 6
rtl/atari/sysfile.inc

@@ -30,9 +30,9 @@ begin
 end;
 end;
 
 
 
 
-procedure do_erase(p : pchar; pchangeable: boolean);
+procedure do_erase(p : PAnsiChar; pchangeable: boolean);
 var
 var
-  oldp: pchar;
+  oldp: PAnsiChar;
   dosResult: longint;
   dosResult: longint;
 begin
 begin
   oldp:=p;
   oldp:=p;
@@ -45,9 +45,9 @@ begin
 end;
 end;
 
 
 
 
-procedure do_rename(p1,p2 : pchar; p1changeable, p2changeable: boolean);
+procedure do_rename(p1,p2 : PAnsiChar; p1changeable, p2changeable: boolean);
 var
 var
-  oldp1, oldp2 : pchar;
+  oldp1, oldp2 : PAnsiChar;
   dosResult: longint;
   dosResult: longint;
 begin
 begin
   oldp1:=p1;
   oldp1:=p1;
@@ -163,7 +163,7 @@ begin
 end;
 end;
 
 
 
 
-procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean);
+procedure do_open(var f;p:PAnsiChar;flags:longint; pchangeable: boolean);
 {
 {
   filerec and textrec have both handle and mode as the first items so
   filerec and textrec have both handle and mode as the first items so
   they could use the same routine for opening/creating.
   they could use the same routine for opening/creating.
@@ -172,7 +172,7 @@ procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean);
   when (flags and $10000) there is no check for close (needed for textfiles)
   when (flags and $10000) there is no check for close (needed for textfiles)
 }
 }
 var
 var
-  oldp     : pchar;
+  oldp     : PAnsiChar;
   dosResult: longint;
   dosResult: longint;
 begin
 begin
 { close first if opened }
 { close first if opened }

+ 5 - 5
rtl/atari/syspara.inc

@@ -51,7 +51,7 @@ var
 
 
   function scan_argv : boolean;
   function scan_argv : boolean;
   var
   var
-     hp, start : pchar;
+     hp, start : PAnsiChar;
      len: integer;
      len: integer;
   begin
   begin
    hp:=basepage^.p_env;
    hp:=basepage^.p_env;
@@ -106,7 +106,7 @@ var
   Start: Word;
   Start: Word;
   Ende: Word;
   Ende: Word;
   i: Integer;
   i: Integer;
-  P : PChar;
+  P : PAnsiChar;
 begin
 begin
   P := Args;
   P := Args;
   ArgVLen := 0;
   ArgVLen := 0;
@@ -181,7 +181,7 @@ Var
   olddta : PDTA;
   olddta : PDTA;
   dta    : TDTA;
   dta    : TDTA;
   i,j    : longint;
   i,j    : longint;
-  p      : pchar;
+  p      : PAnsiChar;
   tmpPath: String;
   tmpPath: String;
 Begin
 Begin
 
 
@@ -202,7 +202,7 @@ Begin
      mypath:=ToSingleByteFileSystemEncodedFileName(tmppath);
      mypath:=ToSingleByteFileSystemEncodedFileName(tmppath);
      olddta := gemdos_getdta;
      olddta := gemdos_getdta;
      gemdos_setdta(@dta);
      gemdos_setdta(@dta);
-     p:=pchar(dirlist);
+     p:=PAnsiChar(dirlist);
      i:=length(dirlist);
      i:=length(dirlist);
      j:=1;
      j:=1;
      Repeat
      Repeat
@@ -214,7 +214,7 @@ Begin
             mydir[length(mydir)]:=DirectorySeparator;
             mydir[length(mydir)]:=DirectorySeparator;
           end;
           end;
        NewDir:=mydir+mypath;
        NewDir:=mydir+mypath;
-       if (gemdos_fsfirst(PChar(NewDir),$07)>=0) and
+       if (gemdos_fsfirst(PAnsiChar(NewDir),$07)>=0) and
           ((dta.d_attrib and ATTRIB_DIRECTORY)=0) then
           ((dta.d_attrib and ATTRIB_DIRECTORY)=0) then
         Begin
         Begin
           {DOS strips off an initial .\}
           {DOS strips off an initial .\}

+ 6 - 6
rtl/atari/system.pp

@@ -41,8 +41,8 @@ const
     DriveSeparator = ':';
     DriveSeparator = ':';
     ExtensionSeparator = '.';
     ExtensionSeparator = '.';
     PathSeparator = ';';
     PathSeparator = ';';
-    AllowDirectorySeparators : set of char = ['\','/'];
-    AllowDriveSeparators : set of char = [':'];
+    AllowDirectorySeparators : set of AnsiChar = ['\','/'];
+    AllowDriveSeparators : set of AnsiChar = [':'];
     FileNameCaseSensitive = false;
     FileNameCaseSensitive = false;
     FileNameCasePreserving = false;
     FileNameCasePreserving = false;
     maxExitCode = 255;
     maxExitCode = 255;
@@ -59,10 +59,10 @@ const
     StdErrorHandle  = 2;
     StdErrorHandle  = 2;
 
 
 var
 var
-    args: PChar;
+    args: PAnsiChar;
     argc: LongInt;
     argc: LongInt;
-    argv: PPChar;
-    envp: PPChar;
+    argv: PPAnsiChar;
+    envp: PPAnsiChar;
     AppFlag: Boolean;			{ Application or Accessory				}
     AppFlag: Boolean;			{ Application or Accessory				}
 
 
 
 
@@ -132,7 +132,7 @@ var
 
 
 function fpGetEnv(const envvar : ShortString): RawByteString; public name '_fpc_atari_getenv';
 function fpGetEnv(const envvar : ShortString): RawByteString; public name '_fpc_atari_getenv';
   var
   var
-    hp : pchar;
+    hp : PAnsiChar;
     i : longint;
     i : longint;
     upperenv, str : RawByteString;
     upperenv, str : RawByteString;
 begin
 begin

+ 17 - 17
rtl/atari/sysutils.pp

@@ -73,7 +73,7 @@ function FileOpen(const FileName: rawbytestring; Mode: Integer): THandle;
 begin
 begin
   { Mode has some Share modes. Maybe something for MiNT? }
   { Mode has some Share modes. Maybe something for MiNT? }
   { Lower three bits of Mode are actually TOS compatible }
   { Lower three bits of Mode are actually TOS compatible }
-  FileOpen:=gemdos_fopen(pchar(FileName), Mode and 3);
+  FileOpen:=gemdos_fopen(PAnsiChar(FileName), Mode and 3);
   if FileOpen < -1 then
   if FileOpen < -1 then
     FileOpen:=-1;
     FileOpen:=-1;
 end;
 end;
@@ -116,7 +116,7 @@ end;
 
 
 function FileCreate(const FileName: RawByteString) : THandle;
 function FileCreate(const FileName: RawByteString) : THandle;
 begin
 begin
-  FileCreate:=gemdos_fcreate(pchar(FileName),0);
+  FileCreate:=gemdos_fcreate(PAnsiChar(FileName),0);
   if FileCreate < -1 then
   if FileCreate < -1 then
     FileCreate:=-1;
     FileCreate:=-1;
 end;
 end;
@@ -192,13 +192,13 @@ end;
 
 
 function DeleteFile(const FileName: RawByteString) : Boolean;
 function DeleteFile(const FileName: RawByteString) : Boolean;
 begin
 begin
-  DeleteFile:=gemdos_fdelete(pchar(FileName)) >= 0;
+  DeleteFile:=gemdos_fdelete(PAnsiChar(FileName)) >= 0;
 end;
 end;
 
 
 
 
 function RenameFile(const OldName, NewName: RawByteString): Boolean;
 function RenameFile(const OldName, NewName: RawByteString): Boolean;
 begin
 begin
-  RenameFile:=gemdos_frename(0,pchar(oldname),pchar(newname)) >= 0;
+  RenameFile:=gemdos_frename(0,PAnsiChar(oldname),PAnsiChar(newname)) >= 0;
 end;
 end;
 
 
 
 
@@ -257,7 +257,7 @@ begin
   gemdos_setdta(@IFD^.dta_search);
   gemdos_setdta(@IFD^.dta_search);
 
 
   Rslt.FindHandle:=nil;
   Rslt.FindHandle:=nil;
-  dosResult:=gemdos_fsfirst(pchar(path), Attr and faAnyFile);
+  dosResult:=gemdos_fsfirst(PAnsiChar(path), Attr and faAnyFile);
   if dosResult < 0 then
   if dosResult < 0 then
     begin
     begin
       InternalFindClose(IFD);
       InternalFindClose(IFD);
@@ -330,13 +330,13 @@ end;
 
 
 Function FileGetAttr (Const FileName : RawByteString) : Longint;
 Function FileGetAttr (Const FileName : RawByteString) : Longint;
 begin
 begin
-  FileGetAttr:=gemdos_fattrib(pchar(FileName),0,0);
+  FileGetAttr:=gemdos_fattrib(PAnsiChar(FileName),0,0);
 end;
 end;
 
 
 
 
 Function FileSetAttr (Const Filename : RawByteString; Attr: longint) : Longint;
 Function FileSetAttr (Const Filename : RawByteString; Attr: longint) : Longint;
 begin
 begin
-  FileSetAttr:=gemdos_fattrib(pchar(FileName),1,Attr and faAnyFile);
+  FileSetAttr:=gemdos_fattrib(PAnsiChar(FileName),1,Attr and faAnyFile);
 
 
   if FileSetAttr < -1 then
   if FileSetAttr < -1 then
     FileSetAttr:=-1
     FileSetAttr:=-1
@@ -464,7 +464,7 @@ end;
 
 
 Function GetEnvironmentVariableCount : Integer;
 Function GetEnvironmentVariableCount : Integer;
 var
 var
-  hp : pchar;
+  hp : PAnsiChar;
 begin
 begin
   result:=0;
   result:=0;
   hp:=basepage^.p_env;
   hp:=basepage^.p_env;
@@ -478,7 +478,7 @@ end;
 
 
 Function GetEnvironmentString(Index : Integer) : {$ifdef FPC_RTL_UNICODE}UnicodeString{$else}AnsiString{$endif};
 Function GetEnvironmentString(Index : Integer) : {$ifdef FPC_RTL_UNICODE}UnicodeString{$else}AnsiString{$endif};
 var
 var
-  hp : pchar;
+  hp : PAnsiChar;
 begin
 begin
   result:='';
   result:='';
   hp:=basepage^.p_env;
   hp:=basepage^.p_env;
@@ -503,10 +503,10 @@ var
   pcmdline: ShortString;
   pcmdline: ShortString;
   CommandLine: RawByteString;
   CommandLine: RawByteString;
   E: EOSError;
   E: EOSError;
-  env, s: pchar;
-  buf, start: pchar;
+  env, s: PAnsiChar;
+  buf, start: PAnsiChar;
   enlen, len: SizeInt;
   enlen, len: SizeInt;
-  hp : pchar;
+  hp : PAnsiChar;
 
 
 begin
 begin
   tmpPath:=ToSingleByteFileSystemEncodedFileName(Path);
   tmpPath:=ToSingleByteFileSystemEncodedFileName(Path);
@@ -524,9 +524,9 @@ begin
       end;
       end;
 
 
   { count up space needed for arguments }
   { count up space needed for arguments }
-  len := strlen(PChar(tmpPath)) + 1;
+  len := strlen(PAnsiChar(tmpPath)) + 1;
   inc(enlen, len);
   inc(enlen, len);
-  buf := PChar(ComLine);
+  buf := PAnsiChar(ComLine);
   while (buf^<>#0) do                   // count nr of args
   while (buf^<>#0) do                   // count nr of args
    begin
    begin
      while (buf^ in [' ',#9,#10]) do    // Kill separators.
      while (buf^ in [' ',#9,#10]) do    // Kill separators.
@@ -580,13 +580,13 @@ begin
       inc(s, 6); { s+=sizeof("ARGV=") }
       inc(s, 6); { s+=sizeof("ARGV=") }
 
 
       { copy argv[0] }
       { copy argv[0] }
-      buf := PChar(tmpPath);
+      buf := PAnsiChar(tmpPath);
       len := strlen(buf) + 1;
       len := strlen(buf) + 1;
       strcopy(s, buf);
       strcopy(s, buf);
           inc(s, len);
           inc(s, len);
 
 
       { copy the parameters }
       { copy the parameters }
-          buf:=PChar(ComLine);
+          buf:=PAnsiChar(ComLine);
           while (buf^<>#0) do
           while (buf^<>#0) do
            begin
            begin
              while (buf^ in [' ',#9,#10]) do    // Kill separators.
              while (buf^ in [' ',#9,#10]) do    // Kill separators.
@@ -636,7 +636,7 @@ begin
       pcmdline[0] := #127;
       pcmdline[0] := #127;
       { the zero offset for cmdline is actually correct here. pexec() expects
       { the zero offset for cmdline is actually correct here. pexec() expects
         pascal formatted string for cmdline, so length in first byte }
         pascal formatted string for cmdline, so length in first byte }
-      result:=gemdos_pexec(0,PChar(tmpPath),@pcmdline[0],env);
+      result:=gemdos_pexec(0,PAnsiChar(tmpPath),@pcmdline[0],env);
       gemdos_mfree(env);
       gemdos_mfree(env);
     end;
     end;