Check whether `isbits(cdCanvas) == true` (probably not). If not, try
changing it to an immutable.

Aside from that, `Ptr{Void}` should be correct as the field type. This
construct is used frequently; see e.g.:
https://github.com/staticfloat/Nettle.jl/blob/97268c4764cf4a84b16208628224e36d49a469ec/src/hash.jl#L20-L28

On Thu, Jan 8, 2015 at 6:40 PM, J Luis <[email protected]> wrote:

> Hi,
>
> I need to convert a structure of function pointers into a composite type.
> The struct looks like this
>
> struct cdCanvas {
>   void   (*cxPixel)(cdCtxCanvas* ctxcanvas, int x, int y, long color);
>   void   (*cxLine)(cdCtxCanvas* ctxcanvas, int x1, int y1, int x2, int y2);
>   void   (*cxPoly)(cdCtxCanvas* ctxcanvas, int mode, cdPoint* points, int
> n);
> ...
>
> used Clang.jl but it converted it to
>
> type cdCanvas
>     cxPixel::Ptr{Void}
>     cxLine::Ptr{Void}
>     cxPoly::Ptr{Void}
> ...
>
> which is not correct (ccall crash when using this type), but I don't know
> either how to write it manually.
>
> Any advise?
>
> Thanks
>

Reply via email to