* make the reference to the TCustomAttribute type global

git-svn-id: trunk@42393 -
This commit is contained in:
svenbarth 2019-07-12 22:07:15 +00:00
parent d9d2515ada
commit 0b63e89ba2
3 changed files with 7 additions and 7 deletions

View File

@ -72,14 +72,11 @@ implementation
cpuinfo
;
var
system_custom_attribute_def: tobjectdef = nil;
function is_system_custom_attribute_descendant(def:tdef):boolean;
begin
if system_custom_attribute_def=nil then
system_custom_attribute_def:=tobjectdef(search_system_type('TCUSTOMATTRIBUTE').typedef);
Result:=def_is_related(def,system_custom_attribute_def);
if not assigned(class_tcustomattribute) then
class_tcustomattribute:=tobjectdef(search_system_type('TCUSTOMATTRIBUTE').typedef);
Result:=def_is_related(def,class_tcustomattribute);
end;
function readconstant(const orgname:string;const filepos:tfileposinfo; out nodetype: tnodetype):tconstsym;
@ -449,7 +446,7 @@ implementation
{ Check if the attribute class is related to TCustomAttribute }
if not is_system_custom_attribute_descendant(od) then
incompatibletypes(od,system_custom_attribute_def);
incompatibletypes(od,class_tcustomattribute);
paran:=read_attr_paras;

View File

@ -1147,6 +1147,8 @@ interface
{ pointer to the anchestor of all classes }
class_tobject : tobjectdef;
{ pointer to the base type for custom attributes }
class_tcustomattribute : tobjectdef;
{ pointer to the ancestor of all COM interfaces }
interface_iunknown : tobjectdef;
{ pointer to the ancestor of all dispinterfaces }

View File

@ -4714,6 +4714,7 @@ implementation
{$endif}
{ set some global vars to nil, might be important for the ide }
class_tobject:=nil;
class_tcustomattribute:=nil;
interface_iunknown:=nil;
interface_idispatch:=nil;
rec_tguid:=nil;