You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it'd be swell if the HelloWorld example were actually valid C instead of just C-shaped C++. There are a couple issues with the bindings preventing that:
Change enums from C23/C++-style enums with reprs to constants
Use NULL instead of nullptr
Change struct initialization from C++-style Foo{...} to (Foo){...} or {...}.
The text was updated successfully, but these errors were encountered:
I was messing around with this right now and it seems it mostly is valid C? You need to change nullptr to NULL, and JPC_RVec3{...} to (JPC_RVec3){...}, and it builds just fine?
I was messing around with this right now and it seems it mostly is valid C? You need to change nullptr to NULL, and JPC_RVec3{...} to (JPC_RVec3){...}, and it builds just fine?
Nice! Those are easy fixes. I didn't realize that C didn't have that style of struct initializer. I bet we can just use {...} in a lot of places.
(However, it does not seem to bounce, which I think it's meant to?)
Ah, you mean that when we compile the same HelloWorld example in the repo as C, the behavior changes? That's not good! 🤔
When I ported the example originally I verified that we got identical output between the original C++ HelloWorld, the new C-ish HelloWorld, and a Rust program using bindings to JoltC.
I think it'd be swell if the HelloWorld example were actually valid C instead of just C-shaped C++. There are a couple issues with the bindings preventing that:
NULL
instead ofnullptr
Foo{...}
to(Foo){...}
or{...}
.The text was updated successfully, but these errors were encountered: