about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-08 09:59:44 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-08 09:59:44 +0200
commit58d58b0af7113edb7623903535c436da5a1a6304 (patch)
tree9368455c5a3431d59358d82f0d0cefbf5b2f2c6a /src
parentce5daaa835fffd790db6973cf5ec75bedf31a18a (diff)
downloadbox64-58d58b0af7113edb7623903535c436da5a1a6304.tar.gz
box64-58d58b0af7113edb7623903535c436da5a1a6304.zip
[BOX32] More adjustments to x86 structures packing & alignment (or not)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/include/myalign32.h22
-rw-r--r--src/include/sdl1align32.h52
-rw-r--r--src/include/sdl2align32.h76
-rw-r--r--src/libtools/libc_net32.c4
-rw-r--r--src/libtools/my_x11_defs_32.h432
-rwxr-xr-xsrc/libtools/threads32.c2
-rw-r--r--src/wrapped32/generated/converter32.c12
-rw-r--r--src/wrapped32/wrappedfontconfig.c10
-rw-r--r--src/wrapped32/wrappedfreetype.c2
-rwxr-xr-xsrc/wrapped32/wrappedlibc.c4
-rwxr-xr-xsrc/wrapped32/wrappedlibdl.c4
-rw-r--r--src/wrapped32/wrappedlibxrandr.c4
-rw-r--r--src/wrapped32/wrappedsdl1.c2
-rw-r--r--src/wrapped32/wrappedsdl2.c4
14 files changed, 315 insertions, 315 deletions
diff --git a/src/include/myalign32.h b/src/include/myalign32.h
index e77e37e8..07585141 100755
--- a/src/include/myalign32.h
+++ b/src/include/myalign32.h
@@ -131,11 +131,11 @@ struct i386_stat64 {
 	uint32_t	st_ctime;
 	uint32_t	st_ctime_nsec;
 	uint64_t	st_ino;
-} __attribute__((packed, aligned(4)));
+} __attribute__((packed, aligned(4)));  // important for this one
 
 struct i386_fsid {
   int     val[2];
-} __attribute__((packed, aligned(4)));
+};
 
 struct i386_statfs {
   uint32_t    f_type;
@@ -150,7 +150,7 @@ struct i386_statfs {
   uint32_t    f_frsize;
   uint32_t    f_flags;
   uint32_t    f_spare[4];
-} __attribute__((packed, aligned(4)));
+};
 
 struct i386_statfs64 {
   uint32_t    f_type;
@@ -165,7 +165,7 @@ struct i386_statfs64 {
   uint32_t    f_frsize;
   uint32_t    f_flags;
   uint32_t    f_spare[4];
-} __attribute__((packed, aligned(4)));
+};
 
 struct i386_statvfs64 {
   ulong_t f_bsize;
@@ -182,7 +182,7 @@ struct i386_statvfs64 {
   ulong_t f_namemax;
   unsigned int f_type;
   int __f_spare[5];
-} __attribute__((packed, aligned(4)));
+};
 
 struct i386_statvfs {
   ulong_t f_bsize;
@@ -199,7 +199,7 @@ struct i386_statvfs {
   ulong_t f_namemax;
   unsigned int f_type;
   int __f_spare[5];
-} __attribute__((packed, aligned(4)));
+};
 
 void UnalignStatVFS_32(const void* source, void* dest);
 void UnalignStatVFS64_32(const void* source, void* dest);
@@ -211,7 +211,7 @@ struct i386_dirent
   uint16_t d_reclen;
   uint8_t d_type;
   char d_name[256];
-} __attribute__((packed, aligned(4)));
+};
 void UnalignDirent_32(const void* source, void* dest);
 
 #if 0
@@ -425,7 +425,7 @@ typedef struct my_flock64_s {
 	int       l_pid;
 } my_flock64_t;
 
