Skip to content

How to use variadic functions with extern(module)? #23

Answered by MrSmith33
rempas asked this question in Q&A
Discussion options

You must be logged in to vote

On linux @extern(module) is not useful, as linking shared libraries is still work in progress (I'm close to figuring it out though).

Also, C-style variadic functions are not supported, and I'm not sure that implementing it mostly for printf from libc is worth it.

The most complicated and valuable part is float to string conversion though. I haven't yet implemented it using Vox. But here you can see a simple implementation that I use for printing stuff (supports ints, pointers, strings, bools) https://github.com/MrSmith33/voxelman2/blob/master/plugins/core/utils.vx#L217-L230

Latest CI builds have debug version, btw

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rempas
Comment options

Answer selected by rempas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants