* Small patch from Inoussa OUEDRAOGO so it compiles with Delphi

git-svn-id: trunk@8363 -
This commit is contained in:
michael 2007-09-02 21:57:51 +00:00
parent e6df979bf7
commit 3ed12b0229

View File

@ -47,20 +47,20 @@ Function GetLongOpts (ShortOpts : String;LongOpts : POption;var Longind : Longin
Implementation Implementation
{$IFNDEF FPC}
{$ifdef TP} {$ifdef TP}
uses uses strings;
strings; {$else }
{$endif} uses SysUtils;
type PtrInt = Integer;
{$endif}
{$ENDIF FPC}
{*************************************************************************** {***************************************************************************
Create an ArgV Create an ArgV
***************************************************************************} ***************************************************************************}
{$ifdef TP} {$IF not Declared(argv)} //{$ifdef TP}
type type
ppchar = ^pchar; ppchar = ^pchar;
@ -134,7 +134,7 @@ begin
move(argsbuf,argv,count shl 2); move(argsbuf,argv,count shl 2);
end; end;
{$endif TP} {$IFEND} //{$endif TP}
{*************************************************************************** {***************************************************************************
Real Getopts Real Getopts
@ -336,7 +336,7 @@ begin
else else
ambig:=true; ambig:=true;
end; end;
inc(pointer(p),sizeof(toption)); inc(PByte(p),sizeof(toption)); //inc(pointer(p),sizeof(toption)); // for Delphi compatibility
inc(option_index); inc(option_index);
end; end;
if ambig and not exact then if ambig and not exact then
@ -490,10 +490,18 @@ begin
getlongopts:=internal_getopt(shortopts,longopts,@longind,true); getlongopts:=internal_getopt(shortopts,longopts,@longind,true);
end; end;
{$ifdef FPC}
begin initialization
{$endif}
{$ifndef FPC}
{$ifdef TP}
begin
{$else}
initialization
{$endif}
{$endif}
{ create argv if running under TP } { create argv if running under TP }
{$ifdef TP} {$ifndef FPC}
setup_arguments; setup_arguments;
{$endif} {$endif}
{ Needed to detect startup } { Needed to detect startup }