mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 10:39:39 +02:00
fcl-passrc: support for syscall functions, parameter location, HASAMIGA define
git-svn-id: trunk@31168 -
This commit is contained in:
parent
4eaf1ffa48
commit
09addc9e78
@ -91,7 +91,7 @@ type
|
|||||||
visPublished, visAutomated,
|
visPublished, visAutomated,
|
||||||
visStrictPrivate, visStrictProtected);
|
visStrictPrivate, visStrictProtected);
|
||||||
|
|
||||||
TCallingConvention = (ccDefault,ccRegister,ccPascal,ccCDecl,ccStdCall,ccOldFPCCall,ccSafeCall);
|
TCallingConvention = (ccDefault,ccRegister,ccPascal,ccCDecl,ccStdCall,ccOldFPCCall,ccSafeCall,ccSysCall);
|
||||||
TPackMode = (pmNone,pmPacked,pmBitPacked);
|
TPackMode = (pmNone,pmPacked,pmBitPacked);
|
||||||
|
|
||||||
TPasMemberVisibilities = set of TPasMemberVisibility;
|
TPasMemberVisibilities = set of TPasMemberVisibility;
|
||||||
@ -1183,7 +1183,7 @@ const
|
|||||||
cPasMemberHint : array[TPasMemberHint] of string =
|
cPasMemberHint : array[TPasMemberHint] of string =
|
||||||
( 'deprecated', 'library', 'platform', 'experimental', 'unimplemented' );
|
( 'deprecated', 'library', 'platform', 'experimental', 'unimplemented' );
|
||||||
cCallingConventions : array[TCallingConvention] of string =
|
cCallingConventions : array[TCallingConvention] of string =
|
||||||
( '', 'Register','Pascal','CDecl','StdCall','OldFPCCall','SafeCall');
|
( '', 'Register','Pascal','CDecl','StdCall','OldFPCCall','SafeCall','SysCall');
|
||||||
|
|
||||||
ModifierNames : Array[TProcedureModifier] of string
|
ModifierNames : Array[TProcedureModifier] of string
|
||||||
= ('virtual', 'dynamic','abstract', 'override',
|
= ('virtual', 'dynamic','abstract', 'override',
|
||||||
|
@ -307,7 +307,7 @@ Function IsCallingConvention(S : String; out CC : TCallingConvention) : Boolean;
|
|||||||
|
|
||||||
Var
|
Var
|
||||||
CCNames : Array[TCallingConvention] of String
|
CCNames : Array[TCallingConvention] of String
|
||||||
= ('','register','pascal','cdecl','stdcall','oldfpccall','safecall');
|
= ('','register','pascal','cdecl','stdcall','oldfpccall','safecall','syscall');
|
||||||
Var
|
Var
|
||||||
C : TCallingConvention;
|
C : TCallingConvention;
|
||||||
|
|
||||||
@ -443,7 +443,13 @@ begin
|
|||||||
else if s = 'BEOS' then
|
else if s = 'BEOS' then
|
||||||
Scanner.AddDefine('UNIX')
|
Scanner.AddDefine('UNIX')
|
||||||
else if s = 'QNX' then
|
else if s = 'QNX' then
|
||||||
Scanner.AddDefine('UNIX');
|
Scanner.AddDefine('UNIX')
|
||||||
|
else if s = 'AROS' then
|
||||||
|
Scanner.AddDefine('HASAMIGA')
|
||||||
|
else if s = 'MORPHOS' then
|
||||||
|
Scanner.AddDefine('HASAMIGA')
|
||||||
|
else if s = 'AMIGA' then
|
||||||
|
Scanner.AddDefine('HASAMIGA');
|
||||||
|
|
||||||
// TargetCPU
|
// TargetCPU
|
||||||
s := UpperCase(CPUTarget);
|
s := UpperCase(CPUTarget);
|
||||||
@ -2676,6 +2682,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
NextToken;
|
NextToken;
|
||||||
|
if (CurToken = tkIdentifier) and (LowerCase(CurTokenString) = 'location') then
|
||||||
|
begin
|
||||||
|
NextToken; // remove 'location'
|
||||||
|
NextToken; // remove register
|
||||||
|
end;
|
||||||
if CurToken = EndToken then
|
if CurToken = EndToken then
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
@ -2905,6 +2916,15 @@ begin
|
|||||||
begin
|
begin
|
||||||
if Assigned(Element) then // !!!
|
if Assigned(Element) then // !!!
|
||||||
Element.CallingConvention:=Cc;
|
Element.CallingConvention:=Cc;
|
||||||
|
if cc = ccSysCall then
|
||||||
|
begin
|
||||||
|
// remove LibBase
|
||||||
|
NextToken;
|
||||||
|
// remove legacy or basesysv on MorphOS syscalls
|
||||||
|
if CurTokenIsIdentifier('legacy') or CurTokenIsIdentifier('BaseSysV') then
|
||||||
|
NextToken;
|
||||||
|
NextToken; // remove offset
|
||||||
|
end;
|
||||||
ExpectToken(tkSemicolon);
|
ExpectToken(tkSemicolon);
|
||||||
end
|
end
|
||||||
else if TokenIsProcedureModifier(Parent,CurTokenString,pm) then
|
else if TokenIsProcedureModifier(Parent,CurTokenString,pm) then
|
||||||
|
@ -1647,7 +1647,7 @@ begin
|
|||||||
else if Param[1]='%' then
|
else if Param[1]='%' then
|
||||||
begin
|
begin
|
||||||
fcurtokenstring:='{$i '+param+'}';
|
fcurtokenstring:='{$i '+param+'}';
|
||||||
fcurtoken:=tkstring;
|
fcurtoken:=tkstring;
|
||||||
result:=fcurtoken;
|
result:=fcurtoken;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user