[glib] Backport g(s)size -> g(u)intptr atomics
gcc 14 and clang 15 disallow implicit integer-to-pointer conversion by
default. This was done for safety reasons with archs that use 128bit
pointers. Versions of glib prior to 2.80 used gsize
/gssize
as the
return type of g_atomic_pointer_*
, which would not be large enough to
hold a pointer on 128bit archs as gsize
/gssize
are generally aliased
to ulong
/long
.
This commit backports Alex Richardson's commit 1 which updates the
return types, and additionally integrates Philip Withnall's commit 2
that migrates from __sync_fetch_*
to __atomic_*
intrinsics.
This patch allows pkg-config to be compiled using default CFLAGS on gcc 14 and later, and clang 15 and later.
Of course, this is all a bit silly, as pkg-config doesn't even use these
features, and they could just be removed, but that might be more effort
than backporting the patch.
- Co-Authored-By: Alex Richardson arichardson@FreeBSD.org
- Co-Authored-By: Philip Withnall withnall@endlessm.com
- Signed-Off-By: Dan Fuhry dan@fuhry.com