Closed RobLoach closed 1 year ago
[ 96%] Building CXX object CMakeFiles/node-raylib.dir/src/generated/node-raylib.cc.o
/Users/runner/work/node-raylib/node-raylib/src/generated/node-raylib.cc:268:6: error: non-constant-expression cannot be narrowed from type 'uintptr_t' (aka 'unsigned long') to 'char' in initializer list [-Wc++11-narrowing]
pointerFromValue(info, index + 0),
^~~~~~~~~
/Users/runner/work/node-raylib/node-raylib/src/generated/node-raylib.cc:268:6: note: insert an explicit cast to silence this issue
pointerFromValue(info, index + 0),
^~~~~~~~~
static_cast
I'm not sure I totally follow what changes are being made and what is failing, but I'd like to help. Is the issue that the generated code uses uintptr_t
which is 64bit, but char
is 8 bits? Is this what is intended? If this is what we intend, can we just do a cast there?
I got it to build by hand-editing this:
inline BoneInfo BoneInfoFromValue(const Napi::CallbackInfo& info, int index) {
return {
(char) pointerFromValue(info, index + 0),
charFromValue(info, index + 1)
};
}
instead of
inline BoneInfo BoneInfoFromValue(const Napi::CallbackInfo& info, int index) {
return {
pointerFromValue(info, index + 0),
charFromValue(info, index + 1)
};
}
Not sure if that will actually work right, but might lead to a solution.
I added a small change that gets it building in a542777 but I'm really not sure if that is the right way to go. Seems like it probly isn't dealing with arrays right, but I'm not sure how to test it.
Given that the parser has changed, and it's difficult for us to target different versions of the API vs parser version, it may be worth it to manage it ourselves. The provided
raylib_api.json
was built using the latest Parser Generator frommaster
, with the4.0.0
raylib.h.DO NOT MERGE YET! It's not compiling with this yet. We'll need to wrap...
float[4]
char[32]
Matrix[2]
float[2]
float[16]
Fixes #145