There’s (deliberately) a bit of race in implementing/handling
`CloseBeforeReturning()` in `gdbus-method-invocation.c`. If the server
closes the D-Bus connection early, the client may exit with `SIGTERM` if
`GDBusConnection:exit-on-close` is set. We don’t want that, as the test
is trying to check that the default handling of a D-Bus method return
after a connection has closed works.
See https://gnome.pages.gitlab.gnome.org/-/glib/-/jobs/1935191/artifacts/_build/meson-logs/testlog.txt
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Move msvc warnings in meson.build file from line 24 to line 469 to group
them next to gcc/clang warnings. So it is easier to see warnings flags
for all platforms at once.
G_GNUC_UNUSED does perfectly its job with gcc compiler but the warning
still remains with msvc compiler.
Once the unused variable removed, the finalize vfunc can be removed as
it's doing the same job as the parent function.
We must not open the fd with O_PATH|O_NOFOLLOW,
since the portal rejects that combination. Leaving
out O_NOFOLLOW is fine in this case - we know it
is a directory, we just received EISDIR.
Fixes: #2629
The C++ variant implements type safety differently, to avoid warnings
from C++ compilers about:
```
../../../gnome-commander-1.14.2/src/intviewer/searcher.cc:303:5: error: cannot initialize a parameter of type 'gint *' (aka 'int *') with an rvalue of type 'void *'
g_atomic_int_compare_and_exchange ((gint*)&src->priv->progress_value, oldval, (gint)d);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux/gnome-commander/1.14.2-r0/recipe-sysroot/usr/include/glib-2.0/glib/gatomic.h:160:44: note: expanded from macro 'g_atomic_int_compare_and_exchange'
__atomic_compare_exchange_n ((atomic), (void *) (&(gaicae_oldval)), (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This complements the existing C++ variant for
`g_atomic_pointer_compare_and_exchange()`, and fixes a regression on C++
from https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2114.
With the addition of the unit tests in the previous commit, this is
effectively tested by the FreeBSD and macOS CI jobs, as they use
`clang++` in C++ mode. `g++` doesn’t seem to emit a warning about this.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2625
The tests have to be conditional on C++11 being enabled, as the default
C++ standard on macOS is (for some reason), C++97 (`__cplusplus` is
defined as `199711L`).
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #2625