Commit Graph

21710 Commits

Author SHA1 Message Date
Martin Storsjö
5ed1e39865 gregistrysettings: Fix a mismatched error format string 2020-04-27 16:26:04 +03:00
Martin Storsjö
4cf4dbfc1e meson: Add -Wno-format-zero-length for gcc/clang builds
Zero length format strings isn't something that needs to be warned
about.
2020-04-27 16:26:04 +03:00
Martin Storsjö
fcc7489d46 meson: Fix the gnulib checks for isnan* functions
The gnulib math code uses __builtin_isnanf and __builtin_isnanl
within the __GNUC__ >= 4 ifdef, and clang doesn't provide those
builtins, only the one without a suffix. Make the meson check
match the code it controls, using the exactly right builtins.

Set REPLACE_ISNAN to 1 if either of the have_isnan* functions failed,
this matches how gnulib's m4 routines does it (in gnulib/m4/isnan.m4).

This fixes the isnan functions in the gnulib math header replacement
work on Clang.
2020-04-25 22:16:10 +03:00
Ross Burton
2709d5e1bb gio/tests/memory-monitor-*.py.in: skip if 3rd party modules not available
The GIO tests memory-monitor-dbus and memory-monitor-portal use a number
of third party Python modules that may not be present when running the
test case.

Instead of failing due to missing imports, catch the ImportError and
mock a test case that skips.  This can't use the usual unittest.skip
logic because the test case class itself uses a 3rd party module.

Closes #2083.
2020-04-23 15:01:25 +01:00
Philip Withnall
de8708cd95 Merge branch 'wip/oholy/fast-content-type' into 'master'
gfile: Fallback to fast-content-type if content-type is not set

See merge request GNOME/glib!1442
2020-04-14 15:48:43 +00:00
Philip Withnall
fa76bde252 Merge branch 'tap' into 'master'
gio: use TAPTestRunner in the memory monitor tests

See merge request GNOME/glib!1443
2020-04-09 14:33:09 +00:00
Philip Withnall
0f8399fe2c Merge branch 'checks-asserts' into 'master'
Meson: Add glib-checks and glib-asserts options

See merge request GNOME/glib!1444
2020-04-09 14:09:13 +00:00
Ross Burton
1fcd32a159 gio: use TAPTestRunner in the memory monitor tests
There are two memory monitor tests that use Python's unittest module directly,
but GLib tests should be outputting TAP.  Use the embedded TAPTestRunner to
ensure that TAP is output for these tests too.
2020-04-09 14:55:39 +01:00
Xavier Claessens
be3728b9fa Meson: Add glib_checks and glib_asserts options
In cases where performance are critical it can be useful to disable
checks and asserts. GStreamer has those options too, using the same name
and setting them yielding means we can set those options on the main
project (e.g. gst-build) and glib will inherit the same value when built
as subproject.
2020-04-09 09:17:35 -04:00
Sebastian Dröge
12d79a3f7a Merge branch 'update-gvdb' into 'master'
Update gvdb

Closes #2

See merge request GNOME/glib!1446
2020-04-09 12:43:15 +00:00
Philip Withnall
683cf4c642 Merge remote-tracking branch 'gvdb/master' into update-gvdb
Bring in uninitialised memory fixes from
https://gitlab.gnome.org/GNOME/gvdb/issues/2.
2020-04-09 13:10:30 +01:00
Philip Withnall
82a557502d Merge branch '1841-cancellable-race-fix' into 'master'
Resolve "Signal handler disconnection race when finalising GCancellableSource"

Closes #1841

See merge request GNOME/glib!1400
2020-04-09 12:00:52 +00:00
Philip Withnall
bd45f71abb Merge branch 'override-dependency' into 'master'
Meson: Override every dependency glib provides

See merge request GNOME/glib!1441
2020-04-09 11:51:46 +00:00
Ondrej Holy
461052f66e gfile: Fallback to fast-content-type if content-type is not set
The G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE attribute doesn't have to be
always set. See https://gitlab.gnome.org/GNOME/gvfs/-/merge_requests/68
for more details. In that case, the g_file_query_default_handler function
fails with the "No application is registered as handling this file" error.
Let's fallback to the "standard::fast-content-type" attribute instead to
fix issues when opening such files.

