Bläddra i källkod

* disabled the name mangling of external non-cdecl and non-cppdecl procedures
that don't have an import name specified explicitly. The previous behaviour
wasn't very useful, because it included the current module name in the mangled
name and that was very unlikely to be the correct name of a routine in a
different module. The new behaviour is also BP7 and Delphi compatible.

git-svn-id: trunk@32385 -

nickysn 9 år sedan
förälder
incheckning
4da9296f80
3 ändrade filer med 19 tillägg och 1 borttagningar
  1. 1 0
      .gitattributes
  2. 3 1
      compiler/pdecsub.pas
  3. 15 0
      tests/tbs/tb0613.pp

+ 1 - 0
.gitattributes

@@ -10810,6 +10810,7 @@ tests/tbs/tb0609.pp svneol=native#text/plain
 tests/tbs/tb0610.pp svneol=native#text/pascal
 tests/tbs/tb0611.pp svneol=native#text/pascal
 tests/tbs/tb0612.pp svneol=native#text/pascal
+tests/tbs/tb0613.pp svneol=native#text/pascal
 tests/tbs/tb205.pp svneol=native#text/plain
 tests/tbs/tb610.pp svneol=native#text/pascal
 tests/tbs/tb613.pp svneol=native#text/plain

+ 3 - 1
compiler/pdecsub.pas

@@ -3004,7 +3004,9 @@ const
                   { but according to MacPas mode description
                     Cprefix should still be used PM }
                   if (m_mac in current_settings.modeswitches) then
-                    result:=target_info.Cprefix+tprocdef(pd).procsym.realname;
+                    result:=target_info.Cprefix+tprocdef(pd).procsym.realname
+                  else
+                    result:=pd.procsym.realname;
                 end;
             end;
           end;

+ 15 - 0
tests/tbs/tb0613.pp

@@ -0,0 +1,15 @@
+procedure TestProc1; external;
+procedure TestProc2; pascal; external;
+
+procedure Ext_TestProc1; public name 'TestProc1';
+begin
+end;
+
+procedure Ext_TestProc2; pascal; public name 'TestProc2';
+begin
+end;
+
+begin
+  TestProc1;
+  TestProc2;
+end.