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" <[EMAIL PROTECTED]>
To: "FPC developers' list" <[email protected]>
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" <[EMAIL PROTECTED]>
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  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to