[Ecls-list] ffi:clines and @ preprocessing

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Fri Mar 12 23:00:54 UTC 2010


On Fri, Mar 12, 2010 at 10:40 PM, Matthew Mondor
<mm_lists at pulsar-zone.net>wrote:

> I get
> C compilation errors: "error: stray '@' in program", suggesting that
> CLINES does not do @ preprocessing.  Is there a way to tell CLINES to
> do so,


Not right now. CLINES is not intended to be used for arbitrary C code, but
rather small pieces such as header inclusion. The reason is that CLINES
become part of the header and are included before anything else.

or should I find a way to use C-INLINE instead?


You may also consider writing a lisp function and exporting it to the C
world with a given C name, as in

(proclaim '(ext:c-export-name ("my_constructor" my-constructor)))

and then try calling the function from C code. Note that this lisp function
should only take a fixed number of arguments and all of them having type
cl_object.

 Also, I've not
> fully read the compiler and I'm wondering if there's not a function I
> could simply call to preprocess a string containing C code.
>

Again, no. Processing of @ forms is done when emitting the C code itself.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20100313/5b169037/attachment.html>


More information about the ecl-devel mailing list