Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures. SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Mon, 09 Jan 2012 07:06:36 -0500
branchSDL-1.2
changeset 6203 bc960ba38aae
parent 6199 a1d200f7ed38
child 6206 ceb6db0058f1
Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures.
include/begin_code.h
--- a/include/begin_code.h	Mon Jan 09 04:36:57 2012 -0500
+++ b/include/begin_code.h	Mon Jan 09 07:06:36 2012 -0500
@@ -132,7 +132,12 @@
 #ifdef __BORLANDC__
 #pragma nopackwarning
 #endif
+#ifdef _M_X64
+/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
+#pragma pack(push,8)
+#else
 #pragma pack(push,4)
+#endif
 #elif (defined(__MWERKS__) && defined(__MACOS__))
 #pragma options align=mac68k4byte
 #pragma enumsalwaysint on