Commit Graph

2822 Commits

Author SHA1 Message Date
Emmanuele Bassi
9723c5595c ci: Use meson compile rather than bare ninja
This makes it more consistent with `meson setup` in the rest of the
file.
2023-08-16 13:07:05 +01:00
René de Hesselle
0c73ff3a08 meson: Use 'meson setup' to configure
This removes a deprecation warning when using 'meson' without 'setup'.
2023-08-16 13:06:40 +01:00
Philip Withnall
627dc1415c Revert "build-sys: drop -mms-bitfields GCC flag"
This reverts commit 252bbcd207.

After further discussion in !3511, we’ve decided that there are risks
associated with this change, and it’s not the best way of addressing the
original problem.

The original motivation for the change turned out to be that
`-mms-bitfields` was not handled by `windres`, which was receiving it
from `pkg-config --cflags glib-2.0` in some projects. However, if
`windres` is claiming to accept CFLAGS then it should accept (and
ignore) `-mms-bitfields`, since the `-m` family of options are defined
in `man gcc`, just like `-I`, `-D`, etc.

There is some question that there might still be third party projects
which are built with an old enough compiler that `-mms-bitfields` is not
the compiler default. For that reason, we should either still continue
to specify `-mms-bitfields` in the `.pc` file, or add a test to assert
that third party projects are always compiled with `-mms-bitfields` set.
But adding a new test for all third-party compilations is risky (if we
get it wrong, things will break; and it’s a test which may behave
differently on different platforms), so it seems safer to just keep
`-mms-bitfields` in `.pc` for now.

Once all compilers which we require specify `-mms-bitfields` by default,
we can finally drop this flag (without adding a test for third-party
compilations).

See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3511
2023-07-29 11:54:22 +03:00
Simon McVittie
be2c9220d6 testutils: Factor out g_test_disable_crash_reporting()
We're already repeating this in 4 places, and in a subsequent commit
I'll extend it to do more.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-07-26 15:41:47 +01:00
Philip Withnall
e051f4abaf Merge branch 'win32' into 'main'
build-sys: drop -mms-bitfields GCC flag

See merge request GNOME/glib!3509
2023-07-24 15:52:10 +00:00
Marc-André Lureau
252bbcd207 build-sys: drop -mms-bitfields GCC flag
This flag is problematic for some usages, and is no longer needed since
~2012 GCC 4.7 (https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a6c467624ade35128)

It is dropped from MINGW since:
https://github.com/msys2/MINGW-packages/pull/12891

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2023-07-24 14:45:09 +04:00
Philip Withnall
9b80774ca7 Merge branch 'fileinfo-filepath' into 'main'
gfileinfo: add file_path methods for language bindings

See merge request GNOME/glib!3461
2023-07-22 05:27:12 +00:00
Jason Francis
04b683c34f gfileinfo: add file_path methods for language bindings
Including some tests by Philip Withnall.
2023-07-21 21:24:50 +01:00
Philip Withnall
741a561c4d Merge branch 'supported-platforms-docs' into 'main'
docs: Expand supported platforms documentation a little

See merge request GNOME/glib!3485
2023-07-14 11:57:03 +00:00
Marco Trevisan
4cf6c78512 Merge branch 'codegen-docs' into 'main'
gdbus-codegen: Fix some minor typos in the documentation

See merge request GNOME/glib!3477
2023-07-05 11:58:20 +00:00
Marco Trevisan
14907d2f77 Merge branch 'backports-typo-fix' into 'main'
docs: Fix a typo in the backports policy

See merge request GNOME/glib!3484
2023-06-29 16:54:22 +00:00
Philip Withnall
0c640f0130 docs: Document issue and merge request triaging and review guidelines
This documents the practices that I’ve been trying to follow for the
last few years for managing GLib issues and merge requests, and why they
seem to work well enough.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-06-29 16:50:00 +01:00
Philip Withnall
05b861db8b docs: Expand supported platforms documentation a little
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-06-29 15:51:44 +01:00
Philip Withnall
7c6d306927 docs: Fix a typo in the backports policy
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-06-29 15:40:59 +01:00
Philip Withnall
28ad519ff8 gdbus-codegen: Fix some minor typos in the documentation
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-06-27 14:23:01 +01:00
Emmanuele Bassi
6fc6d9ea3e Merge branch 'ebassi/keyfile-docs' into 'main'
docs: Use the type name as the section name for GKeyFile

See merge request GNOME/glib!3453
2023-05-31 01:05:34 +00:00
Emmanuele Bassi
23a9dbdaf6 Allow proper introspection of GTypeValueTable
The introspection scanner cannot deal very well with function pointers
into a plain structure. In order to document the various function
pointers in GTypeValueTable we need to create typed callbacks, and
use them to replace the anonymous function pointers inside the
structure. This not only allows us to properly document the function
pointers, but it also allows us to annotate the arguments and return
value of those function pointers.

See also: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/400#note_1721707
2023-05-30 14:38:16 +01:00
Emmanuele Bassi
28e8f5c136 docs: Rename the GBookmarkFile section
Use the type name, to ensure that the section docblock gets merged into
the type docblock in the introspection data.

Helps: #2961
2023-05-30 13:33:45 +01:00
Emmanuele Bassi
4386d912d7 docs: Use the type name as the section name for GKeyFile
Without this, the section docblock for GKeyFile disappears into the
ether when generating the introspection data.

Helps: #2961
2023-05-30 12:46:30 +01:00
Philip Withnall
153c7f7b99 Merge branch 'wip/p3732/truncate-middle' into 'main'
gutf8: Add a g_utf8_truncate_middle() function

See merge request GNOME/glib!3440
2023-05-30 11:02:03 +00:00
Philip Withnall
57087ff42d Merge branch 'remove-action-entries' into 'main'
gactionmap: Add g_action_map_remove_action_entries()

See merge request GNOME/glib!3450
2023-05-26 09:47:30 +00:00
Guido Günther
b3b23072f3 gactionmap: Add g_action_map_remove_action_entries()
Since we have a convenience method to add actions let's allow to remove
them just as easily. This makes resource cleanup as simple as initially
adding the entries.
2023-05-26 10:30:40 +01:00
Peter Eisenmann
cd3837174b gutf8: Add a g_utf8_truncate_middle() function
Adds a helper to truncate UTF8 strings in the middle, allowing to make
them fit certain size constraints.

This function is modeled after similar functionality that has existed
since 2008 in nautilus and in eel before that.
2023-05-25 00:36:56 +02:00
Philip Withnall
f6f250fc38 docs: Move README.win32.md to the docs folder
It’s a bit confusing to have two files called `README`, especially given
that `README.win32.md` only contains build instructions and none of the
other overview/contribution/bug reporting information that `README.md`
contains.

It feels like these would be better organised by having one top-level
`README.md`, and pointing to the Windows build instructions from there.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-05-24 16:19:47 +01:00
Sonny Piers
0b73d72a44 gio: Add g_file_new_build_filenamev 2023-05-23 10:14:28 +00:00
Peter Eisenmann
afdab4f493 gstring: add g_string_new_take
Adds a GString constructor that takes over ownership of an existing,
dynamically allocated, string.
2023-05-16 11:27:45 +01:00
Philip Withnall
eee3885077 Merge branch 'gtk-plus' into 'main'
Rename GTK+ to GTK (mostly comments and documentation)

See merge request GNOME/glib!3429
2023-05-10 08:39:58 +00:00
Philip Withnall
329213f742 Merge branch 'main' into 'main'
gtestutils: Improve g_assert_cmpuint

Closes #2997

See merge request GNOME/glib!3424
2023-05-10 08:35:27 +00:00
Arnaud Rebillout
f722f11e57 Rename GTK+ to GTK (mostly comments and documentation)
GTK lost it's '+' suffix back in 2019, according to
<https://mail.gnome.org/archives/gtk-devel-list/2019-February/msg00000.html>

This commit can be re-generated with:

    git grep -l GTK+ \
    | grep -v -e ^NEWS -e ^glib/tests/collate.c \
    | xargs sed -i 's/GTK+/GTK/g'

Most of the changes are in comments and documentation.
2023-05-10 10:56:44 +07:00
Eric Blake
2ab2ce57e6 gtestutils: Improve g_assert_cmpuint
While x86_64 has enough precision in long double to do a round trip
from guint64 to long double and back, this is platform-specific, and
is a disservice to users trying to debug failing unit tests on other
architectures where it loses precision for g_assert_cmp{int,uint,hex}.
See also https://bugzilla.gnome.org/show_bug.cgi?id=788385 which
mentions having to add casts to specifically silence the compiler on
platforms where the precision loss occurs.

Meanwhile, g_assert_cmpuint() does an unsigned comparison, but outputs
signed values if the comparison fails, which is confusing.

Fix both issues by introducing a new g_assertion_message_cmpint()
function with a new 'u' numtype.  For backwards compatibility, the
macros still call into the older g_assertion_message_cmpnum() when not
targetting 2.78, and that function still works when passed 'i' and 'x'
types even though code compiled for 2.78 and later will never invoke
it with numtype anything other than 'f'.  Note that g_assert_cmpmem
can also take advantage of the new code, even though in practice,
comparison between two size_t values representing array lengths that
can actually be compiled is unlikely to have ever hit the precision
loss.  The macros in signals.c test code does not have to worry about
versioning, since it is not part of the glib library proper.

Closes #2997
Signed-off-by: Eric Blake <eblake@redhat.com>
2023-05-09 08:28:09 -05:00
Marco Trevisan
08aee6b5f4 Merge branch 'unixfdlist-again' into 'main'
docs: Don’t ignore gunixfdlist.h when building docs on Windows

