Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliased enum members are not renamed on symbol collision #228

Open
kavaari opened this issue Apr 27, 2019 · 1 comment
Open

Aliased enum members are not renamed on symbol collision #228

kavaari opened this issue Apr 27, 2019 · 1 comment

Comments

@kavaari
Copy link

kavaari commented Apr 27, 2019

Run dstep with --alias-enum-members=true:
dstep bgfx\include\bgfx\c99\bgfx.h -Ibx\include\ -o ..\source\bgfx.d --alias-enum-members=true

Get some symbol collision warnings during translate:

bgfx\include\bgfx\c99\bgfx.h:330:14: warning: a type renamed to 'bgfx_topology_convert_' due to the collision with the symbol declared in bgfx\include\bgfx\c99\bgfx.h:1012:21
bgfx\include\bgfx\c99\bgfx.h:384:14: warning: a type renamed to 'bgfx_render_frame_' due to the collision with the symbol declared in bgfx\include\bgfx\c99\bgfx.h:2729:32

Try compile the .d and get errors related to the renamed type:

source\bgfx.d(494,53): Error: function bgfx.bgfx_topology_convert(bgfx_topology_convert_ _conversion, void* _dst, uint _dstSize, const(void)* _indices, uint _numIndices, bool _index32) is not callable using argument types () ....
source\bgfx.d(498,55):        missing argument for parameter #1: bgfx_topology_convert_ _conversion
source\bgfx.d(499,37): Error: function bgfx.bgfx_topology_convert(bgfx_topology_convert_ _conversion, void* _dst, uint _dstSize, const(void)* _indices, uint _numIndices, bool _index32) is not callable using argument types ()
source\bgfx.d(499,37):        missing argument for parameter #1: bgfx_topology_convert_ _conversion
source\bgfx.d(577,38): Error: function bgfx.bgfx_render_frame(int _msecs) is not callable using argument types () ....

It seems that the alias strill refers to the old unrenamed type: alias BGFX_TOPOLOGY_CONVERT_COUNT = bgfx_topology_convert.BGFX_TOPOLOGY_CONVERT_COUNT;

Full:

enum bgfx_topology_convert_
{
    BGFX_TOPOLOGY_CONVERT_TRI_LIST_FLIP_WINDING = 0, /** ( 0) Flip winding order of triangle list. */
    BGFX_TOPOLOGY_CONVERT_TRI_STRIP_FLIP_WINDING = 1, /** ( 1) Flip winding order of trinagle strip. */
    BGFX_TOPOLOGY_CONVERT_TRI_LIST_TO_LINE_LIST = 2, /** ( 2) Convert triangle list to line list. */
    BGFX_TOPOLOGY_CONVERT_TRI_STRIP_TO_TRI_LIST = 3, /** ( 3) Convert triangle strip to triangle list. */
    BGFX_TOPOLOGY_CONVERT_LINE_STRIP_TO_LINE_LIST = 4, /** ( 4) Convert line strip to line list. */

    BGFX_TOPOLOGY_CONVERT_COUNT = 5
}

alias BGFX_TOPOLOGY_CONVERT_TRI_LIST_FLIP_WINDING = bgfx_topology_convert.BGFX_TOPOLOGY_CONVERT_TRI_LIST_FLIP_WINDING;
alias BGFX_TOPOLOGY_CONVERT_TRI_STRIP_FLIP_WINDING = bgfx_topology_convert.BGFX_TOPOLOGY_CONVERT_TRI_STRIP_FLIP_WINDING;
alias BGFX_TOPOLOGY_CONVERT_TRI_LIST_TO_LINE_LIST = bgfx_topology_convert.BGFX_TOPOLOGY_CONVERT_TRI_LIST_TO_LINE_LIST;
alias BGFX_TOPOLOGY_CONVERT_TRI_STRIP_TO_TRI_LIST = bgfx_topology_convert.BGFX_TOPOLOGY_CONVERT_TRI_STRIP_TO_TRI_LIST;
alias BGFX_TOPOLOGY_CONVERT_LINE_STRIP_TO_LINE_LIST = bgfx_topology_convert.BGFX_TOPOLOGY_CONVERT_LINE_STRIP_TO_LINE_LIST;
alias BGFX_TOPOLOGY_CONVERT_COUNT = bgfx_topology_convert.BGFX_TOPOLOGY_CONVERT_COUNT;

alias bgfx_topology_convert_t = bgfx_topology_convert_;

Thanks a lot for this awesome tool! It saves time quite a bit. 👍

@jacob-carlborg
Copy link
Owner

jacob-carlborg commented Apr 27, 2019

Do you have a minimal example that shows this problem? I'm not familiar with "bgfx". You can try adding the --collision-action flag as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants