fpc/tests/webtbs/tw35533.pp

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.