[fpc-devel] patch testreport

Tomas Hajny XHajT03 at mbox.vol.cz
Sun Aug 13 22:29:40 CEST 2006


On 13 Aug 06, at 21:31, Darius Blaszijk wrote:

> I would like to use it like this;
> 
> // XML output.option
>   {$IFDEF VER2_1}
>     // text output option
>   {$ENDIF}
> 
> So I would only include the code if the minimum version is supported. IIRC 
> this define will stay there even when new releases are made right?

No. The meaning of VERx[_y[_z]] conditional 
symbol is "this compiler's version is x[.y[.z]]". 
So VER2_1 is only defined in FPC 2.1.x. Once a 
new release is made from trunk, it will probably 
become 2.2.0 or possibly 3.0.0, but certainly not 
2.1.x.


> I think this way nothing would be broken. The define would
> eventually be removed once Lazarus proceeds to 2.2 FPC version but
> would never hurt keeping the define. 

Well, it wouldn't be broken, but it wouldn't keep 
the plain text output feature either. ;-)

Tomas


> ----- Original Message ----- 
> From: "Tomas Hajny" <XHajT03 at mbox.vol.cz>
> To: "FPC developers' list" <fpc-devel at lists.freepascal.org>
> Sent: Sunday, August 13, 2006 9:14 PM
> Subject: Re: [fpc-devel] patch testreport
> 
> 
> > On 13 Aug 06, at 20:25, Darius Blaszijk wrote:
> >> From: "Michael Van Canneyt" <michael at freepascal.org>
> >> Sent: Sunday, August 13, 2006 7:10 PM
> >> > On Sun, 13 Aug 2006, Darius Blaszijk wrote:
> >> >
> >> >> Hi Michael,
> >> >>
> >> >> Thanks, but I have a question.
> >> >>
> >> >> Following the testreport patch, I have 
also a patch for the
> >> >> FPCUnitLazIDEIntf
> >> >> to make use of the plain text output. But 
I need to put defines around
> >> >> the new
> >> >> option, so people with an older FPC 
version do not get a broken tool.
> >> >> What
> >> >> defines would that be?
> >> >
> >> > {$IFNDEF VER2_1}
> >> >  // text output
> >> > {$ELSE}
> >> >  // XML output.
> >> > {$ENDIF}
> > .
> > .
> >
> > Would this really provide the wanted 
behaviour?
> > I'd be very careful with using $IFDEF
> > VER<minimum_supported_version> rather than 
$IFDEF
> > VER<unsupported_versions>. The proposed 
version
> > would only work for trunk snapshots (and only 
for
> > sufficiently recent ones, of course). Any 
time a
> > new release based on trunk is made available,
> > this would stop working (and I doubt that 
anybody
> > would remember to change it at that time). My
> > recommendation would be to use either:
> >
> > {$IFDEF VER2_0}
> >  // XML output only
> > {$ELSE}
> >  // text output allowed
> > {$ENDIF}
> >
> > (if nothing older than 2.0 is supported 
anyway -
> > I guess this is the case here) or possibly:
> >
> > {$IF defined(VER2_0) or defined(VER1)}
> >  // XML output only
> > {$ELSE}
> >  // text output allowed
> > {$ENDIF}
> >
> >
> > Tomas



More information about the fpc-devel mailing list