Commit Graph

23280 Commits

Author SHA1 Message Date
Chun-wei Fan
7b76995298 gmacros.h: Use _Static_assert for clang
It appears that CLang supports _Static_assert() even when not in C11
mode, since at least CLang 3.1, so let's just use that for CLang builds.

Fixes issue #2338.
2021-03-30 16:45:07 +08:00
Chun-wei Fan
97959cd7eb msvc_recommended_pragmas.h: Refine for clang-cl
Make msvc_recommended_pragmas.h work better with clang-cl so that we can
use that to eliminate some warnings that are emitted as it also consumes
Microsoft compiler and SDK headers.

Also, for GLib builds, force-include msvc_recommended_pragmas.h for
clang-cl builds as well, as it becomes usable and useful there.

Fixes issue #2357.
2021-03-30 16:45:07 +08:00
Philip Withnall
622b31f69e Merge branch 'fixing_2281' into 'master'
Update GFileInfo to use GDateTime as timestamps

Closes #2281

See merge request GNOME/glib!2017
2021-03-29 16:47:58 +00:00
Philip Withnall
e42aff2592 Merge branch 'gio-appinfo-thread-crash' into 'master'
GIO W32: Pin gio DLL

Closes #2300 and #2359

See merge request GNOME/glib!2016
2021-03-29 16:34:04 +00:00
Abanoub Ghadban
1bdfc1a36b gfileinfo: Add tests for get and set {access,creation}_date_time APIs 2021-03-28 23:07:39 +02:00
Abanoub Ghadban
240cc7da97 gfileinfo: Add APIs to get and set {access,creation}_date_time 2021-03-28 23:07:39 +02:00
Dz Chen
7629fdaaeb Update Chinese (China) translation 2021-03-27 23:39:12 +00:00
Simon McVittie
6d50032167 Merge branch 'fuzz-path-fix' into 'master'
fuzzing: Fix assertion failure in fuzz_paths.c

See merge request GNOME/glib!2013
2021-03-25 17:28:20 +00:00
Simon McVittie
760ba5c4f1 Merge branch '2363-alloca-docs' into 'master'
galloca: Clarify alloca() sizes must always be controlled by the program

Closes #2363