-typedef struct __attribute__((packed, aligned(4))) x86_flock64_s {
+typedef struct __attribute__((packed, aligned(4))) x86_flock64_s {  // alignment needed here to avoid 8bytes align before the start
 	uint16_t  l_type;
 	uint16_t  l_whence;
 	int64_t   l_start;
@@ -470,7 +470,7 @@ struct i386_addrinfo
   ptr_t ai_addr;	    // struct sockaddr *
   ptr_t ai_canonname;   // char *
   ptr_t ai_next;        // struct addrinfo *
-} __attribute__((packed, aligned(4)));
+};
 
 struct i386_hostent {
     ptr_t  h_name;     // char  *
@@ -478,13 +478,13 @@ struct i386_hostent {
     int    h_addrtype;
     int    h_length;
     ptr_t  h_addr_list;// char **
-} __attribute__((packed, aligned(4)));
+};
 
 struct i386_iovec
 {
   ptr_t     iov_base; // void *
   ulong_t   iov_len;
-} __attribute__((packed, aligned(4)));
+};
 
 struct i386_msghdr
 {
diff --git a/src/include/sdl1align32.h b/src/include/sdl1align32.h
index 6ac0cb07..83b0e7bb 100644
--- a/src/include/sdl1align32.h
+++ b/src/include/sdl1align32.h
@@ -66,7 +66,7 @@ typedef struct my_SDL_Surface_s
 
 // x86 version (packed, 32bits pointers and long)
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_Rect_32_s
+typedef struct my_SDL_Rect_32_s
 {
     int16_t  x;
     int16_t  y;
@@ -74,7 +74,7 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_Rect_32_s
     uint16_t h;
 } my_SDL_Rect_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_Color_32_s
+typedef struct my_SDL_Color_32_s
 {
     uint8_t r;
     uint8_t g;
@@ -82,13 +82,13 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_Color_32_s
     uint8_t unused;
 } my_SDL_Color_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_Palette_32_s
+typedef struct my_SDL_Palette_32_s
 {
     int ncolors;
     ptr_t colors;   // my_SDL_Color_t*
 } my_SDL_Palette_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_PixelFormat_32_s
+typedef struct my_SDL_PixelFormat_32_s
 {
     ptr_t palette;  // my_SDL_Palette_t *
     uint8_t BitsPerPixel;
@@ -109,7 +109,7 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_PixelFormat_32_s
     uint8_t alpha;
 } my_SDL_PixelFormat_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_Surface_32_s
+typedef struct my_SDL_Surface_32_s
 {
     uint32_t flags;
     ptr_t format;   // my_SDL_PixelFormat_t *
@@ -144,7 +144,7 @@ typedef struct my_SDL_keysym_s
     uint16_t unicode;
 } my_SDL_keysym_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_keysym_32_s
+typedef struct my_SDL_keysym_32_s
 {
     uint8_t scancode;
     int sym;
@@ -338,14 +338,14 @@ typedef union my_SDL_Event_s
     my_SDL_SysWMEvent_t syswm;
 } my_SDL_Event_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_ActiveEvent_32_s
+typedef struct my_SDL_ActiveEvent_32_s
 {
     uint8_t type;
     uint8_t gain;
     uint8_t state;
 } my_SDL_ActiveEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_KeyboardEvent_32_s
+typedef struct my_SDL_KeyboardEvent_32_s
 {
     uint8_t type;
     uint8_t which;
@@ -353,7 +353,7 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_KeyboardEvent_32_s
     my_SDL_keysym_32_t keysym;
 } my_SDL_KeyboardEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_MouseMotionEvent_32_s
+typedef struct my_SDL_MouseMotionEvent_32_s
 {
     uint8_t type;
     uint8_t which;
@@ -364,7 +364,7 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_MouseMotionEvent_32_s
     int16_t yrel;
 } my_SDL_MouseMotionEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_MouseButtonEvent_32_s
+typedef struct my_SDL_MouseButtonEvent_32_s
 {
     uint8_t type;
     uint8_t which;
@@ -374,7 +374,7 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_MouseButtonEvent_32_s
     uint16_t y;
 } my_SDL_MouseButtonEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_JoyAxisEvent_32_s
+typedef struct my_SDL_JoyAxisEvent_32_s
 {
     uint8_t type;
     uint8_t which;
@@ -382,7 +382,7 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_JoyAxisEvent_32_s
     int16_t value;
 } my_SDL_JoyAxisEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_JoyBallEvent_32_s
+typedef struct my_SDL_JoyBallEvent_32_s
 {
     uint8_t type;
     uint8_t which;
@@ -391,7 +391,7 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_JoyBallEvent_32_s
     int16_t yrel;
 } my_SDL_JoyBallEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_JoyHatEvent_32_s
+typedef struct my_SDL_JoyHatEvent_32_s
 {
     uint8_t type;
     uint8_t which;
@@ -399,7 +399,7 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_JoyHatEvent_32_s
     uint8_t value;
 } my_SDL_JoyHatEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_JoyButtonEvent_32_s
+typedef struct my_SDL_JoyButtonEvent_32_s
 {
     uint8_t type;
     uint8_t which;
@@ -407,24 +407,24 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_JoyButtonEvent_32_s
     uint8_t state;
 } my_SDL_JoyButtonEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_ResizeEvent_32_s
+typedef struct my_SDL_ResizeEvent_32_s
 {
     uint8_t type;
     int w;
     int h;
 } my_SDL_ResizeEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_ExposeEvent_32_s
+typedef struct my_SDL_ExposeEvent_32_s
 {
     uint8_t type;
 } my_SDL_ExposeEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_QuitEvent_32_s
+typedef struct my_SDL_QuitEvent_32_s
 {
     uint8_t type;
 } my_SDL_QuitEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_UserEvent_32_s
+typedef struct my_SDL_UserEvent_32_s
 {
     uint8_t type;
     int code;
@@ -432,13 +432,13 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_UserEvent_32_s
     ptr_t data2;    //void*
 } my_SDL_UserEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_version_32_s {
+typedef struct my_SDL_version_32_s {
     uint8_t major;
     uint8_t minor;
     uint8_t patch;
 } my_SDL_version_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_SysWMinfo_32_s {
+typedef struct my_SDL_SysWMinfo_32_s {
   my_SDL_version_32_t version;
   int subsystem;
   union {
@@ -454,12 +454,12 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_SysWMinfo_32_s {
   } info;
 } my_SDL_SysWMinfo_32_t;
 
-typedef union __attribute__((packed, aligned(4))) my_XEvent_32_s {
+typedef union my_XEvent_32_s {
     int Type;
 	long_t pad[24];
 } my_XEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_SysWMmsg_32_s
+typedef struct my_SDL_SysWMmsg_32_s
 {
     my_SDL_version_32_t version;
     int subsystem;
@@ -469,7 +469,7 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL_SysWMmsg_32_s
 } my_SDL_SysWMmsg_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_SysWMEvent_32_s
+typedef struct my_SDL_SysWMEvent_32_s
 {
     uint8_t type;
     ptr_t msg; //my_SDL_SysWMmsg_t*
@@ -507,7 +507,7 @@ typedef struct my_SDL_RWops_s {
     void* hidden[3]; // not converting hidden, just moving it
 } my_SDL_RWops_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_RWops_32_s {
+typedef struct my_SDL_RWops_32_s {
     ptr_t  seek;    //sdl1_seek
     ptr_t  read;    //sdl1_read
     ptr_t write;    //sdl1_write
@@ -538,7 +538,7 @@ typedef struct my_SDL_VideoInfo_s {
   int current_h;
 } my_SDL_VideoInfo_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_VideoInfo_32_s {
+typedef struct my_SDL_VideoInfo_32_s {
   uint32_t hw_available:1;
   uint32_t wm_available:1;
   uint32_t UnusedBits1:6;
@@ -571,7 +571,7 @@ typedef struct my_SDL_AudioCVT_s {
   int filter_index;
 } my_SDL_AudioCVT_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL_AudioCVT_32_s {
+typedef struct my_SDL_AudioCVT_32_s {
   int needed;
   uint16_t src_format;
   uint16_t dest_format;
diff --git a/src/include/sdl2align32.h b/src/include/sdl2align32.h
index 1e9de523..dd93d85e 100644
--- a/src/include/sdl2align32.h
+++ b/src/include/sdl2align32.h
@@ -11,7 +11,7 @@ typedef struct my_SDL2_DisplayMode_s {
     void* driverdata;
 } my_SDL2_DisplayMode_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL2_DisplayMode_32_s {
+typedef struct my_SDL2_DisplayMode_32_s {
     uint32_t format;
     int w;
     int h;
@@ -358,12 +358,12 @@ typedef union my_SDL2_Event_s {
     my_SDL2_DropEvent_t drop;
 } my_SDL2_Event_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_CommonEvent_32_s {
+typedef struct SDL2_CommonEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
 } my_SDL2_CommonEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_DisplayEvent_32_s {
+typedef struct SDL2_DisplayEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t display;
@@ -374,7 +374,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_DisplayEvent_32_s {
     int32_t data1;
 } my_SDL2_DisplayEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_WindowEvent_32_s {
+typedef struct SDL2_WindowEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t windowID;
@@ -386,14 +386,14 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_WindowEvent_32_s {
     int32_t data2;
 } my_SDL2_WindowEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_Keysym_32_s {
+typedef struct SDL2_Keysym_32_s {
     int32_t scancode;
     int32_t sym;
     uint16_t mod;
     uint32_t unused;
 } my_SDL2_Keysym_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_KeyboardEvent_32_s {
+typedef struct SDL2_KeyboardEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t windowID;
@@ -404,7 +404,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_KeyboardEvent_32_s {
     my_SDL2_Keysym_32_t keysym;
 } my_SDL2_KeyboardEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_TextEditingEvent_32_s {
+typedef struct SDL2_TextEditingEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t windowID;
@@ -414,7 +414,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_TextEditingEvent_32_s {
 } my_SDL2_TextEditingEvent_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_TextEditingExtEvent_32_s {
+typedef struct SDL2_TextEditingExtEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t windowID;
@@ -423,14 +423,14 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_TextEditingExtEvent_32_s
     int32_t length;
 } my_SDL2_TextEditingExtEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_TextInputEvent_32_s {
+typedef struct SDL2_TextInputEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t windowID;
     char text[32];
 } my_SDL2_TextInputEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_MouseMotionEvent_32_s {
+typedef struct SDL2_MouseMotionEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t windowID;
@@ -442,7 +442,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_MouseMotionEvent_32_s {
     int32_t yrel;
 } my_SDL2_MouseMotionEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_MouseButtonEvent_32_s {
+typedef struct SDL2_MouseButtonEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t windowID;
@@ -455,7 +455,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_MouseButtonEvent_32_s {
     int32_t y;
 } my_SDL2_MouseButtonEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_MouseWheelEvent_32_s {
+typedef struct SDL2_MouseWheelEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t windowID;
@@ -469,7 +469,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_MouseWheelEvent_32_s {
     int32_t mouseY;
 } my_SDL2_MouseWheelEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_JoyAxisEvent_32_s {
+typedef struct SDL2_JoyAxisEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
@@ -482,7 +482,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_JoyAxisEvent_32_s {
 } my_SDL2_JoyAxisEvent_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_JoyBallEvent_32_s {
+typedef struct SDL2_JoyBallEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
@@ -494,7 +494,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_JoyBallEvent_32_s {
     int16_t yrel;
 } my_SDL2_JoyBallEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_JoyHatEvent_32_s {
+typedef struct SDL2_JoyHatEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
@@ -504,7 +504,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_JoyHatEvent_32_s {
     uint8_t padding2;
 } my_SDL2_JoyHatEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_JoyButtonEvent_32_s {
+typedef struct SDL2_JoyButtonEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
@@ -514,21 +514,21 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_JoyButtonEvent_32_s {
     uint8_t padding2;
 } my_SDL2_JoyButtonEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_JoyDeviceEvent_32_s {
+typedef struct SDL2_JoyDeviceEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
 } my_SDL2_JoyDeviceEvent_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_JoyBatteryEvent_32_s {
+typedef struct SDL2_JoyBatteryEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
     int32_t level;
 } my_SDL2_JoyBatteryEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_ControllerAxisEvent_32_s {
+typedef struct SDL2_ControllerAxisEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
@@ -541,7 +541,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_ControllerAxisEvent_32_s
 } my_SDL2_ControllerAxisEvent_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_ControllerButtonEvent_32_s {
+typedef struct SDL2_ControllerButtonEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
@@ -552,13 +552,13 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_ControllerButtonEvent_32
 } my_SDL2_ControllerButtonEvent_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_ControllerDeviceEvent_32_s {
+typedef struct SDL2_ControllerDeviceEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
 } my_SDL2_ControllerDeviceEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_ControllerTouchpadEvent_32_s {
+typedef struct SDL2_ControllerTouchpadEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
@@ -569,7 +569,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_ControllerTouchpadEvent_
     float pressure;
 } my_SDL2_ControllerTouchpadEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_ControllerSensorEvent_32_s {
+typedef struct SDL2_ControllerSensorEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
@@ -578,7 +578,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_ControllerSensorEvent_32
     uint64_t timestamp_us;
 } my_SDL2_ControllerSensorEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_AudioDeviceEvent_32_s {
+typedef struct SDL2_AudioDeviceEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t which;
@@ -588,7 +588,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_AudioDeviceEvent_32_s {
     uint8_t padding3;
 } my_SDL2_AudioDeviceEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_TouchFingerEvent_32_s {
+typedef struct SDL2_TouchFingerEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int64_t touchId;
@@ -601,7 +601,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_TouchFingerEvent_32_s {
     uint32_t windowID;
 } my_SDL2_TouchFingerEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_MultiGestureEvent_32_s {
+typedef struct SDL2_MultiGestureEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int64_t touchId;
@@ -614,7 +614,7 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_MultiGestureEvent_32_s {
 } my_SDL2_MultiGestureEvent_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_DollarGestureEvent_32_s {
+typedef struct SDL2_DollarGestureEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int64_t touchId;
@@ -625,14 +625,14 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_DollarGestureEvent_32_s
     float y;
 } my_SDL2_DollarGestureEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_DropEvent_32_s {
+typedef struct SDL2_DropEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     ptr_t file;
     uint32_t windowID;
 } my_SDL2_DropEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_SensorEvent_32_s {
+typedef struct SDL2_SensorEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     int32_t which;
@@ -641,13 +641,13 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_SensorEvent_32_s {
 } my_SDL2_SensorEvent_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_QuitEvent_32_s {
+typedef struct SDL2_QuitEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
 } my_SDL2_QuitEvent_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_UserEvent_32_s {
+typedef struct SDL2_UserEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     uint32_t windowID;
@@ -656,14 +656,14 @@ typedef struct __attribute__((packed, aligned(4))) SDL2_UserEvent_32_s {
     ptr_t data2;
 } my_SDL2_UserEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL2_SysWMEvent_32_s {
+typedef struct SDL2_SysWMEvent_32_s {
     uint32_t type;
     uint32_t timestamp;
     ptr_t msg;
 } my_SDL2_SysWMEvent_32_t;
 
 
-typedef union __attribute__((packed, aligned(4))) my_SDL2_Event_32_s {
+typedef union my_SDL2_Event_32_s {
     uint32_t type;
     my_SDL2_CommonEvent_32_t common;
     my_SDL2_DisplayEvent_32_t display;
@@ -809,14 +809,14 @@ typedef struct my_SDL2_Surface_s {
     int refcount;
 } my_SDL2_Surface_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL2_Palette_32_s {
+typedef struct my_SDL2_Palette_32_s {
     int ncolors;
     ptr_t colors;
     uint32_t version;
     int refcount;
 } my_SDL2_Palette_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL2_PixelFormat_32_s {
+typedef struct my_SDL2_PixelFormat_32_s {
     uint32_t format;
     ptr_t palette;
     uint8_t BitsPerPixel;
@@ -838,12 +838,12 @@ typedef struct __attribute__((packed, aligned(4))) my_SDL2_PixelFormat_32_s {
     ptr_t next;
 } my_SDL2_PixelFormat_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL2_Rect_32_s {
+typedef struct my_SDL2_Rect_32_s {
     int x, y;
     int w, h;
 } my_SDL2_Rect_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL2_Surface_32_s {
+typedef struct my_SDL2_Surface_32_s {
     uint32_t flags;
     ptr_t format;
     int w, h;
@@ -868,7 +868,7 @@ typedef struct my_SDL2_RWops_s {
     void* hidden[3];
 } my_SDL2_RWops_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_SDL2_RWops_32_s {
+typedef struct my_SDL2_RWops_32_s {
     ptr_t size;
     ptr_t seek;
     ptr_t read;
diff --git a/src/libtools/libc_net32.c b/src/libtools/libc_net32.c
index cdbffeed..ea621f0d 100644
--- a/src/libtools/libc_net32.c
+++ b/src/libtools/libc_net32.c
@@ -238,7 +238,7 @@ struct i386_ifaddrs
   ptr_t     ifa_netmask;// struct sockaddr *
   ptr_t     ifa_ifu;    // union of struct sockaddr
   ptr_t     ifa_data;   // void *
-} __attribute__((packed, aligned(4)));
+};
 
 EXPORT int my32_getifaddrs(x64emu_t* emu, void** res)
 {
@@ -275,7 +275,7 @@ struct protoent_32
   ptr_t p_name; //char*
   ptr_t p_aliases;// char**
   int p_proto;
-} __attribute__((packed, aligned(4)));
+};
 
 EXPORT void* my32_getprotobyname(x64emu_t* emu, void* name)
 {
diff --git a/src/libtools/my_x11_defs_32.h b/src/libtools/my_x11_defs_32.h
index 2fed047a..5599af18 100644
--- a/src/libtools/my_x11_defs_32.h
+++ b/src/libtools/my_x11_defs_32.h
@@ -5,7 +5,7 @@
 
 typedef ulong_t XID_32;
 
-typedef struct __attribute__((packed, aligned(4))) ximage_32_s {
+typedef struct ximage_32_s {
     ptr_t create_image;
     ptr_t destroy_image;
     ptr_t get_pixel;
@@ -14,7 +14,7 @@ typedef struct __attribute__((packed, aligned(4))) ximage_32_s {
     ptr_t add_pixel;
 } ximage_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) _XImage_32 {
+typedef struct _XImage_32 {
     int32_t width, height;
     int32_t xoffset;
     int32_t format;
@@ -43,7 +43,7 @@ struct my_XFreeFuncs_32 {
     ptr_t intensityMaps;    // void*
     ptr_t im_filters;   // void*
     ptr_t xkb;  // void*
-} __attribute__((packed, aligned(4)));
+};
 
 struct my_XExten_32 {
     ptr_t next; //struct my_XExten *
@@ -61,18 +61,18 @@ struct my_XExten_32 {
     ptr_t error_values; // PrintErrorType
     ptr_t before_flush; // BeforeFlushType
     ptr_t next_flush;   //struct my_XExten *
-} __attribute__((packed, aligned(4)));
+};
 
 struct my_XInternalAsync_32 {
     ptr_t next; //struct my_XInternalAsync_32 *
     ptr_t handler; //int (*handler)(void*, void*, char*, int, void*);
     ptr_t data; //void*
-} __attribute__((packed, aligned(4)));
+};
 
 struct my_XLockPtrs_32 {
     ptr_t lock_display;// void (*lock_display)(void* dpy);
     ptr_t unlock_display;// void (*unlock_display)(void *dpy);
-} __attribute__((packed, aligned(4)));
+};
 
 struct my_XConnectionInfo_32 {
     int fd;
@@ -80,128 +80,128 @@ struct my_XConnectionInfo_32 {
     ptr_t call_data;
     ptr_t watch_data;   // void**
     struct my_XConnectionInfo *next;
-} __attribute__((packed, aligned(4)));
+};
 
 struct my_XConnWatchInfo_32 {
     ptr_t fn;   // XConnectionWatchProc
     ptr_t client_data;
     ptr_t next; //struct _XConnWatchInfo *
-} __attribute__((packed, aligned(4)));
-
-typedef struct __attribute__((packed, aligned(4))) my_Screen_32_s {
-        ptr_t ext_data;         //XExtData *
-        ptr_t display;      //struct my_XDisplay_s *
-        XID_32 root;
-        int width, height;
-        int mwidth, mheight;
-        int ndepths;
-        ptr_t depths;   //Depth *
-        int root_depth;         /* bits per pixel */
-        ptr_t root_visual;  //Visual *
-        ptr_t default_gc;   //GC == struct _XGC*
-        XID_32 cmap;
-        ulong_t white_pixel;
-        ulong_t black_pixel;
-        int max_maps, min_maps;
-        int backing_store;
-        int save_unders;
-        long_t root_input_mask;
+};
+
+typedef struct my_Screen_32_s {
+    ptr_t ext_data;         //XExtData *
+    ptr_t display;      //struct my_XDisplay_s *
+    XID_32 root;
+    int width, height;
+    int mwidth, mheight;
+    int ndepths;
+    ptr_t depths;   //Depth *
+    int root_depth;         /* bits per pixel */
+    ptr_t root_visual;  //Visual *
+    ptr_t default_gc;   //GC == struct _XGC*
+    XID_32 cmap;
+    ulong_t white_pixel;
+    ulong_t black_pixel;
+    int max_maps, min_maps;
+    int backing_store;
+    int save_unders;
+    long_t root_input_mask;
 } my_Screen_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XDisplay_32_s
-{
-        ptr_t ext_data; //void *                            //offset = 0x00
-        ptr_t free_funcs;   //struct my_XFreeFuncs_32 *
-        int fd;
-        int conn_checker;
-        int proto_major_version;                            //offset = 0x10
-        int proto_minor_version;
-        ptr_t vendor;   //char *
-        XID_32 resource_base;
-        XID_32 resource_mask;                               // offset = 0x20
-        XID_32 resource_id;
-        int resource_shift;
-        ptr_t resource_alloc;//XID_32 (*resource_alloc)(void*);
-        int byte_order;                                     // offset = 0x30
-        int bitmap_unit;
-        int bitmap_pad;
-        int bitmap_bit_order;
-        int nformats;                                       //offset = 0x40
-        ptr_t pixmap_format;    //void *
-        int vnumber;
-        int release;
-        ptr_t head, tail;                                   //ofsset = 0x50
-        int qlen;
-        ulong_t last_request_read;
-        ulong_t request;                                    //offset = 0x60
-        ptr_t last_req; //char *
-        ptr_t buffer;   //char *
-        ptr_t bufptr;   //char *
-        ptr_t bufmax;   //char *                            //offset = 0x70
-        unsigned max_request_size;
-        ptr_t db;   //void* *
-        ptr_t synchandler; //int (*synchandler)(void*);
-        ptr_t display_name;//char *                         //offset = 0x80
-        int default_screen;
-        int nscreens;
-        ptr_t screens;//void *
-        ulong_t motion_buffer;                              //offset = 0x90
-        volatile ulong_t flags;
-        int min_keycode;
-        int max_keycode;
-        ptr_t keysyms;  //void *
-        ptr_t modifiermap;  //void *
-        int keysyms_per_keycode;
-        ptr_t xdefaults;    //char *
-        ptr_t scratch_buffer;   //char *
-        ulong_t scratch_length;
-        int ext_number;
-        ptr_t ext_procs;    //struct my_XExten *
-        ptr_t event_vec;    //int (*event_vec[128])(void *, void *, void *);
-        ptr_t wire_vec; //int (*wire_vec[128])(void *, void *, void *);
-        XID_32 lock_meaning;
-        ptr_t lock; //void* 
-        ptr_t async_handlers;   //struct my_XInternalAsync *
-        ulong_t bigreq_size;
-        ptr_t lock_fns; //struct my_XLockPtrs *
-        ptr_t idlist_alloc; //void (*idlist_alloc)(void *, void *, int);
-        ptr_t key_bindings; //void* 
-        XID_32 cursor_font;
-        ptr_t atoms;    //void* *
-        unsigned int mode_switch;
-        unsigned int num_lock;
-        ptr_t context_db;   //void*
-        ptr_t error_vec;    //int (**error_vec)(void*, void*, void*);
-        struct {
-           ptr_t defaultCCCs;   //void*
-           ptr_t clientCmaps;   //void*
-           ptr_t perVisualIntensityMaps;    //void*
-        } cms;
-        ptr_t im_filters;   //void*
-        ptr_t qfree;    //void*
-        ulong_t next_event_32_serial_num;
-        ptr_t flushes;  //struct my_XExten *
-        ptr_t im_fd_info;   //struct my_XConnectionInfo *
-        int im_fd_length;
-        ptr_t conn_watchers;    //struct my_XConnWatchInfo *
-        int watcher_count;
-        ptr_t filedes;  //void*
-        ptr_t savedsynchandler;  //int (*savedsynchandler)(void *);
-        XID_32 resource_max;
-        int xcmisc_opcode;
-        ptr_t xkb_info; //void* *
-        ptr_t trans_conn;   //void* *
-        ptr_t xcb;  //void* *
-        unsigned int next_cookie;
-        ptr_t generic_event_vec[128]; //int (*generic_event_vec[128])(void*, void*, void*);
-        ptr_t generic_event_copy_vec[128]; //int (*generic_event_copy_vec[128])(void*, void*, void*);
-        ptr_t cookiejar;    //void *
-        ptr_t error_threads;    //void *
-        ptr_t exit_handler; //void *
-        ptr_t exit_handler_data;    //void *
+typedef struct my_XDisplay_32_s
+{
+    ptr_t ext_data; //void *                            //offset = 0x00
+    ptr_t free_funcs;   //struct my_XFreeFuncs_32 *
+    int fd;
+    int conn_checker;
+    int proto_major_version;                            //offset = 0x10
+    int proto_minor_version;
+    ptr_t vendor;   //char *
+    XID_32 resource_base;
+    XID_32 resource_mask;                               // offset = 0x20
+    XID_32 resource_id;
+    int resource_shift;
+    ptr_t resource_alloc;//XID_32 (*resource_alloc)(void*);
+    int byte_order;                                     // offset = 0x30
+    int bitmap_unit;
+    int bitmap_pad;
+    int bitmap_bit_order;
+    int nformats;                                       //offset = 0x40
+    ptr_t pixmap_format;    //void *
+    int vnumber;
+    int release;
+    ptr_t head, tail;                                   //ofsset = 0x50
+    int qlen;
+    ulong_t last_request_read;
+    ulong_t request;                                    //offset = 0x60
+    ptr_t last_req; //char *
+    ptr_t buffer;   //char *
+    ptr_t bufptr;   //char *
+    ptr_t bufmax;   //char *                            //offset = 0x70
+    unsigned max_request_size;
+    ptr_t db;   //void* *
+    ptr_t synchandler; //int (*synchandler)(void*);
+    ptr_t display_name;//char *                         //offset = 0x80
+    int default_screen;
+    int nscreens;
+    ptr_t screens;//void *
+    ulong_t motion_buffer;                              //offset = 0x90
+    volatile ulong_t flags;
+    int min_keycode;
+    int max_keycode;
+    ptr_t keysyms;  //void *
+    ptr_t modifiermap;  //void *
+    int keysyms_per_keycode;
+    ptr_t xdefaults;    //char *
+    ptr_t scratch_buffer;   //char *
+    ulong_t scratch_length;
+    int ext_number;
+    ptr_t ext_procs;    //struct my_XExten *
+    ptr_t event_vec;    //int (*event_vec[128])(void *, void *, void *);
+    ptr_t wire_vec; //int (*wire_vec[128])(void *, void *, void *);
+    XID_32 lock_meaning;
+    ptr_t lock; //void* 
+    ptr_t async_handlers;   //struct my_XInternalAsync *
+    ulong_t bigreq_size;
+    ptr_t lock_fns; //struct my_XLockPtrs *
+    ptr_t idlist_alloc; //void (*idlist_alloc)(void *, void *, int);
+    ptr_t key_bindings; //void* 
+    XID_32 cursor_font;
+    ptr_t atoms;    //void* *
+    unsigned int mode_switch;
+    unsigned int num_lock;
+    ptr_t context_db;   //void*
+    ptr_t error_vec;    //int (**error_vec)(void*, void*, void*);
+    struct {
+        ptr_t defaultCCCs;   //void*
+        ptr_t clientCmaps;   //void*
+        ptr_t perVisualIntensityMaps;    //void*
+    } cms;
+    ptr_t im_filters;   //void*
+    ptr_t qfree;    //void*
+    ulong_t next_event_32_serial_num;
+    ptr_t flushes;  //struct my_XExten *
+    ptr_t im_fd_info;   //struct my_XConnectionInfo *
+    int im_fd_length;
+    ptr_t conn_watchers;    //struct my_XConnWatchInfo *
+    int watcher_count;
+    ptr_t filedes;  //void*
+    ptr_t savedsynchandler;  //int (*savedsynchandler)(void *);
+    XID_32 resource_max;
+    int xcmisc_opcode;
+    ptr_t xkb_info; //void* *
+    ptr_t trans_conn;   //void* *
+    ptr_t xcb;  //void* *
+    unsigned int next_cookie;
+    ptr_t generic_event_vec[128]; //int (*generic_event_vec[128])(void*, void*, void*);
+    ptr_t generic_event_copy_vec[128]; //int (*generic_event_copy_vec[128])(void*, void*, void*);
+    ptr_t cookiejar;    //void *
+    ptr_t error_threads;    //void *
+    ptr_t exit_handler; //void *
+    ptr_t exit_handler_data;    //void *
 } my_XDisplay_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XSetWindowAttributes_32_s {
+typedef struct my_XSetWindowAttributes_32_s {
     XID_32 background_pixmap;
     ulong_t background_pixel;
     XID_32 border_pixmap;
@@ -221,7 +221,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XSetWindowAttributes_32_s
 
 // Events
 
-typedef struct __attribute__((packed, aligned(4))) my_XKeyEvent_32_s
+typedef struct my_XKeyEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -240,7 +240,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XKeyEvent_32_s
 typedef my_XKeyEvent_32_t my_XKeyPressedEvent_32_t;
 typedef my_XKeyEvent_32_t my_XKeyReleasedEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XButtonEvent_32_s
+typedef struct my_XButtonEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -259,7 +259,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XButtonEvent_32_s
 typedef my_XButtonEvent_32_t my_XButtonPressedEvent_32_t;
 typedef my_XButtonEvent_32_t my_XButtonReleasedEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XMotionEvent_32_s
+typedef struct my_XMotionEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -277,7 +277,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XMotionEvent_32_s
 } my_XMotionEvent_32_t;
 typedef my_XMotionEvent_32_t my_XPointerMovedEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XCrossingEvent_32_s
+typedef struct my_XCrossingEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -299,7 +299,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XCrossingEvent_32_s
 typedef my_XCrossingEvent_32_t my_XEnterWindowEvent_32_t;
 typedef my_XCrossingEvent_32_t my_XLeaveWindowEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XFocusChangeEvent_32_s
+typedef struct my_XFocusChangeEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -312,7 +312,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XFocusChangeEvent_32_s
 typedef my_XFocusChangeEvent_32_t my_XFocusInEvent_32_t;
 typedef my_XFocusChangeEvent_32_t my_XFocusOutEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XKeymapEvent_32_s
+typedef struct my_XKeymapEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -322,7 +322,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XKeymapEvent_32_s
     char key_vector[32];
 } my_XKeymapEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XExposeEvent_32_s
+typedef struct my_XExposeEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -334,7 +334,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XExposeEvent_32_s
     int count;
 } my_XExposeEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XGraphicsExposeEvent_32_s
+typedef struct my_XGraphicsExposeEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -348,7 +348,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XGraphicsExposeEvent_32_s
     int minor_code;
 } my_XGraphicsExposeEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XNoExposeEvent_32_s
+typedef struct my_XNoExposeEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -359,7 +359,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XNoExposeEvent_32_s
     int minor_code;
 } my_XNoExposeEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XVisibilityEvent_32_s
+typedef struct my_XVisibilityEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -369,7 +369,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XVisibilityEvent_32_s
     int state;
 } my_XVisibilityEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XCreateWindowEvent_32_s
+typedef struct my_XCreateWindowEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -383,7 +383,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XCreateWindowEvent_32_s
     int override_redirect;
 } my_XCreateWindowEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XDestroyWindowEvent_32_s
+typedef struct my_XDestroyWindowEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -393,7 +393,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XDestroyWindowEvent_32_s
     XID_32 window;
 } my_XDestroyWindowEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XUnmapEvent_32_s
+typedef struct my_XUnmapEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -404,7 +404,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XUnmapEvent_32_s
     int from_configure;
 } my_XUnmapEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XMapEvent_32_s
+typedef struct my_XMapEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -415,7 +415,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XMapEvent_32_s
     int override_redirect;
 } my_XMapEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XMapRequestEvent_32_s
+typedef struct my_XMapRequestEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -425,7 +425,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XMapRequestEvent_32_s
     XID_32 window;
 } my_XMapRequestEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XReparentEvent_32_s
+typedef struct my_XReparentEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -438,7 +438,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XReparentEvent_32_s
     int override_redirect;
 } my_XReparentEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XConfigureEvent_32_s
+typedef struct my_XConfigureEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -453,7 +453,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XConfigureEvent_32_s
     int override_redirect;
 } my_XConfigureEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XGravityEvent_32_s
+typedef struct my_XGravityEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -464,7 +464,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XGravityEvent_32_s
     int x, y;
 } my_XGravityEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XResizeRequestEvent_32_s
+typedef struct my_XResizeRequestEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -474,7 +474,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XResizeRequestEvent_32_s
     int width, height;
 } my_XResizeRequestEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XConfigureRequestEvent_32_s
+typedef struct my_XConfigureRequestEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -490,7 +490,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XConfigureRequestEvent_32_
     ulong_t       value_mask;
 } my_XConfigureRequestEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XCirculateEvent_32_s
+typedef struct my_XCirculateEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -501,7 +501,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XCirculateEvent_32_s
     int place;
 } my_XCirculateEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XCirculateRequestEvent_32_s
+typedef struct my_XCirculateRequestEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -512,7 +512,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XCirculateRequestEvent_32_
     int place;
 } my_XCirculateRequestEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XPropertyEvent_32_s
+typedef struct my_XPropertyEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -524,7 +524,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XPropertyEvent_32_s
     int state;
 } my_XPropertyEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XSelectionClearEvent_32_s
+typedef struct my_XSelectionClearEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -535,7 +535,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XSelectionClearEvent_32_s
     ulong_t       time;
 } my_XSelectionClearEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XSelectionRequestEvent_32_s
+typedef struct my_XSelectionRequestEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -549,7 +549,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XSelectionRequestEvent_32_
     ulong_t       time;
 } my_XSelectionRequestEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XSelectionEvent_32_s
+typedef struct my_XSelectionEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -562,7 +562,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XSelectionEvent_32_s
     ulong_t       time;
 } my_XSelectionEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XColormapEvent_32_s
+typedef struct my_XColormapEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -574,7 +574,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XColormapEvent_32_s
     int state;
 } my_XColormapEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XClientMessageEvent_32_s
+typedef struct my_XClientMessageEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -590,7 +590,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XClientMessageEvent_32_s
             } data;
 } my_XClientMessageEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XMappingEvent_32_s
+typedef struct my_XMappingEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -602,18 +602,18 @@ typedef struct __attribute__((packed, aligned(4))) my_XMappingEvent_32_s
     int count;
 } my_XMappingEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XErrorEvent_32_s
+typedef struct my_XErrorEvent_32_s
 {
-        int type;
-        ptr_t display;  //Display*
-        XID_32 resourceid;
-        ulong_t       serial;
-        unsigned char error_code;
-        unsigned char request_code;
-        unsigned char minor_code;
+    int type;
+    ptr_t display;  //Display*
+    XID_32 resourceid;
+    ulong_t       serial;
+    unsigned char error_code;
+    unsigned char request_code;
+    unsigned char minor_code;
 } my_XErrorEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XAnyEvent_32_s
+typedef struct my_XAnyEvent_32_s
 {
     int type;
     ulong_t       serial;
@@ -622,7 +622,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XAnyEvent_32_s
     XID_32 window;
 } my_XAnyEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XGenericEvent_32_s
+typedef struct my_XGenericEvent_32_s
 {
     int            type;
     ulong_t        serial;
@@ -632,7 +632,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XGenericEvent_32_s
     int            evtype;
 } my_XGenericEvent_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XGenericEventCookie_32_s
+typedef struct my_XGenericEventCookie_32_s
 {
     int            type;
     ulong_t        serial;
@@ -641,49 +641,49 @@ typedef struct __attribute__((packed, aligned(4))) my_XGenericEventCookie_32_s
     int            extension;
     int            evtype;
     unsigned int   cookie;
-    void           *data;
+    ptr_t          data;    //void*
 } my_XGenericEventCookie_32_t;
 
-typedef union __attribute__((packed, aligned(4))) my_XEvent_32_s {
-        int type;
-        my_XAnyEvent_32_t xany;
-        my_XKeyEvent_32_t xkey;
-        my_XButtonEvent_32_t xbutton;
-        my_XMotionEvent_32_t xmotion;
-        my_XCrossingEvent_32_t xcrossing;
-        my_XFocusChangeEvent_32_t xfocus;
-        my_XExposeEvent_32_t xexpose;
-        my_XGraphicsExposeEvent_32_t xgraphicsexpose;
-        my_XNoExposeEvent_32_t xnoexpose;
-        my_XVisibilityEvent_32_t xvisibility;
-        my_XCreateWindowEvent_32_t xcreatewindow;
-        my_XDestroyWindowEvent_32_t xdestroywindow;
-        my_XUnmapEvent_32_t xunmap;
-        my_XMapEvent_32_t xmap;
-        my_XMapRequestEvent_32_t xmaprequest;
-        my_XReparentEvent_32_t xreparent;
-        my_XConfigureEvent_32_t xconfigure;
-        my_XGravityEvent_32_t xgravity;
-        my_XResizeRequestEvent_32_t xresizerequest;
-        my_XConfigureRequestEvent_32_t xconfigurerequest;
-        my_XCirculateEvent_32_t xcirculate;
-        my_XCirculateRequestEvent_32_t xcirculaterequest;
-        my_XPropertyEvent_32_t xproperty;
-        my_XSelectionClearEvent_32_t xselectionclear;
-        my_XSelectionRequestEvent_32_t xselectionrequest;
-        my_XSelectionEvent_32_t xselection;
-        my_XColormapEvent_32_t xcolormap;
-        my_XClientMessageEvent_32_t xclient;
-        my_XMappingEvent_32_t xmapping;
-        my_XErrorEvent_32_t xerror;
-        my_XKeymapEvent_32_t xkeymap;
-        my_XGenericEvent_32_t xgeneric;
-        my_XGenericEventCookie_32_t xcookie;
-        long_t pad[24];
+typedef union my_XEvent_32_s {
+    int type;
+    my_XAnyEvent_32_t xany;
+    my_XKeyEvent_32_t xkey;
+    my_XButtonEvent_32_t xbutton;
+    my_XMotionEvent_32_t xmotion;
+    my_XCrossingEvent_32_t xcrossing;
+    my_XFocusChangeEvent_32_t xfocus;
+    my_XExposeEvent_32_t xexpose;
+    my_XGraphicsExposeEvent_32_t xgraphicsexpose;
+    my_XNoExposeEvent_32_t xnoexpose;
+    my_XVisibilityEvent_32_t xvisibility;
+    my_XCreateWindowEvent_32_t xcreatewindow;
+    my_XDestroyWindowEvent_32_t xdestroywindow;
+    my_XUnmapEvent_32_t xunmap;
+    my_XMapEvent_32_t xmap;
+    my_XMapRequestEvent_32_t xmaprequest;
+    my_XReparentEvent_32_t xreparent;
+    my_XConfigureEvent_32_t xconfigure;
+    my_XGravityEvent_32_t xgravity;
+    my_XResizeRequestEvent_32_t xresizerequest;
+    my_XConfigureRequestEvent_32_t xconfigurerequest;
+    my_XCirculateEvent_32_t xcirculate;
+    my_XCirculateRequestEvent_32_t xcirculaterequest;
+    my_XPropertyEvent_32_t xproperty;
+    my_XSelectionClearEvent_32_t xselectionclear;
+    my_XSelectionRequestEvent_32_t xselectionrequest;
+    my_XSelectionEvent_32_t xselection;
+    my_XColormapEvent_32_t xcolormap;
+    my_XClientMessageEvent_32_t xclient;
+    my_XMappingEvent_32_t xmapping;
+    my_XErrorEvent_32_t xerror;
+    my_XKeymapEvent_32_t xkeymap;
+    my_XGenericEvent_32_t xgeneric;
+    my_XGenericEventCookie_32_t xcookie;
+    long_t pad[24];
 } my_XEvent_32_t;
 
 // WMHints 
-typedef struct __attribute__((packed, aligned(4))) my_XWMHints_32_s {
+typedef struct my_XWMHints_32_s {
     long_t flags;
     int input;
     int initial_state;
@@ -695,7 +695,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XWMHints_32_s {
     XID_32 window_group;
 } my_XWMHints_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XRRModeInfo_32_s {
+typedef struct my_XRRModeInfo_32_s {
     XID_32              id;
     unsigned int        width;
     unsigned int        height;
@@ -713,7 +713,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XRRModeInfo_32_s {
 } my_XRRModeInfo_32_t;
 
 
-typedef struct __attribute__((packed, aligned(4))) my_XRRScreenResources_32_s {
+typedef struct my_XRRScreenResources_32_s {
     ulong_t     timestamp;
     ulong_t     configTimestamp;
     int         ncrtc;
@@ -724,7 +724,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XRRScreenResources_32_s {
     ptr_t       modes;  //my_XRRModeInfo_32_t *
 } my_XRRScreenResources_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XRRCrtcInfo_32_s {
+typedef struct my_XRRCrtcInfo_32_s {
     ulong_t         timestamp;
     int             x, y;
     unsigned int    width, height;
@@ -737,7 +737,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XRRCrtcInfo_32_s {
     ptr_t           possible;   //XID_32*
 } my_XRRCrtcInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XRROutputInfo_32_s {
+typedef struct my_XRROutputInfo_32_s {
     ulong_t         timestamp;
     XID_32          crtc;
     ptr_t           name;   //char*
@@ -755,7 +755,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XRROutputInfo_32_s {
     ptr_t           modes; //XID_32*
 } my_XRROutputInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XWindowAttributes_32_s {
+typedef struct my_XWindowAttributes_32_s {
     int x, y;
     int width, height;
     int border_width;
@@ -779,7 +779,7 @@ typedef struct __attribute__((packed, aligned(4))) my_XWindowAttributes_32_s {
     ptr_t screen;   //Screen*
 } my_XWindowAttributes_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XVisualInfo_32_s {
+typedef struct my_XVisualInfo_32_s {
   ptr_t visual; //Visual*
   ulong_t visualid;
   int screen;
@@ -792,25 +792,25 @@ typedef struct __attribute__((packed, aligned(4))) my_XVisualInfo_32_s {
   int bits_per_rgb;
 } my_XVisualInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XModifierKeymap_32_s {
+typedef struct my_XModifierKeymap_32_s {
     int             max_keypermod;
     ptr_t           modifiermap;    //uint8_t*
 } my_XModifierKeymap_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XdbeVisualInfo_32_s
+typedef struct my_XdbeVisualInfo_32_s
 {
     XID_32      visual;
     int         depth;
     int         perflevel;
 } my_XdbeVisualInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XdbeScreenVisualInfo_32_s
+typedef struct my_XdbeScreenVisualInfo_32_s
 {
     int         count;
     ptr_t       visinfo;    //my_XdbeVisualInfo_t*
 } my_XdbeScreenVisualInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XF86VidModeModeInfo_32_s
+typedef struct my_XF86VidModeModeInfo_32_s
 {
     unsigned int        dotclock;
     unsigned short      hdisplay;
@@ -827,14 +827,14 @@ typedef struct __attribute__((packed, aligned(4))) my_XF86VidModeModeInfo_32_s
     ptr_t               tc_private;
 } my_XF86VidModeModeInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XColor_32_s {
+typedef struct my_XColor_32_s {
 	ulong_t pixel;
 	unsigned short red, green, blue;
 	char flags;
 	char pad;
 } my_XColor_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XRRProviderInfo_32_s {
+typedef struct my_XRRProviderInfo_32_s {
     unsigned int    capabilities;
     int             ncrtcs;
     ptr_t           crtcs;  //XID*
@@ -847,19 +847,19 @@ typedef struct __attribute__((packed, aligned(4))) my_XRRProviderInfo_32_s {
     int             nameLen;
 } my_XRRProviderInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XRRProviderResources_32_t {
+typedef struct my_XRRProviderResources_32_t {
     ulong_t   timestamp;
     int       nproviders;
     ptr_t     providers;    //XID*
 } my_XRRProviderResources_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XIAnyClassInfo_32_s
+typedef struct my_XIAnyClassInfo_32_s
 {
     int         type;
     int         sourceid;
 } my_XIAnyClassInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XIDeviceInfo_32_s
+typedef struct my_XIDeviceInfo_32_s
 {
     int        deviceid;
     ptr_t      name;   //char*
@@ -870,24 +870,24 @@ typedef struct __attribute__((packed, aligned(4))) my_XIDeviceInfo_32_s
     ptr_t      classes;    //my_XIAnyClassInfo_t**
 } my_XIDeviceInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XIEventMask_32_s {
+typedef struct my_XIEventMask_32_s {
     int deviceid;
     int mask_len;
     ptr_t mask; //unsigned char*
 } my_XIEventMask_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XInputClassInfo_32_s {
+typedef struct my_XInputClassInfo_32_s {
      unsigned char input_class;
      unsigned char event_type_base;
 } my_XInputClassInfo_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XDevice_32_s {
+typedef struct my_XDevice_32_s {
      XID_32 device_id;
      int    num_classes;
      ptr_t  classes;    //my_XInputClassInfo_t*
 } my_XDevice_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) my_XcursorCursors_32_s {
+typedef struct my_XcursorCursors_32_s {
     ptr_t      dpy;     //Display*
     int        ref;
     int        ncursor;
diff --git a/src/libtools/threads32.c b/src/libtools/threads32.c
index adbfd894..093e4749 100755
--- a/src/libtools/threads32.c
+++ b/src/libtools/threads32.c
@@ -53,7 +53,7 @@ typedef struct threadstack_s {
 } threadstack_t;
 
 // longjmp / setjmp
-typedef struct __attribute__((packed, aligned(4))) jump_buff_i386_s {
+typedef struct jump_buff_i386_s {
  uint32_t save_ebx;
  uint32_t save_esi;
  uint32_t save_edi;
diff --git a/src/wrapped32/generated/converter32.c b/src/wrapped32/generated/converter32.c
index 205791f0..6748be0b 100644
--- a/src/wrapped32/generated/converter32.c
+++ b/src/wrapped32/generated/converter32.c
@@ -405,11 +405,11 @@ void from_struct_WWpWpWpWp(struct_WWpWpWpWp_t *dest, ptr_t s)
 	dest->W0 = *(uint16_t*)src; src += 2;
 	dest->W1 = *(uint16_t*)src; src += 2;
 	dest->p2 = from_ptrv(*(ptr_t*)src); src += 4;
-	dest->W3 = *(uint16_t*)src; src += 2;
+	dest->W3 = *(uint16_t*)src; src += 4;	// align
 	dest->p4 = from_ptrv(*(ptr_t*)src); src += 4;
-	dest->W5 = *(uint16_t*)src; src += 2;
+	dest->W5 = *(uint16_t*)src; src += 4;	// align
 	dest->p6 = from_ptrv(*(ptr_t*)src); src += 4;
-	dest->W7 = *(uint16_t*)src; src += 2;
+	dest->W7 = *(uint16_t*)src; src += 4;	// align
 	dest->p8 = from_ptrv(*(ptr_t*)src); src += 4;
 }
 void to_struct_WWpWpWpWp(ptr_t d, const struct_WWpWpWpWp_t *src)
@@ -419,11 +419,11 @@ void to_struct_WWpWpWpWp(ptr_t d, const struct_WWpWpWpWp_t *src)
 	*(uint16_t*)dest = src->W0; dest += 2;
 	*(uint16_t*)dest = src->W1; dest += 2;
 	*(ptr_t*)dest = to_ptrv(src->p2); dest += 4;
-	*(uint16_t*)dest = src->W3; dest += 2;
+	*(uint16_t*)dest = src->W3; dest += 4;	// align
 	*(ptr_t*)dest = to_ptrv(src->p4); dest += 4;
-	*(uint16_t*)dest = src->W5; dest += 2;
+	*(uint16_t*)dest = src->W5; dest += 4;	// align
 	*(ptr_t*)dest = to_ptrv(src->p6); dest += 4;
-	*(uint16_t*)dest = src->W7; dest += 2;
+	*(uint16_t*)dest = src->W7; dest += 4;	// align
 	*(ptr_t*)dest = to_ptrv(src->p8); dest += 4;
 }
 
diff --git a/src/wrapped32/wrappedfontconfig.c b/src/wrapped32/wrappedfontconfig.c
index 9533b2e5..6a103768 100644
--- a/src/wrapped32/wrappedfontconfig.c
+++ b/src/wrapped32/wrappedfontconfig.c
@@ -95,33 +95,33 @@ typedef struct __attribute__((packed, aligned(4))) FcValue_32_s {
     } u;
 } FcValue_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) FcPattern_32_s {
+typedef struct FcPattern_32_s {
     int		    num;
     int		    size;
     long_t	    elts_offset;
     int		    ref;
 } FcPattern_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) FcFontSet_32_s {
+typedef struct FcFontSet_32_s {
     int		nfont;
     int		sfont;
     ptr_t   fonts;//FcPattern_t	**
 } FcFontSet_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) FcStrSet_32_s {
+typedef struct FcStrSet_32_s {
     int		    ref;
     int		    num;
     int		    size;
     ptr_t       strs;   //void	    **
 } FcStrSet_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) FcBlanks_32_s {
+typedef struct FcBlanks_32_s {
     int		nblank;
     int		sblank;
     ptr_t   blanks; //void	*
 } FcBlanks_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) FcConfig_32_s {
+typedef struct FcConfig_32_s {
     ptr_t       configDirs;     //FcStrSet_t*
     ptr_t       blanks;         //FcBlanks_t*
     ptr_t       fontDirs;       //FcStrSet_t*
diff --git a/src/wrapped32/wrappedfreetype.c b/src/wrapped32/wrappedfreetype.c
index ca71c3f7..82a7c942 100644
--- a/src/wrapped32/wrappedfreetype.c
+++ b/src/wrapped32/wrappedfreetype.c
@@ -584,7 +584,7 @@ typedef struct __attribute__((packed, aligned(4))) FT_Open_Args_32_s
     ptr_t           params; //FT_Parameter_t*
 } FT_Open_Args_32_t;
 
-typedef struct __attribute__((packed, aligned(4))) FT_WinFNT_HeaderRec_32_s
+typedef struct FT_WinFNT_HeaderRec_32_s // removed the packed attribute
 {
     uint16_t        version;
     ulong_t         file_size;
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c
index 70c06d16..90fe756f 100755
--- a/src/wrapped32/wrappedlibc.c
+++ b/src/wrapped32/wrappedlibc.c
@@ -1728,7 +1728,7 @@ EXPORT int32_t my32_execvp(x64emu_t* emu, const char* path, ptr_t argv[])
     return execv(fullpath, (void*)newargv);
 }
 // execvp should use PATH to search for the program first
-typedef struct __attribute__((packed, aligned(4)))
+typedef struct
 {
   int __allocated;
   int __used;
@@ -2426,7 +2426,7 @@ EXPORT void* my32___deregister_frame_info(void* a)
 EXPORT void* my32____brk_addr = NULL;
 #endif
 // longjmp / setjmp
-typedef struct __attribute__((packed, aligned(4))) jump_buff_i386_s {
+typedef struct jump_buff_i386_s {
  uint32_t save_ebx;
  uint32_t save_esi;
  uint32_t save_edi;
diff --git a/src/wrapped32/wrappedlibdl.c b/src/wrapped32/wrappedlibdl.c
index 05e7b058..c3a79feb 100755
--- a/src/wrapped32/wrappedlibdl.c
+++ b/src/wrapped32/wrappedlibdl.c
@@ -51,7 +51,7 @@ void dl_set_error(const char*);
 char* dl_last_error();
 library_t* dl_get_library(void* handle);
 
-typedef struct __attribute__((packed, aligned(4))) my_dl_info_32_s
+typedef struct my_dl_info_32_s
 {
   ptr_t dli_fname;	// const char*
   ptr_t dli_fbase;	// void*
@@ -120,7 +120,7 @@ int my32_dlinfo(x64emu_t* emu, void* handle, int request, void* info)
     return -1;
 }
 
-typedef struct __attribute__((packed, aligned(4))) my_dl_find_object_s {
+typedef struct my_dl_find_object_s {
     uint64_t    dlfo_flags;
     ptr_t       dlfo_map_start;
     ptr_t       dlfo_map_end;
diff --git a/src/wrapped32/wrappedlibxrandr.c b/src/wrapped32/wrappedlibxrandr.c
index 48cc411f..39b49a35 100644
--- a/src/wrapped32/wrappedlibxrandr.c
+++ b/src/wrapped32/wrappedlibxrandr.c
@@ -189,9 +189,9 @@ void inplace_XRRCrtcInfo_shrink(void* s)
     dst->height = src->height;
     dst->mode = to_ulong(src->mode);
     dst->rotation = src->rotation;
-    dst->noutput = src->noutput;
-    for(int i=0; i<dst->noutput; ++i)
+    for(int i=0; i<src->noutput; ++i)
         ((XID_32*)src->outputs)[i] = to_ulong(src->outputs[i]);
+    dst->noutput = src->noutput;
     dst->outputs = to_ptrv(src->outputs);
     dst->rotations = src->rotations;
     dst->npossible = src->npossible;
diff --git a/src/wrapped32/wrappedsdl1.c b/src/wrapped32/wrappedsdl1.c
index 7186fc47..86adf985 100644
--- a/src/wrapped32/wrappedsdl1.c
+++ b/src/wrapped32/wrappedsdl1.c
@@ -48,7 +48,7 @@ typedef struct {
   void *userdata;
 } SDL_AudioSpec;
 
-typedef struct __attribute__((packed, aligned(4))) {
+typedef struct {    // removed packed attribute
   int32_t freq;
   uint16_t format;
   uint8_t channels;
diff --git a/src/wrapped32/wrappedsdl2.c b/src/wrapped32/wrappedsdl2.c
index 64cbaa9d..3198260b 100644
--- a/src/wrapped32/wrappedsdl2.c
+++ b/src/wrapped32/wrappedsdl2.c
@@ -508,7 +508,7 @@ typedef struct SDL_version_s
     uint8_t patch;
 } SDL_version_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL_version_32_s
+typedef struct SDL_version_32_s //removed packed attribute
 {
     uint8_t major;
     uint8_t minor;
@@ -530,7 +530,7 @@ typedef struct SDL_SysWMinfo_s
     } info;
 } SDL_SysWMinfo_t;
 
-typedef struct __attribute__((packed, aligned(4))) SDL_SysWMinfo_32_s
+typedef struct SDL_SysWMinfo_32_s
 {
     SDL_version_32_t version;
     int subsystem;  // 1=Windows, 2 =X11, 6=Wayland