瀏覽代碼

* DLL export names are not mangled on Windows (bug #11228).

git-svn-id: trunk@10836 -
yury 17 年之前
父節點
當前提交
c79fe114a3
共有 1 個文件被更改,包括 11 次插入7 次删除
  1. 11 7
      compiler/pexports.pas

+ 11 - 7
compiler/pexports.pas

@@ -189,14 +189,18 @@ implementation
                         { if a name is specified? (JM)                         }
 
                         if ((options and eo_name)=0) then
-                          { Use set mangled name in case of cdecl/cppdecl/mwpascal }
-                          { if no name specified                                   }
-                          if (tprocdef(tprocsym(srsym).procdeflist[0]).proccalloption in [pocall_cdecl,pocall_mwpascal]) then
-                            hpname:=target_info.cprefix+tprocsym(srsym).realname
-                          else if (tprocdef(tprocsym(srsym).procdeflist[0]).proccalloption in [pocall_cppdecl]) then
-                            hpname:=target_info.cprefix+tprocdef(tprocsym(srsym).procdeflist[0]).cplusplusmangledname
+                          if target_info.system in system_all_windows then
+                            { Export names are not mangled on Windows }
+                            hpname:=orgs
                           else
-                            hpname:=orgs;
+                            { Use set mangled name in case of cdecl/cppdecl/mwpascal }
+                            { if no name specified                                   }
+                            if (tprocdef(tprocsym(srsym).procdeflist[0]).proccalloption in [pocall_cdecl,pocall_mwpascal]) then
+                              hpname:=target_info.cprefix+tprocsym(srsym).realname
+                            else if (tprocdef(tprocsym(srsym).procdeflist[0]).proccalloption in [pocall_cppdecl]) then
+                              hpname:=target_info.cprefix+tprocdef(tprocsym(srsym).procdeflist[0]).cplusplusmangledname
+                            else
+                              hpname:=orgs;
 
                         exportprocsym(srsym,hpname,index,options);
                       end