mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 12:39:38 +01:00 
			
		
		
		
	+ add utility function to check whether an objectdef is an invokable one
This commit is contained in:
		
							parent
							
								
									f0748ad59b
								
							
						
					
					
						commit
						833a971877
					
				@ -385,6 +385,9 @@ interface
 | 
			
		||||
    { returns true if def is a function reference }
 | 
			
		||||
    function is_funcref(def:tdef):boolean;
 | 
			
		||||
 | 
			
		||||
    { returns true if def is an invokable interface }
 | 
			
		||||
    function is_invokable(def:tdef):boolean;
 | 
			
		||||
 | 
			
		||||
    { returns true if def is a C "block" }
 | 
			
		||||
    function is_block(def: tdef): boolean;
 | 
			
		||||
 | 
			
		||||
@ -1903,6 +1906,12 @@ implementation
 | 
			
		||||
      end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    function is_invokable(def:tdef):boolean;
 | 
			
		||||
      begin
 | 
			
		||||
        result:=(def.typ=objectdef) and (oo_is_invokable in tobjectdef(def).objectoptions);
 | 
			
		||||
      end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    function is_block(def: tdef): boolean;
 | 
			
		||||
      begin
 | 
			
		||||
        result:=(def.typ=procvardef) and (po_is_block in tprocvardef(def).procoptions)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user