-
Notifications
You must be signed in to change notification settings - Fork 142
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
bool type #56
Comments
Is it possible to show me a more complete sample code to demonstrate your problem? What C lib are you trying to invoke? |
I have just done a stripped down version of api, the C api is like this
Struct for c api is defined like this
It is defined and used in javascript like this
|
Oh I see. You don't need to do the const newObj = new Obj({
traceMode: true
}); What you were doing was passing in a pointer to a bool, which was an address in memory which would basically always be "true". |
Ok I will try that, thanks for your swift answer! |
I am testing value of bool inside c like this but it still doesn't recognise the ref past from javascript.
|
Seems to be working as expected
@simon-p-r I added a test case in node-ffi/node-ffi@7a928f3 which seems to be working as expected. Let me know if I'm missing anything. |
Thanks @TooTallNate forgot about this, I think my problem was a boundary problem with the struct I was working with. I am a total c novice, thanks for this excellent module! |
Hi
I am trying to use a bool type however the value in c code is not true or false, I have tried these 2 different ways
and
Any pointers would be appreciated!
Thanks
The text was updated successfully, but these errors were encountered: