Search
18:06:00
frgo
drmeister: And you are aware of https://common-lisp.net/project/cffi/manual/html_node/foreign_002dfuncall_002dvarargs.html ?
18:07:09
frgo
Ah - yes. C++, well. Make a wrapper function in C for that C++ function and that's it. It's tedious, yes, but...
18:07:11
drmeister
It's probably going through libffi. I'm working with libffi directly in clbind.
18:07:43
frgo
Ok. When you have something working I'd really like to see what you have...
18:23:00
drmeister
You didn't have to implement foreign-funcall-varargs at the low level?
18:23:51
drmeister
I know the answer - no - it isn't implemented in fli.cc
18:50:18
drmeister
Am I thinking about this wrong? It looks like a tremendous amount of work to wrap something like printf.
18:50:52
drmeister
I have to convert every Common Lisp value into a C Plain Old Data type and manage memory for it and then clean up after the call.
19:00:22
frgo
For this reason CFFI provides said macro ... I can't say what it takes for clbind to support varargs C++ function/method calls..
19:00:50
frgo
But basically, yes, what you described is how it's done.
19:02:07
frgo
I've always done that as much as possible in Lisp land and only very rarely done that in C land.
19:03:05
frgo
I also use https://github.com/jetmonk/waaf-cffi for array passing.