alien icon indicating copy to clipboard operation
alien copied to clipboard

How to set the lua side of a void argument in C?

Open perlawk opened this issue 11 years ago • 0 comments

How to set the lua side of a void argument in C?

example:

C side: cat libtest.c

int five(void) { return 5; }

lua side:

so = require"alien" tst = so.load("test") tst.five:types("int", "void")

assert( tst.five() == 5) -- error: two few arguments (function five)

assert( tst.five(1) == 5) -- error: paramenter 2 is of unknow type (function five)

take around the bug:

so = require"alien" tst = so.load("test") tst.five:types("int", "int") assert( tst.five(0) == 5) -- ok

perlawk avatar Feb 10 '14 09:02 perlawk