Page 1 of 1

Bug, and fix, for zeoslib(trunk) with FPC/Lazarus in Linux

Posted: 26.06.2007, 16:43
by Almindor
I tried zeoslib from trunk on Linux (32bits, ubuntu) with FPC 2.1.5 and Lazarus/trunk. Everything went fine up until ZAbstractRODataset.pas

It seems that an odd define/ifdef caused a wrong number of elements problem in procedure TZAbstractRODataset.CheckFieldCompatibility(Field: TField;FieldDef: TFieldDef) concretly:

const
BaseFieldTypes: array[TFieldType] of TFieldType = (
ftUnknown, ftString, ftInteger, ftInteger, ftInteger, ftBoolean, ftFloat,
ftFloat, ftBCD, ftDateTime, ftDateTime, ftDateTime, ftBytes, ftVarBytes,
ftInteger, ftBlob, ftBlob, ftBlob, ftBlob, ftBlob, ftBlob, ftBlob, ftUnknown,
ftString, ftString, ftLargeInt, ftADT, ftArray, ftReference, ftDataSet,
ftBlob, ftBlob, ftVariant, ftInterface, ftInterface, ftString, ftTimeStamp, ftFMTBcd
{$IFDEF VER2_1_3}, ftString, ftBlob{$ENDIF});

I fixed the problem by removing the {$IFDEF VER2_1_3} which seems ISN'T defined for FPC 2.1.5 (or 2.1.4) and thus causes a compiler error (because TFieldType still has the original number of elements). It seems to have worked. You can detect fpc version properly by combination of major and minor defines. NOTE: I got zeoslib sources from svn://firmos.at/zeos as per Lazarus wiki...

Posted: 27.06.2007, 12:04
by mdaems
That's the good place to get it. Only... the patch to correct this is not yet in trunk version. Check testing branch of this repository. I think there it's OK now.

Mark