[cffi-devel] There doesn't seem to be anything in CFFI doc. about wrapping macros

Joeish W joeish80829 at yahoo.com
Sat Nov 2 17:32:53 UTC 2013



I'm trying to wrap the GET_SEQ_ELEM  macro below can some one give me clues or example how i would go about this easily

with a cffi function like defcfun...If there is no clear way i definately propose an addendum to cffi for wrapping macros


#define  CV_SEQ_ELEM( seq, elem_type, index )                    \ 
/* assert gives some guarantee that <seq> parameter is valid */  \ 
(   assert(sizeof((seq)->first[0]) == sizeof(CvSeqBlock) &&      \ 
    (seq)->elem_size == sizeof(elem_type)),                      \ 
    (elem_type*)((seq)->first && (unsigned)index <               \ 
    (unsigned)((seq)->first->count) ?                            \ 
    (seq)->first->data + (index) * sizeof(elem_type) :           \ 
    cvGetSeqElem( (CvSeq*)(seq), (index) ))) 
#define CV_GET_SEQ_ELEM( elem_type, seq, index ) CV_SEQ_ELEM( (seq), elem_type, (index) )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20131102/a12ea11e/attachment.html>


More information about the cffi-devel mailing list