Hello,
Is it possible with NativeBoost to create a binding for a variadic function ?
I've seen the printf example in NBCPrinter but this implementation is kind of cheating since it always pass just a %s as format and one already formatted string to the C function.
I've written a simple variadic function which adds every integer it receives as argument (first argument is for the number of following arguments) :
int add(int number,...);
In Pharo I've tried something like this :
add: number arg1: first arg2: second
<primitive: #primitiveNativeCall module: #NativeBoostPlugin>
^ self nbCall: #( int add (int number, int first, int second))
�� module: 'libMyLib.so'
and it works fine with two arguments.
Basically, doing so, I would need one method per number of arguments so it's not very cool.
I thought that maybe I could pass an array as argument to my Pharo method but I didn't really find a way to figure out how to define the nbCall without having a "Generic failure".