gmain: Fix use of atomic primitives with sig_atomic_t
It seems that `sig_atomic_t` is not the same width as `int` on FreeBSD, which is causing CI failures: ``` ../glib/gmain.c:5206:3: error: '_GStaticAssertCompileTimeAssertion_73' declared as an array with a negative size g_atomic_int_set (&any_unix_signal_pending, 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../glib/gatomic.h:100:5: note: expanded from macro 'g_atomic_int_set' G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Fix that by only using `sig_atomic_t` if the code is *not* using atomic primitives (i.e. in the fallback case). `sig_atomic_t` is only a typedef around an integer type and is not magic. Its typedef is chosen by the platform to be async-signal-safe (i.e. read or written in one instruction), but not necessarily thread-safe. Signed-off-by: Philip Withnall <email@example.com>
Showing with 13 additions and 4 deletions
Seems fine to me
Thanks, sorry for the cock-up.