I have a unit which is for both Delphi & Lazarus. In Lazarus the unit compiled without any exception but in Delphi it gives me Error Data type too large: exceeds 2 GB. Below is the code:
unit UType;
{$ifdef FPC}
{$MODE delphi}{$H+}
{$endif}
interface
type
TFreqType = Extended;
TFreqCutArray = Array [0..0]of TFreqType;
PFreqCutArray = ^TFreqCutArray;
FilterOrder = Integer;
TAS_Sample = Extended;
TAS_SampleArray = Array[0..High(Integer) div Sizeof(TAS_Sample) - 1] of TAS_Sample;
PTAS_SampleArray = ^TAS_SampleArray;
TAS_Float = Extended;
TComplex = record
Re, Im: TAS_Sample; // Z = Re + i*Im
end;
PComplex = ^TComplex;
TComplexArray = Array[0..High(Integer) div Sizeof(TComplex) - 1] of TComplex;//here Delphi gives the error
PComplexArray = ^TComplexArray;
FilterProc = function(V: TAS_Sample): TAS_Sample of object;
implementation
end.
I am using Berlin Update 2, with the same code in Lazarus it compile without any error.