* fixes reading/writing of extended properties on arm-linux, by Koenraad Lelong

git-svn-id: trunk@11431 -
This commit is contained in:
florian 2008-07-21 19:01:46 +00:00
parent fcceb9cfa1
commit 502b41a277
2 changed files with 21 additions and 3 deletions

View File

@ -79,6 +79,17 @@ begin
Result:=LEtoN(Result);
end;
{$IFDEF FPC_DOUBLE_HILO_SWAPPED}
procedure SwapDoubleHiLo(var avalue: double); {$ifdef CLASSESINLINE}inline{$endif CLASSESINLINE}
var dwo1 : dword;
type tdoublerec = array[0..1] of dword;
begin
dwo1:= tdoublerec(avalue)[0];
tdoublerec(avalue)[0]:=tdoublerec(avalue)[1];
tdoublerec(avalue)[1]:=dwo1;
end;
{$ENDIF FPC_DOUBLE_HILO_SWAPPED}
{$ifndef FPUNONE}
function TBinaryObjectReader.ReadExtended : extended; {$ifdef CLASSESINLINE}inline;{$endif CLASSESINLINE}
{$IFNDEF FPC_HAS_TYPE_EXTENDED}
@ -88,6 +99,9 @@ begin
{$IFNDEF FPC_HAS_TYPE_EXTENDED}
Read(ext[0],10);
Result:=ExtendedToDouble(@(ext[0]));
{$IFDEF FPC_DOUBLE_HILO_SWAPPED}
SwapDoubleHiLo(result);
{$ENDIF}
{$ELSE}
Read(Result,sizeof(Result));
{$ENDIF}

View File

@ -79,12 +79,16 @@ procedure TBinaryObjectWriter.WriteExtended(e : extended); {$ifdef CLASSESINLINE
var ext : array[0..9] of byte;
{$ENDIF}
begin
{$IFNDEF FPC_HAS_TYPE_EXTENDED}
{$IFNDEF FPC_HAS_TYPE_EXTENDED}
{$IFDEF FPC_DOUBLE_HILO_SWAPPED}
{ SwapDoubleHiLo defined in reader.inc }
SwapDoubleHiLo(e);
{$ENDIF FPC_DOUBLE_HILO_SWAPPED}
DoubleToExtended(e,@(ext[0]));
Write(ext[0],10);
{$ELSE}
{$ELSE}
Write(e,sizeof(e));
{$ENDIF}
{$ENDIF}
end;
{$endif}