Skip to content

Fix padding size in Event #17

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

Merged
merged 1 commit into from
Mar 31, 2025

Conversation

coat
Copy link
Contributor

@coat coat commented Mar 31, 2025

I was getting an Illegal instruction error after my program ended normally, and during troubleshooting I noticed the Event union differed that what Zig translate-c was generating.

According to SDL_events.h, the SDL_Event union has 128 bytes of padding, but our Event has 128 bits.

After making this change, my program no longer crashes.

According to SDL_events.h, the SDL_Event union has 128 bytes of padding,
but our Event has 128 bits.

https://github.com/libsdl-org/SDL/blob/8eb57c5a420426f7b6d96f9c6afd0777c6137be6/include/SDL3/SDL_events.h#L1040
@coat coat force-pushed the fix-event-union-padding branch from fe59c20 to 5ca93a2 Compare March 31, 2025 01:47
@hazeycode hazeycode merged commit d76d5f6 into zig-gamedev:main Mar 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants