#CC++ Interop Variadic Function?

22 messages · Page 1 of 1 (latest)

upper zenith
#

How would I call a variadic function from my C# interop, I am using the c declaration way of interopping btw.

untold ploverBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

upper zenith
#

Also, it removed the #, it was meant to say C#/C++ interop.

dire kindle
#

by "variadic function" you mean what exactly?

#

some va_list stuff?

#

or variadic templates?

upper zenith
#

va_list

#

@dire kindle

dire kindle
#

ok, i'm afraid i have no idea if that's possible in a good way

#

why do you need to?

#

va_list is generally pretty terrible

upper zenith
#

I just need to call spdlog from c#, there might be a better way, I don't have much c++ experience.

dire kindle
#

i mean, a hack that i guess should work would be to just declare functions with the signatures you like and call them. just make sure that the parameter types match the promoted parameter types you'd get with an ellipsis in C

#

real question ofc is why it needs to be a C logging library when i'm sure there's at least a billion such libraries designed for C#…

upper zenith
#

I'm writing a game engine in c++ with a c# front-end, I thought it would be better to keep the logging library uniform.

dire kindle
#

i'd consider just presenting the C# side of things with some logging interface it can use

#

that can internally just forward to spdlog or whatever anyways

upper zenith
#

Yeah, makes sense.

#

Alright, thanks

#

!solved

untold ploverBOT
#

Thank you and let us know if you have any more questions!

#

[SOLVED] CC++ Interop Variadic Function?