Fixed another gcc <-> Visual C++ ABI issue
authorSam Lantinga <slouken@libsdl.org>
Sat, 20 Oct 2012 00:49:08 -0700
changeset 6595 c6402c811a40
parent 6594 dccafb0699dc
child 6596 b00cf2e4835c
Fixed another gcc <-> Visual C++ ABI issue
include/SDL_events.h
--- a/include/SDL_events.h	Sat Oct 20 00:14:58 2012 -0700
+++ b/include/SDL_events.h	Sat Oct 20 00:49:08 2012 -0700
@@ -438,6 +438,15 @@
     SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data */
     SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data */
     SDL_DropEvent drop;             /**< Drag and drop event data */
+
+    /* This is necessary for ABI compatibility between Visual C++ and GCC
+       Visual C++ will respect the push pack pragma and use 52 bytes for
+       this structure, and GCC will use the alignment of the largest datatype
+       within the union, which is 8 bytes.
+
+       So... we'll add padding to force the size to be 56 bytes for both.
+    */
+    Uint8 padding[56];
 } SDL_Event;