Surendra Singhi <[EMAIL PROTECTED]> writes:

> Hello,
>   Any allegro experts around? I wrote cffi bindings (Dec-15) for some 
> functions in
> wxWidgets, the bindings work smoothly on clisp and lispworks.
>
> But they crash on allegro. Then I tried to write the allego bindings directly,
> but it still crashes.
>
OK, I debugged further and found out that my allegro bindings were incorrect
which was causing segmentation faults, but cffi bindings still seem to be
correct as they work on clisp and lispworks. 

If I have C header file containing declarations as

typedef void _cdecl (*ClosureFun)(void* _evt );
void ELJApp_InitializeC(ClosureFun closure, int _argc, char** _argv)
{
 closure(NULL);
.....
}

The incorrect allegro bindings which I wrote are: 

(ff:def-foreign-call (ELJApp_InitializeC "ELJApp_InitializeC")
    ((closure (* :void))
     (_argc :int fixnum)
    (_argv (* :void)))
  :returning :void)

(ff:defun-foreign-callable init-func ((evt (* :void)))
  (print "hello-world"))

(Eljapp_initializeC #'init-func 0 nil)

How do I fix these incorrect allegro bindings?

Thanks.

-- 
Surendra Singhi
http://www.public.asu.edu/~sksinghi/index.html

,----
| "War is Peace! Freedom is Slavery! Ignorance is Strength!"
|     -- Orwell, 1984, 1948
`----

_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to