mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-06 17:36:14 +01:00
gvariant: Add portable alignment fix for GVariant suffix
We want to keep the suffix aligned to 8 bytes on 32-bit too. This makes sure we do that in a way that is portable across our supported compilers. Fixes: #3486
This commit is contained in:
parent
e4f5c2e9c5
commit
4db378a739
@ -76,13 +76,12 @@ struct _GVariant
|
|||||||
gatomicrefcount ref_count;
|
gatomicrefcount ref_count;
|
||||||
gsize depth;
|
gsize depth;
|
||||||
|
|
||||||
#if g_macro__has_attribute(aligned)
|
#if GLIB_SIZEOF_VOID_P == 4
|
||||||
guint8 suffix[] __attribute__((aligned(8)));
|
/* Keep suffix aligned to 8 bytes */
|
||||||
#elif defined _MSC_VER
|
guint _padding;
|
||||||
__declspec(align (8)) guint8 suffix[];
|
|
||||||
#else
|
|
||||||
guint8 suffix[];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
guint8 suffix[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Ensure our suffix data aligns to largest guaranteed offset
|
/* Ensure our suffix data aligns to largest guaranteed offset
|
||||||
|
Loading…
Reference in New Issue
Block a user