Patrik Stridvall wrote:
On MSVC it does matter in the following example whether n is 4 or 8. Or 16 for that matter eventhough that gives the same result as 8.
#ifdef _MSC_VER typedef __int64 longlong_t; #else typedef long long longlong_t; #endif
#pragma pack(n) typedef struct { char x; longlong_t y; /* offset is 4 if n = 4, but is 8 if n =
8 or n = 16*/
} longlong_n; #pragma pack()
I would assume that MSVC and GCC use different structure layouts even without any #pragma pack(), because the default aligment of 8-byte data types is different.
As I mentioned in my other mail, GCC should use the same layout as MSVC if you compile with -malign-double.
As I mention in my other mail you are absolutely correct. :-)
So it seems that if we add a -malign-double to CFLAGS we can remove the warning in pshpack8.h since now it will hopefully work correctly.
Patrik Stridvall wrote:
So it seems that if we add a -malign-double to CFLAGS we can remove the warning in pshpack8.h since now it will hopefully work correctly.
Yes. However, the -malign-double option obviously causes GCC to produce code that in some cases does not conform to the Linux/i386 ABI. So, if Wine were to call any standard library routines whose ABI is affected by -malign-double (because a parameter is a structure type which is layed out differently), we'd have a problem here ...
Bye, Ulrich