See merge request GNOME/glib!3409
2023-05-09 12:53:19 +00:00
Philip Withnall
63e1e83c33 Merge branch 'wip/p3732/timeout-seconds-once' into 'main'
add g_timeout_add_seconds_once

See merge request GNOME/glib!3383
2023-05-09 12:50:39 +00:00
Patrick Griffis
de2ff26454 Merge branch '116-utf8-docs' into 'main'
docs: Document high-level UTF-8 requirements for GLib

Closes #116

See merge request GNOME/glib!3414
2023-05-02 19:20:30 +00:00
Philip Withnall
ff315e8407 docs: Fix list formatting in supported-platforms.md
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-05-02 14:34:21 +01:00
Philip Withnall
377e8a2d9e docs: Update various broken/redirected links
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-05-02 14:26:52 +01:00
Peter Eisenmann
3abf23b2a7 add g_timeout_add_seconds_once
Add a new call combing behaviors of g_timeout_add_seconds and
g_timeout_add_once.
2023-05-02 13:42:54 +02:00
Philip Withnall
5803a24826 docs: Add lb90 as a Windows maintainer
They’ve been actively doing good work.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-05-02 11:19:31 +01:00
Philip Withnall
0e941418d1 docs: Document high-level UTF-8 requirements for GLib
I’ve finally found the right place in the docs to put this stuff.

This doesn’t auto-link this section from every string in the GLib
documentation, but I think that at this point (with gtk-doc in
maintenance mode, and gi-docgen not fully applied to GLib) I don’t think
we can do any better. The perfect is the enemy of the good, and having
this stuff documented somewhere means that someone can link to it from
multiple places in future *somehow*.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #116
2023-05-02 10:41:50 +01:00
Patrick Griffis
8a67f0c5c2 Merge branch 'old-txt-docs' into 'main'
docs: Update/Drop txt documents from docs directory

See merge request GNOME/glib!3408
2023-04-29 03:31:05 +00:00
Patrick Griffis
f009d8e368 Merge branch '2289-setuid-docs' into 'main'
docs: Document that GIO should not be used in privileged processes

Closes #2289

See merge request GNOME/glib!3413
2023-04-29 03:28:10 +00:00
Philip Withnall
f42e04d247 docs: Document that GIO should not be used in privileged processes
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #2289
2023-04-28 11:11:03 +01:00
Philip Withnall
e43b2452b9 docs: Add high-level documentation about malloc failure
While I’m here.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-04-28 11:01:25 +01:00
Philip Withnall
3b9fc71644 docs: Mention that calls after fork() must be async-signal-safe
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2958
2023-04-28 11:00:33 +01:00
Philip Withnall
9b8369852b Merge branch 'html-doc-flag' into 'main'
meson: wrap html documentation generation with gtk_doc option

See merge request GNOME/glib!3399
2023-04-28 01:09:04 +00:00
James Knight
0fa17ec3c7 meson: wrap html documentation generation with gtk_doc option
By default, if a host environment has the `rst2html5` application
available, builds will automatically perform some HTML documentation
generation from the documentation's glib reference content (e.g.
creating `gvariant-specification-1.0.html`). The creation of this
documentation is not required for all use cases.

This commit tweaks the building of the HTML-based GLIB specification
document to be guarded by `gtk_doc`.

Signed-off-by: James Knight <james.d.knight@live.com>
2023-04-27 20:23:30 -04:00
Philip Withnall
dda319c7db docs: Port docs/macros.txt to Markdown and update it
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-04-28 00:07:12 +01:00
Philip Withnall
dc95b911f3 docs: Drop outdated docs/debugging.txt
Most of the document was about traps, which have not existed since
commit 58cdf0b474, 10 years ago.

The rest of the document was about `GOBJECT_DEBUG`, and that information
would be more easily findable in the full GObject documentation — so
move it there and update it a bit.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-04-27 23:56:59 +01:00
Philip Withnall
7922d3200c Merge branch 'resolver-thread-pool' into 'main'
gthreadedresolver: Switch to using a separate thread pool and support timeouts

See merge request GNOME/glib!3397
2023-04-27 12:46:53 +00:00
Philip Withnall
bf92bae481 gresolver: Add GResolver:timeout property
Without a timeout, some lookup requests can go on forever, typically due
to bugs in underlying systems.

This can have particularly significant effects on the Happy Eyeballs
algorithm in `GSocketClient`, which relies on multiple name lookups as
its first step.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #2866
2023-04-27 12:23:25 +01:00
Emmanuele Bassi
e2e93056f2 Add init macros for refcounting types
We need a way to initialise refcounted types placed in static storage,
or on the stack. Using proper macros avoids knowing the magic constant
used for grefcount and gatomicrefcount.
2023-04-24 12:48:32 +01:00