Hi,
today I played with SunVox which is quite an interesting tracker with modular synthesizer. It produces pretty small files and there exists also a dll which can play these files.
Unfortunately, the dll exports functions with names such as sv_init@16, sv_open_slot@4, sv_load@8, etc. If used in a C code, the dll is initialized in a header file, where pointers to all these stupid functions are loaded and stored in variables with normal names, eg., v_init, sv_open_slot, sv_load, etc. Then used in the C code normally. Of course, ZGE cannot call this header file with dll initialization.
Because the interface uses just primitive types which are called from ZGE easily, I did not want to create a dll facade; which would be in fact another dll loading/calling the original sunvox.dll. (Distributing 2 dlls with one zge file just to play music is stupid anyway.)
How is it possible to call functions with @ from ZGE? The problem is that @ is not a valid character in names. What about to extend calling external functions with something like this:
alias "exported_name" (parameters) {}
? Alias would be the name of the function in ZGE, real exported name can be omitted if identical with alias. I'm not sure it it could work... is it a stupid idea?
@ in names of external functions
Moderator: Moderators
That's a good idea, I've seen solutions like that in other languages but haven't before encountered a situation where it would be needed in ZGE.
I'll look into it but can't promise when it will be fixed. In the meantime you could also ask on their forums if they can't just make a dll with normal (unmangled) names.
I'll look into it but can't promise when it will be fixed. In the meantime you could also ask on their forums if they can't just make a dll with normal (unmangled) names.
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
It is not necessary to solve the @ problem now - we have a version of the SunVox library with unmangled function names, see this topic for details.