Surendra Singhi efuzzyone@netscape.net 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.