Skip to content

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