mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 20:49:09 +02:00
Also use union with double field to ensure correct alignment for float64 type from genmath.inc source
git-svn-id: trunk@45779 -
This commit is contained in:
parent
ac5407268c
commit
834dbf5f80
@ -62,21 +62,26 @@
|
|||||||
type
|
type
|
||||||
PReal = ^Real;
|
PReal = ^Real;
|
||||||
{ also necessary for Int() on systems with 64bit floats (JM) }
|
{ also necessary for Int() on systems with 64bit floats (JM) }
|
||||||
|
{ union required to get correct alignement for floating point type }
|
||||||
{$ifndef FPC_SYSTEM_HAS_float64}
|
{$ifndef FPC_SYSTEM_HAS_float64}
|
||||||
{$ifdef ENDIAN_LITTLE}
|
{$ifdef ENDIAN_LITTLE}
|
||||||
float64 = record
|
float64 = record
|
||||||
{$ifndef FPC_DOUBLE_HILO_SWAPPED}
|
case byte of
|
||||||
low,high: longint;
|
1: (dummy : double);
|
||||||
|
{$ifndef FPC_DOUBLE_HILO_SWAPPED}
|
||||||
|
2: (low,high: longint);
|
||||||
{$else}
|
{$else}
|
||||||
high,low: longint;
|
2: (high,low: longint);
|
||||||
{$endif FPC_DOUBLE_HILO_SWAPPED}
|
{$endif FPC_DOUBLE_HILO_SWAPPED}
|
||||||
end;
|
end;
|
||||||
{$else}
|
{$else}
|
||||||
float64 = record
|
float64 = record
|
||||||
|
case byte of
|
||||||
|
1: (dummy : double);
|
||||||
{$ifndef FPC_DOUBLE_HILO_SWAPPED}
|
{$ifndef FPC_DOUBLE_HILO_SWAPPED}
|
||||||
high,low: longint;
|
2: (high,low: longint);
|
||||||
{$else}
|
{$else}
|
||||||
low,high: longint;
|
2: (low,high: longint);
|
||||||
{$endif FPC_DOUBLE_HILO_SWAPPED}
|
{$endif FPC_DOUBLE_HILO_SWAPPED}
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
Loading…
Reference in New Issue
Block a user