Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures.
authorSam Lantinga <slouken@libsdl.org>
Mon, 09 Jan 2012 07:07:43 -0500
changeset 6204 dc2eb9370e82
parent 6202 691248f529b7
child 6205 7dd8ea9f282d
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:53:58 2012 -0500
+++ b/include/begin_code.h	Mon Jan 09 07:07:43 2012 -0500
@@ -87,7 +87,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
 #endif /* Compiler needs structure packing set */
 
 /* Set up compiler-specific options for inlining functions */