-
Notifications
You must be signed in to change notification settings - Fork 116
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
*anyopaque struct members aren't checked for null pointers #118
Comments
I think returning an error would me more "Zig like", but it requires creating an extra struct for each type this affects. These are
I'll see if I can come up with an elegant solution for this, without requiring much manual intervention |
Not-Nik
changed the title
rl.Image.data should be nullable
*anyopaque struct members aren't checked for null pointers
Jul 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Raylib,
Image.data
can be checked for null in case loading an image failed: https://github.com/raysan5/raylib/blob/9a280cda0be211ee751cdb44fedab8f1e698be2a/src/rtextures.c#L4156But in the bindings,
data
is*anyopaque
, and Zig seems to not allow comparing it with null. Maybe it should be?*anyopaque
? OrloadImage
could return an error? (depending on how thin the bindings should be)The text was updated successfully, but these errors were encountered: