فهرست منبع

+ added defutil.is_32bit helper function, similar to is_64bit

git-svn-id: branches/i8086@23869 -
nickysn 12 سال پیش
والد
کامیت
a274e62724
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      compiler/defutil.pas

+ 8 - 0
compiler/defutil.pas

@@ -228,6 +228,9 @@ interface
     {# Returns true, if def is a 32 bit integer type }
     {# Returns true, if def is a 32 bit integer type }
     function is_32bitint(def : tdef) : boolean;
     function is_32bitint(def : tdef) : boolean;
 
 
+    {# Returns true, if def is a 32 bit ordinal type }
+    function is_32bit(def : tdef) : boolean;
+
     {# Returns true, if def is a 64 bit integer type }
     {# Returns true, if def is a 64 bit integer type }
     function is_64bitint(def : tdef) : boolean;
     function is_64bitint(def : tdef) : boolean;
 
 
@@ -794,6 +797,11 @@ implementation
          result:=(def.typ=orddef) and (torddef(def).ordtype in [u32bit,s32bit])
          result:=(def.typ=orddef) and (torddef(def).ordtype in [u32bit,s32bit])
       end;
       end;
 
 
+    { true, if def is a 32 bit ordinal type }
+    function is_32bit(def: tdef): boolean;
+      begin
+         result:=(def.typ=orddef) and (torddef(def).ordtype in [u32bit,s32bit,pasbool32,bool32bit])
+      end;
 
 
     { true, if def is a 64 bit int type }
     { true, if def is a 64 bit int type }
     function is_64bitint(def : tdef) : boolean;
     function is_64bitint(def : tdef) : boolean;