On Thu, 17 Jan 2019, Bart wrote:
Hi, I'm trying to fix an issue in getopts unit. I noticed some (ancient?) compiler directives: {$IFNDEF FPC} {$ifdef TP} uses strings; {$else } uses SysUtils; type PtrInt = Integer; {$endif} {$ENDIF FPC} {$IF not Declared(argv)} //{$ifdef TP} type ppchar = ^pchar; apchar = array[0..127] of pchar; var argc : longint; argv : apchar; .... { create argv if running under TP } {$ifndef FPC} setup_arguments; {$endif} It seems this code at one time needed to be compilable with TP. AFAIK TP however does not support {$IF CONDITION} nor the Declared() macro(?), so the source should not be compilable anymore with TP?
Clearly not.
The unit is still compileable with Delphi (7) though. Question is: do we need to keep that in?
No.
I don't think it is possible anymore to bootstrap the compiler with anything other than FPC?
Exactly.
As for the {$IF not Declared(Argv)} part: does that apply to a target that FPC supports or is also there just to be able to compile it with Delphi? If we keep it, then at least the comments should be updated.
You can make the unit FPC only if you wish. Michael. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel