|
@@ -22,12 +22,12 @@ interface
|
|
systemh.inc is included otherwise the
|
|
systemh.inc is included otherwise the
|
|
$mode switch is not effective }
|
|
$mode switch is not effective }
|
|
|
|
|
|
-{ Use Ansi Char for files }
|
|
|
|
|
|
+{ Use AnsiChar for files }
|
|
{$define FPC_ANSI_TEXTFILEREC}
|
|
{$define FPC_ANSI_TEXTFILEREC}
|
|
{$define FPC_STDOUT_TRUE_ALIAS}
|
|
{$define FPC_STDOUT_TRUE_ALIAS}
|
|
|
|
|
|
{$ifdef NO_WIDESTRINGS}
|
|
{$ifdef NO_WIDESTRINGS}
|
|
- { Do NOT use wide Char for files }
|
|
|
|
|
|
+ { Do NOT use wide AnsiChar for files }
|
|
{$undef FPC_HAS_FEATURE_WIDESTRINGS}
|
|
{$undef FPC_HAS_FEATURE_WIDESTRINGS}
|
|
{$endif NO_WIDESTRINGS}
|
|
{$endif NO_WIDESTRINGS}
|
|
|
|
|
|
@@ -42,8 +42,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 and FileNameCasePreserving are defined separately below!!! }
|
|
{ FileNameCaseSensitive and FileNameCasePreserving are defined separately below!!! }
|
|
maxExitCode = 255;
|
|
maxExitCode = 255;
|
|
MaxPathLen = 256;
|
|
MaxPathLen = 256;
|
|
@@ -78,7 +78,7 @@ var
|
|
meml : array[0..($7fff div sizeof(longint))-1] of longint absolute $0:$0;
|
|
meml : array[0..($7fff div sizeof(longint))-1] of longint absolute $0:$0;
|
|
{ C-compatible arguments and environment }
|
|
{ C-compatible arguments and environment }
|
|
argc:smallint; //!! public name 'operatingsystem_parameter_argc';
|
|
argc:smallint; //!! public name 'operatingsystem_parameter_argc';
|
|
- argv:PPchar; //!! public name 'operatingsystem_parameter_argv';
|
|
|
|
|
|
+ argv:PPAnsiChar; //!! public name 'operatingsystem_parameter_argv';
|
|
|
|
|
|
{ The DOS Program Segment Prefix segment (TP7 compatibility) }
|
|
{ The DOS Program Segment Prefix segment (TP7 compatibility) }
|
|
PrefixSeg:Word;public name '__fpc_PrefixSeg';
|
|
PrefixSeg:Word;public name '__fpc_PrefixSeg';
|
|
@@ -122,7 +122,7 @@ const
|
|
|
|
|
|
type
|
|
type
|
|
PFarByte = ^Byte;far;
|
|
PFarByte = ^Byte;far;
|
|
- PFarChar = ^Char;far;
|
|
|
|
|
|
+ PFarChar = ^AnsiChar;far;
|
|
PFarWord = ^Word;far;
|
|
PFarWord = ^Word;far;
|
|
PPFarChar = ^PFarChar;
|
|
PPFarChar = ^PFarChar;
|
|
|
|
|
|
@@ -359,13 +359,13 @@ end;
|
|
procedure setup_arguments;
|
|
procedure setup_arguments;
|
|
var
|
|
var
|
|
I: SmallInt;
|
|
I: SmallInt;
|
|
- pc: PChar;
|
|
|
|
|
|
+ pc: PAnsiChar;
|
|
pfc: PFarChar;
|
|
pfc: PFarChar;
|
|
- quote: Char;
|
|
|
|
|
|
+ quote: AnsiChar;
|
|
count: SmallInt;
|
|
count: SmallInt;
|
|
arglen, argv0len: SmallInt;
|
|
arglen, argv0len: SmallInt;
|
|
- argblock: PChar;
|
|
|
|
- arg: PChar;
|
|
|
|
|
|
+ argblock: PAnsiChar;
|
|
|
|
+ arg: PAnsiChar;
|
|
doscmd : string[129]; { Dos commandline copied from PSP, max is 128 chars +1 for terminating zero }
|
|
doscmd : string[129]; { Dos commandline copied from PSP, max is 128 chars +1 for terminating zero }
|
|
begin
|
|
begin
|
|
{ force environment to be setup so dos_argv0 is loaded }
|
|
{ force environment to be setup so dos_argv0 is loaded }
|
|
@@ -417,7 +417,7 @@ begin
|
|
begin
|
|
begin
|
|
if quote<>'''' then
|
|
if quote<>'''' then
|
|
begin
|
|
begin
|
|
- if pchar(pc+1)^<>'"' then
|
|
|
|
|
|
+ if PAnsiChar(pc+1)^<>'"' then
|
|
begin
|
|
begin
|
|
if quote='"' then
|
|
if quote='"' then
|
|
quote:=' '
|
|
quote:=' '
|
|
@@ -434,7 +434,7 @@ begin
|
|
begin
|
|
begin
|
|
if quote<>'"' then
|
|
if quote<>'"' then
|
|
begin
|
|
begin
|
|
- if pchar(pc+1)^<>'''' then
|
|
|
|
|
|
+ if PAnsiChar(pc+1)^<>'''' then
|
|
begin
|
|
begin
|
|
if quote='''' then
|
|
if quote='''' then
|
|
quote:=' '
|
|
quote:=' '
|
|
@@ -457,7 +457,7 @@ begin
|
|
end;
|
|
end;
|
|
{ set argc and allocate argv }
|
|
{ set argc and allocate argv }
|
|
argc:=count;
|
|
argc:=count;
|
|
- argv:=AllocMem((count+1)*SizeOf(PChar));
|
|
|
|
|
|
+ argv:=AllocMem((count+1)*SizeOf(PAnsiChar));
|
|
{ allocate a single memory block for all arguments }
|
|
{ allocate a single memory block for all arguments }
|
|
argblock:=GetMem(arglen);
|
|
argblock:=GetMem(arglen);
|
|
{ create argv[0] }
|
|
{ create argv[0] }
|
|
@@ -505,7 +505,7 @@ begin
|
|
begin
|
|
begin
|
|
if quote<>'''' then
|
|
if quote<>'''' then
|
|
begin
|
|
begin
|
|
- if pchar(pc+1)^<>'"' then
|
|
|
|
|
|
+ if PAnsiChar(pc+1)^<>'"' then
|
|
begin
|
|
begin
|
|
if quote='"' then
|
|
if quote='"' then
|
|
quote:=' '
|
|
quote:=' '
|
|
@@ -525,7 +525,7 @@ begin
|
|
begin
|
|
begin
|
|
if quote<>'"' then
|
|
if quote<>'"' then
|
|
begin
|
|
begin
|
|
- if pchar(pc+1)^<>'''' then
|
|
|
|
|
|
+ if PAnsiChar(pc+1)^<>'''' then
|
|
begin
|
|
begin
|
|
if quote='''' then
|
|
if quote='''' then
|
|
quote:=' '
|
|
quote:=' '
|
|
@@ -636,8 +636,8 @@ end;
|
|
function CheckLFN:boolean;
|
|
function CheckLFN:boolean;
|
|
var
|
|
var
|
|
regs : Registers;
|
|
regs : Registers;
|
|
- RootName : pchar;
|
|
|
|
- buf : array [0..31] of char;
|
|
|
|
|
|
+ RootName : PAnsiChar;
|
|
|
|
+ buf : array [0..31] of AnsiChar;
|
|
begin
|
|
begin
|
|
{ Check LFN API on drive c:\ }
|
|
{ Check LFN API on drive c:\ }
|
|
RootName:='C:\';
|
|
RootName:='C:\';
|