* Force 4-byte alignment of fields in record-buffers hwn necessary

git-svn-id: trunk@11134 -
This commit is contained in:
joost 2008-05-30 22:23:52 +00:00
parent 6274dd72d7
commit 8aa27c6254

View File

@ -1807,12 +1807,20 @@ var x : longint;
begin begin
FNullmaskSize := 1+((FieldDefs.count-1) div 8); FNullmaskSize := 1+((FieldDefs.count-1) div 8);
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
if (FNullmaskSize and 3 <> 0) then
FNullmaskSize := (FNullmaskSize and not 3)+4;
{$ENDIF}
FRecordSize := FNullmaskSize; FRecordSize := FNullmaskSize;
SetLength(FFieldBufPositions,FieldDefs.count); SetLength(FFieldBufPositions,FieldDefs.count);
for x := 0 to FieldDefs.count-1 do for x := 0 to FieldDefs.count-1 do
begin begin
FFieldBufPositions[x] := FRecordSize; FFieldBufPositions[x] := FRecordSize;
inc(FRecordSize, GetFieldSize(FieldDefs[x])); inc(FRecordSize, GetFieldSize(FieldDefs[x]));
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
if (FRecordSize and 3 <> 0) then
FRecordSize := (FRecordSize and not 3)+4;
{$ENDIF}
end; end;
end; end;