Re: Machine Level Exception Error
- Posted by Icy_Viking 1 week ago
- 125 views
petelomax said...
Icy_Viking said...
public constant xAG_InitGraphics = define_c_func(gui,"+AG_InitGraphics",{C_STRING},C_INT) public function AG_InitGraphics(sequence driver) return c_func(xAG_InitGraphics,{driver}) end function
Don't you have to allocate_string(driver) (and free it) and pass that memory address in Euphoria? Or does libffi/C_STRING take care of that?
jmduro's code is passing 0, perhaps "dummy" would be a better test.
C_STRING does take care of string_allocation for you. https://github.com/ghaberek/libffi-euphoria/blob/main/include/std/ffi.e
However based on the other replies, it may be better to use C_POINTER in this case. However it seems the issue still isn't resolved yet.