#pragma pack(?) changed to #include "*pack*.h"
diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c
index b011972..38c830a 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 @@
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 b1fe72f..ac1d6f9 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 @@
} 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 75f7d00..1cde64c 100644
--- a/dlls/shell32/shelllink.c
+++ b/dlls/shell32/shelllink.c
@@ -23,7 +23,7 @@
/* link file formats */
-#pragma (1);
+#include "pshpack1.h"
/* lnk elements: simple link has 0x0B */
#define WORKDIR 0x10
@@ -52,7 +52,7 @@
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 c007c33..00ba38b 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 @@
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 b172755..6914d46 100644
--- a/if1632/snoop.c
+++ b/if1632/snoop.c
@@ -20,7 +20,7 @@
#ifdef __i386__
-#pragma pack(1)
+#include "pshpack1.h"
void WINAPI SNOOP16_Entry(CONTEXT *context);
void WINAPI SNOOP16_Return(CONTEXT *context);
@@ -82,7 +82,7 @@
/* 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 bfa4c8b..1ce73a3 100644
--- a/if1632/thunk.c
+++ b/if1632/thunk.c
@@ -114,7 +114,7 @@
typedef void (*RELAY)();
-#pragma pack(1)
+#include "pshpack1.h"
typedef struct tagTHUNK
{
@@ -127,7 +127,7 @@
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 @@
* 16<->32 Thunklet/Callback API:
*/
-#pragma pack(1)
+#include "pshpack1.h"
typedef struct _THUNKLET
{
BYTE prefix_target;
@@ -1170,7 +1170,7 @@
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 57703e0..f899e46 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 @@
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 bb5d377..e4ecb5a 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 @@
} 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 dbd90fe..0932681 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 @@
HGLOBAL16 hDialogHeap;
} DIALOGINFO;
-#pragma pack(4)
+#include "poppack.h"
#define DF_END 0x0001
diff --git a/include/display.h b/include/display.h
index b5830dd..1196501 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 6fce9fc..e24ae83 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 @@
#endif
-#pragma pack(4)
+#include "poppack.h"
#endif /* __WINE_DPLAY_H */
diff --git a/include/font.h b/include/font.h
index 28cccf5..90a0069 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 @@
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 1002817..1688811 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 @@
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 8a96777..6cdca60 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 @@
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 b3197ec..e56a5ca 100644
--- a/include/mmsystem.h
+++ b/include/mmsystem.h
@@ -13,7 +13,7 @@
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 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 fa35eca..45ce685 100644
--- a/include/module.h
+++ b/include/module.h
@@ -84,7 +84,7 @@
/* Self-loading modules contain this structure in their first segment */
-#pragma pack(1)
+#include "pshpack1.h"
typedef struct
{
@@ -118,7 +118,7 @@
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 2b7d18d..94ba21a 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 @@
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 0000000..7104791
--- /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 0000000..775642d
--- /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 0000000..8b7e29e
--- /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 0000000..3904415
--- /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 0000000..d0de263
--- /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 63179be..570077f 100644
--- a/include/shell.h
+++ b/include/shell.h
@@ -59,7 +59,7 @@
/****************************************************************************
* 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
{ 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 0326abd..cbe87e0 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 @@
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 c9f43a0..a0b6000 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 @@
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 e416ed0..b3deacb 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 @@
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 04fbe46..26c9899 100644
--- a/include/win16drv.h
+++ b/include/win16drv.h
@@ -110,7 +110,7 @@
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 @@
} 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 0af1d5e..2b0ca58 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 @@
typedef union SRB16 SRB16;
-#pragma pack(4)
+#include "poppack.h"
#endif
diff --git a/include/wine/winbase16.h b/include/wine/winbase16.h
index a472a69..7097106 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 @@
#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 8b72291..ad26789 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 @@
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 d068556..d7a3d71 100644
--- a/include/winioctl.h
+++ b/include/winioctl.h
@@ -239,14 +239,14 @@
/* 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 90e25cf..a99763f 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 @@
PCONTEXT ContextRecord;
} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
+#include "poppack.h"
-#pragma pack(4)
/*
* function pointer to a exception filter
*/
@@ -378,7 +378,7 @@
#ifndef _SECURITY_DEFINED
#define _SECURITY_DEFINED
-#pragma pack(1)
+#include "pshpack1.h"
typedef struct {
BYTE Value[6];
@@ -437,8 +437,12 @@
#define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
+#include "poppack.h"
+
#endif /* _SECURITY_DEFINED */
+#include "pshpack1.h"
+
/*
* SID_AND_ATTRIBUTES
*/
@@ -784,6 +788,6 @@
#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 c364e32..217764f 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 @@
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 8f6981c..9260a03 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 @@
typedef union SRB SRB;
-#pragma pack(4)
+#include "poppack.h"
#endif
diff --git a/include/x11font.h b/include/x11font.h
index b831153..4c22e69 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 @@
LPCSTR dfFace;
} IFONTINFO16, *LPIFONTINFO16;
-#pragma pack(4)
+#include "poppack.h"
/* internal flags */
diff --git a/loader/module.c b/loader/module.c
index 21a2128..d57acda 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -1633,7 +1633,7 @@
* HasGPHandler (KERNEL.338)
*/
-#pragma pack(1)
+#include "pshpack1.h"
typedef struct _GPHANDLERDEF
{
WORD selector;
@@ -1641,7 +1641,7 @@
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 618c349..3cb6c07 100644
--- a/memory/heap.c
+++ b/memory/heap.c
@@ -1444,7 +1444,7 @@
#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 @@
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 aed93aa..c4c7c92 100644
--- a/memory/local.c
+++ b/memory/local.c
@@ -79,7 +79,7 @@
* (LMEM_DISCARDED >> 8)
*/
-#pragma pack(1)
+#include "pshpack1.h"
typedef struct
{
@@ -105,7 +105,7 @@
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 325ecc7..4eb3744 100644
--- a/misc/shell.c
+++ b/misc/shell.c
@@ -31,7 +31,7 @@
/* .ICO file ICONDIR definitions */
-#pragma pack(1)
+#include "pshpack1.h"
typedef struct
{
@@ -53,7 +53,7 @@
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 afc739e..29a4cb4 100644
--- a/misc/winsock.c
+++ b/misc/winsock.c
@@ -69,8 +69,6 @@
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 03f8084..833c6c6 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 9699184..8d7e767 100644
--- a/msdos/dosmem.c
+++ b/msdos/dosmem.c
@@ -24,8 +24,6 @@
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 c79be2d..4bea708 100644
--- a/programs/view/globals.h
+++ b/programs/view/globals.h
@@ -19,7 +19,7 @@
extern char szTitle[]; /* The title bar text */
-#pragma pack(1)
+#include "pshpack1.h"
typedef struct
{
DWORD key;
@@ -32,4 +32,4 @@
#define APMHEADER_KEY 0x9AC6CDD7l
-#pragma pack(4)
+#include "poppack.h"
diff --git a/relay32/snoop.c b/relay32/snoop.c
index 2852150..7950984 100644
--- a/relay32/snoop.c
+++ b/relay32/snoop.c
@@ -52,7 +52,7 @@
"ret"
);
-#pragma pack(1)
+#include "pshpack1.h"
typedef struct tagSNOOP_FUN {
/* code part */
@@ -94,7 +94,7 @@
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 139ba33..90faa15 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 @@
} UT32THUNK;
-#pragma pack(4)
+#include "poppack.h"
typedef struct _UTINFO
{
diff --git a/windows/hook.c b/windows/hook.c
index 57b3ef5..2d694af 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 @@
WORD flags; /* 0c flags */
} HOOKDATA;
-#pragma pack(4)
+#include "poppack.h"
#define HOOK_MAGIC ((int)'H' | (int)'K' << 8) /* 'HK' */