mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 04:30:35 +01:00
* fixes reading/writing of extended properties on arm-linux, by Koenraad Lelong
git-svn-id: trunk@11431 -
This commit is contained in:
parent
fcceb9cfa1
commit
502b41a277
@ -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}
|
||||
|
||||
@ -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}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user