Merge branch 'wip/3v1n0/sys-64-clang' into 'main'

gatomic: Cast the oldval pointer type to the atomic value type, and add msys2-clang64 scheduled CI job

Closes #2798

See merge request GNOME/glib!3031
This commit is contained in:
Philip Withnall
2022-10-31 12:24:10 +00:00
8 changed files with 78 additions and 35 deletions

View File

@@ -241,7 +241,8 @@ G_END_DECLS
* https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715#note_1024120. */
#define g_atomic_pointer_compare_and_exchange(atomic, oldval, newval) \
(G_GNUC_EXTENSION ({ \
G_STATIC_ASSERT (sizeof (oldval) == sizeof (gpointer)); \
G_STATIC_ASSERT (sizeof (static_cast<glib_typeof (*(atomic))>((oldval))) \
== sizeof (gpointer)); \
glib_typeof (*(atomic)) gapcae_oldval = (oldval); \
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
(void) (0 ? (gpointer) *(atomic) : NULL); \

View File

@@ -1143,7 +1143,7 @@ write_to_file (const gchar *contents,
{
gssize s;
s = write (fd, contents, MIN (length, G_MAXSSIZE));
s = write (fd, contents, MIN (length, G_MAXSIZE));
if (s < 0)
{

View File

@@ -3,6 +3,13 @@
extra_gnulib_args = cc.get_supported_arguments([
'-Wno-format-nonliteral', '-Wno-duplicated-branches'])
if host_system == 'windows' and cc.get_id() == 'clang'
extra_gnulib_args += cc.get_supported_arguments([
'-Wno-unused-but-set-variable',
'-Wno-implicit-fallthrough',
])
endif
math_h_config = configuration_data ()
unneeded_funcs = [

View File

@@ -186,7 +186,11 @@ test_steal_pointer (void)
int
main (int argc, char *argv[])
{
#if __cplusplus >= 201103L
g_test_init (&argc, &argv, NULL);
#else
g_test_init (&argc, &argv, static_cast<void *>(NULL));
#endif
g_test_add_func ("/C++/typeof", test_typeof);
g_test_add_func ("/C++/atomic-pointer-compare-and-exchange", test_atomic_pointer_compare_and_exchange);