diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index 16199c8437..1922f08f9c 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -2033,6 +2033,18 @@ begin da_DefineRecurse)); RTLDir.AddChild(IFTempl); + // rtl: IF TargetOS=iphonesim then add include path rtl/unix, rtl/macos + IFTempl:=TDefineTemplate.Create('If TargetOS=iphonesim','If TargetOS=iphonesim', + '',''''+TargetOSMacro+'''=''iphonesim''',da_If); + IFTempl.AddChild(TDefineTemplate.Create('Include Path', + Format(ctsIncludeDirectoriesPlusDirs,['unix,macos']), + ExternalMacroStart+'IncPath', + IncPathMacro + +';'+Dir+'rtl'+DS+'unix' + +';'+Dir+'rtl'+DS+'macos', + da_DefineRecurse)); + RTLDir.AddChild(IFTempl); + // add processor and SrcOS alias defines for the RTL AddProcessorTypeDefine(RTLDir); AddSrcOSDefines(RTLDir); diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index e1e241c37a..37cc740b84 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -2794,6 +2794,14 @@ var if ContextNode.Desc=ctnGenericType then begin NameNode:=ContextNode.FirstChild; if NameNode=nil then exit; + end else + if (ContextNode.Desc=ctnTypeDefinition) + and Assigned(ContextNode.FirstChild) + and (ContextNode.FirstChild.Desc=ctnObjCCategory) then begin + NameNode:=FindInheritanceNode(ContextNode.FirstChild); + if NameNode=nil then exit; + NameNode:=NameNode.FirstChild; + if NameNode=nil then exit; end; if (fdfCollect in Params.Flags) @@ -6127,6 +6135,27 @@ function TFindDeclarationTool.BuildInterfaceIdentifierCache( end; end; + procedure ScanForExtendedClass(ParentNode: TCodeTreeNode); + var + Node: TCodeTreeNode; + begin + Node:=ParentNode.FirstChild; + if (Node<>nil) then + case Node.Desc of + ctnObjCCategory: + begin + Node:=FindInheritanceNode(Node); + if Assigned(Node) then begin + Node:=Node.FirstChild; + if Assigned(Node) then + FInterfaceIdentifierCache.Add(@Src[Node.StartPos], + ParentNode,ParentNode.StartPos); + end; + end; + { TODO : class helpers } + end; + end; + procedure ScanChildren(ParentNode: TCodeTreeNode); forward; procedure ScanNode(Node: TCodeTreeNode); @@ -6138,6 +6167,7 @@ function TFindDeclarationTool.BuildInterfaceIdentifierCache( begin FInterfaceIdentifierCache.Add(@Src[Node.StartPos],Node,Node.StartPos); ScanForEnums(Node); + ScanForExtendedClass(Node); end; ctnGenericType: if Node.FirstChild<>nil then begin diff --git a/components/codetools/pascalreadertool.pas b/components/codetools/pascalreadertool.pas index 0215fad241..e555c8140d 100644 --- a/components/codetools/pascalreadertool.pas +++ b/components/codetools/pascalreadertool.pas @@ -1884,7 +1884,7 @@ end; function TPascalReaderTool.FindInheritanceNode(ClassNode: TCodeTreeNode): TCodeTreeNode; begin Result:=ClassNode.FirstChild; - while (Result<>nil) and (Result.Desc in [ctnClassSealed,ctnClassAbstract]) do + while (Result<>nil) and (Result.Desc in [ctnClassSealed,ctnClassAbstract,ctnClassExternal]) do Result:=Result.NextBrother; if (Result<>nil) and (Result.Desc<>ctnClassInheritance) then Result:=nil; @@ -2027,7 +2027,24 @@ begin if ProcNode.Desc<>ctnProcedure then exit; MoveCursorToNodeStart(ProcNode); ReadNextAtom; + if UpAtomIs('CLASS') then ReadNextAtom; Result:=UpAtomIs('CONSTRUCTOR'); + if not Result and UpAtomIs('FUNCTION') + and ([cmsObjectiveC1,cmsObjectiveC2]*Scanner.CompilerModeSwitches<>[]) then + begin + ProcNode:=ProcNode.FirstChild; + if ProcNode=nil then exit; + if (ProcNode.SubDesc and ctnsNeedJITParsing)>0 then + BuildSubTreeForProcHead(ProcNode); + ProcNode:=ProcNode.FirstChild; + if (ProcNode=nil) then exit; + if ProcNode.Desc=ctnParameterList then + ProcNode:=ProcNode.NextBrother; + if (ProcNode=nil) then exit; + MoveCursorToNodeStart(ProcNode); + ReadNextAtom; + Result:=UpAtomIs('ID'); + end; end; function TPascalReaderTool.NodeIsDestructor(ProcNode: TCodeTreeNode): boolean; diff --git a/ide/frames/compiler_codegen_options.pas b/ide/frames/compiler_codegen_options.pas index 5edcb9955f..570f2683e0 100644 --- a/ide/frames/compiler_codegen_options.pas +++ b/ide/frames/compiler_codegen_options.pas @@ -168,6 +168,7 @@ begin Add('symbian'); Add('java'); Add('android'); + Add('iphonesim'); end; ItemIndex := 0; end;