<div dir="ltr"><div><div><div><div>Hello,<br><br></div> Thank you for your reply.<br></div> <br> Now I am trying direct access wxWidgets GUI library with c-inline.<br></div> If CFFI is possible to access C++ library, I will use CFFI.<br></div><br> Best regards,<div><div> hirohiro<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-13 19:12 GMT+09:00 Daniel Kochmański <span dir="ltr"><<a href="mailto:daniel@turtleware.eu" target="_blank">daniel@turtleware.eu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey,<br>
<br>
thanks for the report!<br>
<br>
Inlining is somewhat broken. Direct casting of a function into (void*)<br>
is undefined behavior in C afaik but that's what we'll do.<br>
<br>
Please consult this issue:<br>
<a href="https://gitlab.com/embeddable-common-lisp/ecl/issues/167" rel="noreferrer" target="_blank">https://gitlab.com/embeddable-common-lisp/ecl/issues/167</a><br>
<span class=""><br>
<br>
hiro hiro writes:<br>
<br>
> Hello,<br>
><br>
>   I compiled ecl16.0.0 with option "--with-cxx".<br>
><br>
>   Then I use ffi:defcallback function like<br>
><br>
>     (ffi:defcallback yyyy :void () ..... )<br>
><br>
>   then compile-file<br>
>     (compile-file "xxxxx.lisp" :c-file "xxxxx.cpp" :system-p t)<br>
><br>
>   I received error message as follows<br>
>    (freebsd10.1 clang++)<br>
>     xxxxx.cpp:162:8: error: no matching function for call to<br>
>       'ecl_make_foreign_data'<br>
>       T0 =<br>
> ecl_make_foreign_data(ECL_SYM("POINTER-VOID",1381),0,ecl_callback_0)<br>
><br>
>   I try as follows<br>
><br>
>     in src/cmp/cmpcbk.lsp & src/new-cmp/cmpc-cbk.lsp   line 44<br>
>      from:<br>
>        ,(format nil "ecl_make_foreign_data(@':pointer-void,0,~a)" c-name)<br>
>      to:<br>
>        ,(format nil "ecl_make_foreign_data(@':pointer-void,0,(void*)~a)"<br>
> c-name)<br>
<br>
</span>I've added main part of your mail to the abovementioned issue. I won't<br>
incorporate this fix directly because I remember I did similar stuff<br>
//casting to (void*)obj, or even casting to (void**)&obj// at my last<br>
attempt when working on this issue but it was breaking arm builds. When<br>
I'll confirm it doesn't break a builds I'll add it along with other<br>
changes and the appropriate patch to CFFI.<br>
<span class="">><br>
>   after that, I did not receive error message and ffi:callback work fine.<br>
><br>
>   Would you let me know what your thoughts are on this matter.<br>
<br>
</span>Generally use CFFI's defcallback. It does just that but without inlining<br>
(I've disabled inlining to make things working and left issue opened to<br>
work on it when I'll find time/incentive to do it).<br>
><br>
>                                                    hirohiro447<br>
<br>
As a sidenote, according to Juan (I've asked him about the newcmp)<br>
newcmp was a failed experiment and it doesn't build anyway. src/cmp/*<br>
changes were enough. I'll remove the `new-cmp' directory before the next<br>
release to avoid unnecessary confusing of people approaching the<br>
codebase.<br>
<br>
Once again - thanks for the report :-)<br>
<br>
Best regards,<br>
Daniel<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Daniel Kochmański ;; aka jackdaniel | Poznań, Poland<br>
TurtleWare - Daniel Kochmański      | <a href="http://www.turtleware.eu" rel="noreferrer" target="_blank">www.turtleware.eu</a><br>
<br>
"Be the change that you wish to see in the world." - Mahatma Gandhi<br>
</font></span></blockquote></div><br></div>