Selaa lähdekoodia

* only compare non-hidden parameters when searching for an implementation. The location
of hidden parameters can be different between calling conventions and cause problems
with delphi mode where the implementation calling convention can be skipped

git-svn-id: trunk@4741 -

peter 19 vuotta sitten
vanhempi
commit
506f44dc7a
3 muutettua tiedostoa jossa 22 lisäystä ja 2 poistoa
  1. 1 0
      .gitattributes
  2. 3 2
      compiler/pdecsub.pas
  3. 18 0
      tests/webtbs/tw7329.pp

+ 1 - 0
.gitattributes

@@ -7336,6 +7336,7 @@ tests/webtbs/tw7161.pp svneol=native#text/plain
 tests/webtbs/tw7195.pp svneol=native#text/plain
 tests/webtbs/tw7227.pp svneol=native#text/plain
 tests/webtbs/tw7276.pp svneol=native#text/plain
+tests/webtbs/tw7329.pp svneol=native#text/plain
 tests/webtbs/tw7372.pp svneol=native#text/plain
 tests/webtbs/tw7379.pp svneol=native#text/plain
 tests/webtbs/tw7391.pp svneol=native#text/plain

+ 3 - 2
compiler/pdecsub.pas

@@ -2426,9 +2426,10 @@ const
                (pd.maxparacount=0) and
                not(po_overload in hd.procoptions)
               ) or
-              { check arguments }
+              { check arguments, we need to check only the user visible parameters. The hidden parameters
+                can be in a different location becuase of the calling convention, eg. L-R vs. R-L order (PFV) }
               (
-               (compare_paras(pd.paras,hd.paras,cp_none,[cpo_comparedefaultvalue])>=te_equal) and
+               (compare_paras(pd.paras,hd.paras,cp_none,[cpo_comparedefaultvalue,cpo_ignorehidden])>=te_equal) and
                { for operators equal_paras is not enough !! }
                ((pd.proctypeoption<>potype_operator) or (optoken<>_ASSIGNMENT) or
                 { be careful here, equal_defs doesn't take care of unique }

+ 18 - 0
tests/webtbs/tw7329.pp

@@ -0,0 +1,18 @@
+{$MODE DELPHI}
+unit tw7329;
+
+interface
+
+type
+  IDirect3D9 = interface(IUnknown) end;
+// IDirect3D9 = Integer; //todo: Uncomment this line and comment previous one to successfully compile with 2.0.4
+
+function Direct3DCreate9(SDKVersion: LongWord): IDirect3D9; stdcall;
+
+implementation
+
+function Direct3DCreate9(SDKVersion: LongWord): IDirect3D9;
+begin
+end;
+
+end.