浏览代码

New export option that enforces the use of the provided export name instead of using the name of the provided symbol. This is necessary to correctly handle overloaded functions, especially if one of them is an internproc one.

export.pas:
  + texportoption: new option eo_no_sym_name
pkgutil.pas:
  * exportprocsym: set eo_no_sym_name when exporting procdefs from a package
systems/t_win.pas, TExportLibWin:
  * generatelib: respect eo_no_sym_name

git-svn-id: trunk@33574 -
svenbarth 9 年之前
父节点
当前提交
adbef4fc84
共有 3 个文件被更改,包括 4 次插入3 次删除
  1. 2 1
      compiler/export.pas
  2. 1 1
      compiler/pkgutil.pas
  3. 1 1
      compiler/systems/t_win.pas

+ 2 - 1
compiler/export.pas

@@ -36,7 +36,8 @@ type
    texportoption=(eo_none,
      eo_resident,
      eo_index,
-     eo_name
+     eo_name,
+     eo_no_sym_name { don't try to use another mangled name if symbol is known }
    );
    texportoptions=set of texportoption;
 

+ 1 - 1
compiler/pkgutil.pas

@@ -91,7 +91,7 @@ implementation
                 )
               ) then
             begin
-              exportallprocdefnames(tprocsym(sym),pd,[]);
+              exportallprocdefnames(tprocsym(sym),pd,[eo_name,eo_no_sym_name]);
             end;
         end;
     end;

+ 1 - 1
compiler/systems/t_win.pas

@@ -871,7 +871,7 @@ implementation
                 end;
 
               { symbol known? then get a new name }
-              if assigned(hp.sym) then
+              if assigned(hp.sym) and not (eo_no_sym_name in hp.options) then
                 case hp.sym.typ of
                   staticvarsym :
                     asmsym:=current_asmdata.RefAsmSymbol(tstaticvarsym(hp.sym).mangledname);