Hi folks,
In each of the include/{pshpack[1248],poppack}.h headers we have checks like this:
# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) # pragma pack(1) # elif !defined(RC_INVOKED) # error "Adjusting the alignment is not supported with this compiler" # endif
Problem is that __GNUC__ is not defined when the standalone preprocessor (cpp) includes the headers, resulting in an error. Needless to say, this is Not Good (TM), as the standard headers can be used by cpp (I think :)).
How do we solve this? Maybe change the last condition to:
-# elif !defined(RC_INVOKED) +# elif defined(WINE_HEADER_DEBUG_ON)
or
+# elif defined(__WINESRC__)
or some such?
"Dimitrie O. Paun" dimi@intelliware.ca writes:
How do we solve this? Maybe change the last condition to:
-# elif !defined(RC_INVOKED) +# elif defined(WINE_HEADER_DEBUG_ON)
or
+# elif defined(__WINESRC__)
or some such?
I'd say just kill the #ifdef completely. We want packing on all compilers anyway.
On Thu, 11 Sep 2003, Alexandre Julliard wrote:
I'd say just kill the #ifdef completely. We want packing on all compilers anyway.
Here it is:
ChangeLog Dimitrie O. Paun dpaun@rogers.com Remove checks from {pop,psh}pack[1248].h that were causing the standalone processor to fail.
Index: include/poppack.h =================================================================== RCS file: /var/cvs/wine/include/poppack.h,v retrieving revision 1.4 diff -u -r1.4 poppack.h --- include/poppack.h 10 Mar 2002 00:02:34 -0000 1.4 +++ include/poppack.h 11 Sep 2003 20:56:28 -0000 @@ -22,18 +22,14 @@ # endif /* Depth == 3 */
-# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) -# if __WINE_PSHPACK_H2 == 1 -# pragma pack(1) -# elif __WINE_PSHPACK_H2 == 2 -# pragma pack(2) -# elif __WINE_PSHPACK_H2 == 8 -# pragma pack(8) -# else -# pragma pack(4) -# endif -# elif !defined(RC_INVOKED) -# error "Adjusting the alignment is not supported with this compiler" +# if __WINE_PSHPACK_H2 == 1 +# pragma pack(1) +# elif __WINE_PSHPACK_H2 == 2 +# pragma pack(2) +# elif __WINE_PSHPACK_H2 == 8 +# pragma pack(8) +# else +# pragma pack(4) # endif
#elif defined(__WINE_PSHPACK_H2) @@ -42,18 +38,14 @@ # endif /* Depth == 2 */
-# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) -# if __WINE_PSHPACK_H == 1 -# pragma pack(1) -# elif __WINE_PSHPACK_H == 2 -# pragma pack(2) -# elif __WINE_PSHPACK_H == 8 -# pragma pack(8) -# else -# pragma pack(4) -# endif -# elif !defined(RC_INVOKED) -# error "Adjusting the alignment is not supported with this compiler" +# if __WINE_PSHPACK_H == 1 +# pragma pack(1) +# elif __WINE_PSHPACK_H == 2 +# pragma pack(2) +# elif __WINE_PSHPACK_H == 8 +# pragma pack(8) +# else +# pragma pack(4) # endif
#elif defined(__WINE_PSHPACK_H) @@ -62,13 +54,11 @@ # endif /* Depth == 1 */
-# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(_MSC_VER) -# pragma pack() -# elif defined(__SUNPRO_CC) +# if defined(__SUNPRO_CC) # warning "Assuming a default alignment of 4" # pragma pack(4) -# elif !defined(RC_INVOKED) -# error "Adjusting the alignment is not supported with this compiler" +# else +# pragma pack() # endif
#else Index: include/pshpack1.h =================================================================== RCS file: /var/cvs/wine/include/pshpack1.h,v retrieving revision 1.5 diff -u -r1.5 pshpack1.h --- include/pshpack1.h 28 Aug 2003 21:43:35 -0000 1.5 +++ include/pshpack1.h 11 Sep 2003 20:57:09 -0000 @@ -42,10 +42,6 @@ # pragma warning(disable:4103) # endif
-# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) -# pragma pack(1) -# elif !defined(RC_INVOKED) -# error "Adjusting the alignment is not supported with this compiler" -# endif +# pragma pack(1)
#endif Index: include/pshpack2.h =================================================================== RCS file: /var/cvs/wine/include/pshpack2.h,v retrieving revision 1.5 diff -u -r1.5 pshpack2.h --- include/pshpack2.h 28 Aug 2003 21:43:35 -0000 1.5 +++ include/pshpack2.h 11 Sep 2003 20:57:22 -0000 @@ -42,10 +42,6 @@ # pragma warning(disable:4103) # endif
-# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) -# pragma pack(2) -# elif !defined(RC_INVOKED) -# error "Adjusting the alignment is not supported with this compiler" -# endif +# pragma pack(2)
#endif Index: include/pshpack4.h =================================================================== RCS file: /var/cvs/wine/include/pshpack4.h,v retrieving revision 1.6 diff -u -r1.6 pshpack4.h --- include/pshpack4.h 28 Aug 2003 21:43:35 -0000 1.6 +++ include/pshpack4.h 11 Sep 2003 20:57:36 -0000 @@ -42,10 +42,6 @@ # pragma warning(disable:4103) # endif
-# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) -# pragma pack(4) -# elif !defined(RC_INVOKED) -# error "Adjusting the alignment is not supported with this compiler" -# endif +# pragma pack(4)
#endif Index: include/pshpack8.h =================================================================== RCS file: /var/cvs/wine/include/pshpack8.h,v retrieving revision 1.5 diff -u -r1.5 pshpack8.h --- include/pshpack8.h 28 Aug 2003 21:43:35 -0000 1.5 +++ include/pshpack8.h 11 Sep 2003 20:58:01 -0000 @@ -42,11 +42,7 @@ # pragma warning(disable:4103) # endif
-# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) -# pragma pack(8) -# warning "8 as alignment is not supported" -# elif !defined(RC_INVOKED) -# error "Adjusting the alignment is not supported with this compiler" -# endif +# pragma pack(8) +# warning "8 as alignment is not supported"
#endif