mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 11:48:04 +02:00
31 lines
524 B
ObjectPascal
31 lines
524 B
ObjectPascal
{ %NORUN }
|
|
|
|
program tw35533;
|
|
{$mode delphiunicode}
|
|
|
|
type
|
|
TPointerHelper = record helper for pointer
|
|
function AsNativeUint: nativeuint;
|
|
function PCharLen: uint32;
|
|
end;
|
|
|
|
function TPointerHelper.AsNativeUint: nativeuint;
|
|
begin
|
|
Result := nativeuint(self);
|
|
end;
|
|
|
|
function TPointerHelper.PCharLen: uint32;
|
|
begin
|
|
Result := 5; //- Just here to illustrate the issue.
|
|
end;
|
|
|
|
var
|
|
P: pointer;
|
|
|
|
begin
|
|
P := @ParamStr(0); //- Just a nonsense pointer.
|
|
Writeln( P.AsNativeUInt );
|
|
Writeln( P.PCharLen );
|
|
Readln;
|
|
end.
|