Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
perlawk opened this issue Feb 10, 2014 · 0 comments
Open

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

perlawk opened this issue Feb 10, 2014 · 0 comments

Comments

@perlawk
Copy link

perlawk commented Feb 10, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant