-
Notifications
You must be signed in to change notification settings - Fork 19
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
miniaudiohelpers library uses full implementation unnecessarily #38
Comments
👋 Hey thank you so much! Wasn't really sure what to do about this. Do you think there is a better way of doing this entirely? I kind of feel like this isn't necessary and I need to either hardcode sizes once during postinstall or figure something else out for determining these struct sizes. I'm not even sure if this method of determining struct sizes is even valid because potentially raylib may flip some switches with miniaudio that could change struct sizes. Id love to hear your thoughts 🤔💭 |
Unfortunately, since the packing, padding and layout of structs are both platform and compiler vendor-specific (Microsoft does it differently than GCC etc.), you have no choice but to do this if the structs can't be expressed directly in a Crystal file. I tried to take a look at them, and they look like a nightmare, but I can't quickly tell if one could treat them like the Raylib structs or not. However, your way of doing it should be fine as long Raylib doesn't modify the miniaudio struct layouts. |
Thanks for the input. I've heard various rumblings from people about this but I'm like not trying to maintain the miniaudio bindings just so I can unpack a struct someone needs in a rare situation (modifying the AudioCallback thing). I'm gonna set this up right now and give it a try. |
The sole purpose of miniaudiohelpers.c is to determine some struct sizes. On all platforms. the C compiler can calculate struct sizes based on the struct definitions. Therefore, instead of a nearly > 1 MB large miniaudiohelpers library that also fully implements the miniaudio library, one can get an ~ 1 KB large one that is perfectly sufficient.
FIX: remove the #define MINIAUDIO_IMPLEMENTATION in miniaudiohelpers.c
The text was updated successfully, but these errors were encountered: