mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 09:46:17 +01:00
GBitLock: turn assumptions of g_futex_int_address into a static assertion
We'll probably never encounter a platform where these fail, but that's what static assertions are for... https://bugzilla.gnome.org/show_bug.cgi?id=548954
This commit is contained in:
parent
fc731de929
commit
1425aa664d
@ -366,6 +366,12 @@ g_futex_int_address (const volatile void *address)
|
||||
{
|
||||
const volatile gint *int_address = address;
|
||||
|
||||
/* this implementation makes these (reasonable) assumptions: */
|
||||
G_STATIC_ASSERT (G_BYTE_ORDER == G_LITTLE_ENDIAN ||
|
||||
(G_BYTE_ORDER == G_BIG_ENDIAN &&
|
||||
sizeof (int) == 4 &&
|
||||
(sizeof (gpointer) == 4 || sizeof (gpointer) == 8)));
|
||||
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN && GLIB_SIZEOF_VOID_P == 8
|
||||
int_address++;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user