[fpc-devel] patch testreport

Darius Blaszijk dhkblaszyk at zeelandnet.nl
Sun Aug 13 21:31:26 CEST 2006


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? 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.

Darius

----- 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
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel 




More information about the fpc-devel mailing list