@ in names of external functions

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 771
Joined: Wed May 05, 2010 12:16 pm

@ in names of external functions

Post by Rado1 » Tue Aug 28, 2012 5:14 pm

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?

User avatar
VilleK
Site Admin
Posts: 2052
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Wed Aug 29, 2012 7:02 am

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.

User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski » Fri Aug 31, 2012 1:49 pm

Oh that is a rather niffty tracker,. what is the licence on the .dll (.so) ? Do post if you get it working as I would give it a try,.
iterationGAMES.com

User avatar
Rado1
Posts: 771
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 » Fri Aug 31, 2012 5:27 pm

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.

Post Reply