Open lundmark opened 3 years ago
That solution do not really look ideal no... But I have some things to test now at least... I'll try to find some time to look at it during the week!
Yeah the code was actually copy-paste from a different place. I think it's because DL doesn't require enums to be defined before used in the typelibrary.
To be honest I think that DL should ensure that the enum is defined and then just start by going through all the enum definitions in the typelibrary before anything else.
Something like that yes... Do you have a typelib to repro the issue?
Unfortunately I haven't been able to extract the parts of the typelib that causes this issue, and the typelibs are too huge and with too much secret-stuff so I can't send them either :/ But it should be easy to reproduce?
I can't seem to reproduce this... things I have tried is just inline arrays of enums (these tests has been there for a long while) and declaring the enum after the struct using it, that also works. Could it be if the enum is from another typelib all together?
Hi, sorry for the late answer.
Yes it is possible but unlikely that it's from a different typelib. Maybe it's possible to track down the other fix that I copied in order to get this working, and see what happens if you remove that one? The patch is basically a copy-paste from a different part of the code.
https://pastecode.io/s/1j7TQi4rOE
This patch fixes an issue with writing a c-header with inline-arrays of enums. I expect there to be a better solution for this issue maybe generally, but unfortunately I did not have time to dive deeper for a better fix.
Unfortunately I couldn't get a diff to paste correctly in github so I added it to pastecode instead.