Browse Source

+ added is_farpointer(tdef) and is_hugepointer(tdef) helper functions to defutil

git-svn-id: trunk@24865 -
nickysn 12 years ago
parent
commit
894d400a7b
1 changed files with 22 additions and 0 deletions
  1. 22 0
      compiler/defutil.pas

+ 22 - 0
compiler/defutil.pas

@@ -328,6 +328,14 @@ interface
     { returns true of def is a methodpointer }
     function is_methodpointer(def : tdef) : boolean;
 
+{$ifdef i8086}
+    {# Returns true if p is a far pointer def }
+    function is_farpointer(p : tdef) : boolean;
+
+    {# Returns true if p is a huge pointer def }
+    function is_hugepointer(p : tdef) : boolean;
+{$endif i8086}
+
 implementation
 
     uses
@@ -1429,4 +1437,18 @@ implementation
         result:=(def.typ=procvardef) and (po_methodpointer in tprocvardef(def).procoptions);
       end;
 
+{$ifdef i8086}
+    { true if p is a far pointer def }
+    function is_farpointer(p : tdef) : boolean;
+      begin
+        result:=(p.typ=pointerdef) and (tpointerdef(p).x86pointertyp=x86pt_far);
+      end;
+
+    { true if p is a huge pointer def }
+    function is_hugepointer(p : tdef) : boolean;
+      begin
+        result:=(p.typ=pointerdef) and (tpointerdef(p).x86pointertyp=x86pt_huge);
+      end;
+{$endif i8086}
+
 end.