[Ecls-list] Tighter c/c++ integration, toplevel inline c/c++ code ???
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Mon May 3 12:40:01 UTC 2010
On Mon, May 3, 2010 at 1:54 PM, Seth Burleigh <seth at tewebs.com> wrote:
> Lets say i have a file called test.lisp and in it is this code:
>
> (in-package :utils2)
>
> (FFI:C-INLINE NIL ..
>
No!!! C-INLINE is for INLINE statements that perform computations in C. NOT
FOR DECLARATIONS.
> (si:system "cat foo.lisp")
(FFI:CLINES "
int foo(int a, int b)
{
return a+b;
}
")
(let ((x (ffi:c-inline (1 2) (:int :int) :int "foo(#0,#1)" :one-liner t)))
(print x))
> (compile-file "foo" :load t)
;; Loading "/Users/jjgarcia/foo.fas"
3
Is there anything else I am missing here?
Juanjo
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://tream.dreamhosters.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20100503/4120d346/attachment.html>
More information about the ecl-devel
mailing list