diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-10-08 09:59:44 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-10-08 09:59:44 +0200 |
| commit | 58d58b0af7113edb7623903535c436da5a1a6304 (patch) | |
| tree | 9368455c5a3431d59358d82f0d0cefbf5b2f2c6a /src/libtools | |
| parent | ce5daaa835fffd790db6973cf5ec75bedf31a18a (diff) | |
| download | box64-58d58b0af7113edb7623903535c436da5a1a6304.tar.gz box64-58d58b0af7113edb7623903535c436da5a1a6304.zip | |
[BOX32] More adjustments to x86 structures packing & alignment (or not)
Diffstat (limited to 'src/libtools')
| -rw-r--r-- | src/libtools/libc_net32.c | 4 | ||||
| -rw-r--r-- | src/libtools/my_x11_defs_32.h | 432 | ||||
| -rwxr-xr-x | src/libtools/threads32.c | 2 |
3 files changed, 219 insertions, 219 deletions
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; |