Browse Source

+ is_single added

florian 22 years ago
parent
commit
69f8751c7a
1 changed files with 15 additions and 1 deletions
  1. 15 1
      compiler/defutil.pas

+ 15 - 1
compiler/defutil.pas

@@ -157,6 +157,9 @@ interface
     {# Returns true, if def is a currency type }
     {# Returns true, if def is a currency type }
     function is_currency(def : tdef) : boolean;
     function is_currency(def : tdef) : boolean;
 
 
+    {# Returns true, if def is a single type }
+    function is_single(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;
 
 
@@ -212,6 +215,14 @@ implementation
       end;
       end;
 
 
 
 
+    { returns true, if def is a currency type }
+    function is_single(def : tdef) : boolean;
+      begin
+        result:=(def.deftype=floatdef) and
+          (tfloatdef(def).typ=s32real);
+      end;
+
+
     function range_to_basetype(low,high:TConstExprInt):tbasetype;
     function range_to_basetype(low,high:TConstExprInt):tbasetype;
       begin
       begin
         { generate a unsigned range if high<0 and low>=0 }
         { generate a unsigned range if high<0 and low>=0 }
@@ -822,7 +833,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  2003-10-01 20:34:48  peter
+  Revision 1.7  2003-11-10 18:05:16  florian
+    + is_single added
+
+  Revision 1.6  2003/10/01 20:34:48  peter
     * procinfo unit contains tprocinfo
     * procinfo unit contains tprocinfo
     * cginfo renamed to cgbase
     * cginfo renamed to cgbase
     * moved cgmessage to verbose
     * moved cgmessage to verbose