We had gcc-only implementations for them while both can be used in all
the supported platforms we have.
So let's just provide generic definitions, while we keep the old ones
for both consistency and retro-compatibility.
If a `.la` file is empty, `lt_libdir` and/or `lt_dlname` won’t be set,
but will then still be used in `g_strconcat()`, leading to invalid
output.
Detect that and return an error.
Adds a unit test.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Coverity CID: #1474756
These headers have all been written manually, by looking through the git
log for each file and noting the copyright of each significant
contribution.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #1415
There’s a precondition assertion on the function which checks that
`group_name != NULL`.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Coverity CID: #1474780
It’s failed on a CI machine
(https://gitlab.gnome.org/GNOME/glib/-/jobs/2006694) with log:
```
[unused] => pushed 100 threads onto the idle pool
[unused] stopping unused threads
[unused] waiting ONE second for threads to die
[unused] waiting ONE second for threads to die
[unused] waiting ONE second for threads to die
[unused] waiting ONE second for threads to die
[unused] waiting ONE second for threads to die
[unused] stopped idle threads, 9 remain
Bail out! GLib:ERROR:../glib/tests/thread-pool-slow.c:113:test_thread_stop_unused: assertion failed (g_thread_pool_get_num_unused_threads () == 0): (9 == 0)
```
I can’t reproduce this locally, but it’s possible that it failed because
a one second wait was not enough to enqueue all the jobs (on a heavily
loaded machine), and hence some jobs spawned thread pool threads after
calling `g_thread_pool_stop_unused_threads()`, leading to the assertion
failure.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
While `gio_xdgmime` is unlocked, the data which `type` points to in the
xdgmime cache might get invalidated, leaving `type` as a dangling
pointer. That would not bode well for the `g_strdup (type)` call to
insert a new entry into the `type_comment_cache` once `gio_xdgmime` is
re-acquired.
This was spotted using static analysis, and the symptoms have not
knowingly been seen in the wild.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Coverity CID: #1474702
We should mention glib-mkenums in the documentation for
G_DEFINE_ENUM_TYPE and G_DEFINE_FLAGS_TYPE.
We should also mention the macros in the documentation for glib-mkenums.
This way, developers can choose the most appropriate tool for their use
case.
While you might want to use automated tools like glib-mkenums to
generate enumeration types for your library, it's often not entirely
necessary to complicate your build system in order to handle a couple of
enumerations with few values.
Just like we have G_DEFINE macros for object, interface, pointer, and
boxed types, we should provide macros for defining enum and flags types.
We have fallback in places for GNU's variadic arguments in macros, and
for static inline functions with variadic arguments as an fallback of
last resort, but going forward we are going to depend on `__VA_ARGS__`
for macros that cannot be re-implemented using a static inline function.
Fixes: #2681
Since the macOS CI jobs are run on a machine which isn’t using a
pre-made container image, we can’t ship a cached version of the
subproject, so it has to be pulled as a git submodule.
GitLab doesn’t do that by default unless you set
`GIT_SUBMODULE_STRATEGY` to something other than `none`.
See https://docs.gitlab.com/ee/ci/git_submodules.html
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Some of the CI runners disable ptrace, as they’re running inside a
container and ptrace would allow container escape. On those systems, gdb
can’t work, so skip the gdb test.
Add some additional stderr debug output to make it clear that’s the
case.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>