mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-24 01:48:53 +02:00
typelib: Fix invalid alignment assumptions
The current source has invalid assumptions about structure alignment that break on platforms like m68k where 32-bit integers are aligned to 16-bit only. Fix this by introducing explicit structure padding for 32-bit quantities following odd numbers of 16-bit quantities and structure trail padding, to make the binary representation generated by the compiler match the text of the specification exactly. https://bugzilla.gnome.org/show_bug.cgi?id=661839
This commit is contained in:
committed by
Colin Walters
parent
c2d79efd53
commit
87857869e9
@@ -282,7 +282,7 @@ typedef struct {
|
|||||||
guint32 sections;
|
guint32 sections;
|
||||||
|
|
||||||
/* <private> */
|
/* <private> */
|
||||||
guint16 padding[5];
|
guint16 padding[6];
|
||||||
} Header;
|
} Header;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@@ -434,6 +434,10 @@ typedef struct {
|
|||||||
gint8 closure;
|
gint8 closure;
|
||||||
gint8 destroy;
|
gint8 destroy;
|
||||||
|
|
||||||
|
/* <private> */
|
||||||
|
guint16 padding;
|
||||||
|
/* <public> */
|
||||||
|
|
||||||
SimpleTypeBlob arg_type;
|
SimpleTypeBlob arg_type;
|
||||||
} ArgBlob;
|
} ArgBlob;
|
||||||
|
|
||||||
@@ -1051,6 +1055,8 @@ typedef struct {
|
|||||||
guint16 n_vfuncs;
|
guint16 n_vfuncs;
|
||||||
guint16 n_constants;
|
guint16 n_constants;
|
||||||
|
|
||||||
|
guint16 padding;
|
||||||
|
|
||||||
guint32 reserved2;
|
guint32 reserved2;
|
||||||
guint32 reserved3;
|
guint32 reserved3;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user