See merge request GNOME/glib!2014
2021-03-25 17:27:23 +00:00
Руслан Ижбулатов
03b574ae66 Don't leak a handle from _g_io_win32_get_module()
This call increments the DLL refcount by default and
needs a flag to avoid that.
2021-03-25 15:20:49 +00:00
Руслан Ижбулатов
f701d6c497 GIO W32: Pin gio DLL
On Windows gio runs a thread to update appinfo at startup.
If someone unloads gio (this happens when a dynamic gio module gets
unloaded by a program that doesn't use gio itself), there doesn't seem
to be a way to detect that until gio is already gone, and as soon as
gio is gone, the thread crashes, since it tries to execute instructions
that are no longer there.

Holding an extra reference to gio DLL fixes this, but it also prevents
gio from being unloaded, and there's no "weak references" for DLLs.
So we just pin gio and acknowledge that it will never be unloaded.

Fixes #2300
Fixes #2359
2021-03-25 15:16:08 +00:00
Philip Withnall
b657e78add galloca: Clarify alloca() sizes must always be controlled by the program
To avoid security vulnerabilities.

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

Fixes: #2363
2021-03-25 12:55:21 +00:00
Philip Withnall
c3eb4a939b fuzzing: Fix assertion failure in fuzz_paths.c
If operating on a zero-length input, the return values of
`g_path_get_basename()` and `g_path_get_dirname()` are correctly `.`.
The assertions in the test didn’t account for this.

oss-fuzz#32454

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-25 11:23:55 +00:00
Philip Withnall
55cbc31517 Merge branch 'master' into 'master'
make g_tree_remove_all public

See merge request GNOME/glib!1986
2021-03-24 12:13:18 +00:00
Philip Withnall
eaaa41f98f Merge branch 'fuzz-path-functions' into 'master'
fuzzing: Add fuzz tests for functions which parse paths

See merge request GNOME/glib!2006
2021-03-24 11:16:49 +00:00
Philip Withnall
1140c228ab fuzzing: Add fuzz tests for functions which parse paths
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-24 11:16:49 +00:00
Philip Withnall
f078ba1fff Merge branch 'git-to-gitlab' into 'master'
docs: Replace git.gnome.org with gitlab.gnome.org urls

See merge request GNOME/glib!2012
2021-03-24 11:10:28 +00:00
Avinash Sonawane
5ce6ba287f docs: Replace git.gnome.org with gitlab.gnome.org urls 2021-03-24 16:18:53 +05:30
Philip Withnall
083e450d5f Merge branch 'docs' into 'master'
docs: Fix example program link

See merge request GNOME/glib!2011
2021-03-24 10:21:39 +00:00
Avinash Sonawane
d6a9b954fa docs: Fix example program link 2021-03-24 10:21:38 +00:00
Sebastian Dröge
8406a2b742 Merge branch '2361-key-file-locale-caching' into 'master'
gkeyfile: Fix crash when parsing translations on a second load

Closes #2361

See merge request GNOME/glib!2009
2021-03-23 16:52:15 +00:00
Philip Withnall
34e4841854 gkeyfile: Fix crash when parsing translations on a second load
If the same `GKeyFile` is reused to load multiple different key files,
any loads after the first which encounter translated keys will crash,
because clearing the data from the first load cleared the cached
language names, but didn’t clear `checked_locales`, so they were never
reloaded.

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

Fixes: #2361
2021-03-23 16:33:33 +00:00
Philip Withnall
164da19983 gkeyfile: Drop a redundant check
It should not be possible for `->locales` to be set without
`->checked_locales` being set, so drop the redundant check. This helps
with branch code coverage.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-23 16:27:49 +00:00
liuyangming
8fb3101715 gtree: Make g_tree_remove_all() public
g_tree_remove_all is useful and the corresponding function in GHashTable
is exposed, so make this function public is meaningful.
2021-03-23 11:36:57 +00:00
Philip Withnall
9bad38887d Merge branch 'security-policy' into 'master'
docs: Add a policy for handling security issues

See merge request GNOME/glib!1985
2021-03-23 11:35:22 +00:00
Philip Withnall
0d8799b44b Merge branch 'tls-bindings-ci-failure' into 'master'
tests: Deactivate tls-bindings test suite for windows

See merge request GNOME/glib!2008
2021-03-23 11:30:16 +00:00
Frederic Martinsons
7f2fef5c26 tests: Deactivate tls-bindings test suite for windows
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>

Helps: #2297
2021-03-23 11:11:45 +00:00
Philip Withnall
01d1aaeb27 Merge branch 'wip/steal-fd' into 'master'
Add g_steal_fd() to API

See merge request GNOME/glib!1966
2021-03-22 11:48:10 +00:00
Simon McVittie
6c5a227bcc gmain: Add g_steal_fd() to API
This is basically glnx_steal_fd() from libglnx. We already had two
private implementations of it in GLib.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-03-22 11:48:10 +00:00
Sebastian Dröge
46c34ea20f Merge branch 'remove-out-caller-allocates-from-pod-types' into 'master'
introspection: Remove 'caller-allocates' from POD types

See merge request GNOME/glib!2005
2021-03-20 19:15:14 +00:00
Philip Chimento
748103d75a introspection: Remove 'caller-allocates' from POD types
The (out caller-allocates) and (out callee-allocates) annotations are
meant for structured or pointer types. Plain old data types are just
regular out parameters and don't need the annotation about who
allocates them.

See: https://gitlab.gnome.org/GNOME/gjs/-/issues/386
2021-03-20 11:14:15 -07:00
Philip Withnall
33734480d3 Merge branch 'parsing' into 'master'
goption.c: Simplfy parse_short_option()

See merge request GNOME/glib!1999
2021-03-19 11:07:16 +00:00
Avinash Sonawane
b21766ec3c goption.c: Simplfy parse_short_option() 2021-03-19 14:08:27 +05:30
Sebastian Dröge
2bf649320f Merge branch 'gpollableinputstream-read-nonblocking-caller-allocates' into 'master'
gpollableinputstream: Add missing annotation

See merge request GNOME/glib!1998
2021-03-19 07:39:38 +00:00
Марко Костић
32ed18237d Update Serbian translation 2021-03-19 07:30:25 +00:00
Philip Chimento
27b9d2cb27 gpollableinputstream: Add missing annotation
The buffer for g_pollable_input_stream_read_nonblocking() is an out
parameter which the caller must allocate.

See https://gitlab.gnome.org/GNOME/gjs/-/issues/389
2021-03-18 20:42:05 -07:00
Boyuan Yang
3653260ec2 Update Chinese (China) translation 2021-03-19 02:02:27 +00:00
Philip Withnall
2fd21175e7 Merge branch '2011-add-dbus-watch-name-tests' into 'master'
Resolve "Add additional unit tests for D-Bus name watching"

Closes #2011

See merge request GNOME/glib!1904
2021-03-18 21:10:19 +00:00
Philip Withnall
e45a92ece2 Merge branch 'citrus-it-master-patch-49452' into 'master'
Include glibconfig.h to get the G_OS_UNIX token

See merge request GNOME/glib!1996
2021-03-18 19:36:34 +00:00
Andy Fiddaman
1fafbb82b0 Include glibconfig.h to get the G_OS_UNIX token 2021-03-18 16:21:42 +00:00
Philip Withnall
9106fd4e81 Merge branch 'wip/start-2-70' into 'master'
gversionmacros: Add version macros for GLib 2.70

See merge request GNOME/glib!1965
2021-03-18 14:47:00 +00:00
Philip Withnall
bdea78295c Merge branch 'fix-data-to-c-line-endings' into 'master'
data-to-c.py: autodetect line endings

Closes #2340

See merge request GNOME/glib!1974
2021-03-18 14:00:05 +00:00
Philip Withnall
3a0edbed5b build: Post-release version bump to 2.69.0
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-18 13:58:50 +00:00
Simon McVittie
1248b642ad gversionmacros: Add version macros for GLib 2.70
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-03-18 13:58:41 +00:00
Philip Withnall
a58a47fd6d 2.68.0
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-03-18 13:27:26 +00:00
Matej Urbančič
840d50b8d8 Update Slovenian translation 2021-03-17 17:44:17 +00:00
Sebastian Dröge
c53711492c Merge branch 'coverity-localfileoutputstream-error-handling' into 'master'
glocalfileoutputstream: Tidy up error handling

See merge request GNOME/glib!1994
2021-03-17 07:43:03 +00:00
Frederic Martinsons
59e999fd0a Add two test cases which covers disconnection scenario in another thread
1) Check that schedule_call_in_idle code branch of gdbusnamewatching.c
   is working to call vanished handler in the thread which had watched the name
2) Check cancellation of vanished handler if the name is unwatched before
   vanished callback is dispatched.

Closes #2011

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-03-17 08:36:47 +01:00
Frederic Martinsons
2f5f69e969 Use OwnNameData structure when owning a name instead of WatchNameData.
The two structures share some common variable name but it's confusing.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-03-17 08:36:47 +01:00
Frederic Martinsons
98abfc9da7 Correct memleak introduced by !1885
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2021-03-17 08:36:47 +01:00