https://gitlab.gnome.org/GNOME/nautilus/-/issues/1425
2020-04-07 14:56:49 +02:00
Xavier Claessens
10280deebd Meson: Override every dependency glib provides
Meson 0.54.0 added a new method meson.override_dependency() that must be
used to ensure dependency consistency. This patch ensures a project that
depends on glib will never link to a mix of system and subproject
libraries. It would happen in such cases:

The system has glib 2.40 installed, and a project does:
dependency('glib-2.0', version: '>=2.60',
  fallback: ['glib', 'glib_dep'])
dependency('gobject-2.0')

The first call will configure glib subproject because the system libglib
is too old, but the 2nd call will return system libgobject.

By overriding 'gobject-2.0' dependency while configuring glib subproject
during the first call, meson knows that on the 2nd call it must return
the subproject dependency instead of system dependency.

This also has the nice side effect that with Meson >0.54.0 an
application depending on glib can declare the fallback without knowing
the dependency variable name: dependency('glib-2.0', fallback: 'glib').
2020-04-05 00:34:04 -04:00
Philip Withnall
1a3a1865eb Merge branch 'gmarkup-more-unit-tests' into 'master'
gmarkup tests: tab character escape/unescape

See merge request GNOME/glib!1437
2020-04-03 19:16:42 +00:00
Sebastian Dröge
a136776e81 Merge branch 'wip/oholy/gio-tool-docs' into 'master'
docs: Mention new gio tool options

See merge request GNOME/glib!1432
2020-04-03 15:03:05 +00:00
Sébastien Wilmet
50a3064933 gmarkup tests: tab character escape/unescape
"\t" is not escaped by g_markup_escape_text(), as per its documentation:

"Note that this function doesn't protect whitespace and line endings
from being processed according to the XML rules for normalization of
line endings and attribute values."

The relevant portion of the XML specification
https://www.w3.org/TR/xml/#AVNormalize

