2
0
Эх сурвалжийг харах

+ is_automatable

git-svn-id: trunk@3410 -
florian 19 жил өмнө
parent
commit
23f1f83835

+ 19 - 1
compiler/defutil.pas

@@ -1,5 +1,5 @@
 {
 {
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2006 by Florian Klaempfl
 
 
     This unit provides some help routines for type handling
     This unit provides some help routines for type handling
 
 
@@ -210,6 +210,8 @@ interface
        to note that the value returned can be @var(OS_NO) }
        to note that the value returned can be @var(OS_NO) }
     function def_cgsize(def: tdef): tcgsize;
     function def_cgsize(def: tdef): tcgsize;
 
 
+    {# returns true, if the type passed is can be used with windows automation }
+    function is_automatable(p : tdef) : boolean;
 
 
 implementation
 implementation
 
 
@@ -920,4 +922,20 @@ implementation
       end;
       end;
 
 
 
 
+    function is_automatable(p : tdef) : boolean;
+      begin
+        result:=false;
+        case p.deftype of
+          orddef:
+            result:=torddef(p).typ in [u8bit,s32bit,s16bit,bool16bit];
+          floatdef:
+            result:=tfloatdef(p).typ in [s64currency,s64real,s32real];
+          stringdef:
+            result:=tstringdef(p).string_typ in [st_shortstring,st_ansistring];
+          variantdef:
+            result:=true;
+        end;
+      end;
+
+
 end.
 end.

+ 0 - 1
compiler/nld.pas

@@ -744,7 +744,6 @@ implementation
              exit;
              exit;
            end;
            end;
 
 
-
          registersint:=left.registersint+right.registersint;
          registersint:=left.registersint+right.registersint;
          registersfpu:=max(left.registersfpu,right.registersfpu);
          registersfpu:=max(left.registersfpu,right.registersfpu);
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}