mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 09:59:17 +02:00
* Make clongdouble:
- 8 bytes on windows - For other platforms: 12 bytes on 32-bit and 16 bytes on 64-bit cpus. ... using a record with assignment overloads. git-svn-id: trunk@8112 -
This commit is contained in:
parent
4c81c227fa
commit
2fbe0038b9
@ -72,7 +72,21 @@ type
|
||||
|
||||
cfloat = single; pcfloat = ^cfloat;
|
||||
cdouble = double; pcdouble = ^cdouble;
|
||||
clongdouble = extended; pclongdouble = ^clongdouble;
|
||||
|
||||
{$ifdef windows}
|
||||
clongdouble=double;
|
||||
{$else}
|
||||
{$define longdouble_assignment_overload}
|
||||
clongdouble = packed record
|
||||
value:extended;
|
||||
{$ifdef cpu64}
|
||||
padding:array[0..5] of byte;
|
||||
{$else}
|
||||
padding:array[0..1] of byte;
|
||||
{$endif}
|
||||
end;
|
||||
{$endif}
|
||||
Pclongdouble=^clongdouble;
|
||||
|
||||
// Kylix compat types
|
||||
u_long = culong;
|
||||
@ -80,6 +94,25 @@ type
|
||||
|
||||
{$endif}
|
||||
|
||||
{$ifdef longdouble_assignment_overload}
|
||||
operator := (const v:clongdouble):r:extended;
|
||||
operator := (const v:extended):r:clongdouble;
|
||||
{$endif}
|
||||
|
||||
implementation
|
||||
|
||||
{$ifdef longdouble_assignment_overload}
|
||||
operator := (const v:clongdouble):r:extended;inline;
|
||||
|
||||
begin
|
||||
r:=v.value;
|
||||
end;
|
||||
|
||||
operator := (const v:extended):r:clongdouble;inline;
|
||||
|
||||
begin
|
||||
r.value:=v;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user