mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-11 16:30:36 +01:00
* extend TParamFlag by pfConstRef which is set for constref parameters
* extend test trtti9.pp accordingly git-svn-id: trunk@35175 -
This commit is contained in:
parent
1553aa5639
commit
2acf542737
@ -55,7 +55,7 @@ unit typinfo;
|
||||
TMethodKind = (mkProcedure,mkFunction,mkConstructor,mkDestructor,
|
||||
mkClassProcedure,mkClassFunction,mkClassConstructor,
|
||||
mkClassDestructor,mkOperatorOverload);
|
||||
TParamFlag = (pfVar,pfConst,pfArray,pfAddress,pfReference,pfOut);
|
||||
TParamFlag = (pfVar,pfConst,pfArray,pfAddress,pfReference,pfOut,pfConstRef);
|
||||
TParamFlags = set of TParamFlag;
|
||||
TIntfFlag = (ifHasGuid,ifDispInterface,ifDispatch,ifHasStrGUID);
|
||||
TIntfFlags = set of TIntfFlag;
|
||||
|
||||
@ -7,7 +7,7 @@ uses
|
||||
|
||||
type
|
||||
PProcedureParam = ^TProcedureParam;
|
||||
TProc = procedure(var A: Integer; S: String); stdcall;
|
||||
TProc = procedure(var A: Integer; S: String; constref U: UnicodeString); stdcall;
|
||||
|
||||
function TestParam(Param: PProcedureParam; Flags: TParamFlags; ParamType: Pointer; Name: ShortString): Boolean;
|
||||
begin
|
||||
@ -27,7 +27,7 @@ begin
|
||||
halt(2);
|
||||
if Data^.ProcSig.ResultType <> nil then
|
||||
halt(3);
|
||||
if Data^.ProcSig.ParamCount <> 2 then
|
||||
if Data^.ProcSig.ParamCount <> 3 then
|
||||
halt(4);
|
||||
Param := Data^.ProcSig.GetParam(0);
|
||||
if not TestParam(Param, [pfVar], TypeInfo(Integer), 'A') then
|
||||
@ -35,4 +35,7 @@ begin
|
||||
Param := Data^.ProcSig.GetParam(1);
|
||||
if not TestParam(Param, [], TypeInfo(String), 'S') then
|
||||
halt(6);
|
||||
Param := Data^.ProcSig.GetParam(2);
|
||||
if not TestParam(Param, [pfConstRef], TypeInfo(UnicodeString), 'U') then
|
||||
halt(7);
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user