diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index b01197280c3..38c830a2108 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -21,7 +21,7 @@ DEFAULT_DEBUG_CHANNEL(shell) -#pragma pack(1) +#include "pshpack1.h" typedef struct { @@ -43,7 +43,7 @@ typedef struct icoICONDIRENTRY idEntries[1]; /* An entry for each image (idCount of 'em) */ } icoICONDIR, *LPicoICONDIR; -#pragma pack(4) +#include "poppack.h" #if 0 static void dumpIcoDirEnty ( LPicoICONDIRENTRY entry ) diff --git a/dlls/shell32/pidl.h b/dlls/shell32/pidl.h index b1fe72fc507..ac1d6f9cbd7 100644 --- a/dlls/shell32/pidl.h +++ b/dlls/shell32/pidl.h @@ -62,7 +62,7 @@ #define PT_NETWORK 0x47 #define PT_SHARE 0xc3 -#pragma pack(1) +#include "pshpack1.h" typedef BYTE PIDLTYPE; typedef struct tagPIDLDATA @@ -94,7 +94,7 @@ typedef struct tagPIDLDATA } network; }u; } PIDLDATA, *LPPIDLDATA; -#pragma pack(4) +#include "poppack.h" /* * getting string values from pidls diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c index 75f7d00c0b6..1cde64c9453 100644 --- a/dlls/shell32/shelllink.c +++ b/dlls/shell32/shelllink.c @@ -23,7 +23,7 @@ DEFAULT_DEBUG_CHANNEL(shell) /* link file formats */ -#pragma (1); +#include "pshpack1.h" /* lnk elements: simple link has 0x0B */ #define WORKDIR 0x10 @@ -52,7 +52,7 @@ typedef struct _LINK_HEADER ITEMIDLIST Pidl; /* 0x4e */ } LINK_HEADER, * PLINK_HEADER; -#pragma (4); +#include "poppack.h" /* IPersistFile Implementation */ typedef struct diff --git a/graphics/win16drv/init.c b/graphics/win16drv/init.c index c007c330d3f..00ba38baf10 100644 --- a/graphics/win16drv/init.c +++ b/graphics/win16drv/init.c @@ -20,7 +20,7 @@ DEFAULT_DEBUG_CHANNEL(win16drv) #define SUPPORT_REALIZED_FONTS 1 -#pragma pack(1) +#include "pshpack1.h" typedef struct { SHORT nSize; @@ -29,7 +29,7 @@ typedef struct SEGPTR lpXForm; SEGPTR lpDrawMode; } EXTTEXTDATA, *LPEXTTEXTDATA; -#pragma pack(4) +#include "poppack.h" SEGPTR win16drv_SegPtr_TextXForm; LPTEXTXFORM16 win16drv_TextXFormP; diff --git a/if1632/snoop.c b/if1632/snoop.c index b1727558196..6914d46b509 100644 --- a/if1632/snoop.c +++ b/if1632/snoop.c @@ -20,7 +20,7 @@ DEFAULT_DEBUG_CHANNEL(snoop) #ifdef __i386__ -#pragma pack(1) +#include "pshpack1.h" void WINAPI SNOOP16_Entry(CONTEXT *context); void WINAPI SNOOP16_Return(CONTEXT *context); @@ -82,7 +82,7 @@ typedef struct tagSNOOP16_RELAY { /* unreached */ } SNOOP16_RELAY; -#pragma pack(4) +#include "poppack.h" static SNOOP16_DLL *firstdll = NULL; static SNOOP16_RETURNENTRIES *firstrets = NULL; diff --git a/if1632/thunk.c b/if1632/thunk.c index bfa4c8b2c35..1ce73a3abc0 100644 --- a/if1632/thunk.c +++ b/if1632/thunk.c @@ -114,7 +114,7 @@ extern LONG CALLBACK CallTo16_long_llllllllllllllll(FARPROC16,LONG,LONG,LONG, typedef void (*RELAY)(); -#pragma pack(1) +#include "pshpack1.h" typedef struct tagTHUNK { @@ -127,7 +127,7 @@ typedef struct tagTHUNK struct tagTHUNK *next WINE_PACKED; } THUNK; -#pragma pack(4) +#include "poppack.h" #define DECL_THUNK(name,proc,relay) \ THUNK name = { 0x58, 0x68, (FARPROC)(proc), 0x50, 0xe9, \ @@ -1152,7 +1152,7 @@ WOW16Call(WORD x,WORD y,WORD z) { * 16<->32 Thunklet/Callback API: */ -#pragma pack(1) +#include "pshpack1.h" typedef struct _THUNKLET { BYTE prefix_target; @@ -1170,7 +1170,7 @@ typedef struct _THUNKLET HINSTANCE16 owner; struct _THUNKLET *next; } THUNKLET; -#pragma pack(4) +#include "poppack.h" #define THUNKLET_TYPE_LS 1 #define THUNKLET_TYPE_SL 2 diff --git a/include/aspi.h b/include/aspi.h index 57703e07b28..f899e46f4a7 100644 --- a/include/aspi.h +++ b/include/aspi.h @@ -3,7 +3,7 @@ #if !defined(ASPI_H) #define ASPI_H -#pragma pack(1) +#include "pshpack1.h" #define SS_PENDING 0x00 #define SS_COMP 0x01 @@ -115,6 +115,6 @@ struct ASPI_DEVICE_INFO { typedef struct ASPI_DEVICE_INFO ASPI_DEVICE_INFO; static ASPI_DEVICE_INFO *ASPI_open_devices = NULL; -#pragma pack(4) +#include "poppack.h" #endif diff --git a/include/cursoricon.h b/include/cursoricon.h index bb5d37775f8..e4ecb5a9a05 100644 --- a/include/cursoricon.h +++ b/include/cursoricon.h @@ -9,7 +9,7 @@ #include "windef.h" -#pragma pack(1) +#include "pshpack1.h" typedef struct { @@ -64,7 +64,7 @@ typedef struct } CURSORICONFILEDIR; -#pragma pack(4) +#include "poppack.h" #define CID_RESOURCE 0x0001 #define CID_WIN32 0x0004 diff --git a/include/dialog.h b/include/dialog.h index dbd90fe01e0..0932681f91d 100644 --- a/include/dialog.h +++ b/include/dialog.h @@ -14,7 +14,7 @@ * sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30). */ -#pragma pack(1) +#include "pshpack1.h" typedef struct { @@ -34,7 +34,7 @@ typedef struct HGLOBAL16 hDialogHeap; } DIALOGINFO; -#pragma pack(4) +#include "poppack.h" #define DF_END 0x0001 diff --git a/include/display.h b/include/display.h index b5830dd4b53..1196501f595 100644 --- a/include/display.h +++ b/include/display.h @@ -11,13 +11,13 @@ struct tagCURSORICONINFO; -#pragma pack(1) +#include "pshpack1.h" typedef struct tagCURSORINFO { WORD wXMickeys; WORD wYMickeys; } CURSORINFO, *PCURSORINFO, *LPCURSORINFO; -#pragma pack(4) +#include "poppack.h" WORD WINAPI DISPLAY_Inquire(LPCURSORINFO lpCursorInfo); VOID WINAPI DISPLAY_SetCursor( struct tagCURSORICONINFO *lpCursor ); diff --git a/include/dplay.h b/include/dplay.h index 6fce9fc4f30..e24ae837fb3 100644 --- a/include/dplay.h +++ b/include/dplay.h @@ -3,7 +3,7 @@ #include "wine/obj_base.h" -#pragma pack(1) +#include "pshpack1.h" /***************************************************************************** * Predeclare the interfaces @@ -585,6 +585,6 @@ ICOM_DEFINE(IDirectPlay3,IDirectPlay2) #endif -#pragma pack(4) +#include "poppack.h" #endif /* __WINE_DPLAY_H */ diff --git a/include/font.h b/include/font.h index 28cccf57fce..90a0069312a 100644 --- a/include/font.h +++ b/include/font.h @@ -9,7 +9,7 @@ #include "gdi.h" -#pragma pack(1) +#include "pshpack1.h" /* GDI logical font object */ typedef struct @@ -51,7 +51,7 @@ typedef struct { CHAR szFaceName[60]; /* dito */ } FONTDIR16, *LPFONTDIR16; -#pragma pack(4) +#include "poppack.h" #define FONTCACHE 32 /* dynamic font cache size */ diff --git a/include/keyboard.h b/include/keyboard.h index 1002817b789..1688811cb4d 100644 --- a/include/keyboard.h +++ b/include/keyboard.h @@ -9,7 +9,7 @@ #include "windef.h" -#pragma pack(1) +#include "pshpack1.h" typedef struct _KBINFO { BYTE Begin_First_Range; @@ -18,7 +18,7 @@ typedef struct _KBINFO BYTE End_Second_Range; WORD StateSize; } KBINFO, *LPKBINFO; -#pragma pack(4) +#include "poppack.h" typedef VOID (CALLBACK *LPKEYBD_EVENT_PROC)(BYTE,BYTE,DWORD,DWORD); diff --git a/include/miscemu.h b/include/miscemu.h index 8a967774a63..6cdca60ace5 100644 --- a/include/miscemu.h +++ b/include/miscemu.h @@ -14,7 +14,7 @@ extern int DOSCONF_ReadConfig(void); /* msdos/dosmem.c */ -#pragma pack(1) +#include "pshpack1.h" typedef struct { @@ -74,7 +74,7 @@ typedef struct BYTE DiskDataRate; /* 8B: Last disk data rate selected */ } BIOSDATA; -#pragma pack(4) +#include "poppack.h" extern HANDLE16 DOSMEM_BiosDataSeg; extern HANDLE16 DOSMEM_BiosSysSeg; diff --git a/include/mmsystem.h b/include/mmsystem.h index b3197ec2790..e56a5ca5cb2 100644 --- a/include/mmsystem.h +++ b/include/mmsystem.h @@ -13,7 +13,7 @@ extern "C" { typedef LPSTR HPSTR; /* a huge version of LPSTR */ typedef LPCSTR HPCSTR; /* a huge version of LPCSTR */ -#pragma pack(1) +#include "pshpack1.h" #define MAXWAVEDRIVERS 10 #define MAXMIDIDRIVERS 10 @@ -2865,7 +2865,7 @@ DWORD WINAPI widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2); DWORD WINAPI wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2); -#pragma pack(4) +#include "poppack.h" #ifdef __cplusplus } diff --git a/include/module.h b/include/module.h index fa35ecad38d..45ce685b6c3 100644 --- a/include/module.h +++ b/include/module.h @@ -84,7 +84,7 @@ typedef struct /* Self-loading modules contain this structure in their first segment */ -#pragma pack(1) +#include "pshpack1.h" typedef struct { @@ -118,7 +118,7 @@ typedef struct DWORD dwReserved; } LOADPARAMS; -#pragma pack(4) +#include "poppack.h" /* internal representation of 32bit modules. per process. */ typedef enum { diff --git a/include/mouse.h b/include/mouse.h index 2b7d18da8d0..94ba21a1f7d 100644 --- a/include/mouse.h +++ b/include/mouse.h @@ -11,7 +11,7 @@ struct tagCURSORICONINFO; -#pragma pack(1) +#include "pshpack1.h" typedef struct _MOUSEINFO { BYTE msExist; @@ -24,7 +24,7 @@ typedef struct _MOUSEINFO WORD msYRes; WORD msMouseCommPort; } MOUSEINFO, *LPMOUSEINFO; -#pragma pack(4) +#include "poppack.h" typedef VOID (CALLBACK *LPMOUSE_EVENT_PROC)(DWORD,DWORD,DWORD,DWORD,DWORD); diff --git a/include/poppack.h b/include/poppack.h new file mode 100644 index 00000000000..71047915915 --- /dev/null +++ b/include/poppack.h @@ -0,0 +1,15 @@ +#ifdef __WINE_PSHPACK_H +#undef __WINE_PSHPACK_H + +#if defined(__GNUC__) || defined(__SUNPRO_C) +#pragma pack() +#elif defined(__SUNPRO_CC) +#warning "Assumes default alignment is 4" +#pragma pack(4) +#elif !defined(RC_INVOKED) +#error "Restoration of the previous alignment isn't supported by the compiler" +#endif /* defined(__GNUC__) || defined(__SUNPRO_C) ; !defined(RC_INVOKED) */ + +#else /* defined(__WINE_PSHPACK_H) */ +#error "Popping alignment isn't possible since no alignment has been pushed" +#endif /* defined(__WINE_PSHPACK_H) */ diff --git a/include/pshpack1.h b/include/pshpack1.h new file mode 100644 index 00000000000..775642dc1c0 --- /dev/null +++ b/include/pshpack1.h @@ -0,0 +1,13 @@ +#ifndef __WINE_PSHPACK_H +#define __WINE_PSHPACK_H 1 + +#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#pragma pack(1) +#elif !defined(RC_INVOKED) +#error "1 as alignment isn't supported by the compiler" +#endif /* defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */ + +#else /* !defined(__WINE_PSHPACK_H) */ +#error "Nested pushing of alignment isn't supported by the compiler" +#endif /* !defined(__WINE_PSHPACK_H) */ + diff --git a/include/pshpack2.h b/include/pshpack2.h new file mode 100644 index 00000000000..8b7e29e7ec3 --- /dev/null +++ b/include/pshpack2.h @@ -0,0 +1,12 @@ +#ifndef __WINE_PSHPACK_H +#define __WINE_PSHPACK_H 2 + +#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#pragma pack(2) +#elif !defined(RC_INVOKED) +#error "2 as alignment isn't supported by the compiler" +#endif /* defined(__GNUC__) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */ + +#else /* !defined(__WINE_PSHPACK_H) */ +#error "Nested pushing of alignment isn't supported by the compiler" +#endif /* !defined(__WINE_PSHPACK_H) */ diff --git a/include/pshpack4.h b/include/pshpack4.h new file mode 100644 index 00000000000..3904415678c --- /dev/null +++ b/include/pshpack4.h @@ -0,0 +1,16 @@ +#ifndef __WINE_PSHPACK_H +#define __WINE_PSHPACK_H 4 + +#if defined(__GNUC__) || defined(__SUNPRO_CC) +#pragma pack(4) +#elif defined(__SUNPRO_C) +#warning "Assumes default alignment is 4" +#pragma pack() +#elif !defined(RC_INVOKED) +#error "4 as alignment isn't supported by the compiler" +#endif /* defined(__GNUC__) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */ + +#else /* !defined(__WINE_PSHPACK_H) */ +#error "Nested pushing of alignment isn't supported by the compiler" +#endif /* !defined(__WINE_PSHPACK_H) */ + diff --git a/include/pshpack8.h b/include/pshpack8.h new file mode 100644 index 00000000000..d0de2635dfe --- /dev/null +++ b/include/pshpack8.h @@ -0,0 +1,12 @@ +#ifndef __WINE_PSHPACK_H +#define __WINE_PSHPACK_H 8 + +#if 0 +#pragma pack(8) +#elif !defined(RC_INVOKED) +#error "8 as alignment is not supported" +#endif /* 0 ; !defined(RC_INVOKED) */ + +#else /* !defined(__WINE_PSHPACK_H) */ +#error "Nested pushing of alignment isn't supported by the compiler" +#endif /* !defined(__WINE_PSHPACK_H) */ diff --git a/include/shell.h b/include/shell.h index 63179beab59..570077fbc98 100644 --- a/include/shell.h +++ b/include/shell.h @@ -59,7 +59,7 @@ typedef struct { /* structure for dropped files */ /**************************************************************************** * SHITEMID, ITEMIDLIST, PIDL API */ -#pragma pack(1) +#include "pshpack1.h" typedef struct { WORD cb; /* nr of bytes in this item */ BYTE abID[1];/* first byte in this item */ @@ -68,7 +68,7 @@ typedef struct typedef struct { SHITEMID mkid; /* first itemid in list */ } ITEMIDLIST,*LPITEMIDLIST,*LPCITEMIDLIST; -#pragma pack(4) +#include "poppack.h" DWORD WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl,LPSTR pszPath); DWORD WINAPI SHGetPathFromIDListW (LPCITEMIDLIST pidl,LPWSTR pszPath); diff --git a/include/stackframe.h b/include/stackframe.h index 0326abd97f2..cbe87e09557 100644 --- a/include/stackframe.h +++ b/include/stackframe.h @@ -10,7 +10,7 @@ #include "ldt.h" #include "thread.h" -#pragma pack(1) +#include "pshpack1.h" /* 32-bit stack layout after CallTo16() */ typedef struct _STACK32FRAME @@ -45,7 +45,7 @@ typedef struct WORD cs; /* 1c */ } STACK16FRAME; -#pragma pack(4) +#include "poppack.h" #define THREAD_STACK16(thdb) ((STACK16FRAME*)PTR_SEG_TO_LIN((thdb)->cur_stack)) #define CURRENT_STACK16 (THREAD_STACK16(THREAD_Current())) diff --git a/include/task.h b/include/task.h index c9f43a068f2..a0b6000c054 100644 --- a/include/task.h +++ b/include/task.h @@ -9,7 +9,7 @@ #include "windef.h" -#pragma pack(1) +#include "pshpack1.h" /* Process database (i.e. a normal DOS PSP) */ @@ -141,7 +141,7 @@ typedef struct _THHOOK HTASK16 LockTDB; /* 14 hLockedTask */ } THHOOK; -#pragma pack(4) +#include "poppack.h" extern THHOOK *pThhook; extern void (*TASK_AddTaskEntryBreakpoint)( HTASK16 hTask ); diff --git a/include/toolhelp.h b/include/toolhelp.h index e416ed0a9b8..b3deacb22c7 100644 --- a/include/toolhelp.h +++ b/include/toolhelp.h @@ -9,7 +9,7 @@ #define MAX_PATH16 255 #define MAX_CLASSNAME 255 -#pragma pack(1) +#include "pshpack1.h" /* Global heap */ @@ -395,7 +395,7 @@ typedef struct { WORD wFlags; } STACKTRACEENTRY; -#pragma pack(4) +#include "poppack.h" /* * Process Entry list as created by CreateToolHelp32Snapshot diff --git a/include/win16drv.h b/include/win16drv.h index 04fbe4621b6..26c9899dc0e 100644 --- a/include/win16drv.h +++ b/include/win16drv.h @@ -110,7 +110,7 @@ typedef struct PDEVICE_HEADER LOADED_PRINTER_DRIVER *pLPD; /* Associated printer driver */ } PDEVICE_HEADER; -#pragma pack(1) +#include "pshpack1.h" #define PCOLOR DWORD typedef struct DRAWMODE { @@ -129,7 +129,7 @@ typedef struct DRAWMODE } DRAWMODE, *LPDRAWMODE; -#pragma pack(4) +#include "poppack.h" typedef struct WINE_ENUM_PRINTER_FONT_CALLBACK { diff --git a/include/winaspi.h b/include/winaspi.h index 0af1d5e033b..2b0ca58cb89 100644 --- a/include/winaspi.h +++ b/include/winaspi.h @@ -1,7 +1,7 @@ #if !defined(WINASPI_H) #define WINASPI_H -#pragma pack(1) +#include "pshpack1.h" #define ASPI_DOS 1 #define ASPI_WIN16 2 @@ -97,6 +97,6 @@ union SRB16 { typedef union SRB16 SRB16; -#pragma pack(4) +#include "poppack.h" #endif diff --git a/include/wine/winbase16.h b/include/wine/winbase16.h index a472a69092e..7097106b5f6 100644 --- a/include/wine/winbase16.h +++ b/include/wine/winbase16.h @@ -2,7 +2,7 @@ #define _INCLUDE_WINE_WINBASE16_H #include "windef.h" -#pragma pack(1) +#include "pshpack1.h" typedef struct _SEGINFO { UINT16 offSegment; UINT16 cbSegment; @@ -34,7 +34,7 @@ typedef struct _SEGINFO { #define WF_WIN32WOW 0x4000 /* undoc */ #define WF_WLO 0x8000 -#pragma pack(4) +#include "poppack.h" HMODULE16 WINAPI GetModuleHandle16(LPCSTR); HLOCAL16 WINAPI LocalAlloc16(UINT16,WORD); diff --git a/include/wine/winuser16.h b/include/wine/winuser16.h index 8b72291d1da..ad267898d52 100644 --- a/include/wine/winuser16.h +++ b/include/wine/winuser16.h @@ -5,7 +5,7 @@ #include "winbase.h" #include "winuser.h" -#pragma pack(1) +#include "pshpack1.h" /* SetWindowPlacement() struct */ typedef struct @@ -473,7 +473,7 @@ typedef struct DWORD itemData2 WINE_PACKED; } COMPAREITEMSTRUCT16, *LPCOMPAREITEMSTRUCT16; -#pragma pack(4) +#include "poppack.h" /* WM_COMMNOTIFY flags */ #define CN_RECEIVE 0x0001 diff --git a/include/winioctl.h b/include/winioctl.h index d0685565b86..d7a3d718d84 100644 --- a/include/winioctl.h +++ b/include/winioctl.h @@ -239,14 +239,14 @@ typedef struct tagDIOCRegs { /* Important: All MS_DOS data structures must be packed on a one-byte boundary - good old 16 bit. */ -#pragma pack(1) +#include "pshpack1.h" typedef struct tagMID { WORD midInfoLevel; DWORD midSerialNum; BYTE midVolLabel[11]; BYTE midFileSysType[8]; } MID, *PMID; -#pragma pack(4) +#include "poppack.h" /* End VWIN32 information */ diff --git a/include/winnt.h b/include/winnt.h index 90e25cfdac1..a99763fb8a9 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -9,7 +9,7 @@ #include "windef.h" -#pragma pack(1) +#include "pshpack1.h" /* Defines */ /* Argument 1 passed to the DllEntryProc. */ @@ -332,8 +332,8 @@ typedef struct _EXCEPTION_POINTERS PCONTEXT ContextRecord; } EXCEPTION_POINTERS, *PEXCEPTION_POINTERS; +#include "poppack.h" -#pragma pack(4) /* * function pointer to a exception filter */ @@ -378,7 +378,7 @@ typedef enum _TOKEN_INFORMATION_CLASS { #ifndef _SECURITY_DEFINED #define _SECURITY_DEFINED -#pragma pack(1) +#include "pshpack1.h" typedef struct { BYTE Value[6]; @@ -437,8 +437,12 @@ typedef struct { #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR)) +#include "poppack.h" + #endif /* _SECURITY_DEFINED */ +#include "pshpack1.h" + /* * SID_AND_ATTRIBUTES */ @@ -784,6 +788,6 @@ typedef enum tagSID_NAME_USE { #define DACL_SECURITY_INFORMATION 0x00000004 #define SACL_SECURITY_INFORMATION 0x00000008 -#pragma pack(4) +#include "poppack.h" #endif /* __WINE_WINNT_H */ diff --git a/include/winsock.h b/include/winsock.h index c364e328e1d..217764f6fd4 100644 --- a/include/winsock.h +++ b/include/winsock.h @@ -29,7 +29,7 @@ #include "windef.h" #include "task.h" -#pragma pack(1) +#include "pshpack1.h" /* Win16 socket-related types */ @@ -160,7 +160,7 @@ typedef struct WSAData { SEGPTR lpVendorInfo; } WSADATA, *LPWSADATA; -#pragma pack(4) +#include "poppack.h" /* ----------------------------------- no Win16 structure defs beyond this line! */ diff --git a/include/wnaspi32.h b/include/wnaspi32.h index 8f6981c6c33..9260a033dc5 100644 --- a/include/wnaspi32.h +++ b/include/wnaspi32.h @@ -1,7 +1,7 @@ #if !defined(WNASPI32_H) #define WNASPI32_H -#pragma pack(1) +#include "pshpack1.h" typedef union SRB * LPSRB; @@ -93,6 +93,6 @@ union SRB { typedef union SRB SRB; -#pragma pack(4) +#include "poppack.h" #endif diff --git a/include/x11font.h b/include/x11font.h index b8311533d6c..4c22e696b6c 100644 --- a/include/x11font.h +++ b/include/x11font.h @@ -9,7 +9,7 @@ #include "gdi.h" #include "x11drv.h" -#pragma pack(1) +#include "pshpack1.h" /* this is a part of the font resource header, should * make it easier to implement dynamic softfont loading */ @@ -42,7 +42,7 @@ typedef struct LPCSTR dfFace; } IFONTINFO16, *LPIFONTINFO16; -#pragma pack(4) +#include "poppack.h" /* internal flags */ diff --git a/loader/module.c b/loader/module.c index 21a21284980..d57acda6ca9 100644 --- a/loader/module.c +++ b/loader/module.c @@ -1633,7 +1633,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) * HasGPHandler (KERNEL.338) */ -#pragma pack(1) +#include "pshpack1.h" typedef struct _GPHANDLERDEF { WORD selector; @@ -1641,7 +1641,7 @@ typedef struct _GPHANDLERDEF WORD rangeEnd; WORD handler; } GPHANDLERDEF; -#pragma pack(4) +#include "poppack.h" SEGPTR WINAPI HasGPHandler16( SEGPTR address ) { diff --git a/memory/heap.c b/memory/heap.c index 618c349f95e..3cb6c077d18 100644 --- a/memory/heap.c +++ b/memory/heap.c @@ -1444,7 +1444,7 @@ LPSTR HEAP_strdupWtoA( HANDLE heap, DWORD flags, LPCWSTR str ) #define HTABLE_PAGESIZE 0x1000 #define HTABLE_NPAGES (HTABLE_SIZE / HTABLE_PAGESIZE) -#pragma pack(1) +#include "pshpack1.h" typedef struct _LOCAL32HEADER { WORD freeListFirst[HTABLE_NPAGES]; @@ -1465,7 +1465,7 @@ typedef struct _LOCAL32HEADER HANDLE heap; } LOCAL32HEADER; -#pragma pack(4) +#include "poppack.h" #define LOCAL32_MAGIC ((DWORD)('L' | ('H'<<8) | ('3'<<16) | ('2'<<24))) diff --git a/memory/local.c b/memory/local.c index aed93aa04e4..c4c7c92575b 100644 --- a/memory/local.c +++ b/memory/local.c @@ -79,7 +79,7 @@ typedef struct * (LMEM_DISCARDED >> 8) */ -#pragma pack(1) +#include "pshpack1.h" typedef struct { @@ -105,7 +105,7 @@ typedef struct WORD magic; /* 28 Magic number */ } LOCALHEAPINFO; -#pragma pack(4) +#include "poppack.h" #define LOCAL_HEAP_MAGIC 0x484c /* 'LH' */ diff --git a/misc/shell.c b/misc/shell.c index 325ecc78597..4eb374442d6 100644 --- a/misc/shell.c +++ b/misc/shell.c @@ -31,7 +31,7 @@ DECLARE_DEBUG_CHANNEL(shell) /* .ICO file ICONDIR definitions */ -#pragma pack(1) +#include "pshpack1.h" typedef struct { @@ -53,7 +53,7 @@ typedef struct icoICONDIRENTRY idEntries[1]; /* An entry for each image (idCount of 'em) */ } icoICONDIR, *LPicoICONDIR; -#pragma pack(4) +#include "poppack.h" static const char* lpstrMsgWndCreated = "OTHERWINDOWCREATED"; static const char* lpstrMsgWndDestroyed = "OTHERWINDOWDESTROYED"; diff --git a/misc/winsock.c b/misc/winsock.c index afc739eee1d..29a4cb43c1c 100644 --- a/misc/winsock.c +++ b/misc/winsock.c @@ -69,8 +69,6 @@ DEFAULT_DEBUG_CHANNEL(winsock) inet_ntoa(((struct sockaddr_in *)a)->sin_addr), \ ntohs(((struct sockaddr_in *)a)->sin_port)) -#pragma pack(4) - /* ----------------------------------- internal data */ static HANDLE _WSHeap = 0; diff --git a/misc/winsock_async.c b/misc/winsock_async.c index 03f8084802b..833c6c61bfb 100644 --- a/misc/winsock_async.c +++ b/misc/winsock_async.c @@ -71,8 +71,6 @@ DEFAULT_DEBUG_CHANNEL(winsock) -#pragma pack(4) - /* ----------------------------------- helper functions - */ static int list_size(char** l, int item_size) diff --git a/msdos/dosmem.c b/msdos/dosmem.c index 9699184fba2..8d7e767f052 100644 --- a/msdos/dosmem.c +++ b/msdos/dosmem.c @@ -24,8 +24,6 @@ DECLARE_DEBUG_CHANNEL(selector) HANDLE16 DOSMEM_BiosDataSeg; /* BIOS data segment at 0x40:0 */ HANDLE16 DOSMEM_BiosSysSeg; /* BIOS ROM segment at 0xf000:0 */ -#pragma pack(4) - static char *DOSMEM_dosmem; DWORD DOSMEM_CollateTable; diff --git a/programs/view/globals.h b/programs/view/globals.h index c79be2d6fe1..4bea708ed3b 100644 --- a/programs/view/globals.h +++ b/programs/view/globals.h @@ -19,7 +19,7 @@ extern char szAppName[]; /* The name of this application */ extern char szTitle[]; /* The title bar text */ -#pragma pack(1) +#include "pshpack1.h" typedef struct { DWORD key; @@ -32,4 +32,4 @@ typedef struct #define APMHEADER_KEY 0x9AC6CDD7l -#pragma pack(4) +#include "poppack.h" diff --git a/relay32/snoop.c b/relay32/snoop.c index 2852150aa46..7950984171b 100644 --- a/relay32/snoop.c +++ b/relay32/snoop.c @@ -52,7 +52,7 @@ __asm__(".align 4\n\t" "ret" ); -#pragma pack(1) +#include "pshpack1.h" typedef struct tagSNOOP_FUN { /* code part */ @@ -94,7 +94,7 @@ typedef struct tagSNOOP_RETURNENTRIES { struct tagSNOOP_RETURNENTRIES *next; } SNOOP_RETURNENTRIES; -#pragma pack(4) +#include "poppack.h" static SNOOP_DLL *firstdll = NULL; static SNOOP_RETURNENTRIES *firstrets = NULL; diff --git a/relay32/utthunk.c b/relay32/utthunk.c index 139ba3343c5..90faa157a4c 100644 --- a/relay32/utthunk.c +++ b/relay32/utthunk.c @@ -15,7 +15,7 @@ DEFAULT_DEBUG_CHANNEL(thunk) -#pragma pack(1) +#include "pshpack1.h" typedef struct { @@ -39,7 +39,7 @@ typedef struct } UT32THUNK; -#pragma pack(4) +#include "poppack.h" typedef struct _UTINFO { diff --git a/windows/hook.c b/windows/hook.c index 57b3ef5cb13..2d694afcfe8 100644 --- a/windows/hook.c +++ b/windows/hook.c @@ -28,7 +28,7 @@ DEFAULT_DEBUG_CHANNEL(hook) -#pragma pack(1) +#include "pshpack1.h" /* Hook data (pointed to by a HHOOK) */ typedef struct @@ -41,7 +41,7 @@ typedef struct WORD flags; /* 0c flags */ } HOOKDATA; -#pragma pack(4) +#include "poppack.h" #define HOOK_MAGIC ((int)'H' | (int)'K' << 8) /* 'HK' */