mascarenhas/alien

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

perlawk opened this issue · 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