{$IF LCL_FullVersion >= xxx} does not work within a uses clause (unit LCLVersion not "valid")
Original Reporter info from Mantis: Hartmut @Hartmut2
-
Reporter name:
Original Reporter info from Mantis: Hartmut @Hartmut2
- Reporter name:
Description:
When I compile the following code, I get:
unit1.pas(10,5) Error: Incompatible types: got "AnsiString" expected "Int64"
unit1.pas(10,5) Error: Compile time expression: Wanted Boolean but got &LtPos;erroneous type> at IF or ELSEIF
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
LCLVersion,
{$IF LCL_FullVersion >= 1080000}
SpinEx, // this unit does not exist before LCL 1.8.0
{$ENDIF}
spin;
type
TForm1 = class(TForm)
private
public
end;
var Form1: TForm1;
implementation
{$R *.lfm}
end.
Steps to reproduce:
Compile the attached demo program.
Additional information:
I used Lazarus ver=2.1.0 rev=62449 for this test, but howardpc wrote in the forum "I think the Lazarus version is immaterial. The problem is with the FPC parser not having evaluated the constants in the LCLVersion unit in time to interpret the $IF correctly (or something of the sort) in https://forum.lazarus.freepascal.org/index.php/topic,48059.msg345520.html#msg345520
Mantis conversion info:
- Mantis ID: 36536
- OS: Windows
- OS Build: Windows 7 32 bit
- Build: 43796
- Platform: i386
- Version: 3.3.1