"For a character reference, append the referenced character to the
normalized value."
"For a white space character (#x20, #xD, #xA, #x9), append a space
character (#x20) to the normalized value."

So the unescape code in GMarkup does the right thing as can be verified
by the added valid-17.* data files for the markup-parse unit test.

(Note that the valid-13.* data files already tested a plain tab
character in an attribute value, among other white space characters).

Note that the libxml2's xmlSetProp() function escapes "\t" into the
character reference "	".

See https://gitlab.gnome.org/GNOME/glib/-/issues/2080
2020-04-03 16:30:27 +02:00
Sebastian Dröge
4530aac317 Merge branch 'sync-valgrind' into 'master'
glib: Update internal copy of valgrind.h from Valgrind 3.15 release

See merge request GNOME/glib!1436
2020-04-03 13:12:36 +00:00
Sebastian Dröge
dde780fd1b Merge branch '2081-dbus-error-messages' into 'master'
gdbusmessage: Fix swapped signatures in error messages

Closes #2081

See merge request GNOME/glib!1435
2020-04-03 12:35:58 +00:00
Sebastian Dröge
5a540c8bca Merge branch 'dbus-signal-sender-nullability' into 'master'
gdbusconnection: Clarify nullability of SignalInstance.sender

See merge request GNOME/glib!1434
2020-04-03 12:11:58 +00:00
Philip Withnall
f07e5f6d08 glib: Update internal copy of valgrind.h from Valgrind 3.15 release
Update our copy of valgrind.h from the Valgrind 3.15 release tarball,
and then re-apply our downstream change af0e0cb995. No other
changes made.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-04-03 13:03:31 +01:00
Sebastian Dröge
87cd6a4a19 Merge branch 'fix-buildtype-usage' into 'master'
meson: Fix buildtype usage

See merge request GNOME/glib!1433
2020-04-03 11:58:56 +00:00
Philip Withnall
8f938ebe27 gdbusmessage: Fix swapped signatures in error messages
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #2081
2020-04-03 12:42:49 +01:00
Philip Withnall
88d526534a Merge branch 'wip/tintou/gdbussignalcallback' into 'master'
gdbusconnection: GDBusSignalCallback can have a NULL sender_name

See merge request GNOME/glib!1425
2020-04-03 11:33:46 +00:00
Philip Withnall
5a74c2f445 gdbusconnection: Clarify nullability of SignalInstance.sender
Following on from !1425.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-04-03 12:16:49 +01:00
Nirbheek Chauhan
b462e2c80c meson: Use the b_vscrt option for selecting the CRT
This option has been available since 0.48, and we should use it
instead of only guessing based on buildtype.
2020-04-03 16:39:22 +05:30
Nirbheek Chauhan
e7cfe62e73 meson: Fix check for builtype arguments
`get_option('buildtype')` will return `'custom'` for most combinations
of `-Doptimization` and `-Ddebug`, but those two will always be set
correctly if only `-Dbuildtype` is set. So we should look at those
options directly.

For the two-way mapping between `buildtype` and `optimization`
+ `debug`, see this table:
https://mesonbuild.com/Builtin-options.html#build-type-options
2020-04-03 16:39:22 +05:30
Corentin Noël
565ba0dbd1 gdbusconnection: GDBusSignalCallback can have a NULL sender_name
On a peer GDBusConnection, the returned sender_name can be NULL
2020-04-03 08:01:44 +02:00
Ondrej Holy
5737d064f9 docs: Mention new gio tool options
New features were added for gio tool, but they are not mentioned in
man pages as it is not generated from GOptionEntry in contrast to the
help output. Let's update the man pages to reflect the recent changes.
2020-04-02 13:23:09 +02:00
Sebastian Dröge
b4d6849c83 Merge branch 'mingw-arch' into 'master'
Fix arch detection ifdefs in glib/valgrind.h

See merge request GNOME/glib!1429
2020-04-01 11:58:39 +00:00
Sebastian Dröge
f62ca931a7 Merge branch 'fno-common-extern' into 'master'
Add missing 'extern' to the dllexport version of GLIB_VAR/GOBJECT_VAR

See merge request GNOME/glib!1428
2020-04-01 11:27:39 +00:00
Sebastian Dröge
aa5cb26c6e Merge branch 'gdbusegdoc' into 'master'
docs: Fix configuration with gtk_doc=true and installed_tests=false

See merge request GNOME/glib!1424
2020-04-01 11:20:59 +00:00
Sebastian Dröge
be85e234b7 Merge branch 'fix-heap-corruption' into 'master'
glib-unix.c: fix heap corruption in g_unix_get_passwd_entry

See merge request GNOME/glib!1431
2020-04-01 11:10:12 +00:00
Alexander Kanavin
473b3b4ce4 glib-unix.c: fix heap corruption in g_unix_get_passwd_entry
malloc() was given too small value (size of pointer,
rather than struct it points to), and subsequent call
getpwnam_r() wrote past the end of allocated block - easily
seen with valgrind.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
2020-04-01 12:39:52 +02:00
disigma
dcd15a10d2
meson: Exclude gosxutils.m when building for iOS
For ios, the Cocoa header file does not exist, which causes compilation errors
2020-04-01 14:32:26 +08:00
Martin Storsjö
af0e0cb995 Fix arch detection ifdefs in glib/valgrind.h
Don't assume that __MINGW32__ implies x86; Windows runs on ARM/ARM64
as well, and there are mingw toolchains that target those architectures.

This mirrors how the MSVC part of the same expressions are written,
as (defined(_WIN32) && defined(_M_IX86)) and
(defined(_WIN64) && defined(_M_X64)) - not relying on _WIN32/_WIN64
or __MINGW32__/__MINGW64__ alone to indicate architecture.
2020-03-31 23:27:53 +03:00
Martin Storsjö
fdfadfc276 Add missing 'extern' to the dllexport version of GLIB_VAR/GOBJECT_VAR
The __declspec(dllexport) attribute in itself doesn't imply
'extern' - thus any intended variable declaration with
GLIB_VAR/GOBJECT_VAR would actually be a variable definition. With
C compilers defaulting to -fcommon, this isn't an issue, but
upcoming compilers (GCC 10 and Clang 11) will default to -fno-common,
ending up with duplicate definitions of these variables.
2020-03-31 23:22:26 +03:00
Sebastian Dröge
50355361e6 Merge branch 'icon-docs' into 'master'
gicon: Clarify GVariant refcounting in docs

See merge request GNOME/glib!1427
2020-03-31 14:49:53 +00:00
Sebastian Dröge
2b9f2b71db Merge branch 'unicode-version-docs' into 'master'
gunidecomp: Update and reformat Unicode version support history

See merge request GNOME/glib!1426
2020-03-31 14:15:06 +00:00
Philip Withnall
f6ed9503d0 gicon: Clarify GVariant refcounting in docs
Slightly unexpectedly, `g_icon_serialize()` doesn’t produce a floating
`GVariant`, it produces one with full ownership and returns that. That’s
not the convention for `GVariant` return values from functions which
build variants, but there’s nothing we can do to change this now as that
would be an API break.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-31 14:27:00 +01:00
Philip Withnall
0ce0701893 gunidecomp: Update and reformat Unicode version support history
To aid https://stackoverflow.com/q/60949426/2931197.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-31 14:18:32 +01:00
Yosef Or Boczko
eae7b0274c Update Hebrew translation
(cherry picked from commit 2443c6bb46)
2020-03-30 17:38:47 +00:00
Chris Mayo
84ad802c3a docs: Fix configuration with gtk_doc=true and installed_tests=false
Skip the gdbus-object-manager-example which is generated as part of
testing.

Program xsltproc found: YES (/usr/bin/xsltproc)
Run-time dependency gtk-doc found: YES 1.32

docs/reference/gio/gdbus-object-manager-example/meson.build:1:0: ERROR:
Unknown variable "libgdbus_example_objectmanager_dep".
2020-03-27 19:33:12 +00:00
Emmanuele Bassi
2b741aaf36 Merge branch 'unref-warning' into 'master'
gobject: Clarify assertion failure on ref-after-finalize

See merge request GNOME/glib!1423
2020-03-23 12:30:20 +00:00
Philip Withnall
641bbd0848 gobject: Clarify assertion failure on ref-after-finalize
Rename the variables involved so that people get a slightly more
obvious critical warning when they try to ref an object which has
already been finalised.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-23 11:48:22 +00:00
Daniel Șerbănescu
eb0f73a39c Update Romanian translation
(cherry picked from commit e62cd323c3)
2020-03-19 10:54:20 +00:00
Sebastian Dröge
697905d0bc Merge branch 'unicode13' into 'master'
glib: Update Unicode Character Database to version 13.0.0

See merge request GNOME/glib!1422
2020-03-19 08:08:22 +00:00
Philip Withnall
a19e554517 glib: Update Unicode Character Database to version 13.0.0
Using commands:
```
glib/gen-unicode-tables.pl -both 13.0.0 path/to/UCD
tests/gen-casefold-txt.py 13.0.0 path/to/UCD/CaseFolding.txt \
   > tests/casefold.txt
tests/gen-casemap-txt.py 13.0.0 path/to/UCD/UnicodeData.txt \
   path/to/UCD/SpecialCasing.txt > tests/casemap.txt
```

Using UCD release https://www.unicode.org/Public/zipped/13.0.0/UCD.zip

With some manual additions to `GUnicodeScript` for the 4 new scripts
added in 13.0, using the first assigned character in each block in
`glib/tests/unicode.c`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-18 14:50:36 +00:00
Simon McVittie
bba5576fb2 Merge branch '480-gdbus-connection-test' into 'master'
Race fixes for gdbus-connection unit tests

Closes #480

See merge request GNOME/glib!1419
2020-03-18 10:27:02 +00:00