Why is GenTLB renaming symbols (appending '_')

牧云@^-^@ 提交于 2019-12-24 18:12:43

问题


I am using GenTLB.exe to compile a ridl file to .tlb and _TLB.pas files.

In the resulting _TLB.pas file, there are hints that it has renamed a number of symbols by appending an underscore to the end of the name.

A sample of the hints is:

// Errors:
//   Hint: Symbol 'Assign' renamed to 'Assign_'
//   Hint: Enum Member '_amStretch' of 'EnumVRSAppliedMaterial' changed to '_amStretch_'
//   Hint: Enum Member '_amTile' of 'EnumVRSAppliedMaterial' changed to '_amTile_'

The command line I use with GenTLB is:

GenTLB -P -Pt+ <ridl file>

I get the same problem occuring if I use the tlibimp tool as well.


回答1:


Assign is renamed to Assign_ because of a mapping in tlibimp.sym, a INI-format text file in the same directory as tlibimp.

Another piece of logic continuously appends '_' until the name is unique with respect to prior global names tlibimp has found. All enumeration members are interpreted as globals. Are there any other instances of _amTile etc. in the generated .pas file?




回答2:


I am not sure, but often an underscore is appended in front of a name, if the name is conflicting with and exsisting name (e.g. reserwed word, and so). It could be something like that.



来源:https://stackoverflow.com/questions/531171/why-is-gentlb-renaming-symbols-appending

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!